[Libreoffice-commits] core.git: icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg

2022-09-20 Thread Rizal Muttaqin (via logerrit)
 dev/null   |binary
 icon-themes/sifr/cmd/32/ar/linenumberingdialog.png |binary
 icon-themes/sifr/cmd/32/hyphenate.png  |binary
 icon-themes/sifr/cmd/32/linenumberingdialog.png|binary
 icon-themes/sifr/cmd/32/normalmultipanegui.png |binary
 icon-themes/sifr/cmd/32/outputqualityblackwhite.png|binary
 icon-themes/sifr/cmd/32/outputqualitycolor.png |binary
 icon-themes/sifr/cmd/32/outputqualitygrayscale.png |binary
 icon-themes/sifr/cmd/32/safemode.png   |binary
 icon-themes/sifr/cmd/32/sendfeedback.png   |binary
 icon-themes/sifr/cmd/32/watermark.png  |binary
 icon-themes/sifr/cmd/ar/lc_linenumberingdialog.png |binary
 icon-themes/sifr/cmd/ar/sc_linenumberingdialog.png |binary
 icon-themes/sifr/cmd/lc_hyphenate.png  |binary
 icon-themes/sifr/cmd/lc_linenumberingdialog.png|binary
 icon-themes/sifr/cmd/lc_normalmultipanegui.png |binary
 icon-themes/sifr/cmd/lc_outputqualityblackwhite.png|binary
 icon-themes/sifr/cmd/lc_outputqualitycolor.png |binary
 icon-themes/sifr/cmd/lc_outputqualitygrayscale.png |binary
 icon-themes/sifr/cmd/lc_safemode.png   |binary
 icon-themes/sifr/cmd/lc_sendfeedback.png   |binary
 icon-themes/sifr/cmd/lc_watermark.png  |binary
 icon-themes/sifr/cmd/sc_hyphenate.png  |binary
 icon-themes/sifr/cmd/sc_linenumberingdialog.png|binary
 icon-themes/sifr/cmd/sc_normalmultipanegui.png |binary
 icon-themes/sifr/cmd/sc_outputqualityblackwhite.png|binary
 icon-themes/sifr/cmd/sc_outputqualitycolor.png |binary
 icon-themes/sifr/cmd/sc_outputqualitygrayscale.png |binary
 icon-themes/sifr/cmd/sc_safemode.png   |binary
 icon-themes/sifr/cmd/sc_sendfeedback.png   |binary
 icon-themes/sifr/cmd/sc_watermark.png  |binary
 icon-themes/sifr/links.txt |   73 
++
 icon-themes/sifr_dark/cmd/32/ar/linenumberingdialog.png|binary
 icon-themes/sifr_dark/cmd/32/hyphenate.png |binary
 icon-themes/sifr_dark/cmd/32/linenumberingdialog.png   |binary
 icon-themes/sifr_dark/cmd/32/normalmultipanegui.png|binary
 icon-themes/sifr_dark/cmd/32/outputqualityblackwhite.png   |binary
 icon-themes/sifr_dark/cmd/32/outputqualitycolor.png|binary
 icon-themes/sifr_dark/cmd/32/outputqualitygrayscale.png|binary
 icon-themes/sifr_dark/cmd/32/safemode.png  |binary
 icon-themes/sifr_dark/cmd/32/sendfeedback.png  |binary
 icon-themes/sifr_dark/cmd/32/watermark.png |binary
 icon-themes/sifr_dark/cmd/ar/lc_linenumberingdialog.png|binary
 icon-themes/sifr_dark/cmd/ar/sc_linenumberingdialog.png|binary
 icon-themes/sifr_dark/cmd/lc_hyphenate.png |binary
 icon-themes/sifr_dark/cmd/lc_linenumberingdialog.png   |binary
 icon-themes/sifr_dark/cmd/lc_normalmultipanegui.png|binary
 icon-themes/sifr_dark/cmd/lc_outputqualityblackwhite.png   |binary
 icon-themes/sifr_dark/cmd/lc_outputqualitycolor.png|binary
 icon-themes/sifr_dark/cmd/lc_outputqualitygrayscale.png|binary
 icon-themes/sifr_dark/cmd/lc_safemode.png  |binary
 icon-themes/sifr_dark/cmd/lc_sendfeedback.png  |binary
 icon-themes/sifr_dark/cmd/lc_watermark.png |binary
 icon-themes/sifr_dark/cmd/sc_hyphenate.png |binary
 icon-themes/sifr_dark/cmd/sc_linenumberingdialog.png   |binary
 icon-themes/sifr_dark/cmd/sc_normalmultipanegui.png|binary
 icon-themes/sifr_dark/cmd/sc_outputqualityblackwhite.png   |binary
 icon-themes/sifr_dark/cmd/sc_outputqualitycolor.png|binary
 icon-themes/sifr_dark/cmd/sc_outputqualitygrayscale.png|binary
 icon-themes/sifr_dark/cmd/sc_safemode.png  |binary
 icon-themes/sifr_dark/cmd/sc_sendfeedback.png  |binary
 icon-themes/sifr_dark/cmd/sc_watermark.png |binary
 icon-themes/sifr_dark/links.txt|   73 
++
 icon-themes/sifr_dark_svg/cmd/32/ar/linenumberingdialog.svg|2 
 icon-themes/sifr_dark_svg/cmd/32/hyphenate.svg |2 
 icon-themes/sifr_dark_svg/cmd/32/linenumberingdialog.svg   |2 
 icon-themes/sifr_dark_svg/cmd/32/normalmultipanegui.svg|2 
 icon-themes/sifr_dark_svg/cmd/32/outputqualityblackwhite.svg   |2 
 icon-themes/sifr_dark_svg/cmd/32/outputqualitycolor.svg|2 
 icon-the

[Libreoffice-commits] core.git: helpcontent2

2022-09-20 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e822ef8c39a326a10d489b5ee50583b934fbb2de
Author: Rafael Lima 
AuthorDate: Wed Sep 21 04:37:53 2022 +0200
Commit: Gerrit Code Review 
CommitDate: Wed Sep 21 04:37:53 2022 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 3b0d630cec012f7aa10cad2029468f5ea6f25b6c
  - tdf#150958 Fix mention to Find tool in help page

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

diff --git a/helpcontent2 b/helpcontent2
index 80034ff19535..3b0d630cec01 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 80034ff19535b6320a8ea113a9cf2f068e6aea31
+Subproject commit 3b0d630cec012f7aa10cad2029468f5ea6f25b6c


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

2022-09-20 Thread Rafael Lima (via logerrit)
 source/text/shared/05/new_help.xhp |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 3b0d630cec012f7aa10cad2029468f5ea6f25b6c
Author: Rafael Lima 
AuthorDate: Tue Sep 20 14:57:33 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 21 04:37:46 2022 +0200

tdf#150958 Fix mention to Find tool in help page

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

diff --git a/source/text/shared/05/new_help.xhp 
b/source/text/shared/05/new_help.xhp
index ca21fd884..1ed2a3706 100644
--- a/source/text/shared/05/new_help.xhp
+++ b/source/text/shared/05/new_help.xhp
@@ -118,8 +118,7 @@
 To search 
in the current Help page:
 
 
-Open the View menu of your default web browser and choose 
Find on this Page entry.
-You 
can also press CommandCtrl+F.
+Open the Search tool in your web browser, which is usually 
accessible using the CommandCtrl+F
 shortcut.
 
 
 In 
the Search for box, enter the text that you want to 
find.


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

2022-09-20 Thread Rafael Lima (via logerrit)
 include/svx/strings.hrc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cff3cea643668228f97ee85056b5ea4d8c7ab475
Author: Rafael Lima 
AuthorDate: Tue Sep 20 21:03:54 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 21 04:35:47 2022 +0200

tdf#151088 Use "Kraft Paper" instead of "Invoice Paper"

As per discussion in Weblate, the correct term here is "Kraft Paper".

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

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index f46663ccf669..e6863c3b2228 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -837,7 +837,7 @@
 #define RID_SVXSTR_BMP19
NC_("RID_SVXSTR_BMP19", "Night Sky")
 #define RID_SVXSTR_BMP20
NC_("RID_SVXSTR_BMP20", "Pool")
 #define RID_SVXSTR_BMP21
NC_("RID_SVXSTR_BMP21", "Bitmap")
-#define RID_SVXSTR_BMP79
NC_("RID_SVXSTR_BMP79", "Invoice Paper")
+#define RID_SVXSTR_BMP79
NC_("RID_SVXSTR_BMP79", "Kraft Paper")
 #define RID_SVXSTR_BMP80
NC_("RID_SVXSTR_BMP80", "Concrete")
 #define RID_SVXSTR_BMP81
NC_("RID_SVXSTR_BMP81", "Brick Wall")
 #define RID_SVXSTR_BMP82
NC_("RID_SVXSTR_BMP82", "Stone Wall")


New Defects reported by Coverity Scan for LibreOffice

2022-09-20 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

4 new defect(s) introduced to LibreOffice found with Coverity Scan.
1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)


** CID 1515521:  Null pointer dereferences  (REVERSE_INULL)
/slideshow/source/engine/shapes/drawshape.cxx: 397 in 
slideshow::internal::DrawShape::DrawShape(const 
com::sun::star::uno::Reference &, const 
com::sun::star::uno::Reference &, double, 
bool, const slideshow::internal::SlideShowContext &)()



*** CID 1515521:  Null pointer dereferences  (REVERSE_INULL)
/slideshow/source/engine/shapes/drawshape.cxx: 397 in 
slideshow::internal::DrawShape::DrawShape(const 
com::sun::star::uno::Reference &, const 
com::sun::star::uno::Reference &, double, 
bool, const slideshow::internal::SlideShowContext &)()
391 mpCurrMtf = std::make_shared();
392 
393 maSubsetting.reset( mpCurrMtf );
394 
395 prepareHyperlinkIndices();
396 
>>> CID 1515521:  Null pointer dereferences  (REVERSE_INULL)
>>> Null-checking "this->mpCurrMtf" suggests that it may be null, but it 
>>> has already been dereferenced on all paths leading to the check.
397 if(mbContainsPageField && mpCurrMtf && !maBounds.isEmpty())
398 {
399 // tdf#150402 Use mbContainsPageField that gets set in 
prepareHyperlinkIndices
400 // which has to be run anyways, so this will cause no 
harm in execution speed.
401 // It lets us detect the potential error case that a 
PageField is contained in
402 // the Text of the Shape. That is a hint that maBounds 
contains the wrong Range

** CID 1515520:  Control flow issues  (DEADCODE)
/filter/source/msfilter/svdfppt.cxx: 1860 in 
SdrPowerPointImport::ImportOLE(unsigned int, const Graphic &, const 
tools::Rectangle &, const tools::Rectangle &, int) const()



*** CID 1515520:  Control flow issues  (DEADCODE)
/filter/source/msfilter/svdfppt.cxx: 1860 in 
SdrPowerPointImport::ImportOLE(unsigned int, const Graphic &, const 
tools::Rectangle &, const tools::Rectangle &, int) const()
1854 {
1855 bSuccess = SdrPowerPointOLEDecompress( *pDest, 
rStCtrl, nLen );
1856 }
1857 if ( bSuccess )
1858 {
1859 pDest->Seek(0);
>>> CID 1515520:  Control flow issues  (DEADCODE)
>>> Execution cannot reach the expression "NULL" inside this statement: 
>>> "pObjStor = (pDest ? new Sto...".
1860 Storage* pObjStor = pDest ? new Storage( *pDest, true 
) : nullptr;
1861 if (pObjStor)
1862 {
1863 tools::SvRef xObjStor( new SotStorage( 
pObjStor ) );
1864 if ( xObjStor.is() && !xObjStor->GetError() )
1865 {

** CID 1515519:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/xcl97/xcl97esc.cxx: 73 in 
XclEscherExGlobal::XclEscherExGlobal(const XclExpRoot &)()



*** CID 1515519:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/xcl97/xcl97esc.cxx: 73 in 
XclEscherExGlobal::XclEscherExGlobal(const XclExpRoot &)()
67 using ::com::sun::star::script::XEventAttacherManager;
68 
69 XclEscherExGlobal::XclEscherExGlobal( const XclExpRoot& rRoot ) :
70 XclExpRoot( rRoot )
71 {
72 SetBaseURI( GetMedium().GetBaseURL( true ) );
>>> CID 1515519:  Uninitialized members  (UNINIT_CTOR)
>>> Non-static class member "mpPicStrm" is not initialized in this 
>>> constructor nor in any functions that it calls.
73 }
74 
75 SvStream* XclEscherExGlobal::ImplQueryPictureStream()
76 {
77 mxPicTempFile.reset( new ::utl::TempFile );
78 mxPicTempFile->EnableKillingFile();

** CID 1515518:  Null pointer dereferences  (REVERSE_INULL)
/filter/source/msfilter/svdfppt.cxx: 1860 in 
SdrPowerPointImport::ImportOLE(unsigned int, const Graphic &, const 
tools::Rectangle &, const tools::Rectangle &, int) const()



*** CID 1515518:  Null pointer dereferences  (REVERSE_INULL)
/filter/source/msfilter/svdfppt.cxx: 1860 in 
SdrPowerPointImport::ImportOLE(unsigned int, const Graphic &, const 
tools::Rectangle &, const tools::Rectangle &, int) const()
1854 {
1855 bSuccess = SdrPowerPointOLEDecompress( *pDe

[Libreoffice-commits] core.git: icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg

2022-09-20 Thread Rizal Muttaqin (via logerrit)
 dev/null   |binary
 icon-themes/sifr/AUTHORS   |2 
 icon-themes/sifr/cmd/32/charfontname.png   |binary
 icon-themes/sifr/cmd/32/dataarearefresh.png|binary
 icon-themes/sifr/cmd/32/dataprovider.png   |binary
 icon-themes/sifr/cmd/32/dataproviderrefresh.png|binary
 icon-themes/sifr/cmd/32/inserttitlefield.png   |binary
 icon-themes/sifr/cmd/32/inserttopicfield.png   |binary
 icon-themes/sifr/cmd/32/savebasicas.png|binary
 icon-themes/sifr/cmd/32/titlepagedialog.png|binary
 icon-themes/sifr/cmd/lc_charfontname.png   |binary
 icon-themes/sifr/cmd/lc_dataarearefresh.png|binary
 icon-themes/sifr/cmd/lc_dataprovider.png   |binary
 icon-themes/sifr/cmd/lc_dataproviderrefresh.png|binary
 icon-themes/sifr/cmd/lc_insertpagenumberfield.png  |binary
 icon-themes/sifr/cmd/lc_inserttitlefield.png   |binary
 icon-themes/sifr/cmd/lc_inserttopicfield.png   |binary
 icon-themes/sifr/cmd/lc_savebasicas.png|binary
 icon-themes/sifr/cmd/lc_titlepagedialog.png|binary
 icon-themes/sifr/cmd/sc_charfontname.png   |binary
 icon-themes/sifr/cmd/sc_dataarearefresh.png|binary
 icon-themes/sifr/cmd/sc_dataprovider.png   |binary
 icon-themes/sifr/cmd/sc_dataproviderrefresh.png|binary
 icon-themes/sifr/cmd/sc_inserttitlefield.png   |binary
 icon-themes/sifr/cmd/sc_inserttopicfield.png   |binary
 icon-themes/sifr/cmd/sc_savebasicas.png|binary
 icon-themes/sifr/cmd/sc_selecttables.png   |binary
 icon-themes/sifr/cmd/sc_show.png   |binary
 icon-themes/sifr/cmd/sc_titlepagedialog.png|binary
 icon-themes/sifr/links.txt |   95 +++--
 icon-themes/sifr/res/dialogfolder_16.png   |binary
 icon-themes/sifr/res/dialogfoldernot_16.png|binary
 icon-themes/sifr/res/im30827.png   |binary
 icon-themes/sifr/sc/res/droplink.png   |binary
 icon-themes/sifr/sd/res/objects.png|binary
 icon-themes/sifr/sd/res/pageexcl.png   |binary
 icon-themes/sifr/sd/res/pageobjs.png   |binary
 icon-themes/sifr/sd/res/pagobjex.png   |binary
 icon-themes/sifr_dark/AUTHORS  |2 
 icon-themes/sifr_dark/cmd/32/charfontname.png  |binary
 icon-themes/sifr_dark/cmd/32/dataarearefresh.png   |binary
 icon-themes/sifr_dark/cmd/32/dataprovider.png  |binary
 icon-themes/sifr_dark/cmd/32/dataproviderrefresh.png   |binary
 icon-themes/sifr_dark/cmd/32/inserttitlefield.png  |binary
 icon-themes/sifr_dark/cmd/32/inserttopicfield.png  |binary
 icon-themes/sifr_dark/cmd/32/savebasicas.png   |binary
 icon-themes/sifr_dark/cmd/32/titlepagedialog.png   |binary
 icon-themes/sifr_dark/cmd/lc_charfontname.png  |binary
 icon-themes/sifr_dark/cmd/lc_dataarearefresh.png   |binary
 icon-themes/sifr_dark/cmd/lc_dataprovider.png  |binary
 icon-themes/sifr_dark/cmd/lc_dataproviderrefresh.png   |binary
 icon-themes/sifr_dark/cmd/lc_insertpagenumberfield.png |binary
 icon-themes/sifr_dark/cmd/lc_inserttitlefield.png  |binary
 icon-themes/sifr_dark/cmd/lc_inserttopicfield.png  |binary
 icon-themes/sifr_dark/cmd/lc_savebasicas.png   |binary
 icon-themes/sifr_dark/cmd/lc_titlepagedialog.png   |binary
 icon-themes/sifr_dark/cmd/sc_charfontname.png  |binary
 icon-themes/sifr_dark/cmd/sc_dataarearefresh.png   |binary
 icon-themes/sifr_dark/cmd/sc_dataprovider.png  |binary
 icon-themes/sifr_dark/cmd/sc_dataproviderrefresh.png   |binary
 icon-themes/sifr_dark/cmd/sc_inserttitlefield.png  |binary
 icon-themes/sifr_dark/cmd/sc_inserttopicfield.png  |binary
 icon-themes/sifr_dark/cmd/sc_savebasicas.png   |binary
 icon-themes/sifr_dark/cmd/sc_selecttables.png  |binary
 icon-themes/sifr_dark/cmd/sc_show.png  |binary
 icon-themes/sifr_dark/cmd/sc_titlepagedialog.png   |binary
 icon-themes/sifr_dark/links.txt|   95 +++--
 icon-themes/sifr_dark/res/dialogfolder_16.png  |binary
 icon-themes/sifr_dark/res/dialogfoldernot_16.png   |binary
 icon-themes/sifr_dark/res/im30827.png  |binary
 icon-themes/sifr_dark/sc/res/droplink.png  |binary
 icon-themes/sifr_dark/sd/res/objects.png   |binary
 icon-themes/sifr_dark/sd/res/pageexcl.png  |binary
 icon-the

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

2022-09-20 Thread Mike Kaganski (via logerrit)
 filter/source/pdf/pdffilter.cxx |   18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 218695f947dfecaa92209adf0c5572b99f0c021f
Author: Mike Kaganski 
AuthorDate: Wed Sep 7 21:50:24 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 20 22:26:13 2022 +0200

tdf#150846: FilterOptions in descriptor could come from import filter

Tolerate failure parsing json here. Unfortunately this means that
we can't provide a diagnostics to user when they provide bad json
in the command line parameters.

Change-Id: Ia3fa18e709a4c0b891faf4365453b79e6c58a9c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139613
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 467308d679a3f2b4bbdd117fcc73636d57d66c09)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140164
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index d7fc558d198e..f12559bfe3df 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -33,6 +33,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace ::com::sun::star::io;
 
 PDFFilter::PDFFilter( const Reference< XComponentContext > &rxContext ) :
@@ -78,11 +80,19 @@ bool PDFFilter::implExport( const Sequence< PropertyValue 
>& rDescriptor )
 pValue[i].Value >>= bIsRedactMode;
 }
 
-if (!aFilterData.hasElements() && !aFilterOptions.isEmpty())
+if (!aFilterData.hasElements() && aFilterOptions.startsWith("{"))
 {
-// Allow setting filter data keys from the cmdline.
-std::vector aData = 
comphelper::JsonToPropertyValues(aFilterOptions.toUtf8());
-aFilterData = comphelper::containerToSequence(aData);
+try
+{
+// Allow setting filter data keys from the cmdline.
+std::vector aData
+= comphelper::JsonToPropertyValues(aFilterOptions.toUtf8());
+aFilterData = comphelper::containerToSequence(aData);
+}
+catch (const boost::property_tree::json_parser::json_parser_error&)
+{
+// This wasn't a valid json; maybe came from import filter 
(tdf#150846)
+}
 }
 
 /* we don't get FilterData if we are exporting directly


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

2022-09-20 Thread Noel Grandin (via logerrit)
 sc/source/core/tool/cellform.cxx |   15 +--
 sc/source/core/tool/interpr1.cxx |5 +++--
 2 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit b52fd544b9c128d3e28de6355286f6480b618e93
Author: Noel Grandin 
AuthorDate: Tue Sep 20 15:48:38 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 22:22:14 2022 +0200

avoid some string refcounting with sheets with lots of conditional 
formatting

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

diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 3da99aec0b2f..9d1a73192923 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -146,12 +146,15 @@ OUString ScCellFormat::GetInputString(
 break;
 case CELLTYPE_FORMULA:
 {
-OUString str;
+std::optional str;
 ScFormulaCell* pFC = rCell.getFormula();
 if (pFC->IsEmptyDisplayedAsString())
 ; // empty
 else if (pFC->IsValue())
-rFormatter.GetInputLineString(pFC->GetValue(), nFormat, str, 
bFiltering, bForceSystemLocale);
+{
+str.emplace();
+rFormatter.GetInputLineString(pFC->GetValue(), nFormat, *str, 
bFiltering, bForceSystemLocale);
+}
 else
 {
 const svl::SharedString& shared = pFC->GetString();
@@ -166,19 +169,19 @@ OUString ScCellFormat::GetInputString(
 const FormulaError nErrCode = pFC->GetErrCode();
 if (nErrCode != FormulaError::NONE)
 {
-str.clear();
+str.reset();
 if( pShared != nullptr )
 *pShared = nullptr;
 }
 
-return str;
+return str ? std::move(*str) : svl::SharedString::EMPTY_STRING;
 }
 case CELLTYPE_NONE:
 if( pShared != nullptr )
 *pShared = &svl::SharedString::getEmptyString();
-return OUString();
+return svl::SharedString::EMPTY_STRING;
 default:
-return OUString();
+return svl::SharedString::EMPTY_STRING;
 }
 }
 
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a8b55d73d90a..cfaa72dbb978 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8178,7 +8178,8 @@ void ScInterpreter::ScIndirect()
 bTryXlA1 = false;
 }
 
-OUString sRefStr = GetString().getString();
+svl::SharedString sSharedRefStr = GetString();
+const OUString & sRefStr = sSharedRefStr.getString();
 if (sRefStr.isEmpty())
 {
 // Bail out early for empty cells, rely on "we do have a string" below.
@@ -8223,7 +8224,7 @@ void ScInterpreter::ScIndirect()
 
 do
 {
-OUString aName( ScGlobal::getCharClass().uppercase( sRefStr));
+const OUString & aName( sSharedRefStr.getDataIgnoreCase() );
 ScDBCollection::NamedDBs& rDBs = 
mrDoc.GetDBCollection()->getNamedDBs();
 const ScDBData* pData = rDBs.findByUpperName( aName);
 if (!pData)


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

2022-09-20 Thread Noel Grandin (via logerrit)
 sw/inc/node.hxx  |3 ++-
 sw/source/core/docnode/node.cxx  |   24 
 sw/source/filter/html/swhtml.cxx |7 +++
 sw/source/filter/xml/xmlimp.cxx  |3 +--
 4 files changed, 30 insertions(+), 7 deletions(-)

New commits:
commit 5b98500614f179b8c725a8476d72ff84327c3716
Author: Noel Grandin 
AuthorDate: Tue Sep 20 16:38:40 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 21:23:59 2022 +0200

add CanJoinNext method that takes a SwPosition*

part of the process of hiding the internals of SwPosition

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

diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 0d749899b078..68a33263124f 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -407,7 +407,8 @@ public:
 virtual SwContentNode *JoinNext();
 /** Is it possible to join two nodes?
In pIdx the second position can be returned. */
-bool CanJoinNext( SwNodeIndex* pIdx =nullptr ) const;
+bool CanJoinNext( SwNodeIndex* pIdx = nullptr ) const;
+bool CanJoinNext( SwPosition* pIdx ) const;
 bool CanJoinPrev( SwNodeIndex* pIdx =nullptr ) const;
 
 void MakeStartIndex( SwContentIndex * pIdx )   { pIdx->Assign( this, 0 ); }
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index e8d415d9d1c2..04d9e3f354bd 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1863,6 +1863,30 @@ bool SwContentNode::CanJoinNext( SwNodeIndex* pIdx ) 
const
 return true;
 }
 
+/// Can we join two Nodes?
+/// We can return the 2nd position in pIdx.
+bool SwContentNode::CanJoinNext( SwPosition* pIdx ) const
+{
+const SwNodes& rNds = GetNodes();
+SwNodeIndex aIdx( *this, 1 );
+
+const SwNode* pNd = this;
+while( aIdx < rNds.Count()-1 &&
+(( pNd = &aIdx.GetNode())->IsSectionNode() ||
+( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode() 
)))
+++aIdx;
+
+if (rNds.Count()-1 == aIdx.GetIndex())
+return false;
+if (!lcl_CheckMaxLength(*this, *pNd))
+{
+return false;
+}
+if( pIdx )
+pIdx->Assign(aIdx);
+return true;
+}
+
 /// Can we join two Nodes?
 /// We can return the 2nd position in pIdx.
 bool SwContentNode::CanJoinPrev( SwNodeIndex* pIdx ) const
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index fa45f91406e3..8a31aa197ec9 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -768,13 +768,13 @@ void SwHTMLParser::Continue( HtmlTokenId nToken )
 if( m_pSttNdIdx->GetIndex()+1 == 
m_pPam->GetBound().GetNodeIndex() )
 {
 const sal_Int32 nCntPos = 
m_pPam->GetBound().GetContentIndex();
-m_pPam->GetBound().nContent.Assign( pTextNode,
+m_pPam->GetBound().SetContent(
 pTextNode->GetText().getLength() + nCntPos 
);
 }
 if( m_pSttNdIdx->GetIndex()+1 == m_pPam->GetBound( false 
).GetNodeIndex() )
 {
 const sal_Int32 nCntPos = m_pPam->GetBound( false 
).GetContentIndex();
-m_pPam->GetBound( false ).nContent.Assign( pTextNode,
+m_pPam->GetBound( false ).SetContent(
 pTextNode->GetText().getLength() + nCntPos 
);
 }
 #endif
@@ -834,10 +834,9 @@ void SwHTMLParser::Continue( HtmlTokenId nToken )
 }
 else if( nullptr != ( pCurrentNd = m_xDoc->GetNodes()[ nNodeIdx 
]->GetTextNode()) && !bHasFlysOrMarks )
 {
-if( pCurrentNd->CanJoinNext( &pPos->nNode ))
+if( pCurrentNd->CanJoinNext( pPos ))
 {
 SwTextNode* pNextNd = pPos->GetNode().GetTextNode();
-pPos->nContent.Assign( pNextNd, 0 );
 m_pPam->SetMark(); m_pPam->DeleteMark();
 pNextNd->JoinPrev();
 }
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 352d658a24d8..565d3f201e1d 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -741,7 +741,7 @@ void SwXMLImport::endDocument()
 {
 // Id we're in insert mode, the empty node is joined with
 // the next and the previous one.
-if( pCurrNd->CanJoinNext( &pPos->nNode ))
+if( pCurrNd->CanJoinNext( pPos ))
 {
 SwTextNode* pNextNd = pPos->GetNode().GetTextNode();
 bool endNodeFound = 
pDoc->GetNodes()[nNodeIdx-1]->IsEndNode();
@@ -754,7 +754,6 @@ void SwXMLImport::endDocument()
 
pNextNd->ChgFormatColl(pLastPar->GetTextNode()->G

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

2022-09-20 Thread Noel Grandin (via logerrit)
 sw/source/uibase/lingu/hhcwrp.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 6b25ea4386cfa48c8cf27a58144306f15b86397b
Author: Noel Grandin 
AuthorDate: Tue Sep 20 16:25:51 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 21:23:27 2022 +0200

use more SwPosition::AdjustContent

part of the process of hiding the internals of SwPosition

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

diff --git a/sw/source/uibase/lingu/hhcwrp.cxx 
b/sw/source/uibase/lingu/hhcwrp.cxx
index 0838fdf37e4c..1efd2927f397 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -175,7 +175,7 @@ void SwHHCWrapper::GetNextPortion(
 void SwHHCWrapper::SelectNewUnit_impl( sal_Int32 nUnitStart, sal_Int32 
nUnitEnd )
 {
 SwPaM *pCursor = m_rWrtShell.GetCursor();
-pCursor->GetPoint()->nContent = m_nLastPos;
+pCursor->GetPoint()->SetContent( m_nLastPos );
 pCursor->DeleteMark();
 
 m_rWrtShell.Right( SwCursorSkipMode::Chars, /*bExpand*/ false,
@@ -268,8 +268,8 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText,
 // set selection to sub string to be replaced in original 
text
 sal_Int32 nChgInNodeStartIndex = nStartIndex + 
nCorrectionOffset + nChgPos;
 OSL_ENSURE( m_rWrtShell.GetCursor()->HasMark(), "cursor 
misplaced (nothing selected)" );
-m_rWrtShell.GetCursor()->GetMark()->nContent.Assign( 
pStartTextNode, nChgInNodeStartIndex );
-m_rWrtShell.GetCursor()->GetPoint()->nContent.Assign( 
pStartTextNode, nChgInNodeStartIndex + nChgLen );
+m_rWrtShell.GetCursor()->GetMark()->Assign( 
*pStartTextNode, nChgInNodeStartIndex );
+m_rWrtShell.GetCursor()->GetPoint()->Assign( 
*pStartTextNode, nChgInNodeStartIndex + nChgLen );
 
 // replace selected sub string with the corresponding
 // sub string from the new text while keeping as
@@ -300,7 +300,7 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText,
 // (as it would happen after ChangeText_impl (Delete and Insert)
 // of the whole text in the 'else' branch below)
 m_rWrtShell.ClearMark();
-m_rWrtShell.GetCursor()->Start()->nContent.Assign( pStartTextNode, 
nStartIndex + nConvTextLen );
+m_rWrtShell.GetCursor()->Start()->Assign( *pStartTextNode, nStartIndex 
+ nConvTextLen );
 }
 else
 {
@@ -325,7 +325,7 @@ void SwHHCWrapper::ChangeText_impl( const OUString 
&rNewText, bool bKeepAttribut
 if (!m_rWrtShell.GetCursor()->HasMark())
 m_rWrtShell.GetCursor()->SetMark();
 SwPosition *pMark = m_rWrtShell.GetCursor()->GetMark();
-pMark->nContent = pMark->GetContentIndex() - rNewText.getLength();
+pMark->SetContent( pMark->GetContentIndex() - rNewText.getLength() );
 
 // since 'SetAttr' below functions like merging with the attributes
 // from the itemset with any existing ones we have to get rid of all
@@ -457,7 +457,7 @@ void SwHHCWrapper::ReplaceUnit(
 if (bIsChineseConversion)
 {
 m_rWrtShell.SetMark();
-m_rWrtShell.GetCursor()->GetMark()->nContent -= 
aNewText.getLength();
+m_rWrtShell.GetCursor()->GetMark()->AdjustContent( 
-aNewText.getLength() );
 
 OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || 
GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL,
 "SwHHCWrapper::ReplaceUnit : unexpected target language" );


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

2022-09-20 Thread Mike Kaganski (via logerrit)
 basegfx/source/polygon/b2dpolypolygon.cxx |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit e4a72aa946b6c41a91dc6e74634093a83b9c22bd
Author: Mike Kaganski 
AuthorDate: Tue Sep 20 18:28:36 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 20 21:20:08 2022 +0200

tdf#151056: avoid modifying the static shared DEFAULT instance

This was a thinko in commit e39fa3c4f5ae2560a4b6f6f789a0c5098ac43cf4
  Simplify b2d(poly)polygon implementation

This led to exponential growth of elements in each next polypolygon
created from scratch, that immediately manifested with the complex
SVG logo shown on the backing window.
And finally, there's no const_cast/as_const left in the file :)

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

diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx 
b/basegfx/source/polygon/b2dpolypolygon.cxx
index 6ce3b398a1fb..1889ddae4220 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -299,13 +299,17 @@ public:
 B2DPolyPolygon B2DPolyPolygon::getDefaultAdaptiveSubdivision() const
 {
 B2DPolyPolygon aRetval;
-// Avoid CoW overhead for the local variable
-auto dest = 
const_cast(std::as_const(aRetval).mpPolyPolygon.get());
-dest->reserve(count());
-
-for(sal_uInt32 a(0); a < count(); a++)
+if (count())
 {
-dest->append(getB2DPolygon(a).getDefaultAdaptiveSubdivision(), 1);
+// Avoid CoW overhead for the local variable
+// But detach from shared static DEFAULT
+ImplB2DPolyPolygon& dest = aRetval.mpPolyPolygon.make_unique();
+dest.reserve(count());
+
+for (sal_uInt32 a(0); a < count(); a++)
+{
+dest.append(getB2DPolygon(a).getDefaultAdaptiveSubdivision(), 
1);
+}
 }
 
 return aRetval;


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

2022-09-20 Thread Miklos Vajna (via logerrit)
 xmloff/qa/unit/text.cxx |   37 +
 xmloff/source/text/txtparae.cxx |   12 ++--
 2 files changed, 47 insertions(+), 2 deletions(-)

New commits:
commit 5ef5b313ad0f6fdb8f8de0a7463cb2a0c4956f1a
Author: Miklos Vajna 
AuthorDate: Tue Sep 20 09:10:25 2022 +0200
Commit: Caolán McNamara 
CommitDate: Tue Sep 20 20:43:47 2022 +0200

tdf#150990 ODT export: fix zero layout size of scale/scale images

The bugdoc has a broken image where both axis are set to a relative size
of 255%, which means "keep aspect", and the expectation is that only one
axis uses this to match the size of the other axis.

The problem was that commit b578fa08a25a83abccad2386e12b707586fffb26
(ODT export: fix fallback svg:width/height for text frames with relative
sizes, 2022-03-16) assumed that only one axis uses "scale", so we always
get a non-zero layout size.

Fix the problem by only using the layout size when exactly one axis uses
the "scale" percentage, which is the expected the case.

This way we just keep the aspect ratio of broken documents, then the UI
will in practice ignore the scale request of the width.

Change-Id: I2dbd6bb92f912f6185422fd301b99b284a66ef74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140218
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 80550ade305b9e68c6281a258d162bc2c413713a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140167
Reviewed-by: Caolán McNamara 

diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index d5c8f0b6e22a..af0fba426822 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -385,6 +385,43 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRelativeWidth)
 assertXPath(pXmlDoc, "//draw:frame", "width", "3.1492in");
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testScaleWidthAndHeight)
+{
+// Given a broken document where both IsSyncHeightToWidth and 
IsSyncWidthToHeight are set to
+// true:
+getComponent() = loadFromDesktop("private:factory/swriter");
+uno::Reference xMSF(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xTextFrame(
+xMSF->createInstance("com.sun.star.text.TextFrame"), uno::UNO_QUERY);
+uno::Reference xTextFrameProps(xTextFrame, 
uno::UNO_QUERY);
+xTextFrameProps->setPropertyValue("Width", 
uno::Any(static_cast(2000)));
+xTextFrameProps->setPropertyValue("Height", 
uno::Any(static_cast(1000)));
+xTextFrameProps->setPropertyValue("IsSyncHeightToWidth", uno::Any(true));
+xTextFrameProps->setPropertyValue("IsSyncWidthToHeight", uno::Any(true));
+uno::Reference xText = xTextDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xText->insertTextContent(xCursor, xTextFrame, /*bAbsorb=*/false);
+
+// When exporting to ODT:
+uno::Reference xStorable(getComponent(), uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("writer8")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+
+// Then make sure that we still export a non-zero size:
+std::unique_ptr pStream = parseExportStream(aTempFile, 
"content.xml");
+xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+// Without the accompanying fix in place, this failed with:
+// - Expected: 0.7874in
+// - Actual  : 0in
+// i.e. the exported size was 0, not 2000 mm100 in inches.
+assertXPath(pXmlDoc, "//draw:frame", "width", "0.7874in");
+}
+
 CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testContentControlExport)
 {
 // Given a document with a content control around one or more text 
portions:
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 3612bbe33490..e310d4c9c2cd 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2866,6 +2866,14 @@ XMLShapeExportFlags 
XMLTextParagraphExport::addTextFrameAttributes(
 rPropSet->getPropertyValue("LayoutSize") >>= aLayoutSize;
 }
 
+bool bUseLayoutSize = true;
+if (bSyncWidth && bSyncHeight)
+{
+// This is broken, width depends on height and height depends on 
width. Don't use the
+// invalid layout size we got.
+bUseLayoutSize = false;
+}
+
 // svg:width
 sal_Int16 nWidthType = SizeType::FIX;
 if( xPropSetInfo->hasPropertyByName( gsWidthType ) )
@@ -2891,7 +2899,7 @@ XMLShapeExportFlags 
XMLTextParagraphExport::addTextFrameAttributes(
 }
 else
 {
-if (nRelWidth > 0 || bSyncWidth)
+if ((nRelWidth > 0 || bSyncWidth) && bUseLayoutSize)
 {
 // Relative width: write the layout size for the fallback 
width.
 sValue.setLength(

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

2022-09-20 Thread Mark Hung (via logerrit)
 sw/qa/extras/layout/data/tdf150642.odt |binary
 sw/qa/extras/layout/layout2.cxx|9 +
 sw/source/core/layout/calcmove.cxx |2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 11ec622b8405dcaabc359e3d6e38c8a9142dad6b
Author: Mark Hung 
AuthorDate: Fri Sep 9 16:09:47 2022 +0800
Commit: Mark Hung 
CommitDate: Tue Sep 20 18:47:53 2022 +0200

tdf#150642 fix table layout with vertical writing.

Revert part of 1bf82b26ae3.

N | V | WAS | 1bf82b26aea3 | WAS  | 1bf82b26aea3 |

---
F | F | fnRectHori  | fnRectHori   | fnAddRight/fnSubLeft |  |
F | T | fnRectVert  | fnRectVert   | fnAddRight/fnSubLeft |  |
T | F | fnRectVert  | fnRectHori   | fnAddRight/fnSubLeft | fnAddBottom  |
T | T | fnRectHori  | fnRectVert   | fnAddRight/fnSubLeft | fnAddBottom  | *

*: the case fixed in this patch.

Ref:

commit 1bf82b26aea3a403920a64cdfcb4671c947c7a01
Author: Mark Hung 
Date:   Sun Aug 14 15:23:14 2022 +0800

tdf#135991 fix unexpected hidden RTL sections.

Change-Id: I1e30c277dd03369bef0a6930b3d3534b7d57a640
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139777
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/sw/qa/extras/layout/data/tdf150642.odt 
b/sw/qa/extras/layout/data/tdf150642.odt
new file mode 100644
index ..5e316424a289
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf150642.odt differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 208bdf908d19..ac783be344fd 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -2382,6 +2382,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135991)
 assertXPath(pDump, "//bounds[@top<0]", 0);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150642)
+{
+createSwDoc(DATA_DIRECTORY, "tdf150642.odt");
+auto pDump = parseLayoutDump();
+// There used to be negative values that made the cell frame invisible.
+assertXPath(pDump, "//bounds[@left<0]", 0);
+assertXPath(pDump, "//bounds[@right<0]", 0);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 1869794300f6..e40e1dab6ef3 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -977,7 +977,7 @@ void SwLayoutFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 setFramePrintAreaValid(false);
 SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
 
-if (IsNeighbourFrame())
+if (IsNeighbourFrame() && !bVert)
 {
 SwTwips nPrtHeight = 
(GetUpper()->getFramePrintArea().*fnRect->fnGetHeight)();
 const tools::Long nDiff = nPrtHeight - 
(getFrameArea().*fnRect->fnGetHeight)();


Taichi Haradaguchi license statement

2022-09-20 Thread Taichi Haradaguchi
All of my past & future contributions to LibreOffice may be licensed under the 
MPLv2/LGPLv3+ dual license.

Taichi Haradaguchi



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

2022-09-20 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx |  198 +-
 sc/source/core/opencl/op_math.cxx|  114 -
 sc/source/core/opencl/op_math.hxx|   90 -
 sc/source/core/opencl/op_math_helpers.hxx|   26 
 sc/source/core/opencl/op_statistical.cxx | 2006 ---
 sc/source/core/opencl/op_statistical.hxx |  132 -
 sc/source/core/opencl/op_statistical_helpers.hxx |   23 
 sc/source/core/opencl/opbase.cxx |  124 +
 sc/source/core/opencl/opbase.hxx |  107 +
 9 files changed, 450 insertions(+), 2370 deletions(-)

New commits:
commit 424595a5997d1cbbf5ab0e3601e329efac9c2fd0
Author: Luboš Luňák 
AuthorDate: Tue Sep 20 09:57:45 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 20 17:54:03 2022 +0200

fix and simplify openCL *A functions (COUNTA,MINA, etc.)

These work just like their non-A counterparts, they just also accept
strings and treat them as zeros. So instead of having a duplicated
function for everything, use the basic functions, detect that string
arguments should be treated this way and then convert them in the input
data. This as a side-effect also makes
the ScCalcConfig::StringConversion::ZERO part work (no idea if that's
even been used).

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

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 87c34f53ef1c..46e40d357464 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -108,6 +108,7 @@ OUString LimitedString( const OUString& str )
 return OUString::Concat("\"") + str.subView( 0, 20 ) + "\"...";
 }
 
+const int MAX_PEEK_ELEMENTS = 5;
 // Returns formatted contents of the data (possibly shortened), to be used in 
debug output.
 std::string DebugPeekData(const FormulaToken* ref, int doubleRefIndex = 0)
 {
@@ -117,16 +118,19 @@ std::string DebugPeekData(const FormulaToken* ref, int 
doubleRefIndex = 0)
 static_cast(ref);
 outputstream buf;
 buf << "SingleRef {";
-for( size_t i = 0; i < std::min< size_t >( 4, pSVR->GetArrayLength()); 
++i )
+for( size_t i = 0; i < std::min< size_t >( MAX_PEEK_ELEMENTS, 
pSVR->GetArrayLength()); ++i )
 {
 if( i != 0 )
 buf << ",";
-if( pSVR->GetArray().mpNumericArray != nullptr )
-buf << pSVR->GetArray().mpNumericArray[ i ];
-else if( pSVR->GetArray().mpStringArray != nullptr )
+if( pSVR->GetArray().mpStringArray != nullptr
+&& pSVR->GetArray().mpStringArray[ i ] != nullptr )
+{
 buf << LimitedString( OUString( 
pSVR->GetArray().mpStringArray[ i ] ));
+}
+else if( pSVR->GetArray().mpNumericArray != nullptr )
+buf << pSVR->GetArray().mpNumericArray[ i ];
 }
-if( pSVR->GetArrayLength() > 4 )
+if( pSVR->GetArrayLength() > MAX_PEEK_ELEMENTS )
 buf << ",...";
 buf << "}";
 return buf.str();
@@ -137,16 +141,19 @@ std::string DebugPeekData(const FormulaToken* ref, int 
doubleRefIndex = 0)
 static_cast(ref);
 outputstream buf;
 buf << "DoubleRef {";
-for( size_t i = 0; i < std::min< size_t >( 4, pDVR->GetArrayLength()); 
++i )
+for( size_t i = 0; i < std::min< size_t >( MAX_PEEK_ELEMENTS, 
pDVR->GetArrayLength()); ++i )
 {
 if( i != 0 )
 buf << ",";
-if( pDVR->GetArrays()[doubleRefIndex].mpNumericArray != nullptr )
-buf << pDVR->GetArrays()[doubleRefIndex].mpNumericArray[ i ];
-else if( pDVR->GetArrays()[doubleRefIndex].mpStringArray != 
nullptr )
+if( pDVR->GetArrays()[doubleRefIndex].mpStringArray != nullptr
+&& pDVR->GetArrays()[doubleRefIndex].mpStringArray[ i ] != 
nullptr )
+{
 buf << LimitedString( OUString( 
pDVR->GetArrays()[doubleRefIndex].mpStringArray[ i ] ));
+}
+else if( pDVR->GetArrays()[doubleRefIndex].mpNumericArray != 
nullptr )
+buf << pDVR->GetArrays()[doubleRefIndex].mpNumericArray[ i ];
 }
-if( pDVR->GetArrayLength() > 4 )
+if( pDVR->GetArrayLength() > MAX_PEEK_ELEMENTS )
 buf << ",...";
 buf << "}";
 return buf.str();
@@ -172,13 +179,13 @@ std::string DebugPeekDoubles(const double* data, int size)
 {
 outputstream buf;
 buf << "{";
-for( int i = 0; i < std::min( 4, size ); ++i )
+for( int i = 0; i < std::min( MAX_PEEK_ELEMENTS, size ); ++i )
 {
 if( i != 0 )
 buf << ",";
 buf << data[ i ];
 }
-if( size > 4 )
+if( size > MAX_PEEK_ELEMENTS )
 buf

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

2022-09-20 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_statistical.cxx |  523 +--
 sc/source/core/opencl/op_statistical.hxx |7 
 sc/source/core/opencl/op_statistical_helpers.hxx |   15 
 3 files changed, 53 insertions(+), 492 deletions(-)

New commits:
commit 68ae0798078cbc9daa8ea951e0f5e7de55042f70
Author: Luboš Luňák 
AuthorDate: Tue Sep 20 09:57:41 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 20 17:53:47 2022 +0200

reduce opencl copy&paste (gaussinv)

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

diff --git a/sc/source/core/opencl/op_statistical.cxx 
b/sc/source/core/opencl/op_statistical.cxx
index f2d32c7eefa1..459057f80e8f 100644
--- a/sc/source/core/opencl/op_statistical.cxx
+++ b/sc/source/core/opencl/op_statistical.cxx
@@ -1089,6 +1089,13 @@ void OpPhi::GenSlidingWindowFunction(
 ss << "}\n";
 }
 
+void OpNorminv::BinInlineFun(std::set& decls,
+std::set& funs)
+{
+decls.insert(gaussinvDecl);
+funs.insert(gaussinv);
+}
+
 void OpNorminv::GenSlidingWindowFunction(
 outputstream &ss,const std::string &sSymName,
 SubArguments &vSubArguments)
@@ -1096,168 +1103,25 @@ void OpNorminv::GenSlidingWindowFunction(
 CHECK_PARAMETER_COUNT( 3, 3 );
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
-ss <<"double q,t,z;\n";
+ss << "int gid0=get_global_id(0);\n";
 GenerateArg( "x", 0, vSubArguments, ss );
 GenerateArg( "mue", 1, vSubArguments, ss );
 GenerateArg( "sigma", 2, vSubArguments, ss );
-ss <<"q = x -0.5;\n";
-ss <<"if(fabs(q)<=.425)\n";
-ss <<"   {\n";
-ss <<"t=0.180625-pow(q,2);\n";
-ss <<"z=\n"
-"q*\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"t*2509.0809287301226727";
-ss <<"+33430.575583588128105\n"
-")\n"
-"*t+67265.770927008700853\n"
-")\n"
-"*t+45921.953931549871457\n"
-")\n"
-"*t+13731.693765509461125\n"
-")\n"
-"*t+1971.5909503065514427\n"
-")\n"
-"*t+133.14166789178437745\n"
-")\n"
-"*t+3.387132872796366608\n"
-")\n"
-"/\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"t*5226.495278852854561";
-ss <<"+28729.085735721942674\n"
-")\n"
-"*t+39307.89580009271061\n"
-")\n"
-"*t+21213.794301586595867\n"
-")\n"
-"*t+5394.1960214247511077\n"
-")\n"
-"*t+687.1870074920579083\n"
-")\n"
-"*t+42.313330701600911252\n"
-")\n"
-"*t+1.0\n"
-");\n";
-ss <<"}\nelse\n{\n";
-ss <<" if(q>0)\nt=1-x;\n";
-ss <<"else\nt=x;\n";
-ss <<"t=sqrt(-log(t));\n";
-ss <<"if(t<=5.0)\n{\n";
-ss <<"t+=-1.6;\n";
-ss <<"z=\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-   "(\n"
-   "(\n"
-"t*7.7454501427834140764e-4";
-ss <<"+0.0227238449892691845833\n"
-")\n"
-"*t+0.24178072517745061177\n"
-")\n"
-"*t+1.27045825245236838258\n"
-")\n"
-"*t+3.64784832476320460504\n"
-")\n"
-"*t+5.7694972214606914055\n"
-")\n"
-"*t+4.6303378461565452959\n"
-")\n"
-"*t+1.42343711074968357734\n"
-")\n"
-"/\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"(\n"
-"t*1.05075007164441684324e-9";
-ss <<"+5.475938084995344946e-4\n"
-")\n"
-"*t+0.0151986665636164571966\n"
-")\n"
-  

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

2022-09-20 Thread Luboš Luňák (via logerrit)
 sc/qa/unit/data/functions/fods/Functions_Excel_2016.fods |2 -
 sc/source/core/opencl/op_logical.hxx |3 +
 sc/source/core/opencl/op_statistical.cxx |   24 ++-
 sc/source/core/opencl/opbase.cxx |4 +-
 sc/source/core/opencl/opbase.hxx |   12 ---
 5 files changed, 29 insertions(+), 16 deletions(-)

New commits:
commit 7dc92d60166a99e0539ce83ecf45bb40fd30d784
Author: Luboš Luňák 
AuthorDate: Tue Sep 20 09:57:38 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 20 17:53:32 2022 +0200

fix opencl AND() to treat empty cell in svSingleVectorRef as core does

Functions_Excel_2016.fods incorrectly used "=AND(Sheet2.C22;C33)"
instead of the correct "=AND(Sheet2.C22:C33)" (colon vs semicolon),
and C33 is an empty cell. The return however was true because empty
cells get special treatment because of Excel compatibility.

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

diff --git a/sc/qa/unit/data/functions/fods/Functions_Excel_2016.fods 
b/sc/qa/unit/data/functions/fods/Functions_Excel_2016.fods
index f5c2aedd3abe..b4a6ea11500d 100644
--- a/sc/qa/unit/data/functions/fods/Functions_Excel_2016.fods
+++ b/sc/qa/unit/data/functions/fods/Functions_Excel_2016.fods
@@ -856,7 +856,7 @@
  
   1
  
- 
+ 
   WAAR
  
  
diff --git a/sc/source/core/opencl/op_logical.hxx 
b/sc/source/core/opencl/op_logical.hxx
index f4c6b7a952ef..a52d1db0cf86 100644
--- a/sc/source/core/opencl/op_logical.hxx
+++ b/sc/source/core/opencl/op_logical.hxx
@@ -32,6 +32,9 @@ public:
 virtual std::string BinFuncName() const override { return "And"; }
 virtual const char* openclOperator() const override { return "&&"; };
 virtual const char* defaultOpenclValue() const override { return "true"; }
+// AND() with a svSingleVectorRef pointing to an empty cell skips that 
cell.
+// See ScInterpreter::ScAnd().
+virtual const char* rangeEmptyCellValue() const override { return "1.0"; };
 };
 
 class OpOr: public OpLogicalBinaryOperator
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index 2cb51e47d080..fe98b4c09dd3 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -189,7 +189,7 @@ void SlidingFunctionBase::GenerateArg( const char* name, 
int arg, SubArguments&
 static_cast(token);
 ss << "if (gid0 >= " << svr->GetArrayLength() << " || isnan(";
 ss << vSubArguments[arg]->GenSlidingWindowDeclRef() << "))\n";
-ss << "" << name << " = 0.0;\n";
+ss << "" << name << " = " << rangeEmptyCellValue() << 
";\n";
 ss << "else\n";
 ss << "" << name << " = ";
 ss << vSubArguments[arg]->GenSlidingWindowDeclRef() << ";\n";
@@ -345,7 +345,7 @@ void SlidingFunctionBase::GenerateRangeArgElement( const 
char* name, int arg, co
 throw Unhandled( __FILE__, __LINE__ );
 const formula::DoubleVectorRefToken* pDVR =
 static_cast(token);
-ss << "double " << name << " = NAN;\n";
+ss << "double " << name << " = " << rangeEmptyCellValue() << ";\n";
 ss << "{\n";
 // GenSlidingWindowDeclRef() may refer to 'i' variable.
 ss << "int i = 0;\n";
diff --git a/sc/source/core/opencl/opbase.hxx b/sc/source/core/opencl/opbase.hxx
index ee55d72c45b6..aa2770cd20aa 100644
--- a/sc/source/core/opencl/opbase.hxx
+++ b/sc/source/core/opencl/opbase.hxx
@@ -261,12 +261,12 @@ public:
 const std::string&, SubArguments& ) = 0;
 protected:
 // generate code for "double  = ;" from vSubArguments, 
svDoubleVectorRef is not supported
-static void GenerateArg( const char* name, int arg, SubArguments& 
vSubArguments, outputstream& ss );
+void GenerateArg( const char* name, int arg, SubArguments& vSubArguments, 
outputstream& ss );
 // overload, variable will be named "arg"
-static void GenerateArg( int arg, SubArguments& vSubArguments, 
outputstream& ss );
+void GenerateArg( int arg, SubArguments& vSubArguments, outputstream& ss );
 // generate code for "double  = ;" from vSubArguments, if it 
exists,
 // otherwise set to 
-static void GenerateArgWithDefault( const char* name, int arg, double def, 
SubArguments& vSubArguments,
+void GenerateArgWithDefault( const char* name, int arg, double def, 
SubArguments& vSubArguments,
 outputstream& ss );
 void GenerateFunctionDeclaration( const std::string& sSymName,
 SubArguments& vSubArguments, outputstream& ss );
@@ -282,7 +282,7 @@ protected:
 // Overload.
 // Both arguments must be svDoubleRef of the same size.
 // If 'firstElementDiff' is set, the loop start will be offset by '+ 
firstElementDiff'.
-static vo

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

2022-09-20 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_array.cxx |  149 ++---
 1 file changed, 27 insertions(+), 122 deletions(-)

New commits:
commit b2c334d76d5d5e5219d94db90e36d597be654c6c
Author: Luboš Luňák 
AuthorDate: Tue Sep 20 09:57:30 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 20 17:52:51 2022 +0200

simplify opencl code in op_array.cxx

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

diff --git a/sc/source/core/opencl/op_array.cxx 
b/sc/source/core/opencl/op_array.cxx
index 65a1caf65fbc..7369c1ed44bf 100644
--- a/sc/source/core/opencl/op_array.cxx
+++ b/sc/source/core/opencl/op_array.cxx
@@ -19,150 +19,55 @@ namespace sc::opencl {
 void OpSumX2MY2::GenSlidingWindowFunction(outputstream &ss,
 const std::string &sSymName, SubArguments &vSubArguments)
 {
+CHECK_PARAMETER_COUNT( 2, 2 );
+CHECK_PARAMETER_DOUBLEVECTORREF( 0 );
+CHECK_PARAMETER_DOUBLEVECTORREF( 1 );
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
-ss <<" int gid0=get_global_id(0);\n";
+ss << "int gid0=get_global_id(0);\n";
 ss << "double tmp =0;\n";
-GenTmpVariables(ss,vSubArguments);
-if(vSubArguments[0]->GetFormulaToken()->GetType() ==
-formula::svDoubleVectorRef)
-{
-FormulaToken *tmpCur = vSubArguments[0]->GetFormulaToken();
-const formula::DoubleVectorRefToken*pCurDVR= static_cast(tmpCur);
-size_t nCurWindowSize = pCurDVR->GetArrayLength() <
-pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength():
-pCurDVR->GetRefRowSize() ;
-ss << "int i ;\n";
-ss << "for (i = ";
-if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) {
-ss << "gid0; i < "<< nCurWindowSize <<"; i++)\n";
-} else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) {
-ss << "0; i < gid0+"<< nCurWindowSize <<"; i++)\n";
-} else {
-ss << "0; i < "<< nCurWindowSize <<"; i++)\n";
-}
-ss << "{\n";
-if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed())
-{
-ss << "int doubleIndex =i+gid0;\n";
-}else
-{
-ss << "int doubleIndex =i;\n";
-}
-
-CheckSubArgumentIsNan(ss,vSubArguments,0);
-CheckSubArgumentIsNan(ss,vSubArguments,1);
-ss << " tmp +=pow(tmp0,2) - pow(tmp1,2);\n";
-ss <<"}\n";
-}
-else
-{
-ss << "int singleIndex =gid0;\n";
-CheckAllSubArgumentIsNan(ss, vSubArguments);
-ss << "tmp = pow(tmp0,2) - pow(tmp1,2);\n";
-}
-ss << "return tmp;\n";
-ss << "}";
+GenerateRangeArgPair( 0, 1, vSubArguments, ss,
+"if( !isnan(arg1) && !isnan(arg2))\n"
+"tmp +=pow(arg1,2) - pow(arg2,2);\n"
+);
+ss << "return tmp;\n";
+ss << "}\n";
 }
 
 void OpSumX2PY2::GenSlidingWindowFunction(outputstream &ss,
 const std::string &sSymName, SubArguments &vSubArguments)
 {
+CHECK_PARAMETER_COUNT( 2, 2 );
+CHECK_PARAMETER_DOUBLEVECTORREF( 0 );
+CHECK_PARAMETER_DOUBLEVECTORREF( 1 );
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
 ss << "int gid0=get_global_id(0);\n";
 ss << "double tmp =0;\n";
-GenTmpVariables(ss,vSubArguments);
-if(vSubArguments[0]->GetFormulaToken()->GetType() ==
-formula::svDoubleVectorRef)
-{
-FormulaToken *tmpCur = vSubArguments[0]->GetFormulaToken();
-const formula::DoubleVectorRefToken*pCurDVR= static_cast(tmpCur);
-size_t nCurWindowSize = pCurDVR->GetArrayLength() <
-pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength():
-pCurDVR->GetRefRowSize() ;
-ss << "int i ;\n";
-ss << "for (i = ";
-if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) {
-ss << "gid0; i < "<< nCurWindowSize <<"; i++)\n";
-} else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) {
-ss << "0; i < gid0+"<< nCurWindowSize <<"; i++)\n";
-} else {
-ss << "0; i < "<< nCurWindowSize <<"; i++)\n";
-}
-ss << "{\n";
-if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed())
-{
-ss << "int doubleIndex =i+gid0;\n";
-}else
-{
-ss << "int doubleIndex =i;\n";
-}
-
-CheckSubArgumentIsNan(ss,vSubArguments,0);
-CheckSubArgumentIsNan(ss,vSubArguments,1);
-ss << " tmp +=pow(tmp0,2) + pow(tmp1,2);\n";
-ss <<"}\n";
-}
-else
-{
-ss << "int singleIndex =gid0;\n";
-CheckAllSubArgumentIsNan(ss, vSubArguments);
-ss << "tmp = pow(tmp0,2) + pow(tmp1,2);\n";
-}
+GenerateRangeArgPair( 0, 1, vSubArguments, ss,
+"   

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

2022-09-20 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx |6 
 sc/source/core/opencl/op_financial.cxx   |  402 ++-
 sc/source/core/opencl/op_financial.hxx   |   54 +---
 sc/source/core/opencl/op_statistical.cxx |2 
 sc/source/core/opencl/opbase.cxx |   96 ---
 sc/source/core/opencl/opbase.hxx |   15 +
 6 files changed, 170 insertions(+), 405 deletions(-)

New commits:
commit e39f5eedc09fb79159bc764f1215d24afa9035e0
Author: Luboš Luňák 
AuthorDate: Tue Sep 20 09:57:21 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 20 17:52:27 2022 +0200

fix and simplify opencl IRR(), MIRR(), XIRR() and XNPV()

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

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index b4e35e932ba5..87c34f53ef1c 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3024,11 +3024,11 @@ 
DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i],
 std::make_shared(), nResultSize));
 }
-/*else if (pChild->GetExternal() == 
"com.sun.star.sheet.addin.Analysis.getXirr")
+else if (pChild->GetExternal() == 
"com.sun.star.sheet.addin.Analysis.getXirr")
 {
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i],
-std::make_shared(), nResultSize));
+}
 else if (pChild->GetExternal() == 
"com.sun.star.sheet.addin.Analysis.getOddlprice")
 {
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts,
diff --git a/sc/source/core/opencl/op_financial.cxx 
b/sc/source/core/opencl/op_financial.cxx
index 83c9472e6c22..92263d78abb4 100644
--- a/sc/source/core/opencl/op_financial.cxx
+++ b/sc/source/core/opencl/op_financial.cxx
@@ -18,13 +18,13 @@ namespace sc::opencl {
 // Definitions of inline functions
 #include "op_financial_helpers.hxx"
 
-void RRI::GenSlidingWindowFunction(
+void OpRRI::GenSlidingWindowFunction(
 outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments)
 {
 CHECK_PARAMETER_COUNT( 3, 3 );
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
-ss << "double tmp = " << GetBottom() <<";\n";
+ss << "double tmp;\n";
 ss << "int gid0 = get_global_id(0);\n";
 GenerateArg( "nper", 0, vSubArguments, ss );
 GenerateArg( "pv", 1, vSubArguments, ss );
@@ -402,251 +402,64 @@ vSubArguments)
 ss <<"}";
 }
 
-void IRR::GenSlidingWindowFunction(outputstream &ss,
+void OpIRR::GenSlidingWindowFunction(outputstream &ss,
 const std::string &sSymName, SubArguments &vSubArguments)
 {
 CHECK_PARAMETER_COUNT( 2, 2 );
+CHECK_PARAMETER_DOUBLEVECTORREF( 0 );
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
 ss << "#define  Epsilon   1.0E-7\n";
 ss << "int gid0 = get_global_id(0);\n";
-FormulaToken* pSur = vSubArguments[1]->GetFormulaToken();
-assert(pSur);
-ss << "double fEstimated = ";
-ss << vSubArguments[1]->GenSlidingWindowDeclRef() << ";\n";
+GenerateArgWithDefault( "fEstimated", 1, 0.1, vSubArguments, ss );
 ss << "double fEps = 1.0;\n";
-ss << "double x = 0.0, xNew = 0.0, fNumerator = 0.0, fDenominator = 
0.0;\n";
+ss << "double xNew = 0.0, fNumerator = 0.0, fDenominator = 0.0;\n";
 ss << "double nCount = 0.0;\n";
-if (pSur->GetType() == formula::svSingleVectorRef)
-{
-const formula::SingleVectorRefToken* pSVR =
-static_cast< const formula::SingleVectorRefToken* >(pSur);
-ss << "if (gid0 >= " << pSVR->GetArrayLength() << ")\n";
-ss << "fEstimated = 0.1;\n";
-ss << "if (isnan(fEstimated))\n";
-ss << "x = 0.1;\n";
-ss << "else\n";
-}
-else if (pSur->GetType() == formula::svDouble)
-{
-ss << "if (isnan(fEstimated))\n";
-ss << "x = 0.1;\n";
-ss << "else\n";
-}
-ss << "x = fEstimated;\n";
 ss << "unsigned short nItCount = 0;\n";
-ss << "while (fEps > Epsilon && nItCount < 20){\n";
+ss << "double x = fEstimated;\n";
+ss << "while (fEps > Epsilon && nItCount < 20)\n";
+ss << "{\n";
 ss << "nCount = 0.0; fNumerator = 0.0;  fDenominator = 0.0;\n";
-ss << "double arg0, arg1;\n";
-ss << "int i = 0;\n";
-FormulaToken* pCur = vSubArguments[0]->GetFormulaToken();
-assert(pCur);
-const formula::DoubleVectorRefToken* pDVR =
-static_cast(pCur);
-size_t nCurWin

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

2022-09-20 Thread Samuel Mehrbrodt (via logerrit)
 svx/source/sidebar/area/AreaPropertyPanel.cxx |   16 -
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |   65 +-
 2 files changed, 64 insertions(+), 17 deletions(-)

New commits:
commit 088cd9dc35b01dc5e8a7a7eedf5f52bcfc4c8001
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 19 13:24:05 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Sep 20 17:31:26 2022 +0200

tdf#150650 Fix changing fill style to None via Sidebar

Regression from 5491a82854e3e6dd2dbb4b0012cb4bbeb4ee22e0

Change-Id: I17cfb037f2064a508317090e6b66f20e253a9436
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140150
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 6238758d80e170cdb586df2b34d479499574cb72)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140161
Reviewed-by: Thorsten Behrens 

diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx 
b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 1bcbdac19e1e..fa634ee4499b 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -90,9 +90,19 @@ void AreaPropertyPanel::setFillTransparence(const 
XFillTransparenceItem& rItem)
 void AreaPropertyPanel::setFillUseBackground(const XFillStyleItem* pStyleItem,
  const 
XFillUseSlideBackgroundItem& rItem)
 {
-GetBindings()->GetDispatcher()->ExecuteList(
-SID_ATTR_FILL_USE_SLIDE_BACKGROUND, SfxCallMode::RECORD,
-std::initializer_list{ &rItem, pStyleItem });
+const SfxPoolItem* pItem = nullptr;
+auto pDispatcher = GetBindings()->GetDispatcher();
+auto state = pDispatcher->QueryState(SID_ATTR_FILL_USE_SLIDE_BACKGROUND, 
pItem);
+// FillUseSlideBackground is only available in Impress
+if (state == SfxItemState::DISABLED)
+{
+setFillStyle(*pStyleItem);
+}
+else
+{
+pDispatcher->ExecuteList(SID_ATTR_FILL_USE_SLIDE_BACKGROUND, 
SfxCallMode::RECORD,
+ std::initializer_list{ 
&rItem, pStyleItem });
+}
 }
 
 void AreaPropertyPanel::setFillFloatTransparence(const 
XFillFloatTransparenceItem& rItem)
commit dbd89ccc4fd989f12d42ebcb68aa56ab969e84bd
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 19 14:10:39 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Sep 20 17:31:17 2022 +0200

tdf#150802 Fix setting gradient from Sidebar

Regression from adc536e9efc77690df62177aa722f9252bdbf96b

Change-Id: I37db76373a3b9b4a1084e830233561abc4b1e6d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140151
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit c112e426bff4bdf2317363a534495498b0aa215a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140158
Reviewed-by: Thorsten Behrens 

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 6dec785c4067..cd3a484e7bb0 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -466,26 +466,63 @@ void AreaPropertyPanelBase::FillStyleChanged(bool 
bUpdateModel)
 mxMTRAngle->set_sensitive(true);
 mxLbFillAttr->clear();
 
-const SvxGradientListItem* pItem = pSh->GetItem(SID_GRADIENT_LIST);
-
-if (0 < pItem->GetGradientList()->Count())
+if (bUpdateModel)
 {
-const XGradient aGradient = 
pItem->GetGradientList()->GetGradient(0)->GetGradient();
-const OUString aName = 
pItem->GetGradientList()->GetGradient(0)->GetName();
-const XFillGradientItem aXFillGradientItem(aName, aGradient);
+mxLbFillAttr->hide();
+mxToolBoxColor->hide();
+mxBmpImport->hide();
 
-// #i122676# change FillStyle and Gradient in one call
-if (bUpdateModel)
+const SvxGradientListItem* pItem = 
pSh->GetItem(SID_GRADIENT_LIST);
+if (pItem->GetGradientList()->Count() > 0)
 {
+const XGradient aGradient
+= 
pItem->GetGradientList()->GetGradient(0)->GetGradient();
+const OUString aName = 
pItem->GetGradientList()->GetGradient(0)->GetName();
+const XFillGradientItem aXFillGradientItem(aName, 
aGradient);
+
+// #i122676# change FillStyle and Gradient in one call
 XFillStyleItem 
aXFillStyleItem(drawing::FillStyle_GRADIENT);
 setFillStyleAndGradient(&aXFillStyleItem, 
aXFillGradientItem);
-}
-mxLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
-mxLbFillGradTo->SelectEntry(aGradient.GetEndColor());
+mxLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
+mx

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

2022-09-20 Thread Mike Kaganski (via logerrit)
 basegfx/source/polygon/b2dpolygon.cxx |9 +
 basegfx/source/polygon/b2dpolypolygon.cxx |2 ++
 2 files changed, 11 insertions(+)

New commits:
commit c8649af8d0353e2fba2e472f0ace50f5bd8167b2
Author: Mike Kaganski 
AuthorDate: Tue Sep 20 11:16:17 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 20 17:26:54 2022 +0200

Assert that cow_wrapped objects aren't called to do nothing

An omission from commit e39fa3c4f5ae2560a4b6f6f789a0c5098ac43cf4
  Simplify b2d(poly)polygon implementation

Change-Id: Ib0b10e06baf91888f0e9797e670e0626f512af15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140229
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/basegfx/source/polygon/b2dpolygon.cxx 
b/basegfx/source/polygon/b2dpolygon.cxx
index 03957c8710a3..b0171ef000e2 100644
--- a/basegfx/source/polygon/b2dpolygon.cxx
+++ b/basegfx/source/polygon/b2dpolygon.cxx
@@ -82,6 +82,7 @@ public:
 
 void insert(sal_uInt32 nIndex, const basegfx::B2DPoint& rValue, sal_uInt32 
nCount)
 {
+assert(nCount > 0);
 assert(nIndex <= maVector.size());
 // add nCount copies of rValue
 maVector.insert(maVector.begin() + nIndex, nCount, rValue);
@@ -89,6 +90,7 @@ public:
 
 void insert(sal_uInt32 nIndex, const CoordinateDataArray2D& rSource)
 {
+assert(rSource.maVector.size() > 0);
 assert(nIndex <= maVector.size());
 // insert data
 auto aIndex = maVector.begin();
@@ -100,6 +102,7 @@ public:
 
 void remove(sal_uInt32 nIndex, sal_uInt32 nCount)
 {
+assert(nCount > 0);
 assert(nIndex + nCount <= maVector.size());
 // remove point data
 const auto aStart = maVector.begin() + nIndex;
@@ -328,6 +331,7 @@ public:
 
 void insert(sal_uInt32 nIndex, const ControlVectorPair2D& rValue, 
sal_uInt32 nCount)
 {
+assert(nCount > 0);
 assert(nIndex <= maVector.size());
 
 // add nCount copies of rValue
@@ -342,6 +346,7 @@ public:
 
 void insert(sal_uInt32 nIndex, const ControlVectorArray2D& rSource)
 {
+assert(rSource.maVector.size() > 0);
 assert(nIndex <= maVector.size());
 
 // insert data
@@ -362,6 +367,7 @@ public:
 
 void remove(sal_uInt32 nIndex, sal_uInt32 nCount)
 {
+assert(nCount > 0);
 assert(nIndex + nCount <= maVector.size());
 
 const ControlVectorPair2DVector::iterator 
aDeleteStart(maVector.begin() + nIndex);
@@ -689,6 +695,7 @@ public:
 
 void insert(sal_uInt32 nIndex, const basegfx::B2DPoint& rPoint, sal_uInt32 
nCount)
 {
+assert(nCount > 0);
 mpBufferedData.reset();
 auto aCoordinate = rPoint;
 maPoints.insert(nIndex, aCoordinate, nCount);
@@ -804,6 +811,7 @@ public:
 
 void append(const ImplB2DPolygon& rSource)
 {
+assert(rSource.maPoints.count() > 0);
 const sal_uInt32 nIndex = count();
 
 mpBufferedData.reset();
@@ -828,6 +836,7 @@ public:
 
 void remove(sal_uInt32 nIndex, sal_uInt32 nCount)
 {
+assert(nCount > 0);
 mpBufferedData.reset();
 maPoints.remove(nIndex, nCount);
 
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx 
b/basegfx/source/polygon/b2dpolypolygon.cxx
index dc8f0f53e98c..6ce3b398a1fb 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -102,6 +102,7 @@ public:
 
 void insert(sal_uInt32 nIndex, const basegfx::B2DPolygon& rPolygon, 
sal_uInt32 nCount)
 {
+assert(nCount > 0);
 assert(nIndex <= maPolygons.size());
 // add nCount copies of rPolygon
 maPolygons.insert(maPolygons.begin() + nIndex, nCount, rPolygon);
@@ -131,6 +132,7 @@ public:
 
 void remove(sal_uInt32 nIndex, sal_uInt32 nCount)
 {
+assert(nCount > 0);
 assert(nIndex + nCount <= maPolygons.size());
 // remove polygon data
 auto aStart(maPolygons.begin() + nIndex);


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

2022-09-20 Thread Noel Grandin (via logerrit)
 include/svl/inettype.hxx   |2 
 include/svl/numformat.hxx  |2 
 include/svl/zformat.hxx|4 -
 svl/source/misc/inettype.cxx   |   21 +-
 svl/source/numbers/zforfind.cxx|   43 ++---
 svl/source/numbers/zforfind.hxx|   12 ++---
 svl/source/numbers/zforlist.cxx|7 +--
 svl/source/numbers/zformat.cxx |   24 +--
 svl/source/numbers/zforscan.hxx|4 -
 svl/source/passwordcontainer/passwordcontainer.cxx |   16 +++
 svl/source/passwordcontainer/passwordcontainer.hxx |4 -
 11 files changed, 71 insertions(+), 68 deletions(-)

New commits:
commit f600c5389ccad6a221732b478650a20de4355890
Author: Noel Grandin 
AuthorDate: Tue Sep 20 14:41:14 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 16:37:38 2022 +0200

use more string_view in svl

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

diff --git a/include/svl/inettype.hxx b/include/svl/inettype.hxx
index b8f79d49a7af..7d9ebce51f60 100644
--- a/include/svl/inettype.hxx
+++ b/include/svl/inettype.hxx
@@ -249,7 +249,7 @@ public:
 
 static INetContentType GetContentType4Extension(OUString const& 
rExtension);
 
-static INetContentType GetContentTypeFromURL(OUString const& rURL);
+static INetContentType GetContentTypeFromURL(std::u16string_view aURL);
 
 static bool GetExtensionFromURL(std::u16string_view rURL, OUString& 
rExtension);
 
diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index dc1c704d364d..6ff04837b0bb 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -489,7 +489,7 @@ public:
  else .
  */
 static const NfCurrencyEntry* GetCurrencyEntry(bool& bFoundBank, 
std::u16string_view rSymbol,
-   const OUString& rExtension,
+   std::u16string_view 
rExtension,
LanguageType 
eFormatLanguage,
bool bOnlyStringLanguage = 
false);
 
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index ae57f5c868ed..43f6ad9775f4 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -469,7 +469,7 @@ public:
 is non-"gregorian" and rOrgCalendar is not empty. Thus a preceding
 ImpSwitchToOtherCalendar() call should have been placed prior to
 calling this method. */
-void SwitchToGregorianCalendar( const OUString& rOrgCalendar, double 
fOrgDateTime ) const;
+void SwitchToGregorianCalendar( std::u16string_view rOrgCalendar, double 
fOrgDateTime ) const;
 
 #ifdef THE_FUTURE
 /** Switches to the first specified calendar, if any, in subformat nNumFor
@@ -584,7 +584,7 @@ private:
  * list of language types. These numbers also correspond with the
  * numbers used by Microsoft Office.
  */
-SVL_DLLPRIVATE static LocaleType ImpGetLocaleType( const OUString& 
rString, sal_Int32& nPos );
+SVL_DLLPRIVATE static LocaleType ImpGetLocaleType( std::u16string_view 
rString, sal_Int32& nPos );
 
 /** Obtain calendar and numerals from a LocaleType that was parsed from a
 LCID with ImpGetLocaleType().
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index b38346d702a7..ca2528c3c242 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -307,22 +308,22 @@ INetContentType 
INetContentTypes::GetContentType4Extension(OUString const & rExt
 }
 
 //static
-INetContentType INetContentTypes::GetContentTypeFromURL(OUString const & rURL)
+INetContentType INetContentTypes::GetContentTypeFromURL(std::u16string_view 
rURL)
 {
 INetContentType eTypeID = CONTENT_TYPE_UNKNOWN;
 sal_Int32 nIdx{ 0 };
-OUString aToken( rURL.getToken(0, ':', nIdx) );
+OUString aToken( o3tl::getToken(rURL, 0, ':', nIdx) );
 if (!aToken.isEmpty())
 {
 if (aToken.equalsIgnoreAsciiCase(INETTYPE_URL_PROT_FILE))
-if (rURL[ rURL.getLength() - 1 ] == '/') // folder
-if (rURL.getLength() > RTL_CONSTASCII_LENGTH("file:///"))
+if (rURL[ rURL.size() - 1 ] == '/') // folder
+if (rURL.size() > RTL_CONSTASCII_LENGTH("file:///"))
 if (WildCard(u"*/{*}/").Matches(rURL)) // special folder
 eTypeID = CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER;
 else
 // drive? -> "file:///?|/"
-if (rURL.getLength() == 11
-&& rURL[ rURL.getLength() - 2 ] == '|'

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

2022-09-20 Thread Noel Grandin (via logerrit)
 sc/inc/compiler.hxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a68ad22fbef20542284354732ee561efd40f41fa
Author: Noel Grandin 
AuthorDate: Fri Sep 16 15:29:20 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 15:49:59 2022 +0200

speed up large sheet with lots of conditions

shaves 10% off view load time

Change-Id: I51078ef81613faa2f8c37530fb7dc77b73192525
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140070
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 7e829725105897da822fe4b0d09c4a04a2666132)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139987
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 5f3b6354c967..585a3c86a9ae 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -323,7 +324,7 @@ private:
 formula::FormulaTokenRef operation;
 };
 std::vector< PendingImplicitIntersectionOptimization > 
mPendingImplicitIntersectionOptimizations;
-std::set mUnhandledPossibleImplicitIntersections;
+std::unordered_set 
mUnhandledPossibleImplicitIntersections;
 #ifdef DBG_UTIL
 std::set mUnhandledPossibleImplicitIntersectionsOpCodes;
 #endif


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

2022-09-20 Thread Noel Grandin (via logerrit)
 sw/qa/extras/odfexport/odfexport.cxx  |  490 
 sw/qa/extras/odfexport/odfexport2.cxx |  506 ++
 2 files changed, 506 insertions(+), 490 deletions(-)

New commits:
commit 78afe29f3d56e589be4e0d25573eef32377548eb
Author: Noel Grandin 
AuthorDate: Tue Sep 20 14:30:39 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 15:49:36 2022 +0200

move some test from odfexport to odfexport2

to trim the long run time of odfexport

Change-Id: Ib2c2f13796ecea14a3aede51442005c08487c128
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140240
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index fb3aa5e3412b..9c723e240380 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2741,496 +2741,6 @@ CPPUNIT_TEST_FIXTURE(Test, testImageMimetype)
 assertXPath(pXmlDoc, 
"/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@draw:mime-type='image/svg+xml']");
 }
 
-CPPUNIT_TEST_FIXTURE(Test, testEmbeddedFontProps)
-{
-loadAndReload("embedded-font-props.odt");
-CPPUNIT_ASSERT_EQUAL(1, getPages());
-#if !defined(MACOSX)
-// Test that font style/weight of embedded fonts is exposed.
-// Test file is a normal ODT, except EmbedFonts is set to true in 
settings.xml.
-xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
-// These failed, the attributes were missing.
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[1]", "font-style", "normal");
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[1]", "font-weight", "normal");
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[2]", "font-style", "normal");
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[2]", "font-weight", "bold");
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[3]", "font-style", "italic");
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[3]", "font-weight", "normal");
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[4]", "font-style", "italic");
-assertXPath(pXmlDoc, "//style:font-face[@style:name='Liberation 
Serif']/svg:font-face-src/svg:font-face-uri[4]", "font-weight", "bold");
-#endif
-}
-
-DECLARE_ODFEXPORT_TEST(testTdf100492, "tdf100492.odt")
-{
-CPPUNIT_ASSERT_EQUAL(2, getShapes());
-CPPUNIT_ASSERT_EQUAL(1, getPages());
-uno::Reference xShape = getShape(1);
-CPPUNIT_ASSERT(xShape.is());
-
-// Save the first shape to a SVG
-uno::Reference xGraphicExporter = 
drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext());
-uno::Reference xSourceDoc(xShape, uno::UNO_QUERY);
-xGraphicExporter->setSourceDocument(xSourceDoc);
-
-SvMemoryStream aStream;
-uno::Reference xOutputStream(new 
utl::OStreamWrapper(aStream));
-uno::Sequence aDescriptor( 
comphelper::InitPropertySequence({
-{ "OutputStream", uno::Any(xOutputStream) },
-{ "FilterName", uno::Any(OUString("SVG")) }
-}));
-xGraphicExporter->filter(aDescriptor);
-aStream.Seek(STREAM_SEEK_TO_BEGIN);
-
-// TODO: Disabled. Parsing of SVG gives just root node without any 
children.
-// Reason of such behavior unclear. So XPATH assert fails.
-
-// Parse resulting SVG as XML file.
-// xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
-
-// Check amount of paths required to draw an arrow.
-// Since there are still some empty paths in output test can fail later. 
There are just two
-// really used and visible paths.
-//assertXPath(pXmlDoc, "/svg/path", 4);
-}
-
-DECLARE_ODFEXPORT_TEST(testTdf77961, "tdf77961.odt")
-{
-CPPUNIT_ASSERT_EQUAL(1, getPages());
-uno::Reference xStyles(getStyles("PageStyles"));
-uno::Reference xStyle(xStyles->getByName("Standard"), 
uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL( false , getProperty(xStyle, "GridDisplay"));
-CPPUNIT_ASSERT_EQUAL( false , getProperty(xStyle, "GridPrint"));
-}
-
-DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt")
-{
-CPPUNIT_ASSERT_EQUAL(2, getPages());
-// Test loext:reference-language attribute of reference fields
-// (used from LibreOffice 6.1, and proposed for next ODF)
-OUString const aFieldTexts[] = { "A 2", "Az Isten", "Az 50-esek",
-"A 2018-asok", "Az egyebek", "A fejezetek",
-u"Az „Őseinket...”", "a 2",
-"Az v", "az 1", "Az e)", "az 1",
-"Az (5)", "az 1", "A 2", "az 1" };
-uno::Reference xTextFieldsSu

[Libreoffice-commits] core.git: solenv/clang-format sw/CppunitTest_sw_mailmerge2.mk sw/Module_sw.mk sw/qa

2022-09-20 Thread Noel Grandin (via logerrit)
 solenv/clang-format/excludelist   |1 
 sw/CppunitTest_sw_mailmerge2.mk   |   62 ++
 sw/Module_sw.mk   |1 
 sw/qa/extras/mailmerge/mailmerge.cxx  |  391 --
 sw/qa/extras/mailmerge/mailmerge2.cxx |  718 ++
 5 files changed, 782 insertions(+), 391 deletions(-)

New commits:
commit e4fe4a2918fbca0dc38441261a0f890720538639
Author: Noel Grandin 
AuthorDate: Tue Sep 20 13:59:15 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 15:49:13 2022 +0200

split the mailmerge unit test

since it is substantially longer running than the next longest test

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

diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 9f9138d1bdd8..3ad66572897a 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -12230,6 +12230,7 @@ sw/qa/extras/docbookexport/docbookexport.cxx
 sw/qa/extras/globalfilter/globalfilter.cxx
 sw/qa/extras/htmlimport/htmlimport.cxx
 sw/qa/extras/mailmerge/mailmerge.cxx
+sw/qa/extras/mailmerge/mailmerge2.cxx
 sw/qa/extras/odfexport/odfexport.cxx
 sw/qa/extras/odfexport/odfexport2.cxx
 sw/qa/extras/odfimport/odfimport.cxx
diff --git a/sw/CppunitTest_sw_mailmerge2.mk b/sw/CppunitTest_sw_mailmerge2.mk
new file mode 100644
index ..2fd6e107258a
--- /dev/null
+++ b/sw/CppunitTest_sw_mailmerge2.mk
@@ -0,0 +1,62 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_mailmerge2))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_mailmerge2))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_mailmerge2, \
+sw/qa/extras/mailmerge/mailmerge2 \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_mailmerge2, \
+comphelper \
+cppu \
+cppuhelper \
+sal \
+sfx \
+svl \
+sw \
+   swqahelper \
+test \
+tl \
+unotest \
+utl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_mailmerge2, \
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_mailmerge2,\
+   udkapi \
+   offapi \
+   oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_mailmerge2,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_mailmerge2))
+$(eval $(call gb_CppunitTest_use_ure,sw_mailmerge2))
+$(eval $(call gb_CppunitTest_use_vcl,sw_mailmerge2))
+
+$(eval $(call gb_CppunitTest_set_include,sw_mailmerge2,\
+-I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/core/inc \
+-I$(SRCDIR)/sw/qa/inc \
+-I$(SRCDIR)/sw/source/uibase/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,sw_mailmerge2,\
+   modules/swriter \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 8b5a42e0ff14..754411a7dc42 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -120,6 +120,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
 CppunitTest_sw_layoutwriter \
 CppunitTest_sw_layoutwriter2 \
 CppunitTest_sw_mailmerge \
+CppunitTest_sw_mailmerge2 \
 CppunitTest_sw_globalfilter \
 CppunitTest_sw_accessible_relation_set \
 CppunitTest_sw_apiterminate \
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx 
b/sw/qa/extras/mailmerge/mailmerge.cxx
index fbeded40b94b..8d024194c985 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -974,397 +974,6 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf62364, 
"tdf62364.odt", "10-testing-addresses
 }
 }
 
-DECLARE_SHELL_MAILMERGE_TEST(tdf125522_shell, "tdf125522.odt", 
"10-testing-addresses.ods", "testing-addresses")
-{
-// prepare unit test and run
-executeMailMerge();
-
-// reset currently opened layout of the original template,
-// and create the layout of the document with 10 mails inside
-dumpMMLayout();
-
-// there should be no any text frame in output
-SwXTextDocument* pTextDoc = dynamic_cast(mxMMComponent.get());
-CPPUNIT_ASSERT(pTextDoc);
-
-const auto & rNodes = pTextDoc->GetDocShell()->GetDoc()->GetNodes();
-for (SwNodeOffset nodeIndex(0); nodeIndexStartOfSectionNode())
-{
-CPPUNIT_ASSERT(!aNode->StartOfSectionNode()->GetFlyFormat());
-}
-}
-}
-
-DECLARE_SHELL_MAILMERGE_TEST(testTd78611_shell, "tdf78611.odt", 
"10-testing-addresses.ods", "testing-addresses")
-{
-// prepare unit test and run
-executeMailMerge();
-
-// reset currently opened layout of the original template,
-// and create the layout of the document with 10 m

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

2022-09-20 Thread Taichi Haradaguchi (via logerrit)
 download.lst   |4 ++--
 external/nss/nss-android.patch.1   |2 +-
 external/nss/nss-bz1646594.patch.1 |2 +-
 external/nss/nss.patch |   16 
 4 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 06c9e1d27093ca7bbe38a1eb93fbb85b80f75f75
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Tue Sep 20 17:51:08 2022 +0900
Commit: Caolán McNamara 
CommitDate: Tue Sep 20 14:50:53 2022 +0200

nss: update to release 3.83

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

diff --git a/download.lst b/download.lst
index 1d53437b253d..7ffd184a058f 100644
--- a/download.lst
+++ b/download.lst
@@ -185,8 +185,8 @@ export MWAW_VERSION_MICRO := 21
 export MWAW_TARBALL := libmwaw-0.3.$(MWAW_VERSION_MICRO).tar.xz
 export MYTHES_SHA256SUM := 
19279f70707bbe5ffa619f2dc319f888cec0c4a8d339dc0a21330517bd6f521d
 export MYTHES_TARBALL := mythes-1.2.5.tar.xz
-export NSS_SHA256SUM := 
5369ed274a19f480ec94e1faef04da63e3cbac1a82e15bb1751e58b2f274b835
-export NSS_TARBALL := nss-3.79-with-nspr-4.34.tar.gz
+export NSS_SHA256SUM := 
b1e1198fa7ee4e0fe4fa6937245c94820fd3c3c6897779493858af1bf6310b30
+export NSS_TARBALL :=  nss-3.83-with-nspr-4.34.1.tar.gz
 export ODFGEN_SHA256SUM := 
55200027fd46623b9b38d275e7452d1b0ff8aeddcad6f9ae6dc25f610625
 export ODFGEN_VERSION_MICRO := 8
 export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.xz
diff --git a/external/nss/nss-android.patch.1 b/external/nss/nss-android.patch.1
index 05172eaad16a..7eb306a50c32 100644
--- a/external/nss/nss-android.patch.1
+++ b/external/nss/nss-android.patch.1
@@ -74,7 +74,7 @@ diff -ur nss.org/nss/Makefile nss/nss/Makefile
 diff -ur nss/nss/coreconf/arch.mk nss/nss/coreconf/arch.mk
 --- nss/nss/coreconf/arch.mk   2019-11-01 10:29:44.933245745 +0100
 +++ nss/nss/coreconf/arch.mk   2019-11-01 10:32:04.347181076 +0100
-@@ -234,7 +234,15 @@
+@@ -213,7 +213,15 @@
  #
  # this should be  configurable from the user
  #
diff --git a/external/nss/nss-bz1646594.patch.1 
b/external/nss/nss-bz1646594.patch.1
index e6c75922a7dc..cffb9f5fe61d 100644
--- a/external/nss/nss-bz1646594.patch.1
+++ b/external/nss/nss-bz1646594.patch.1
@@ -2,7 +2,7 @@ regression from 
https://bugzilla.mozilla.org/show_bug.cgi?id=1646594
 
 --- nss/nss/coreconf/arch.mk.orig2 2020-08-18 14:33:21.295252404 +0200
 +++ nss/nss/coreconf/arch.mk   2020-08-18 14:33:46.360320806 +0200
-@@ -116,8 +116,10 @@
+@@ -94,8 +94,10 @@
OS_RELEASE := $(word 1,$(OS_RELEASE)).$(word 2,$(OS_RELEASE))
  endif
  KERNEL = Linux
diff --git a/external/nss/nss.patch b/external/nss/nss.patch
index 66fbe37dc5ed..cc9eeed1b009 100644
--- a/external/nss/nss.patch
+++ b/external/nss/nss.patch
@@ -1,6 +1,6 @@
 --- a/a/nspr/configure 2017-08-29 23:44:13.686045013 +0530
 +++ b/b/nspr/configure 2017-08-29 23:46:53.774768655 +0530
-@@ -7034,7 +7034,7 @@
+@@ -6794,7 +6794,7 @@
  PR_MD_CSRCS=linux.c
  MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  DSO_CFLAGS=-fPIC
@@ -11,7 +11,7 @@
 # combo is not yet good at debugging 
inlined
 --- a/nss.orig/nspr/pr/src/misc/prnetdb.c  2017-08-29 23:44:13.690045031 
+0530
 +++ b/nss/nspr/pr/src/misc/prnetdb.c   2017-08-29 23:47:03.810814019 +0530
-@@ -438,7 +438,7 @@
+@@ -441,7 +441,7 @@
  char *buf = *bufp;
  PRIntn buflen = *buflenp;
  
@@ -51,7 +51,7 @@
  
 --- a/nss.org/nss/coreconf/arch.mk 2017-08-29 23:44:13.646044832 +0530
 +++ b/nss/nss/coreconf/arch.mk 2017-08-29 23:45:51.494487134 +0530
-@@ -305,11 +305,17 @@
+@@ -284,11 +284,17 @@
  OBJDIR_NAME_COMPILER = $(COMPILER_TAG)
  endif
  OBJDIR_NAME_BASE = 
$(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(OBJDIR_NAME_COMPILER)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG)
@@ -83,7 +83,7 @@
  # The default implementation strategy for FreeBSD is pthreads.
 --- a/nss.org/nss/coreconf/Linux.mk2017-08-29 23:44:13.642044814 +0530
 +++ b/nss/nss/coreconf/Linux.mk2017-08-29 23:47:26.318915759 +0530
-@@ -147,7 +147,7 @@
+@@ -158,7 +158,7 @@
  # Also, -z defs conflicts with Address Sanitizer, which emits relocations
  # against the libsanitizer runtime built into the main executable.
  ZDEFS_FLAG= -Wl,-z,defs
@@ -92,7 +92,7 @@
  LDFLAGS  += $(ARCHFLAG) -z noexecstack
  
  # On Maemo, we need to use the -rpath-link flag for even the standard system
-@@ -177,8 +177,13 @@
+@@ -188,8 +188,13 @@
  endif
  endif
  
@@ -108,7 +108,7 @@
  # dependencies in the same directory where it resides.
 --- a/nss.org/nss/coreconf/rules.mk2017-08-29 23:44:13.646044832 +0530
 +++ b/nss/nss/coreconf/rules.mk2017-08-29 23:47:37.442966042 +0530
-@@ -261,7 +261,7 @@
+@@ -176,7 +176,7 @@
  ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
$(AR) $(subst /,\\,$(OBJS))
  else
@@ -119,7 +119,7 @@
  
 --- a/nss.org/nss/coreconf/SunO

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

2022-09-20 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit.hxx  |1 +
 editeng/source/editeng/impedit2.cxx |5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit e37cb88b51e3ab0da687278b3c846140b507e00b
Author: Caolán McNamara 
AuthorDate: Tue Sep 20 12:28:57 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 20 14:50:29 2022 +0200

ofz#51471 Timeout

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

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index d11ee008c135..b761e3bc4135 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -605,6 +605,7 @@ private:
 boolmbLastTryMerge:1;
 boolmbReplaceLeadingSingleQuotationMark:1;
 boolmbSkipOutsideFormat:1;
+boolmbFuzzing:1;
 
 boolmbNbspRunNext;  // can't be a bitfield as it is passed as 
bool&
 
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 3f655c10bc8e..19b6c72e0536 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -124,6 +124,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* 
pItemPool ) :
 mbLastTryMerge(false),
 mbReplaceLeadingSingleQuotationMark(true),
 mbSkipOutsideFormat(false),
+mbFuzzing(utl::ConfigManager::IsFuzzing()),
 mbNbspRunNext(false)
 {
 aStatus.GetControlWord() =  EEControlBits::USECHARATTRIBS | 
EEControlBits::DOIDLEFORMAT |
@@ -1948,7 +1949,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 
nPara )
 WritingDirectionInfos& rInfos = pParaPortion->aWritingDirectionInfos;
 rInfos.clear();
 
-if (pParaPortion->GetNode()->Len())
+if (pParaPortion->GetNode()->Len() && !mbFuzzing)
 {
 const OUString aText = pParaPortion->GetNode()->GetString();
 
@@ -2722,7 +2723,7 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& 
aCurSel, const OUStrin
 aCurWord = SelectWord( aCurPaM, i18n::WordType::DICTIONARY_WORD );
 
 OUString aText(convertLineEnd(rStr, LINEEND_LF));
-if (utl::ConfigManager::IsFuzzing())//tab expansion performance in 
editeng is appalling
+if (mbFuzzing)//tab expansion performance in editeng is appalling
 aText = aText.replaceAll("\t","-");
 SfxVoidItem aTabItem( EE_FEATURE_TAB );
 


[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-22.05.6-3'

2022-09-20 Thread Andras Timar (via logerrit)
Tag 'cp-22.05.6-3' created by Andras Timar  at 
2022-09-20 12:49 +

cp-22.05.6-3

Changes since cp-22.05.6-1-1:
---
 0 files changed
---


[Libreoffice-commits] core.git: chart2/CppunitTest_chart2_export3.mk chart2/Module_chart2.mk chart2/qa solenv/clang-format

2022-09-20 Thread Noel Grandin (via logerrit)
 chart2/CppunitTest_chart2_export3.mk |   14 
 chart2/Module_chart2.mk  |1 
 chart2/qa/extras/chart2export.cxx|  679 ---
 chart2/qa/extras/chart2export3.cxx   |  765 +++
 solenv/clang-format/excludelist  |1 
 5 files changed, 781 insertions(+), 679 deletions(-)

New commits:
commit 4e17fc21bf59d4dbd80de6a569172406c8f86a1c
Author: Noel Grandin 
AuthorDate: Tue Sep 20 13:14:37 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 14:38:25 2022 +0200

split chart2 export unit test

since it was running for quite a while compared to the others

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

diff --git a/chart2/CppunitTest_chart2_export3.mk 
b/chart2/CppunitTest_chart2_export3.mk
new file mode 100644
index ..3b3e2ed0b597
--- /dev/null
+++ b/chart2/CppunitTest_chart2_export3.mk
@@ -0,0 +1,14 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# 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/.
+#
+#*
+
+$(eval $(call chart2_export_test,3))
+
+# vim: set noet sw=4 ts=4:
diff --git a/chart2/Module_chart2.mk b/chart2/Module_chart2.mk
index fc2f0f95151f..1a26ebd2b959 100644
--- a/chart2/Module_chart2.mk
+++ b/chart2/Module_chart2.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Module_add_check_targets,chart2,\
 $(eval $(call gb_Module_add_slowcheck_targets,chart2,\
 CppunitTest_chart2_export \
 CppunitTest_chart2_export2 \
+CppunitTest_chart2_export3 \
 CppunitTest_chart2_import \
 CppunitTest_chart2_import2 \
 CppunitTest_chart2_trendcalculators \
diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index fc6ffc4d4dbf..57e3356e8296 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -79,50 +79,6 @@ public:
 void testDataLabelAreaChartDOCX();
 void testDataLabelDefaultLineChartDOCX();
 void testIndividualDataLabelProps();
-void testTdf108107();
-void testTdf114139();
-void testTdf64224();
-void testChartTitlePropertiesColorFillDOCX();
-void testChartTitlePropertiesGradientFillDOCX();
-void testChartTitlePropertiesBitmapFillDOCX();
-void testColorGradientWithTransparencyDOCX();
-void testColorGradientWithTransparencyODS();
-void testColorGradientStopXLSX();
-void testRadialColorGradientDOCX();
-void testBarChartDataPointPropDOCX();
-void testFdo83058dlblPos();
-void testAutoTitleDelXLSX();
-void testDispBlanksAsXLSX();
-void testMarkerColorXLSX();
-void testRoundedCornersXLSX();
-void testAxisNumberFormatXLSX();
-void testDataPointLabelNumberFormatXLSX();
-void testDataLabelDefaultValuesXLSX();
-void testDataLabelFillColor();
-void testTitleOverlayXLSX();
-void testInvertIfNegativeXLSX();
-void testBubble3DXLSX();
-void testNoMarkerXLSX();
-void testTitleManualLayoutXLSX();
-void testPlotAreaManualLayoutXLSX();
-void testLegendManualLayoutXLSX();
-void testChartSubTitle();
-void testChartMainWithSubTitle();
-void testAutoTitleDeleted();
-void testChartTitlePropertiesColorFillXLSX();
-void testChartTitlePropertiesGradientFillXLSX();
-void testChartTitlePropertiesBitmapFillXLSX();
-void testBarChartDataPointPropXLSX();
-void testDataseriesOverlapStackedChartXLSX();
-void testAxisCharacterPropertiesXLSX();
-void testTitleCharacterPropertiesXLSX();
-void testPlotVisOnlyXLSX();
-void testBarChartVaryColorsXLSX();
-void testTdf96161();
-void testTableOnPage3();
-void testMultipleAxisXLSX();
-void testSecondaryAxisXLSX();
-void testBarChartSecondaryAxisXLSX();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -174,50 +130,6 @@ public:
 CPPUNIT_TEST(testDataLabelAreaChartDOCX);
 CPPUNIT_TEST(testDataLabelDefaultLineChartDOCX);
 CPPUNIT_TEST(testIndividualDataLabelProps);
-CPPUNIT_TEST(testTdf108107);
-CPPUNIT_TEST(testTdf114139);
-CPPUNIT_TEST(testTdf64224);
-CPPUNIT_TEST(testChartTitlePropertiesColorFillDOCX);
-CPPUNIT_TEST(testChartTitlePropertiesGradientFillDOCX);
-CPPUNIT_TEST(testChartTitlePropertiesBitmapFillDOCX);
-CPPUNIT_TEST(testColorGradientWithTransparencyDOCX);
-CPPUNIT_TEST(testColorGradientWithTransparencyODS);
-CPPUNIT_TEST(testColorGradientStopXLSX);
-CPPUNIT_TEST(testRadialColorGradientDOCX);
-CPPUNIT_TEST(testBarChartDataPointPropDOCX);

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

2022-09-20 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/filtercache.cxx |2 -
 filter/source/config/cache/filtercache.hxx |2 -
 include/unotools/configpaths.hxx   |2 -
 unotools/source/config/configpaths.cxx |   41 +++--
 4 files changed, 25 insertions(+), 22 deletions(-)

New commits:
commit 5edefc801fb48559c8064003f23d22d838710ee4
Author: Noel Grandin 
AuthorDate: Tue Sep 20 11:37:12 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 14:31:24 2022 +0200

use more string_view in unotools

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

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index 9da457627261..5a2a59875953 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -840,7 +840,7 @@ css::uno::Reference< css::uno::XInterface > 
FilterCache::impl_openConfig(EConfig
 return *pConfig;
 }
 
-css::uno::Any FilterCache::impl_getDirectCFGValue(const OUString& sDirectKey)
+css::uno::Any FilterCache::impl_getDirectCFGValue(std::u16string_view 
sDirectKey)
 {
 OUString sRoot;
 OUString sKey ;
diff --git a/filter/source/config/cache/filtercache.hxx 
b/filter/source/config/cache/filtercache.hxx
index 2f647c33e708..635ad29a6514 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -664,7 +664,7 @@ class FilterCache : public cppu::BaseMutex
 Can be empty if an internal error occurred or if the 
requested
 key does not exists!
  */
-css::uno::Any impl_getDirectCFGValue(const OUString& sDirectKey);
+css::uno::Any impl_getDirectCFGValue(std::u16string_view sDirectKey);
 
 
 /** @short  load the underlying configuration into this cache.
diff --git a/include/unotools/configpaths.hxx b/include/unotools/configpaths.hxx
index 119733a477dc..3e8ef3c9aadc 100644
--- a/include/unotools/configpaths.hxx
+++ b/include/unotools/configpaths.hxx
@@ -51,7 +51,7 @@ namespace utl
 , if the path was a one-level path or an invalid path
 
 */
-UNOTOOLS_DLLPUBLIC bool splitLastFromConfigurationPath(OUString const& 
_sInPath,
+UNOTOOLS_DLLPUBLIC bool splitLastFromConfigurationPath(std::u16string_view 
_sInPath,
 OUString& _rsOutPath,
 OUString& _rsLocalName);
 
diff --git a/unotools/source/config/configpaths.cxx 
b/unotools/source/config/configpaths.cxx
index 8efdf19b5519..1b3518c39f7a 100644
--- a/unotools/source/config/configpaths.cxx
+++ b/unotools/source/config/configpaths.cxx
@@ -72,72 +72,75 @@ void lcl_resolveCharEntities(OUString & aLocalString)
 aLocalString = aResult.makeStringAndClear();
 }
 
-bool splitLastFromConfigurationPath(OUString const& _sInPath,
+bool splitLastFromConfigurationPath(std::u16string_view _sInPath,
 OUString& _rsOutPath,
 OUString& _rsLocalName)
 {
-sal_Int32 nStart,nEnd;
+size_t nStart,nEnd;
 
-sal_Int32 nPos = _sInPath.getLength()-1;
+size_t nPos = _sInPath.size()-1;
 
 // strip trailing slash
-if (nPos > 0 && _sInPath[ nPos ] == '/')
+if (nPos != std::u16string_view::npos && _sInPath[ nPos ] == '/')
 {
 OSL_FAIL("Invalid config path: trailing '/' is not allowed");
 --nPos;
 }
 
 // check for predicate ['xxx'] or ["yyy"]
-if (nPos  > 0 && _sInPath[ nPos ] == ']')
+if (nPos != std::u16string_view::npos && _sInPath[ nPos ] == ']')
 {
 sal_Unicode chQuote = _sInPath[--nPos];
 
 if (chQuote == '\'' || chQuote == '\"')
 {
 nEnd = nPos;
-nPos = _sInPath.lastIndexOf(chQuote,nEnd);
+nPos = _sInPath.find(chQuote,nEnd);
 nStart = nPos + 1;
 --nPos; // nPos = rInPath.lastIndexOf('[',nPos);
 }
 else // allow [xxx]
 {
 nEnd = nPos + 1;
-nPos = _sInPath.lastIndexOf('[',nEnd);
+nPos = _sInPath.rfind('[',nEnd);
 nStart = nPos + 1;
 }
 
-OSL_ENSURE(nPos >= 0 && _sInPath[nPos] == '[', "Invalid config path: 
unmatched quotes or brackets");
-if (nPos >= 0 && _sInPath[nPos] == '[')
+OSL_ENSURE(nPos != std::u16string_view::npos && _sInPath[nPos] == '[', 
"Invalid config path: unmatched quotes or brackets");
+if (nPos != std::u16string_view::npos && _sInPath[nPos] == '[')
 {
-nPos =  _sInPath.lastIndexOf('/',nPos);
+nPos =  _sInPath.rfind('/',nPos);
 }
 else // defined behavior for invalid paths
 {
 nStart = 0;
-nEnd = _sInPath.getLength();
-nPos = -1;
+nEnd = 

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

2022-09-20 Thread Miklos Vajna (via logerrit)
 external/pdfium/UnpackedTarball_pdfium.mk|1 
 external/pdfium/annot-alternate-name.patch.1 |   40 +++
 include/vcl/filter/PDFiumLibrary.hxx |1 
 sw/qa/core/text/text.cxx |   13 
 sw/source/core/text/itrform2.cxx |   14 +
 vcl/source/pdf/PDFiumLibrary.cxx |   31 
 6 files changed, 100 insertions(+)

New commits:
commit a14899f16a55e9fd46e6c6eeaaf608aef27597a0
Author: Miklos Vajna 
AuthorDate: Tue Sep 20 08:30:53 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 14:25:11 2022 +0200

sw content controls: add a11y description for PDF export

Acrobat Reader shows these descriptions on mouse hovering on a form
widget.

(cherry picked from commit addfb3cce0f7ce8fbd0b169d467b6956ed95dbb5)

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

diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index 272fa5cb606f..4c9f483f8ed7 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -29,6 +29,7 @@ pdfium_patches += include.patch
 pdfium_patches += abseil-trivial.patch
 
 pdfium_patches += annot.patch.1
+pdfium_patches += annot-alternate-name.patch.1
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
diff --git a/external/pdfium/annot-alternate-name.patch.1 
b/external/pdfium/annot-alternate-name.patch.1
new file mode 100644
index ..6ed619c8ec45
--- /dev/null
+++ b/external/pdfium/annot-alternate-name.patch.1
@@ -0,0 +1,40 @@
+diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
+index 05ec46f01..2aa1ce912 100644
+--- a/fpdfsdk/fpdf_annot.cpp
 b/fpdfsdk/fpdf_annot.cpp
+@@ -1289,6 +1289,18 @@ FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle,
+  buflen);
+ }
+ 
++FPDF_EXPORT unsigned long FPDF_CALLCONV
++FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle,
++   FPDF_ANNOTATION annot,
++   FPDF_WCHAR* buffer,
++   unsigned long buflen) {
++  const CPDF_FormField* pFormField = GetFormField(hHandle, annot);
++  if (!pFormField)
++return 0;
++  return Utf16EncodeMaybeCopyAndReturnLength(pFormField->GetAlternateName(), 
buffer,
++ buflen);
++}
++
+ FPDF_EXPORT int FPDF_CALLCONV
+ FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot) {
+   const CPDF_FormField* pFormField = GetFormField(hHandle, annot);
+diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h
+index e4217056b..7ce6f3caf 100644
+--- a/public/fpdf_annot.h
 b/public/fpdf_annot.h
+@@ -735,6 +735,12 @@ FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle,
+FPDF_WCHAR* buffer,
+unsigned long buflen);
+ 
++FPDF_EXPORT unsigned long FPDF_CALLCONV
++FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle,
++   FPDF_ANNOTATION annot,
++   FPDF_WCHAR* buffer,
++   unsigned long buflen);
++
+ // Experimental API.
+ // Gets the form field type of |annot|, which is an interactive form 
annotation.
+ //
diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 390c826cd57b..1dc1382643d0 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -103,6 +103,7 @@ public:
 virtual std::vector getLineGeometry() = 0;
 virtual PDFFormFieldType getFormFieldType(PDFiumDocument* pDoc) = 0;
 virtual float getFormFontSize(PDFiumDocument* pDoc) = 0;
+virtual OUString getFormFieldAlternateName(PDFiumDocument* pDoc) = 0;
 };
 
 class PDFiumTextPage;
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 8813ebf8879a..201dead90bfa 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/";
 
@@ -534,6 +535,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
 SwDoc* pDoc = createSwDoc();
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT);
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+sal_Int32 nPlaceHolderLen = 
SwResId(STR_CONTENT_CONTROL_PLACEHOLDER).getLength();
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, nPlaceHolderLen,
+ /*bBasicCall=*/false);
+pWrtShell->Insert("mydesc");
 
 // When exporting to PDF:
 StoreToTempFile("writer_pdf_Export");
@@ -546,6 +553,

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

2022-09-20 Thread Mike Kaganski (via logerrit)
 desktop/source/app/officeipcthread.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 321a1b5034e36e156755bbd5794c33c73608e5a5
Author: Mike Kaganski 
AuthorDate: Tue Sep 20 11:19:16 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 20 13:59:14 2022 +0200

Only try to convert outdir to system path when it's not empty

Avoids a warning on startup of a debug build:

  > instdir/program/soffice
  warn:legacy.osl:1528:2140:sal/osl/w32/file_url.cxx:849: 
osl_getAbsoluteFileURL
  called with empty base URL and/or invalid relative URL

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

diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index ea330ea3d415..45b8906c3b42 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -1249,7 +1249,6 @@ static void AddConversionsToDispatchList(
 nType = DispatchWatcher::REQUEST_CAT;
 else
 nType = DispatchWatcher::REQUEST_CONVERSION;
-aParam = rParam;
 }
 else
 {
@@ -1262,8 +1261,6 @@ static void AddConversionsToDispatchList(
 }
 }
 
-OUString aOutDir( rParamOut.trim() );
-std::u16string_view aImgOut = o3tl::trim(rImgOut);
 OUString aPWD;
 if (cwdUrl)
 {
@@ -1274,11 +1271,10 @@ static void AddConversionsToDispatchList(
 utl::Bootstrap::getProcessWorkingDir( aPWD );
 }
 
-if( !::osl::FileBase::getAbsoluteFileURL( aPWD, rParamOut, aOutDir ) )
-::osl::FileBase::getSystemPathFromFileURL( aOutDir, aOutDir );
-
-if( !rParamOut.trim().isEmpty() )
+if (OUString aOutDir(rParamOut.trim()); !aOutDir.isEmpty())
 {
+if (osl::FileBase::getAbsoluteFileURL(aPWD, rParamOut, aOutDir) == 
osl::FileBase::E_None)
+osl::FileBase::getSystemPathFromFileURL(aOutDir, aOutDir);
 aParam += ";" + aOutDir;
 }
 else
@@ -1288,7 +1284,7 @@ static void AddConversionsToDispatchList(
 }
 
 if( !rImgOut.empty() )
-aParam += OUString::Concat("|") + aImgOut;
+aParam += OUString::Concat("|") + o3tl::trim(rImgOut);
 
 for (auto const& request : rRequestList)
 {


[Libreoffice-commits] core.git: Changes to 'refs/tags/co-6.4-63'

2022-09-20 Thread Andras Timar (via logerrit)
Tag 'co-6.4-63' created by Andras Timar  at 
2022-09-20 11:54 +

co-6.4-63

Changes since cp-6.4-62-5:
---
 0 files changed
---


[Libreoffice-commits] translations.git: Changes to 'refs/tags/co-6.4-63'

2022-09-20 Thread Tor Lillqvist (via logerrit)
Tag 'co-6.4-63' created by Andras Timar  at 
2022-09-20 11:54 +

co-6.4-63

Changes since cp-6.4-48:
Tor Lillqvist (1):
  Add missing mobile-specific Impress German translations

---
 source/de/sd/messages.po |   37 +
 1 file changed, 37 insertions(+)
---


[Libreoffice-commits] help.git: Changes to 'refs/tags/co-6.4-63'

2022-09-20 Thread Andras Timar (via logerrit)
Tag 'co-6.4-63' created by Andras Timar  at 
2022-09-20 11:54 +

co-6.4-63

Changes since cp-6.4-branch-point-11:
---
 0 files changed
---


[Libreoffice-commits] dictionaries.git: Changes to 'refs/tags/co-6.4-63'

2022-09-20 Thread Andras Timar (via logerrit)
Tag 'co-6.4-63' created by Andras Timar  at 
2022-09-20 11:54 +

co-6.4-63

Changes since co-6.4-20:
Andras Timar (1):
  update Danish dictionary

---
 da_DK/README_da_DK.txt |4 
 da_DK/da_DK.aff| 3401 
 da_DK/da_DK.dic|288016 
+++--
 da_DK/description.xml  |9 
 4 files changed, 139245 insertions(+), 152185 deletions(-)
---


[Libreoffice-commits] core.git: Branch 'refs/tags/co-6.4-43' - 0 commits -

2022-09-20 Thread (via logerrit)
Rebased ref, commits from common ancestor:


[Libreoffice-commits] translations.git: Branch 'refs/tags/co-6.4-43' - 0 commits -

2022-09-20 Thread (via logerrit)
Rebased ref, commits from common ancestor:


[Libreoffice-commits] help.git: Branch 'refs/tags/co-6.4-43' - 0 commits -

2022-09-20 Thread (via logerrit)
Rebased ref, commits from common ancestor:


[Libreoffice-commits] dictionaries.git: Branch 'refs/tags/co-6.4-43' - 0 commits -

2022-09-20 Thread (via logerrit)
Rebased ref, commits from common ancestor:


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

2022-09-20 Thread Caolán McNamara (via logerrit)
 download.lst |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8c285077e963eaa34d94ecd35c3241040c06e293
Author: Caolán McNamara 
AuthorDate: Tue Sep 20 11:16:02 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 20 13:37:56 2022 +0200

upgrade to harfbuzz-5.2.0.tar.xz

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

diff --git a/download.lst b/download.lst
index 77d075e9e51f..1d53437b253d 100644
--- a/download.lst
+++ b/download.lst
@@ -100,8 +100,8 @@ export GPGME_SHA256SUM := 
6c8cc4aedb10d5d4c905894ba1d850544619ee765606ac43df7405
 export GPGME_TARBALL := gpgme-1.16.0.tar.bz2
 export GRAPHITE_SHA256SUM := 
b8e892d8627c41888ff121e921455b9e2d26836978f2359173d19825da62b8fc
 export GRAPHITE_TARBALL := graphite2-minimal-1.3.14.tgz
-export HARFBUZZ_SHA256SUM := 
2edb95db668781aaa8d60959d21be2ff80085f31b12053cdd660d9a50ce84f05
-export HARFBUZZ_TARBALL := harfbuzz-5.1.0.tar.xz
+export HARFBUZZ_SHA256SUM := 
735a94917b47936575acb4d4fa7e7986522f8a89527e4635721474dee2bc942c
+export HARFBUZZ_TARBALL := harfbuzz-5.2.0.tar.xz
 export HSQLDB_SHA256SUM := 
d30b13f4ba2e3b6a2d4f020c0dee0a9fb9fc6fbcc2d561f36b78da4bf3802370
 export HSQLDB_TARBALL := 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip
 export HUNSPELL_SHA256SUM := 
b2d9c5369c2cc7f321cb5983fda2dbf007dce3d9e17519746840a6f0c4bf7444


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

2022-09-20 Thread Armin Le Grand (allotropia) (via logerrit)
 slideshow/source/engine/shapes/drawshape.cxx |   33 ---
 slideshow/source/engine/shapes/drawshape.hxx |2 +
 2 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit 8cefc95845c585d830f642a8d6a575863e75b987
Author: Armin Le Grand (allotropia) 
AuthorDate: Mon Sep 19 11:48:20 2022 +0200
Commit: Armin Le Grand 
CommitDate: Tue Sep 20 13:29:59 2022 +0200

tdf#150402 Correct wrong Bound of Shape in Slideshow

Added and use mbContainsPageField that gets set in
prepareHyperlinkIndices() which has to be run anyways,
so this will cause no change in execution speed.

It lets us detect the potential error case that a
PageField is contained in the Text of the Shape.
That is a hint that maBounds contains the wrong Range
and needs to be corrected.

For more backgrund information please refer to
tdf#150402, Comment 16.

Change-Id: Ifee01fffdb6e2f5915aa705afc7b5842781aae91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140144
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
(cherry picked from commit 1b0ff1c166211b34370f53995ae9fb3f8eed182e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140166

diff --git a/slideshow/source/engine/shapes/drawshape.cxx 
b/slideshow/source/engine/shapes/drawshape.cxx
index 22b65bf28e21..000ffd262065 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -366,7 +366,8 @@ namespace slideshow::internal
 mbIsVisible( true ),
 mbForceUpdate( false ),
 mbAttributeLayerRevoked( false ),
-mbDrawingLayerAnim( false )
+mbDrawingLayerAnim( false ),
+mbContainsPageField( false )
 {
 ENSURE_OR_THROW( mxShape.is(), "DrawShape::DrawShape(): Invalid 
XShape" );
 ENSURE_OR_THROW( mxPage.is(), "DrawShape::DrawShape(): Invalid 
containing page" );
@@ -391,6 +392,26 @@ namespace slideshow::internal
 maSubsetting.reset( mpCurrMtf );
 
 prepareHyperlinkIndices();
+
+if(mbContainsPageField && mpCurrMtf && !maBounds.isEmpty())
+{
+// tdf#150402 Use mbContainsPageField that gets set in 
prepareHyperlinkIndices
+// which has to be run anyways, so this will cause no harm in 
execution speed.
+// It lets us detect the potential error case that a PageField 
is contained in
+// the Text of the Shape. That is a hint that maBounds 
contains the wrong Range
+// and needs to be corrected. The correct size is in the 
PrefSize of the metafile.
+// For more backgrund information please refer to tdf#150402, 
Comment 16.
+const double fWidthDiff(fabs(mpCurrMtf->GetPrefSize().Width() 
- maBounds.getWidth()));
+const double 
fHeightDiff(fabs(mpCurrMtf->GetPrefSize().Height() - maBounds.getHeight()));
+
+if(fWidthDiff > 1.0 || fHeightDiff > 1.0)
+{
+maBounds = basegfx::B2DRange(
+maBounds.getMinX(), maBounds.getMinY(),
+maBounds.getMinX() + mpCurrMtf->GetPrefSize().Width(),
+maBounds.getMinY() + 
mpCurrMtf->GetPrefSize().Height());
+}
+}
 }
 
 DrawShape::DrawShape( const uno::Reference< drawing::XShape >&  
xShape,
@@ -425,7 +446,8 @@ namespace slideshow::internal
 mbIsVisible( true ),
 mbForceUpdate( false ),
 mbAttributeLayerRevoked( false ),
-mbDrawingLayerAnim( false )
+mbDrawingLayerAnim( false ),
+mbContainsPageField( false )
 {
 ENSURE_OR_THROW( rGraphic.IsAnimated(),
   "DrawShape::DrawShape(): Graphic is no 
animation" );
@@ -475,7 +497,8 @@ namespace slideshow::internal
 mbIsVisible( rSrc.mbIsVisible ),
 mbForceUpdate( false ),
 mbAttributeLayerRevoked( false ),
-mbDrawingLayerAnim( false )
+mbDrawingLayerAnim( false ),
+mbContainsPageField( false )
 {
 ENSURE_OR_THROW( mxShape.is(), "DrawShape::DrawShape(): Invalid 
XShape" );
 ENSURE_OR_THROW( mpCurrMtf, "DrawShape::DrawShape(): Invalid 
metafile" );
@@ -867,6 +890,10 @@ namespace slideshow::internal
 {
 maHyperlinkIndices.back().second = nIndex;
 }
+else if 
(pAct->GetComment().equalsIgnoreAsciiCase("FIELD_SEQ_BEGIN;PageField"))
+{
+mbContainsPageField = true;
+}
 ++nIndex;
 }
 else
diff --git a/slideshow/source/engine/shapes/drawshape.hxx 
b/slideshow/source/engine/shapes/drawshape.hxx
index eb9030affde0..8636a7a

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

2022-09-20 Thread Julien Nabet (via logerrit)
 vcl/source/bitmap/BitmapPopArtFilter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d0c6b4f7a326fc1d3177f88cde4431e56cae2e66
Author: Julien Nabet 
AuthorDate: Mon Sep 19 14:22:32 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 13:20:00 2022 +0200

tdf#150992: fix crash popart filter to an SVG image

part of bt:
6  0x7f018c80186f in BitmapPalette::operator[](unsigned short) const 
(this=0x5576a198fe48, nIndex=176) at vcl/source/bitmap/bitmappalette.cxx:139
7  0x7f018c3d1fce in BitmapInfoAccess::GetPaletteColor(unsigned short) 
const (this=0x5576a2bbc520, nColor=176) at include/vcl/BitmapInfoAccess.hxx:121
8  0x7f018c85b63f in BitmapPopArtFilter::execute(BitmapEx const&) const 
(this=0x7fffb7394728, rBitmapEx=...) at 
vcl/source/bitmap/BitmapPopArtFilter.cxx:73
9  0x7f018c83e66b in BitmapFilter::Filter(BitmapEx&, BitmapFilter 
const&) (rBmpEx=..., rFilter=...) at vcl/source/bitmap/bitmapfilter.cxx:22
10 0x7f01905e5bd4 in SvxGraphicFilter::ExecuteGrfFilterSlot(SfxRequest 
const&, GraphicObject&) (rReq=..., rFilterObject=...) at 
svx/source/dialog/grfflt.cxx:202

some gdb info
(gdb) p nIndex
$1 = 176
(gdb) p mpImpl->GetBitmapData().size()
$2 = 34

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

See https://bugs.documentfoundation.org/show_bug.cgi?id=150992#c2 for some 
comments

the main thing that makes me think that the order is reversed is the 
"nLastEntry" treatment.
Indeed with the current sort, mnCount with 0 come first nLastEntry = 
nEntryCount - 1 (unless there's no color at all)

Change-Id: I3b89f2f4d6f115ea9f6752c49bad776a33f0b020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140153
Reviewed-by: Julien Nabet 
(cherry picked from commit 8dbbc1ca6dfe75affe13dda92bdf82b6b38f1a37)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140160
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 2c7052a76e5348981883ca95cf3c0b079ded5068)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140165
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/bitmap/BitmapPopArtFilter.cxx 
b/vcl/source/bitmap/BitmapPopArtFilter.cxx
index a575a4e06f5a..d644fa3716ad 100644
--- a/vcl/source/bitmap/BitmapPopArtFilter.cxx
+++ b/vcl/source/bitmap/BitmapPopArtFilter.cxx
@@ -55,7 +55,7 @@ BitmapEx BitmapPopArtFilter::execute(BitmapEx const& 
rBitmapEx) const
 // sort table
 std::sort(aPopArtTable.begin(), aPopArtTable.end(),
   [](const PopArtEntry& lhs, const PopArtEntry& rhs) {
-  return lhs.mnCount < rhs.mnCount;
+  return lhs.mnCount > rhs.mnCount;
   });
 
 // get last used entry


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

2022-09-20 Thread Noel Grandin (via logerrit)
 vcl/inc/sft.hxx |   62 +++---
 vcl/source/font/font.cxx|   12 +-
 vcl/source/fontsubset/sft.cxx   |  118 
 vcl/unx/generic/fontmanager/fontmanager.cxx |   10 +-
 4 files changed, 93 insertions(+), 109 deletions(-)

New commits:
commit 2e932f8aeb62ec05057c680ae23fc0fb3ed4f978
Author: Noel Grandin 
AuthorDate: Mon Sep 19 21:46:48 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 13:17:47 2022 +0200

use O[U]String in TrueType code

instead of manual memory management

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

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index c1d2c5c8e3fe..a870baf57033 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -147,33 +147,33 @@ namespace vcl
 /** Return value of GetTTGlobalFontInfo() */
 
 typedef struct TTGlobalFontInfo_ {
-char *family; /**< family name 
*/
-sal_Unicode *ufamily; /**< family name UCS2
 */
-char *subfamily;  /**< subfamily name  
*/
-sal_Unicode *usubfamily;  /**< subfamily name UCS2 */
-char *psname; /**< PostScript name 
*/
-sal_uInt16 macStyle;  /**< macstyle bits from 'HEAD' table */
-int   weight; /**< value of WeightClass or 0 if can't be 
determined*/
-int   width;  /**< value of WidthClass or 0 if can't be 
determined */
-int   pitch;  /**< 0: proportional font, otherwise: 
monospaced */
-int   italicAngle;/**< in counter-clockwise degrees * 65536
*/
-int   xMin;   /**< global bounding box: xMin   
*/
-int   yMin;   /**< global bounding box: yMin   
*/
-int   xMax;   /**< global bounding box: xMax   
*/
-int   yMax;   /**< global bounding box: yMax   
*/
-int   ascender;   /**< typographic ascent. 
*/
-int   descender;  /**< typographic descent.
*/
-int   linegap;/**< typographic line gap.\ Negative values 
are treated as
+OStringfamily;/**< family name 
*/
+OUString   ufamily;   /**< family name UCS2
 */
+OStringsubfamily; /**< subfamily name  
*/
+OUString   usubfamily;/**< subfamily name UCS2 */
+OStringpsname;/**< PostScript name 
*/
+sal_uInt16 macStyle = 0;  /**< macstyle bits from 'HEAD' table */
+int   weight = 0; /**< value of WeightClass or 0 if can't 
be determined*/
+int   width = 0;  /**< value of WidthClass or 0 if can't 
be determined */
+int   pitch = 0;  /**< 0: proportional font, otherwise: 
monospaced */
+int   italicAngle = 0;/**< in counter-clockwise degrees * 
65536*/
+int   xMin = 0;   /**< global bounding box: xMin   
*/
+int   yMin = 0;   /**< global bounding box: yMin   
*/
+int   xMax = 0;   /**< global bounding box: xMax   
*/
+int   yMax = 0;   /**< global bounding box: yMax   
*/
+int   ascender = 0;   /**< typographic ascent. 
*/
+int   descender = 0;  /**< typographic descent.
*/
+int   linegap = 0;/**< typographic line gap.\ Negative 
values are treated as
  zero in Win 3.1, System 6 and System 7.   
  */
-int   typoAscender;   /**< OS/2 portable typographic ascender  
*/
-int   typoDescender;  /**< OS/2 portable typographic descender 
*/
-int   typoLineGap;/**< OS/2 portable typographic line gap  
 */
-int   winAscent;  /**< ascender metric for Windows 
*/
-int   winDescent; /**< descender metric for Windows
*/
-bool  symbolEncoded;  /**< true: MS symbol

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

2022-09-20 Thread Noel Grandin (via logerrit)
 chart2/source/controller/dialogs/ObjectNameProvider.cxx  |   18 +-
 chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx |2 
 chart2/source/controller/inc/ChartController.hxx |2 
 chart2/source/controller/inc/ObjectNameProvider.hxx  |   14 +-
 chart2/source/controller/inc/PositionAndSizeHelper.hxx   |2 
 chart2/source/controller/inc/dlg_InsertErrorBars.hxx |2 
 chart2/source/controller/main/ChartController_Insert.cxx |2 
 chart2/source/controller/main/ChartController_Properties.cxx |2 
 chart2/source/controller/main/ChartController_Tools.cxx  |8 -
 chart2/source/controller/main/ChartController_Window.cxx |2 
 chart2/source/controller/main/PositionAndSizeHelper.cxx  |2 
 chart2/source/controller/sidebar/ChartAxisPanel.cxx  |   16 +-
 chart2/source/controller/sidebar/ChartErrorBarPanel.cxx  |   18 +-
 chart2/source/controller/sidebar/ChartSeriesPanel.cxx|   22 +--
 chart2/source/inc/ObjectIdentifier.hxx   |   14 +-
 chart2/source/tools/ObjectIdentifier.cxx |   70 +--
 16 files changed, 98 insertions(+), 98 deletions(-)

New commits:
commit 65062ceaae656dca2cf66653b0ed7d627737e54c
Author: Noel Grandin 
AuthorDate: Tue Sep 20 11:27:25 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 13:11:56 2022 +0200

use more std::u16string_view in chart2

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

diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx 
b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 55dfbcef0287..987e5c7412cc 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -62,7 +62,7 @@ using ::com::sun::star::uno::Any;
 namespace
 {
 
-OUString lcl_getDataSeriesName( const OUString& rObjectCID, const 
rtl::Reference<::chart::ChartModel>& xChartModel )
+OUString lcl_getDataSeriesName( std::u16string_view rObjectCID, const 
rtl::Reference<::chart::ChartModel>& xChartModel )
 {
 OUString aRet;
 
@@ -81,7 +81,7 @@ OUString lcl_getDataSeriesName( const OUString& rObjectCID, 
const rtl::Reference
 return aRet;
 }
 
-OUString lcl_getFullSeriesName( const OUString& rObjectCID, const 
rtl::Reference<::chart::ChartModel>& xChartModel )
+OUString lcl_getFullSeriesName( std::u16string_view rObjectCID, const 
rtl::Reference<::chart::ChartModel>& xChartModel )
 {
 OUString aRet(SchResId(STR_TIP_DATASERIES));
 OUString aWildcard( "%SERIESNAME" );
@@ -323,7 +323,7 @@ OUString ObjectNameProvider::getName( ObjectType 
eObjectType, bool bPlural )
 return aRet;
 }
 
-OUString ObjectNameProvider::getAxisName( const OUString& rObjectCID
+OUString ObjectNameProvider::getAxisName( std::u16string_view rObjectCID
 , const rtl::Reference<::chart::ChartModel>& 
xChartModel  )
 {
 OUString aRet;
@@ -399,7 +399,7 @@ OUString ObjectNameProvider::getTitleNameByType( 
TitleHelper::eTitleType eType )
 return aRet;
 }
 
-OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID
+OUString ObjectNameProvider::getTitleName( std::u16string_view rObjectCID
 , const rtl::Reference<::chart::ChartModel>& 
xChartModel )
 {
 OUString aRet;
@@ -418,7 +418,7 @@ OUString ObjectNameProvider::getTitleName( const OUString& 
rObjectCID
 return aRet;
 }
 
-OUString ObjectNameProvider::getGridName( const OUString& rObjectCID
+OUString ObjectNameProvider::getGridName( std::u16string_view rObjectCID
 , const rtl::Reference<::chart::ChartModel>& 
xChartModel )
 {
 OUString aRet;
@@ -471,7 +471,7 @@ OUString ObjectNameProvider::getGridName( const OUString& 
rObjectCID
 return aRet;
 }
 
-OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const 
rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose )
+OUString ObjectNameProvider::getHelpText( std::u16string_view rObjectCID, 
const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose )
 {
 OUString aRet;
 ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) );
@@ -716,7 +716,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& 
rObjectCID, const rtl:
 return aRet;
 }
 
-OUString ObjectNameProvider::getSelectedObjectText( const OUString & 
rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument )
+OUString ObjectNameProvider::getSelectedObjectText( std::u16string_view 
rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument )
 {
 OUString aRet;
 ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) );
@@ -768,7 +768,7 @@ OUString ObjectNameProvider::getSelectedObjectText( const 
OUString & rObjectCID,
 }
 
 OUString ObjectNameProvider::getNameForCID(
-

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

2022-09-20 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/itiff/itiff.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6defa69b8f3a60643163ecba28b6df1f5825bcd2
Author: Caolán McNamara 
AuthorDate: Tue Sep 20 09:12:41 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 20 12:33:59 2022 +0200

ofz#51592 Timeout

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

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 612ac4038e79..0edd4e72e83e 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -157,7 +157,7 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 
 if (bOk && bFuzzing)
 {
-const uint64_t MAX_SIZE = 2;
+const uint64_t MAX_SIZE = 15000;
 if (TIFFTileSize64(tif) > MAX_SIZE || nPixelsRequired > MAX_SIZE)
 {
 SAL_WARN("filter.tiff", "skipping large tiffs");


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

2022-09-20 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/htmlimport/data/tdf142781.html |3 +
 sw/qa/extras/htmlimport/htmlimport.cxx  |   19 ++
 sw/qa/filter/html/data/relative-keep-aspect-image.xhtml |3 +
 sw/qa/filter/html/html.cxx  |   27 +
 sw/source/filter/html/htmlgrin.cxx  |   48 ++--
 5 files changed, 94 insertions(+), 6 deletions(-)

New commits:
commit b9f323d7b01ecdabf60eaa85eb2506c036249d85
Author: Miklos Vajna 
AuthorDate: Mon Sep 19 16:08:25 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 12:24:12 2022 +0200

sw HTML import: fix height of images when it is missing and width is 
relative

This is similar to commit 456abae730a787693c3ad98f7e57eba5f6163a76 (sw
HTML import: fix height of OLE objs when it is missing and width is
relative, 2022-09-06), but this is for images, while that was for OLE
objects.

The idea is still that in case only axis is specified in the HTML and
that's a relative percentage, then the ratio should be taken from the
bitmap and it should be kept.

(cherry picked from commit 2e6144fc350fd94f8e66be5a9007c7f06c0213e0)

Conflicts:
sw/source/filter/html/htmlgrin.cxx

Change-Id: I36184ff6531bff2775013462cd8cc711e1a249c5

diff --git a/sw/qa/filter/html/data/relative-keep-aspect-image.xhtml 
b/sw/qa/filter/html/data/relative-keep-aspect-image.xhtml
new file mode 100644
index ..96b8d14047bb
--- /dev/null
+++ b/sw/qa/filter/html/data/relative-keep-aspect-image.xhtml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx
index 43a02aca7ebf..56c1f899352b 100644
--- a/sw/qa/filter/html/html.cxx
+++ b/sw/qa/filter/html/html.cxx
@@ -78,6 +78,33 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspect)
 CPPUNIT_ASSERT_EQUAL(static_cast(SwFormatFrameSize::SYNCED),
  static_cast(rSize.GetHeightPercent()));
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspectImage)
+{
+// Given a document with an image, width set to 100%, height is not set:
+OUString aURL
+= m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"relative-keep-aspect-image.xhtml";
+uno::Sequence aLoadArgs = {
+comphelper::makePropertyValue("FilterName", OUString("HTML 
(StarWriter)")),
+comphelper::makePropertyValue("FilterOptions", 
OUString("xhtmlns=reqif-xhtml")),
+};
+
+// When loading that file:
+mxComponent = loadFromDesktop(aURL, OUString(), aLoadArgs);
+
+// Then make sure that the aspect ratio of the image is kept:
+auto pTextDocument = dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDocument->GetDocShell()->GetDoc();
+const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+const SwFrameFormat* pFormat = rFormats[0];
+const SwFormatFrameSize& rSize = pFormat->GetFrameSize();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 255
+// - Actual  : 0
+// i.e. the height had a fixed value, not "keep aspect".
+CPPUNIT_ASSERT_EQUAL(static_cast(SwFormatFrameSize::SYNCED),
+ static_cast(rSize.GetHeightPercent()));
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 0226c056c492..d01ac4859b5b 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -525,10 +525,30 @@ IMAGE_SETEVENT:
 if (!bHeightProvided)
 nHeight = aPixelSize.Height();
 // tdf#142781 - calculate the width/height keeping the aspect ratio
-if (!bPercentWidth && bWidthProvided && !bHeightProvided && 
aPixelSize.Width())
-nHeight = nWidth * aPixelSize.Height() / aPixelSize.Width();
-else if (!bPercentHeight && !bWidthProvided && bHeightProvided && 
aPixelSize.Height())
-nWidth = nHeight * aPixelSize.Width() / aPixelSize.Height();
+if (bWidthProvided && !bHeightProvided && aPixelSize.Width())
+{
+if (bPercentWidth)
+{
+nHeight = SwFormatFrameSize::SYNCED;
+bPercentHeight = true;
+}
+else
+{
+nHeight = nWidth * aPixelSize.Height() / aPixelSize.Width();
+}
+}
+else if (!bWidthProvided && bHeightProvided && aPixelSize.Height())
+{
+if (bPercentHeight)
+{
+nWidth = SwFormatFrameSize::SYNCED;
+bPercentWidth = true;
+}
+else
+{
+nWidth = nHeight * aPixelSize.Width() / aPixelSize.Height();
+}
+}
 }
 
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
@@ -647,7 +667,11 @@ IMAGE_SETEVENT:
 
 // bPercentWidth / bPercentHeight means we have a percent size.  If that's 
not the case and we 

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

2022-09-20 Thread Miklos Vajna (via logerrit)
 sw/qa/filter/html/data/relative-keep-aspect-image.xhtml |3 
 sw/qa/filter/html/html.cxx  |   27 
 sw/source/filter/html/htmlgrin.cxx  |   51 
 3 files changed, 71 insertions(+), 10 deletions(-)

New commits:
commit 7c926242fb2ae81c67032042eaba503f27c13865
Author: Miklos Vajna 
AuthorDate: Mon Sep 19 16:08:25 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 20 12:05:03 2022 +0200

sw HTML import: fix height of images when it is missing and width is 
relative

This is similar to commit 456abae730a787693c3ad98f7e57eba5f6163a76 (sw
HTML import: fix height of OLE objs when it is missing and width is
relative, 2022-09-06), but this is for images, while that was for OLE
objects.

The idea is still that in case only axis is specified in the HTML and
that's a relative percentage, then the ratio should be taken from the
bitmap and it should be kept.

Change-Id: I36184ff6531bff2775013462cd8cc711e1a249c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140178
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 2e6144fc350fd94f8e66be5a9007c7f06c0213e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140163
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/filter/html/data/relative-keep-aspect-image.xhtml 
b/sw/qa/filter/html/data/relative-keep-aspect-image.xhtml
new file mode 100644
index ..96b8d14047bb
--- /dev/null
+++ b/sw/qa/filter/html/data/relative-keep-aspect-image.xhtml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx
index 6739341d2566..973feeec2951 100644
--- a/sw/qa/filter/html/html.cxx
+++ b/sw/qa/filter/html/html.cxx
@@ -78,6 +78,33 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspect)
 CPPUNIT_ASSERT_EQUAL(static_cast(SwFormatFrameSize::SYNCED),
  static_cast(rSize.GetHeightPercent()));
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspectImage)
+{
+// Given a document with an image, width set to 100%, height is not set:
+OUString aURL
+= m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"relative-keep-aspect-image.xhtml";
+uno::Sequence aLoadArgs = {
+comphelper::makePropertyValue("FilterName", OUString("HTML 
(StarWriter)")),
+comphelper::makePropertyValue("FilterOptions", 
OUString("xhtmlns=reqif-xhtml")),
+};
+
+// When loading that file:
+mxComponent = loadFromDesktop(aURL, OUString(), aLoadArgs);
+
+// Then make sure that the aspect ratio of the image is kept:
+auto pTextDocument = dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDocument->GetDocShell()->GetDoc();
+const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+const SwFrameFormat* pFormat = rFormats[0];
+const SwFormatFrameSize& rSize = pFormat->GetFrameSize();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 255
+// - Actual  : 0
+// i.e. the height had a fixed value, not "keep aspect".
+CPPUNIT_ASSERT_EQUAL(static_cast(SwFormatFrameSize::SYNCED),
+ static_cast(rSize.GetHeightPercent()));
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 5a11fa9c6da6..cbf3727cd775 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -527,10 +527,30 @@ IMAGE_SETEVENT:
 if (!bHeightProvided)
 nHeight = aPixelSize.Height();
 // tdf#142781 - calculate the width/height keeping the aspect ratio
-if (!bPercentWidth && bWidthProvided && !bHeightProvided && 
aPixelSize.Width())
-nHeight = nWidth * aPixelSize.Height() / aPixelSize.Width();
-else if (!bPercentHeight && !bWidthProvided && bHeightProvided && 
aPixelSize.Height())
-nWidth = nHeight * aPixelSize.Width() / aPixelSize.Height();
+if (bWidthProvided && !bHeightProvided && aPixelSize.Width())
+{
+if (bPercentWidth)
+{
+nHeight = SwFormatFrameSize::SYNCED;
+bPercentHeight = true;
+}
+else
+{
+nHeight = nWidth * aPixelSize.Height() / aPixelSize.Width();
+}
+}
+else if (!bWidthProvided && bHeightProvided && aPixelSize.Height())
+{
+if (bPercentHeight)
+{
+nWidth = SwFormatFrameSize::SYNCED;
+bPercentWidth = true;
+}
+else
+{
+nWidth = nHeight * aPixelSize.Width() / aPixelSize.Height();
+}
+}
 }
 
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
@@ -648,7 +668,11 @@ IMAGE_SETEVENT:
 
 // bPercentWidth / bPercentHeight means we have a percent size.  If that's 
not the case and 

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

2022-09-20 Thread Khaled Hosny (via logerrit)
 vcl/inc/sft.hxx  |1 +
 vcl/source/font/PhysicalFontFace.cxx |3 ++-
 vcl/source/fontsubset/sft.cxx|8 
 3 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 348452715de6af8be2d40407bbe191752452b883
Author: Khaled Hosny 
AuthorDate: Tue Sep 20 09:49:29 2022 +0200
Commit: خالد حسني 
CommitDate: Tue Sep 20 12:00:11 2022 +0200

vcl: tdf#138325 pass PostScript name down to CreateCFFfontSubset()

If we don’t pass the name from the caller, it will try to read it from
the CFF table but some fonts has CFF table without a PostScript name so
we end up with a dummy value.

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

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 55464aa85973..c1d2c5c8e3fe 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -628,6 +628,7 @@ class TrueTypeFace;
 VCL_DLLPUBLIC bool CreateCFFfontSubset(const unsigned char* pFontBytes,
   int nByteLength,
   std::vector& rOutBuffer,
+  const OUString& rPSName,
   const sal_GlyphId* pGlyphIds,
   const sal_uInt8* pEncoding,
   int nGlyphCount, FontSubsetInfo& rInfo);
diff --git a/vcl/source/font/PhysicalFontFace.cxx 
b/vcl/source/font/PhysicalFontFace.cxx
index d210304f5b47..411f2d59ef5d 100644
--- a/vcl/source/font/PhysicalFontFace.cxx
+++ b/vcl/source/font/PhysicalFontFace.cxx
@@ -293,7 +293,8 @@ bool 
PhysicalFontFace::CreateFontSubset(std::vector& rOutBuffer,
 // Shortcut for CFF-subsetting.
 auto aData = GetRawFontData(T_CFF);
 if (!aData.empty())
-return CreateCFFfontSubset(aData.data(), aData.size(), rOutBuffer, 
pGlyphIds, pEncoding,
+return CreateCFFfontSubset(aData.data(), aData.size(), rOutBuffer,
+   GetName(NAME_ID_POSTSCRIPT_NAME), 
pGlyphIds, pEncoding,
nGlyphCount, rInfo);
 
 // Prepare data for font subsetter.
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index de2461d07e48..892366ea3a62 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1914,8 +1914,8 @@ bool CreateTTFfontSubset(vcl::AbstractTrueTypeFont& rTTF, 
std::vector
 }
 
 bool CreateCFFfontSubset(const unsigned char* pFontBytes, int nByteLength,
- std::vector& rOutBuffer, const 
sal_GlyphId* pGlyphIds,
- const sal_uInt8* pEncoding, int nGlyphCount,
+ std::vector& rOutBuffer, const OUString& 
rPSName,
+ const sal_GlyphId* pGlyphIds, const sal_uInt8* 
pEncoding, int nGlyphCount,
  FontSubsetInfo& rInfo)
 {
 utl::TempFile aTempFile;
@@ -1926,8 +1926,8 @@ bool CreateCFFfontSubset(const unsigned char* pFontBytes, 
int nByteLength,
 return false;
 
 rInfo.LoadFont(FontType::CFF_FONT, pFontBytes, nByteLength);
-bool bRet = rInfo.CreateFontSubset(FontType::TYPE1_PFB, pOutFile, nullptr, 
pGlyphIds, pEncoding,
-   nGlyphCount);
+bool bRet = rInfo.CreateFontSubset(FontType::TYPE1_PFB, pOutFile, 
rPSName.toUtf8().getStr(),
+   pGlyphIds, pEncoding, nGlyphCount);
 fclose(pOutFile);
 
 if (bRet)


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

2022-09-20 Thread Khaled Hosny (via logerrit)
 vcl/inc/font/FeatureCollector.hxx   |8 +--
 vcl/inc/font/PhysicalFontFace.hxx   |   36 +++-
 vcl/source/font/FeatureCollector.cxx|   28 +---
 vcl/source/font/LogicalFontInstance.cxx |   20 +
 vcl/source/font/PhysicalFontFace.cxx|   30 ++
 vcl/source/outdev/font.cxx  |   10 
 6 files changed, 80 insertions(+), 52 deletions(-)

New commits:
commit 06a23b7b4d23a31a4808c68f00e1be42d8218737
Author: Khaled Hosny 
AuthorDate: Tue Sep 20 07:02:18 2022 +0200
Commit: خالد حسني 
CommitDate: Tue Sep 20 11:59:55 2022 +0200

vcl: Add PhysicalFontFace::GetName()

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

diff --git a/vcl/inc/font/FeatureCollector.hxx 
b/vcl/inc/font/FeatureCollector.hxx
index ae784474e06d..0ffb5f9d424c 100644
--- a/vcl/inc/font/FeatureCollector.hxx
+++ b/vcl/inc/font/FeatureCollector.hxx
@@ -15,19 +15,23 @@
 #include 
 #include 
 
+#include 
+
 namespace vcl::font
 {
 class FeatureCollector
 {
 private:
+const PhysicalFontFace* m_pFace;
 hb_face_t* m_pHbFace;
 std::vector& m_rFontFeatures;
 const LanguageTag& m_rLanguageTag;
 
 public:
-FeatureCollector(hb_face_t* pHbFace, std::vector& 
rFontFeatures,
+FeatureCollector(const PhysicalFontFace* pFace, 
std::vector& rFontFeatures,
  const LanguageTag& rLanguageTag)
-: m_pHbFace(pHbFace)
+: m_pFace(pFace)
+, m_pHbFace(pFace->GetHbFace())
 , m_rFontFeatures(rFontFeatures)
 , m_rLanguageTag(rLanguageTag)
 {
diff --git a/vcl/inc/font/PhysicalFontFace.hxx 
b/vcl/inc/font/PhysicalFontFace.hxx
index 303976c59776..5cdf88bd3ac9 100644
--- a/vcl/inc/font/PhysicalFontFace.hxx
+++ b/vcl/inc/font/PhysicalFontFace.hxx
@@ -21,8 +21,9 @@
 
 #include 
 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -93,6 +94,36 @@ struct ColorLayer
 
 typedef std::vector ColorPalette;
 
+// https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids
+typedef enum {
+NAME_ID_COPYRIGHT = 0,
+NAME_ID_FONT_FAMILY = 1,
+NAME_ID_FONT_SUBFAMILY = 2,
+NAME_ID_UNIQUE_ID = 3,
+NAME_ID_FULL_NAME = 4,
+NAME_ID_VERSION_STRING = 5,
+NAME_ID_POSTSCRIPT_NAME = 6,
+NAME_ID_TRADEMARK = 7,
+NAME_ID_MANUFACTURER = 8,
+NAME_ID_DESIGNER = 9,
+NAME_ID_DESCRIPTION = 10,
+NAME_ID_VENDOR_URL = 11,
+NAME_ID_DESIGNER_URL = 12,
+NAME_ID_LICENSE = 13,
+NAME_ID_LICENSE_URL = 14,
+//NAME_ID_RESERVED = 15,
+NAME_ID_TYPOGRAPHIC_FAMILY = 16,
+NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17,
+NAME_ID_MAC_FULL_NAME = 18,
+NAME_ID_SAMPLE_TEXT = 19,
+NAME_ID_CID_FINDFONT_NAME = 20,
+NAME_ID_WWS_FAMILY = 21,
+NAME_ID_WWS_SUBFAMILY = 22,
+NAME_ID_LIGHT_BACKGROUND = 23,
+NAME_ID_DARK_BACKGROUND = 24,
+NAME_ID_VARIATIONS_PS_PREFIX = 25,
+} NameID;
+
 // TODO: no more direct access to members
 // TODO: get rid of height/width for scalable fonts
 // TODO: make cloning cheaper
@@ -140,6 +171,9 @@ public:
 
 uint32_t UnitsPerEm() const { return hb_face_get_upem(GetHbFace()); }
 
+OUString GetName(NameID, const LanguageTag&) const;
+OUString GetName(NameID aNameID) const { return GetName(aNameID, 
LanguageTag(LANGUAGE_NONE)); }
+
 virtual hb_face_t* GetHbFace() const;
 virtual hb_blob_t* GetHbTable(hb_tag_t) const
 {
diff --git a/vcl/source/font/FeatureCollector.cxx 
b/vcl/source/font/FeatureCollector.cxx
index 134462e0ed44..a97988ca46ce 100644
--- a/vcl/source/font/FeatureCollector.cxx
+++ b/vcl/source/font/FeatureCollector.cxx
@@ -84,29 +84,6 @@ bool FeatureCollector::collectGraphite()
 return true;
 }
 
-static OUString getName(hb_face_t* pHbFace, hb_ot_name_id_t aNameID, OString& 
rLanguage)
-{
-auto aHbLang = hb_language_from_string(rLanguage.getStr(), 
rLanguage.getLength());
-auto nName = hb_ot_name_get_utf16(pHbFace, aNameID, aHbLang, nullptr, 
nullptr);
-
-if (!nName)
-{
-// Fallback to English if localized name is missing.
-aHbLang = hb_language_from_string("en", 2);
-nName = hb_ot_name_get_utf16(pHbFace, aNameID, aHbLang, nullptr, 
nullptr);
-}
-
-OUString sName;
-if (nName)
-{
-std::vector aBuf(++nName); // make space for terminating NUL.
-hb_ot_name_get_utf16(pHbFace, aNameID, aHbLang, &nName, aBuf.data());
-sName = OUString(reinterpret_cast(aBuf.data()), nName);
-}
-
-return sName;
-}
-
 void FeatureCollector::collectForTable(hb_tag_t aTableTag)
 {
 unsigned int nFeatureCount
@@ -144,8 +121,7 @@ void FeatureCollector::collectForTable(hb_tag_t aTableTag)
   nullptr, nullptr, 
&nNamedParameters,
   &aFirstParameterID)

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

2022-09-20 Thread Miklos Vajna (via logerrit)
 xmloff/qa/unit/text.cxx |   37 +
 xmloff/source/text/txtparae.cxx |   12 ++--
 2 files changed, 47 insertions(+), 2 deletions(-)

New commits:
commit 80550ade305b9e68c6281a258d162bc2c413713a
Author: Miklos Vajna 
AuthorDate: Tue Sep 20 09:10:25 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 11:54:33 2022 +0200

tdf#150990 ODT export: fix zero layout size of scale/scale images

The bugdoc has a broken image where both axis are set to a relative size
of 255%, which means "keep aspect", and the expectation is that only one
axis uses this to match the size of the other axis.

The problem was that commit b578fa08a25a83abccad2386e12b707586fffb26
(ODT export: fix fallback svg:width/height for text frames with relative
sizes, 2022-03-16) assumed that only one axis uses "scale", so we always
get a non-zero layout size.

Fix the problem by only using the layout size when exactly one axis uses
the "scale" percentage, which is the expected the case.

This way we just keep the aspect ratio of broken documents, then the UI
will in practice ignore the scale request of the width.

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

diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 53f1de102fc3..8ad3ea6f941b 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -385,6 +385,43 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRelativeWidth)
 assertXPath(pXmlDoc, "//draw:frame", "width", "3.1492in");
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testScaleWidthAndHeight)
+{
+// Given a broken document where both IsSyncHeightToWidth and 
IsSyncWidthToHeight are set to
+// true:
+getComponent() = loadFromDesktop("private:factory/swriter");
+uno::Reference xMSF(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xTextFrame(
+xMSF->createInstance("com.sun.star.text.TextFrame"), uno::UNO_QUERY);
+uno::Reference xTextFrameProps(xTextFrame, 
uno::UNO_QUERY);
+xTextFrameProps->setPropertyValue("Width", 
uno::Any(static_cast(2000)));
+xTextFrameProps->setPropertyValue("Height", 
uno::Any(static_cast(1000)));
+xTextFrameProps->setPropertyValue("IsSyncHeightToWidth", uno::Any(true));
+xTextFrameProps->setPropertyValue("IsSyncWidthToHeight", uno::Any(true));
+uno::Reference xText = xTextDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xText->insertTextContent(xCursor, xTextFrame, /*bAbsorb=*/false);
+
+// When exporting to ODT:
+uno::Reference xStorable(getComponent(), uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("writer8")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+
+// Then make sure that we still export a non-zero size:
+std::unique_ptr pStream = parseExportStream(aTempFile, 
"content.xml");
+xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+// Without the accompanying fix in place, this failed with:
+// - Expected: 0.7874in
+// - Actual  : 0in
+// i.e. the exported size was 0, not 2000 mm100 in inches.
+assertXPath(pXmlDoc, "//draw:frame", "width", "0.7874in");
+}
+
 CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testContentControlExport)
 {
 // Given a document with a content control around one or more text 
portions:
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index ec0457feb755..fdb3de666389 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2866,6 +2866,14 @@ XMLShapeExportFlags 
XMLTextParagraphExport::addTextFrameAttributes(
 rPropSet->getPropertyValue("LayoutSize") >>= aLayoutSize;
 }
 
+bool bUseLayoutSize = true;
+if (bSyncWidth && bSyncHeight)
+{
+// This is broken, width depends on height and height depends on 
width. Don't use the
+// invalid layout size we got.
+bUseLayoutSize = false;
+}
+
 // svg:width
 sal_Int16 nWidthType = SizeType::FIX;
 if( xPropSetInfo->hasPropertyByName( gsWidthType ) )
@@ -2891,7 +2899,7 @@ XMLShapeExportFlags 
XMLTextParagraphExport::addTextFrameAttributes(
 }
 else
 {
-if (nRelWidth > 0 || bSyncWidth)
+if ((nRelWidth > 0 || bSyncWidth) && bUseLayoutSize)
 {
 // Relative width: write the layout size for the fallback 
width.
 sValue.setLength(0);
@@ -2947,7 +2955,7 @@ XMLShapeExportFlags 
XMLTextParagraphExport::addTextFrameAttributes(
 }
 else
 {
-if (nRelHeight > 0 || bSyncHei

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

2022-09-20 Thread Justin Luth (via logerrit)
 sw/inc/fmtautofmt.hxx |2 -
 sw/qa/extras/ww8export/data/tdf117994_CRnumformatting.doc |binary
 sw/qa/extras/ww8export/ww8export4.cxx |7 
 sw/source/core/text/txtfld.cxx|5 +--
 sw/source/filter/ww8/ww8par.cxx   |   23 ++
 5 files changed, 34 insertions(+), 3 deletions(-)

New commits:
commit 6e1c8bcec511444d2d51c5c5143be56d1900e5e6
Author: Justin Luth 
AuthorDate: Sat Sep 3 08:37:19 2022 -0400
Commit: Michael Stahl 
CommitDate: Tue Sep 20 10:53:01 2022 +0200

tdf#150613 sw: better DOC import of paragraph marker formatting

Following the lead of LO 6.4
commit 5ba30f588d6e41a13d68b1461345fca7a7ca61ac.

This fixes a LO 7.2 regression from tdf#108518.
This patch depends on tdf#117994 being fixed in order
for ww8export3's testTdf108518_CRnumformatting to round-trip.

The problem here is that Word allows formatting the paragraph end
marker, and applies the same formatting to the generated numbering
string; Writer has no such marker thing.

On m_xCtrlStck, the rPos is pointing to the end of the paragraph.
GetStackAttr looks for char properties that are still m_bOpen
or else where the Point (Mark is the Start, Point is the End)
is greater than aPos. Well, at the end of the paragraph
I don't think there can be any empty (point==mark) hints in .DOC,
so this should only pick up properties that are spilling
over onto the CR - just like we want.

Change-Id: I06cab075f102d40f93d33fedf5ae0ce8e165e9fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139329
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx
index 5773bffd5329..f4ac2fae7035 100644
--- a/sw/inc/fmtautofmt.hxx
+++ b/sw/inc/fmtautofmt.hxx
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-class SAL_DLLPUBLIC_RTTI SwFormatAutoFormat final : public SfxPoolItem
+class SW_DLLPUBLIC SwFormatAutoFormat final : public SfxPoolItem
 {
 std::shared_ptr mpHandle;
 
diff --git a/sw/qa/extras/ww8export/data/tdf117994_CRnumformatting.doc 
b/sw/qa/extras/ww8export/data/tdf117994_CRnumformatting.doc
new file mode 100644
index ..99744382a82b
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/tdf117994_CRnumformatting.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index e6d1d27f53a4..22ed17e6f849 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -64,6 +64,13 @@ DECLARE_WW8EXPORT_TEST(testTdf150197_anlv2ListFormat, 
"tdf150197_anlv2ListFormat
  getProperty(getParagraph(4), 
"ListLabelString"));
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf117994_CRnumformatting, 
"tdf117994_CRnumformatting.doc")
+{
+CPPUNIT_ASSERT_EQUAL(OUString("1."), 
parseDump("//body/txt[1]/Special[@nType='PortionType::Number']", "rText"));
+//Without this fix in place, it would become 200 (and non-bold).
+CPPUNIT_ASSERT_EQUAL(OUString("160"), 
parseDump("//body/txt[1]/Special[@nType='PortionType::Number']", "nHeight"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 22875f247210..22127dd30e21 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -432,9 +432,10 @@ static void 
checkApplyParagraphMarkFormatToNumbering(SwFont* pNumFnt, SwTextForm
 SwFormatAutoFormat const& 
rListAutoFormat(rInf.GetTextFrame()->GetTextNodeForParaProps()->GetAttr(RES_PARATR_LIST_AUTOFMT));
 std::shared_ptr pSet(rListAutoFormat.GetStyleHandle());
 
-// TODO remove this fallback (for WW8/RTF)
+// TODO remove this fallback for RTF
+bool isDOC = pIDSA->get(DocumentSettingId::ADD_FLY_OFFSETS);
 bool isDOCX = pIDSA->get(DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS);
-if (!isDOCX && !pSet)
+if (!isDOC && !isDOCX && !pSet)
 {
 TextFrameIndex const 
nTextLen(rInf.GetTextFrame()->GetText().getLength());
 SwTextNode const* pNode(nullptr);
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 77805814fc46..82dec7f3105d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -103,6 +103,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "sprmids.hxx"
 
@@ -121,6 +122,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -2423,6 +2425,27 @@ void SwWW8ImplReader::AppendTextNode(SwPosition& rPos)
 if (pText != nullptr)
 pRule = sw::util::GetNumRuleFromTextNode(*pText);
 
+// tdf#64222 / tdf#150613 filter out the "paragraph marker" formatting and
+// set it as a separate paragraph property, just like we do for DOCX.
+// This is only being used for nu

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

2022-09-20 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/rtfexport/rtfexport5.cxx |4 
 sw/qa/extras/rtfimport/rtfimport.cxx  |4 
 writerfilter/CppunitTest_writerfilter_rtftok.mk   |1 
 writerfilter/qa/cppunittests/rtftok/data/page.rtf |6 +
 writerfilter/qa/cppunittests/rtftok/rtfdispatchsymbol.cxx |   72 ++
 writerfilter/source/rtftok/rtfdispatchsymbol.cxx  |   13 +-
 6 files changed, 93 insertions(+), 7 deletions(-)

New commits:
commit f51a4ad1380d932440c03acb754c82e01838c138
Author: Miklos Vajna 
AuthorDate: Thu Sep 8 20:14:27 2022 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 20 10:48:15 2022 +0200

tdf#148214 RTF import: avoid fake paragraph for \page when possible

The bugdoc has 2 pages, an explicit page break between them and the
first page has enough content that an additional fake paragraph at the
end would lead to a 3rd, unwanted page.

The fake paragraph was introduced in commit
7b58fc3dafc789aa55fff5ffef6ab83c3aa8b6e0 (fdo#48104 fix RTF import of
\page in inner groups, 2012-04-02), because dmapper ignores more than 1
page breaks in a paragraph.

Fix the problem by only inserting the fake paragraph in case the "page
break before" paragraph property would have no effect (very first
paragraph in the document) or we already sent characters (para props are
lazy-sent on the first character). This keeps existing cases working,
but avoids the unwanted fake paragraph in the bugdoc.

I suspect the root cause is that dmapper doesn't handle multiple page
breaks in a paragraph -- once that's fixed, this parBreak() call can be
completely removed.

Adjusted tests:

- testImportHeaderFooter: this asserted the presence of fake paragraphs,
  which are now gone in the easy case, so this change is an improvement

- testTdf133437: no visual difference before/after, probably the test
  intent was just "make sure this page has several shapes", the exact
  number isn't that interesting

Change-Id: Idd2b8a70b4122eb08d9d305018d384dc0bbb276a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139704
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 3c610336a58f644525d5e4d2566c35eee6f7a618)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139666
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx 
b/sw/qa/extras/rtfexport/rtfexport5.cxx
index 2b7f37fc1a8b..1dbacde70bea 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -1227,7 +1227,7 @@ DECLARE_RTFEXPORT_TEST(testTdf133437, "tdf133437.rtf")
 xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
 sal_Int32 shapesOnPage = xmlXPathNodeSetGetLength(pXmlNodes);
 xmlXPathFreeObject(pXmlObj);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(120), shapesOnPage);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(118), shapesOnPage);
 }
 // Third page
 {
@@ -1236,7 +1236,7 @@ DECLARE_RTFEXPORT_TEST(testTdf133437, "tdf133437.rtf")
 xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
 sal_Int32 shapesOnPage = xmlXPathNodeSetGetLength(pXmlNodes);
 xmlXPathFreeObject(pXmlObj);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(86), shapesOnPage);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(84), shapesOnPage);
 }
 }
 
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 9047d0b87f3a..85de4922b154 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1417,11 +1417,11 @@ CPPUNIT_TEST_FIXTURE(Test, testImportHeaderFooter)
 OUString value = paragraph->getString();
 CPPUNIT_ASSERT_EQUAL(OUString("First Page"), value);
 
-paragraph = getParagraph(4);
+paragraph = getParagraph(3);
 value = paragraph->getString();
 CPPUNIT_ASSERT_EQUAL(OUString("Second Page"), value);
 
-paragraph = getParagraph(7);
+paragraph = getParagraph(5);
 value = paragraph->getString();
 CPPUNIT_ASSERT_EQUAL(OUString("Third Page"), value);
 
diff --git a/writerfilter/CppunitTest_writerfilter_rtftok.mk 
b/writerfilter/CppunitTest_writerfilter_rtftok.mk
index 0fe9083c6560..614f032c32db 100644
--- a/writerfilter/CppunitTest_writerfilter_rtftok.mk
+++ b/writerfilter/CppunitTest_writerfilter_rtftok.mk
@@ -16,6 +16,7 @@ $(eval $(call 
gb_CppunitTest_use_externals,writerfilter_rtftok,\
 ))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,writerfilter_rtftok, \
+writerfilter/qa/cppunittests/rtftok/rtfdispatchsymbol \
 writerfilter/qa/cppunittests/rtftok/rtfdispatchvalue \
 writerfilter/qa/cppunittests/rtftok/rtfdocumentimpl \
 writerfilter/qa/cppunittests/rtftok/rtfsdrimport \
diff --git a/writerfilter/qa/cppunittests/rtftok/data/page.rtf 
b/writerfilter/qa/cppunittests/rtftok/data/page.rtf
new file mode 100644
index ..75e1376388f2
--- /dev/null
+

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

2022-09-20 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   24 
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 30e427d4091277839f6cbe30d7232498c0b48ef9
Author: Jim Raykowski 
AuthorDate: Mon Sep 19 13:21:13 2022 -0800
Commit: Caolán McNamara 
CommitDate: Tue Sep 20 09:59:05 2022 +0200

tdf#150604 related: fix logic used in determining inclusion of

a separator in the Navigator content tree context menu

In commit fbc9c8e3759ab79fce457565cd725c5a5353186e, https://
gerrit.libreoffice.org/c/core/+/139628, made to include the content
type name in the 'Delete' menu item in the content type content entry
context menu, I mistakenly used logical OR'ing where logical AND'ing
should be used to determine if a 'Delete' menu item is present, which
is used in determining wheather menu item separator, 'Separator2', is
included.

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 8da8aae28676..9e3984333715 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1878,18 +1878,18 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 if (bRemoveDeleteFieldEntry)
 xPop->remove("deletefield");
 
-const bool bRemoveDeleteEntry =
-bRemoveDeleteChapterEntry ||
-bRemoveDeleteFrameEntry ||
-bRemoveDeleteImageEntry ||
-bRemoveDeleteOLEObjectEntry ||
-bRemoveDeleteBookmarkEntry ||
-bRemoveDeleteHyperlinkEntry ||
-bRemoveDeleteIndexEntry ||
-bRemoveDeleteCommentEntry ||
-bRemoveDeleteDrawingObjectEntry ||
-bRemoveDeleteFieldEntry ||
-bRemoveDeleteTableEntry;
+bool bRemoveDeleteEntry =
+bRemoveDeleteChapterEntry &&
+bRemoveDeleteTableEntry &&
+bRemoveDeleteFrameEntry &&
+bRemoveDeleteImageEntry &&
+bRemoveDeleteOLEObjectEntry &&
+bRemoveDeleteBookmarkEntry &&
+bRemoveDeleteHyperlinkEntry &&
+bRemoveDeleteIndexEntry &&
+bRemoveDeleteCommentEntry &&
+bRemoveDeleteDrawingObjectEntry &&
+bRemoveDeleteFieldEntry;
 
 if (bRemoveRenameEntry)
 xPop->remove(OString::number(502));


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

2022-09-20 Thread Noel Grandin (via logerrit)
 sw/source/filter/ww8/ww8par.cxx  |   73 +--
 sw/source/uibase/dochdl/swdtflvr.cxx |   12 +
 2 files changed, 40 insertions(+), 45 deletions(-)

New commits:
commit ca09f1a350c23f49b90950680fffa687979a8ae2
Author: Noel Grandin 
AuthorDate: Mon Sep 19 18:50:52 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 09:54:40 2022 +0200

simplify usage of TempFile in sw

TempFile already handles the stream. And not touching the URL
means we stay on the fast path for temp files.

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ecb4d0c899a2..77805814fc46 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5548,12 +5548,11 @@ ErrCode 
SwWW8ImplReader::SetSubStreams(tools::SvRef &rTableStr
 
 namespace
 {
-std::unique_ptr MakeTemp(SvFileStream &rSt)
+SvStream* MakeTemp(std::optional& roTempFile)
 {
-std::unique_ptr pT(new utl::TempFile);
-pT->EnableKillingFile();
-rSt.Open(pT->GetFileName(), StreamMode::READWRITE | 
StreamMode::SHARE_DENYWRITE);
-return pT;
+roTempFile.emplace();
+roTempFile->EnableKillingFile();
+return roTempFile->GetStream(StreamMode::READWRITE | 
StreamMode::SHARE_DENYWRITE);
 }
 
 #define WW_BLOCKSIZE 0x200
@@ -5781,12 +5780,12 @@ ErrCode 
SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss)
 if (!nErrRet)
 nErrRet = SetSubStreams(xTableStream, xDataStream);
 
-std::unique_ptr pTempMain;
-std::unique_ptr pTempTable;
-std::unique_ptr pTempData;
-SvFileStream aDecryptMain;
-SvFileStream aDecryptTable;
-SvFileStream aDecryptData;
+std::optional oTempMain;
+std::optional oTempTable;
+std::optional oTempData;
+SvStream* pDecryptMain = nullptr;
+SvStream* pDecryptTable = nullptr;
+SvStream* pDecryptData = nullptr;
 
 bool bDecrypt = false;
 enum {RC4CryptoAPI, RC4, XOR, Other} eAlgo = Other;
@@ -5836,34 +5835,34 @@ ErrCode 
SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss)
 if (aEncryptionData.hasElements() && 
aCtx.VerifyKey(m_xWwFib->m_nKey, m_xWwFib->m_nHash))
 {
 nErrRet = ERRCODE_NONE;
-pTempMain = MakeTemp(aDecryptMain);
+pDecryptMain = MakeTemp(oTempMain);
 
 m_pStrm->Seek(0);
 size_t nUnencryptedHdr =
 (8 == m_xWwFib->m_nVersion) ? 0x44 : 0x34;
 std::unique_ptr pIn(new 
sal_uInt8[nUnencryptedHdr]);
 nUnencryptedHdr = m_pStrm->ReadBytes(pIn.get(), 
nUnencryptedHdr);
-aDecryptMain.WriteBytes(pIn.get(), nUnencryptedHdr);
+pDecryptMain->WriteBytes(pIn.get(), nUnencryptedHdr);
 pIn.reset();
 
-DecryptXOR(aCtx, *m_pStrm, aDecryptMain);
+DecryptXOR(aCtx, *m_pStrm, *pDecryptMain);
 
 if (!m_pTableStream || m_pTableStream == m_pStrm)
-m_pTableStream = &aDecryptMain;
+m_pTableStream = pDecryptMain;
 else
 {
-pTempTable = MakeTemp(aDecryptTable);
-DecryptXOR(aCtx, *m_pTableStream, aDecryptTable);
-m_pTableStream = &aDecryptTable;
+pDecryptTable = MakeTemp(oTempTable);
+DecryptXOR(aCtx, *m_pTableStream, *pDecryptTable);
+m_pTableStream = pDecryptTable;
 }
 
 if (!m_pDataStream || m_pDataStream == m_pStrm)
-m_pDataStream = &aDecryptMain;
+m_pDataStream = pDecryptMain;
 else
 {
-pTempData = MakeTemp(aDecryptData);
-DecryptXOR(aCtx, *m_pDataStream, aDecryptData);
-m_pDataStream = &aDecryptData;
+pDecryptData = MakeTemp(oTempData);
+DecryptXOR(aCtx, *m_pDataStream, *pDecryptData);
+m_pDataStream = pDecryptData;
 }
 
 pMedium->GetItemSet()->ClearItem( SID_PASSWORD );
@@ -5904,30 +5903,30 @@ ErrCode 
SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss)
 {
 nErrRet = ERRCODE_NONE;
 
-pTempMain = MakeTemp(aDecryptMain);
+pDecryptMain = MakeTemp(oTe

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

2022-09-20 Thread Sarper Akdemir (via logerrit)
 oox/source/export/drawingml.cxx|   17 +++
 sd/qa/unit/data/odp/tdf94122_autocolor.odp |binary
 sd/qa/unit/export-tests-ooxml3.cxx |   42 +
 3 files changed, 59 insertions(+)

New commits:
commit c544caf08b8809272aaced1186997292b74da575
Author: Sarper Akdemir 
AuthorDate: Fri Sep 16 03:46:45 2022 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 09:35:23 2022 +0200

tdf#94122 pptx export: fix automatic text color export

MS Powerpoint doesn't have automatic colors unlike Word or Excel.

Therefore on export the automatic text color should be first resolved
and then exported.

Change-Id: Ied2c3a4235da403350d8518a3414ff6a372b57a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140059
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140216

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3b0bcb1c03b3..0ab497a4fed3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2298,6 +2298,23 @@ void DrawingML::WriteRunProperties( const Reference< 
XPropertySet >& rRun, bool
 WriteSolidFill(color, nTransparency);
 }
 }
+else if (GetDocumentType() == DOCUMENT_PPTX)
+{
+// Resolve COL_AUTO for PPTX since MS Powerpoint doesn't have 
automatic colors.
+bool bIsTextBackgroundDark = mbIsBackgroundDark;
+if (rXShapePropSet.is() && GetProperty(rXShapePropSet, 
"FillStyle")
+&& mAny.get() != FillStyle_NONE
+&& GetProperty(rXShapePropSet, "FillColor"))
+{
+::Color aShapeFillColor(ColorTransparency, 
mAny.get());
+bIsTextBackgroundDark = aShapeFillColor.IsDark();
+}
+
+if (bIsTextBackgroundDark)
+WriteSolidFill(COL_WHITE);
+else
+WriteSolidFill(COL_BLACK);
+}
 }
 }
 
diff --git a/sd/qa/unit/data/odp/tdf94122_autocolor.odp 
b/sd/qa/unit/data/odp/tdf94122_autocolor.odp
new file mode 100644
index ..921533cbead6
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf94122_autocolor.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 65956330f535..c897fecebaf2 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -118,6 +118,7 @@ public:
 void testTdf109169_OctagonBevel();
 void testTdf109169_DiamondBevel();
 void testTdf144092_emptyShapeTextProps();
+void testTdf94122_autoColor();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
 
@@ -202,6 +203,7 @@ public:
 CPPUNIT_TEST(testTdf109169_OctagonBevel);
 CPPUNIT_TEST(testTdf109169_DiamondBevel);
 CPPUNIT_TEST(testTdf144092_emptyShapeTextProps);
+CPPUNIT_TEST(testTdf94122_autoColor);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -2135,6 +2137,46 @@ void 
SdOOXMLExportTest3::testTdf144092_emptyShapeTextProps()
 xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest3::testTdf94122_autoColor()
+{
+// Document contains three pages, with different scenarios for automatic
+// color export to pptx.
+// - First page: Page background light, automatic colored text on a 
FillType_NONE shape
+// - Second page: Page background dark, automatic colored text on a 
FillType_NONE shape
+// - Third page: Page background light, automatic colored text on a dark 
colored fill
+//   and another automatic colored text on a light colored fill
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf94122_autocolor.odp"),
 ODP);
+
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+// Without the accompanying fix in place, these tests would have failed 
with:
+// - Expected: 1
+// - Actual  : 0
+// - In ..., XPath 
'/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:srgbClr' 
number of nodes is incorrect
+// i.e. automatic color wasn't resolved & exported
+
+xmlDocUniquePtr pXmlDocContent1 = parseExport(tempFile, 
"ppt/slides/slide1.xml");
+assertXPath(pXmlDocContent1,
+
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:srgbClr", 
"val",
+"00");
+
+xmlDocUniquePtr pXmlDocContent2 = parseExport(tempFile, 
"ppt/slides/slide2.xml");
+assertXPath(pXmlDocContent2,
+
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:srgbClr", 
"val",
+"ff");
+
+xmlDocUniquePtr pXmlDocContent3 = parseExport(tempFile, 
"ppt/slides/slide3.xml");
+assert

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

2022-09-20 Thread Miklos Vajna (via logerrit)
 sw/inc/txatbase.hxx   |2 
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |   43 ---
 sw/source/filter/ww8/attributeoutputbase.hxx  |8 --
 sw/source/filter/ww8/docxattributeoutput.cxx  |   86 +++---
 sw/source/filter/ww8/docxattributeoutput.hxx  |   11 --
 sw/source/filter/ww8/docxexport.cxx   |2 
 sw/source/filter/ww8/rtfattributeoutput.cxx   |3 
 sw/source/filter/ww8/rtfattributeoutput.hxx   |3 
 sw/source/filter/ww8/wrtw8nds.cxx |   29 +--
 sw/source/filter/ww8/ww8atr.cxx   |4 -
 sw/source/filter/ww8/ww8attributeoutput.hxx   |2 
 writerfilter/source/dmapper/DomainMapper.cxx  |   15 +--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |8 ++
 writerfilter/source/dmapper/SdtHelper.hxx |4 -
 14 files changed, 93 insertions(+), 127 deletions(-)

New commits:
commit faff21eae051e85f46720414dcbba8cc9660
Author: Miklos Vajna 
AuthorDate: Mon Sep 19 10:01:36 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 09:34:41 2022 +0200

sw content controls, plain text: enable DOCX filter with data binding

- writerfilter/ had explicit code to not map plain text SDT to Writer 
content
  controls if it has data bindings specified, lift this limitation and set 
the
  value of content control from data binding, like Word does and Writer did 
it
  for input fields since b5c616d10bff3213840d4893d13b4493de71fa56 
(tdf#104823:
  support for sdt plain text fields, 2021-11-24)

- call DocxExport::AddSdtData() on the export side to do the opposite on 
export

- give up on the idea to export content controls to DOCX by finding the text
  attribute in SwWW8AttrIter::OutAttrWithRange(): this needs buffering in 
both
  directions (need to start the SDT before the start of the run, need to 
end it
  after the end of the run), and solving this using marks and merges at a
  fast-serializer level looks like hacks on top of hacks. To be more 
specific,
  CppunitTest_sw_ooxmlexport7's testSdtAndShapeOverlapping seems to be very 
hard
  to fix with this design

- instead, give not only the start position but also the length of the run 
to
  DocxAttributeOutput::EndRun(), which has random access to the doc model 
and can
  look up if there is a content control start or end that needs writing at 
the
  current position of the XML output, without any buffering, which also
  means less code

- adapt CppunitTest_sw_ooxmlfieldexport's testSdtBeforeField, which didn't 
like
  the empty run at the start of content controls, which seems to be harmless
  otherwise

- fix CppunitTest_sw_ooxmlfieldexport 
CPPUNIT_TEST_NAME=testSdtDateDuplicate by
  disabling the "set content control value from data binding" logic for date
  pickers because that logic in writerfilter/ sets the value as-is and it 
has to
  consider the requested date format before this can be enabled

As a side effect, this gives PDF export for plain text SDTs, even if they 
have
data binding set. CppunitTest_sw_ooxmlfieldexport's testTdf104823 is now
updated to ensure that we import such SDTs as Writer content controls.

(cherry picked from commit de90c192cb8f1f03a4028493d8bfe9a127a76b2a)

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
sw/source/filter/ww8/docxattributeoutput.cxx
sw/source/filter/ww8/wrtw8nds.cxx
writerfilter/source/dmapper/SdtHelper.hxx

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

diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx
index 183e254f8817..00e2f9b51470 100644
--- a/sw/inc/txatbase.hxx
+++ b/sw/inc/txatbase.hxx
@@ -132,7 +132,7 @@ public:
 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 };
 
-class SAL_DLLPUBLIC_RTTI SwTextAttrEnd : public virtual SwTextAttr
+class SW_DLLPUBLIC SwTextAttrEnd : public virtual SwTextAttr
 {
 protected:
 sal_Int32 m_nEnd;
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 98a5b6ab6a15..9cf424f8aa07 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -549,7 +549,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testSdtBeforeField, 
"sdt-before-field.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 // Make sure the field doesn't sneak inside the SDT: the SDT should 
contain only a single run (there were 6 ones).
-assertXPath(pXmlDoc, "//w:sdt/w:sdtContent/w:r", 1);
+assertXPath(pXmlDoc, "//w:p/w:sdt/w:sdtContent/w:r/w:t", 1);
+assertXPath(pXmlDoc, "//w:p/w:r/w:fldChar", 3);
 }
 
 DECLARE_OOXMLEXPORT_

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

2022-09-20 Thread Miklos Vajna (via logerrit)
 sw/qa/core/unocore/unocore.cxx|9 ++
 sw/source/core/unocore/unoobj.cxx |  124 ++
 2 files changed, 133 insertions(+)

New commits:
commit 5eb6a716886d3d1908010d210e457069cd1e37a9
Author: Miklos Vajna 
AuthorDate: Fri Sep 16 09:12:43 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 09:34:15 2022 +0200

sw content controls: fix getString() and setString() on SwXContentControl

The setter was broken, it inserted the new content at the start, but
didn't delete the old content. The getter was also broken, it returned
an empty string, even if the content control had a non-empty content.

This was always a problem since c4268efef25129b162884312b15527f1e5c3bcb0
(sw content controls: add UNO API to insert this, 2022-03-31) introduced
SwXContentControl.

Fix the problem by extending SwXTextCursor, so in case m_eType is
CursorType::ContentControl, then it keeps the cursor's range inside the
boundaries of the content control.

This also allows changing the data binding code added in
b5c616d10bff3213840d4893d13b4493de71fa56 (tdf#104823: support for sdt
plain text fields, 2021-11-24) to use content controls, in a follow-up
commit.

(cherry picked from commit 08bce8eeb2e18c7cea4108dbfc2519ada56e8b61)

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

diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx
index 065692fef7f3..55c04614b209 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -318,6 +318,15 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, 
testContentControlInsert)
 = static_cast(pTextContentControl->GetAttr());
 std::shared_ptr pContentControl = 
rFormatContentControl.GetContentControl();
 CPPUNIT_ASSERT(pContentControl->GetShowingPlaceHolder());
+
+// Also verify that setText() and getText() works:
+uno::Reference xContentControlText(xContentControl, 
uno::UNO_QUERY);
+xContentControlText->setString("new");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: new
+// - Actual  :
+// i.e. getString() always returned an empty string.
+CPPUNIT_ASSERT_EQUAL(OUString("new"), xContentControlText->getString());
 }
 
 CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testContentControlTextPortionEnum)
diff --git a/sw/source/core/unocore/unoobj.cxx 
b/sw/source/core/unocore/unoobj.cxx
index 90072ed52b78..33dfba9e8358 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -748,6 +748,12 @@ namespace {
 
 enum ForceIntoMetaMode { META_CHECK_BOTH, META_INIT_START, META_INIT_END };
 
+enum ForceIntoContentControlMode
+{
+CONTENT_CONTROL_CHECK_BOTH,
+CONTENT_CONTROL_INIT_START,
+CONTENT_CONTROL_INIT_END
+};
 }
 
 static bool
@@ -794,6 +800,61 @@ lcl_ForceIntoMeta(SwPaM & rCursor,
 return bRet;
 }
 
+namespace
+{
+bool lcl_ForceIntoContentControl(SwPaM& rCursor, const 
uno::Reference& xParentText,
+ ForceIntoContentControlMode eMode)
+{
+bool bRet = true; // means not forced in CONTENT_CONTROL_CHECK_BOTH
+auto pXContentControl = 
dynamic_cast(xParentText.get());
+if (!pXContentControl)
+{
+SAL_WARN("sw.core", "lcl_ForceIntoContentControl: no parent text");
+throw uno::RuntimeException();
+}
+
+SwTextNode* pTextNode;
+sal_Int32 nStart;
+sal_Int32 nEnd;
+bool bSuccess = pXContentControl->SetContentRange(pTextNode, nStart, nEnd);
+if (!bSuccess)
+{
+SAL_WARN("sw.core", "lcl_ForceIntoContentControl: SetContentRange() 
failed");
+throw uno::RuntimeException();
+}
+
+// Force the cursor back into the content control if it has moved outside.
+SwPosition aStart(*pTextNode, nStart);
+SwPosition aEnd(*pTextNode, nEnd);
+switch (eMode)
+{
+case CONTENT_CONTROL_INIT_START:
+*rCursor.GetPoint() = aStart;
+break;
+
+case CONTENT_CONTROL_INIT_END:
+*rCursor.GetPoint() = aEnd;
+break;
+
+case CONTENT_CONTROL_CHECK_BOTH:
+if (*rCursor.Start() < aStart)
+{
+*rCursor.Start() = aStart;
+bRet = false;
+}
+
+if (*rCursor.End() > aEnd)
+{
+*rCursor.End() = aEnd;
+bRet = false;
+}
+break;
+}
+
+return bRet;
+}
+}
+
 bool SwXTextCursor::IsAtEndOfMeta() const
 {
 if (CursorType::Meta == m_eType)
@@ -958,6 +1019,11 @@ SwXTextCursor::goLeft(sal_Int16 nCount, sal_Bool Expand)
 META_CHECK_BOTH)
 && bRet;
 }
+else if (m_eType == CursorType::ContentControl)
+{
+bRet = lcl_ForceIntoContentCo

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

2022-09-20 Thread Miklos Vajna (via logerrit)
 external/pdfium/UnpackedTarball_pdfium.mk|1 
 external/pdfium/annot-alternate-name.patch.1 |   40 +++
 include/vcl/filter/PDFiumLibrary.hxx |1 
 sw/qa/core/text/text.cxx |   13 
 sw/source/core/text/itrform2.cxx |   14 +
 vcl/source/pdf/PDFiumLibrary.cxx |   31 
 6 files changed, 100 insertions(+)

New commits:
commit addfb3cce0f7ce8fbd0b169d467b6956ed95dbb5
Author: Miklos Vajna 
AuthorDate: Tue Sep 20 08:30:53 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 09:22:28 2022 +0200

sw content controls: add a11y description for PDF export

Acrobat Reader shows these descriptions on mouse hovering on a form
widget.

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

diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index 272fa5cb606f..4c9f483f8ed7 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -29,6 +29,7 @@ pdfium_patches += include.patch
 pdfium_patches += abseil-trivial.patch
 
 pdfium_patches += annot.patch.1
+pdfium_patches += annot-alternate-name.patch.1
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
diff --git a/external/pdfium/annot-alternate-name.patch.1 
b/external/pdfium/annot-alternate-name.patch.1
new file mode 100644
index ..6ed619c8ec45
--- /dev/null
+++ b/external/pdfium/annot-alternate-name.patch.1
@@ -0,0 +1,40 @@
+diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
+index 05ec46f01..2aa1ce912 100644
+--- a/fpdfsdk/fpdf_annot.cpp
 b/fpdfsdk/fpdf_annot.cpp
+@@ -1289,6 +1289,18 @@ FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle,
+  buflen);
+ }
+ 
++FPDF_EXPORT unsigned long FPDF_CALLCONV
++FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle,
++   FPDF_ANNOTATION annot,
++   FPDF_WCHAR* buffer,
++   unsigned long buflen) {
++  const CPDF_FormField* pFormField = GetFormField(hHandle, annot);
++  if (!pFormField)
++return 0;
++  return Utf16EncodeMaybeCopyAndReturnLength(pFormField->GetAlternateName(), 
buffer,
++ buflen);
++}
++
+ FPDF_EXPORT int FPDF_CALLCONV
+ FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot) {
+   const CPDF_FormField* pFormField = GetFormField(hHandle, annot);
+diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h
+index e4217056b..7ce6f3caf 100644
+--- a/public/fpdf_annot.h
 b/public/fpdf_annot.h
+@@ -735,6 +735,12 @@ FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle,
+FPDF_WCHAR* buffer,
+unsigned long buflen);
+ 
++FPDF_EXPORT unsigned long FPDF_CALLCONV
++FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle,
++   FPDF_ANNOTATION annot,
++   FPDF_WCHAR* buffer,
++   unsigned long buflen);
++
+ // Experimental API.
+ // Gets the form field type of |annot|, which is an interactive form 
annotation.
+ //
diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 390c826cd57b..1dc1382643d0 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -103,6 +103,7 @@ public:
 virtual std::vector getLineGeometry() = 0;
 virtual PDFFormFieldType getFormFieldType(PDFiumDocument* pDoc) = 0;
 virtual float getFormFontSize(PDFiumDocument* pDoc) = 0;
+virtual OUString getFormFieldAlternateName(PDFiumDocument* pDoc) = 0;
 };
 
 class PDFiumTextPage;
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 12dc50884f23..245f8c230ca6 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/";
 
@@ -623,6 +624,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
 SwDoc* pDoc = createSwDoc();
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT);
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+sal_Int32 nPlaceHolderLen = 
SwResId(STR_CONTENT_CONTROL_PLACEHOLDER).getLength();
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 
nPlaceHolderLen,
+ /*bBasicCall=*/false);
+pWrtShell->Insert("mydesc");
 
 // When exporting to PDF:
 StoreToTempFile("writer_pdf_Export");
@@ -635,6 +642,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
 // - Ac

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

2022-09-20 Thread Noel Grandin (via logerrit)
 sc/source/filter/excel/xeescher.cxx |   22 +++---
 sc/source/filter/inc/xeescher.hxx   |8 +---
 2 files changed, 16 insertions(+), 14 deletions(-)

New commits:
commit 6754b647c145cded1f54b49d53d37ad35ace211c
Author: Noel Grandin 
AuthorDate: Mon Sep 19 18:51:23 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 20 09:17:00 2022 +0200

simplify usage of TempFile in sc

TempFile already handles the stream. And not touching the URL
means we stay on the fast path for temp files.

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

diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 6f931acd75e3..241d448e2992 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1934,14 +1934,14 @@ XclExpObjectManager::XclExpObjectManager( const 
XclExpRoot& rRoot ) :
 XclExpRoot( rRoot )
 {
 InitStream( true );
-mxEscherEx = std::make_shared( GetRoot(), *this, *mxDffStrm );
+mxEscherEx = std::make_shared( GetRoot(), *this, *mpDffStrm );
 }
 
 XclExpObjectManager::XclExpObjectManager( const XclExpObjectManager& rParent ) 
:
 XclExpRoot( rParent.GetRoot() )
 {
 InitStream( false );
-mxEscherEx = std::make_shared( GetRoot(), *this, *mxDffStrm, 
rParent.mxEscherEx.get() );
+mxEscherEx = std::make_shared( GetRoot(), *this, *mpDffStrm, 
rParent.mxEscherEx.get() );
 }
 
 XclExpObjectManager::~XclExpObjectManager()
@@ -2016,18 +2016,18 @@ void XclExpObjectManager::InitStream( bool bTempFile )
 {
 if( bTempFile )
 {
-mxTempFile = std::make_shared<::utl::TempFile>();
-if( mxTempFile->IsValid() )
-{
-mxTempFile->EnableKillingFile();
-mxDffStrm = ::utl::UcbStreamHelper::CreateStream( 
mxTempFile->GetURL(), StreamMode::STD_READWRITE );
-}
+moTempFile.emplace();
+moTempFile->EnableKillingFile();
+mpDffStrm = moTempFile->GetStream( StreamMode::STD_READWRITE );
 }
 
-if( !mxDffStrm )
-mxDffStrm = std::make_unique();
+if( !mpDffStrm )
+{
+mpBackupStrm = std::make_unique();
+mpDffStrm = mpBackupStrm.get();
+}
 
-mxDffStrm->SetEndian( SvStreamEndian::LITTLE );
+mpDffStrm->SetEndian( SvStreamEndian::LITTLE );
 }
 
 XclExpEmbeddedObjectManager::XclExpEmbeddedObjectManager(
diff --git a/sc/source/filter/inc/xeescher.hxx 
b/sc/source/filter/inc/xeescher.hxx
index c8b7ed8c5857..55e970ed4e86 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -26,11 +26,12 @@
 #include "xlformula.hxx"
 #include 
 #include 
+#include 
 #include 
+#include 
 
 class ScPostIt;
 
-namespace utl { class TempFile; }
 namespace com::sun::star::chart { class XChartDocument; }
 namespace com::sun::star::script { struct ScriptEventDescriptor; }
 
@@ -437,8 +438,9 @@ private:
 voidInitStream( bool bTempFile );
 
 private:
-std::shared_ptr< ::utl::TempFile > mxTempFile;
-std::unique_ptr< SvStream >  mxDffStrm;
+std::optional< ::utl::TempFile > moTempFile;
+SvStream* mpDffStrm = nullptr;
+std::unique_ptr mpBackupStrm;
 std::shared_ptr< XclEscherEx > mxEscherEx;
 rtl::Reference< XclExpObjList > mxObjList;
 };