[Libreoffice-commits] core.git: include/docmodel oox/qa schema/libreoffice xmloff/qa xmloff/source

2023-05-26 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx |2 +
 oox/qa/unit/data/ReferenceShapeFill.fodp|   14 
 oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt  |4 +-
 oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt   |8 ++--
 oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt|8 ++--
 oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt  |6 +--
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |3 +
 xmloff/qa/unit/data/theme.fodp  |   20 ++--
 xmloff/qa/unit/draw.cxx |6 +++
 xmloff/source/text/XMLComplexColorContext.cxx   |8 
 xmloff/source/text/XMLComplexColorExport.cxx|1 
 11 files changed, 50 insertions(+), 30 deletions(-)

New commits:
commit 38e0e78998153463caf9c3c72ef7f4549ddff0e8
Author: Tomaž Vajngerl 
AuthorDate: Thu May 25 13:55:21 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat May 27 06:00:31 2023 +0200

xmloff: add color-type attribute to complex color

We need to identify what the color type of the complex color is.
For now we mostly use "theme", but in the future we can also have
other types like "rgb",... when the infrastructure for that is
built.

Change-Id: I38c91d294a191ca3124be4e99050977c9815d23e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152253
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
index d43318cdbe65..958f82f19b4e 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -95,6 +95,8 @@ public:
 public:
 ColorType getType() const { return meType; }
 
+void setType(ColorType eType) { meType = eType; }
+
 ThemeColorType getSchemeType() const { return meSchemeType; }
 
 Color getRGBColor() const { return Color(mnComponent1, mnComponent2, 
mnComponent3); }
diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp 
b/oox/qa/unit/data/ReferenceShapeFill.fodp
index d3db08712ac9..432891b0d849 100644
--- a/oox/qa/unit/data/ReferenceShapeFill.fodp
+++ b/oox/qa/unit/data/ReferenceShapeFill.fodp
@@ -350,28 +350,28 @@



-
+

   
   



-
+

   
   



-
+

   
   



-
+

   
   
@@ -489,7 +489,7 @@



-
+

   
   
@@ -531,7 +531,7 @@
   
   

-
+
  
 

@@ -585,7 +585,7 @@
   
   

-
+

   
   
diff --git a/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
index 8d2f8726d53b..f7af1acc9bbd 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
@@ -358,7 +358,7 @@
   
   

-
+
  
  
 
@@ -367,7 +367,7 @@
   
   

-
+
  
 

diff --git a/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
index fb792bd34e00..70f1448397f3 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
@@ -340,7 +340,7 @@
 


-
+

   
   
@@ -349,17 +349,17 @@
 


-
+

   
   

-
+

   
   

-
+
  
 

diff --git a/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt
index 85f1f6f9de89..018363fdab35 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt
@@ -344,7 +344,7 @@
 


-
+

   
   
@@ -353,17 +353,17 @@
 


-
+

   
   

-
+

   
   

-
+
  
  
 
diff --git a/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt
index ea343737ff6a..6ab0b87822fc 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt
@@ -344,7 +344,7 @@
 


-
+

   
   
@@ -353,12 +353,12 @@
 


-
+

   
   

-
+

   
   
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index d56acc1668ca..f01e1c8533e7 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -3493,6 +3493,9 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
+
+  
   
 
   
diff --git a/xmloff/qa/unit/data/theme.fodp b/xmloff/qa/unit/data/theme.fodp
index b1e7

[Libreoffice-commits] core.git: officecfg/registry sc/inc sc/source sc/uiconfig uitest/libreoffice

2023-05-26 Thread Laurent Balland (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |   14 +
 sc/inc/stringutil.hxx|   11 ++-
 sc/source/core/data/column3.cxx  |2 
 sc/source/core/tool/stringutil.cxx   |7 +-
 sc/source/ui/dbgui/asciiopt.cxx  |   14 -
 sc/source/ui/dbgui/scuiasciiopt.cxx  |   42 ---
 sc/source/ui/docshell/impex.cxx  |8 +-
 sc/source/ui/inc/asciiopt.hxx|3 +
 sc/source/ui/inc/scuiasciiopt.hxx|1 
 sc/uiconfig/scalc/ui/textimportcsv.ui|   21 +++
 uitest/libreoffice/calc/csv_dialog.py|   15 +
 11 files changed, 120 insertions(+), 18 deletions(-)

New commits:
commit 2b3b4026a5c6a1b92c0b29b94dd62a4c3c7b9fad
Author: Laurent Balland 
AuthorDate: Sat May 20 16:47:16 2023 +0200
Commit: Eike Rathke 
CommitDate: Fri May 26 23:57:16 2023 +0200

tdf#154131 Add Detect scientific number option

Add a sub case of Detect special numbers for import CSV (SC_IMPORTFILE),
paste unformated text (SC_PASTETEXT) and text to columns
(SC_TEXTTOCOLUMNS). Following cases are treated:
- If "Detect special numbers" is true, then "Detect scientific numbers"
  must be true and all special formats are treated (date, time,
scientific notation) in addition to basic decimal numbers.
- If "Detect special numbers" is false and "Detect scientific numbers" is
  true only scientific notation is treated in addition to basic decimal
numbers.
- If "Detect special numbers" and "Detect scientific numbers" are both
  false only basic decimal numbers are recognized as numbers. It is the
new case treated by this change
The new option bDetectScientificNumber is append to ASCII options

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

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 7a18fb3381d2..d282ca681fa0 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1032,6 +1032,13 @@
   
   false
 
+
+  
+If true, Calc tries to detect numbers in scientific 
notation.
+DetectScientificNumbers
+  
+  true
+
 
   
 Language to use for CSV import.  This determines how the 
numbers are parsed.
@@ -1121,6 +1128,13 @@
   
   true
 
+
+  
+If true, Calc tries to detect numbers in scientific 
notation.
+DetectScientificNumbers
+  
+  true
+
 
   
 If true, Calc preserves previous content of cells when 
pasting empty ones. If false, Calc delete content of previous cells.
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index b2b58f60fc5a..3d930dd359df 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -70,11 +70,14 @@ struct SAL_WARN_UNUSED SC_DLLPUBLIC ScSetStringParam
 SvNumberFormatter* mpNumFormatter;
 
 /**
- * When true, we try to detect special number format (dates etc) from the
- * input string, when false, we only try to detect a basic decimal number
- * format.
+ * Specify which number formats are detected:
+ * mbDetectNumberFormat=true && mbDetectScientificNumberFormat=true : 
detect all special number formats : basic decimal number, date, scientific 
notation, etc
+ * mbDetectNumberFormat=false && mbDetectScientificNumberFormat=true : 
detect scientific notation and basic decimal number, but not other special 
number formats (date etc)
+ * mbDetectNumberFormat=false && mbDetectScientificNumberFormat=false : 
detect only basic decimal number, but not scientific notation or other special 
number formats (date etc)
+ * Note: mbDetectNumberFormat=true && mbDetectScientificNumberFormat=false 
not allowed
  */
 bool mbDetectNumberFormat;
+bool mbDetectScientificNumberFormat;
 
 /**
  * Determine when to set the 'Text' number format to the cell where the
@@ -145,7 +148,7 @@ public:
  * @return true if the string is a valid number, false otherwise.
  */
 static bool parseSimpleNumber(
-const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, sal_Unicode 
dsepa, double& rVal);
+const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, sal_Unicode 
dsepa, double& rVal, bool bDetectScientificNumber = true);
 
 static bool parseSimpleNumber(
 const char* p, size_t n, char dsep, char gsep, double& rVal);
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index

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

2023-05-26 Thread Andrea Gelmini (via logerrit)
 include/basegfx/utils/gradienttools.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 75cca3bdea8e929bdca590710dc3f44481a72ace
Author: Andrea Gelmini 
AuthorDate: Fri May 26 14:28:42 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri May 26 22:43:17 2023 +0200

Fix typo

Change-Id: I7d6dd38b15df7e18775bc94a64aec215d2106c46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152307
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/basegfx/utils/gradienttools.hxx 
b/include/basegfx/utils/gradienttools.hxx
index 6fc51adc0e37..f2c0de9aa8b4 100644
--- a/include/basegfx/utils/gradienttools.hxx
+++ b/include/basegfx/utils/gradienttools.hxx
@@ -191,7 +191,7 @@ namespace basegfx
on given SingleColor.
This is used for export preparations in case these exports
do neither support Start/EndIntensity nor Border settings,
-   both will be elliminated if possible (see below).
+   both will be eliminated if possible (see below).
The BGradient rGradient and BColorStops& rColorStops
are both return parameters and may be changed.
This will do quite some preparations for the gradient


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

2023-05-26 Thread Andrea Gelmini (via logerrit)
 sw/source/core/undo/unins.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0165b92f8c0980a3c5c4e2d6c77818ee02b73d47
Author: Andrea Gelmini 
AuthorDate: Fri May 26 14:28:31 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri May 26 22:43:01 2023 +0200

Fix typo

Change-Id: I3e63b18e94b26c671d140009db97d82efc346028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152306
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index a9e75f7f8140..38ac9d49c65b 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -124,7 +124,7 @@ SwUndoInsert::SwUndoInsert( const SwNode& rNd )
 }
 
 // Check if the next Insert can be combined with the current one. If so
-// change the length and InsPos. As a result, SwDoc::Inser will not add a
+// change the length and InsPos. As a result, SwDoc::Insert will not add a
 // new object into the Undo list.
 
 bool SwUndoInsert::CanGrouping( sal_Unicode cIns )


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

2023-05-26 Thread Justin Luth (via logerrit)
 sw/qa/extras/ww8export/ww8export.cxx |2 +-
 sw/source/filter/ww8/ww8par2.cxx |7 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit d42f519be7bcc8e194899a6b3225bcee7e54bc16
Author: Justin Luth 
AuthorDate: Fri May 26 09:48:42 2023 -0400
Commit: Justin Luth 
CommitDate: Fri May 26 21:52:39 2023 +0200

tdf#60683 tdf#55946 doc import: use style's anchor info

make CppunitTest_sw_ww8export CPPUNIT_TEST_NAME=testBnc787942

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

diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index fd4da5249319..9658c7e2dd51 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -575,11 +575,11 @@ DECLARE_WW8EXPORT_TEST(testFdo81102, "fdo81102.doc")
 DECLARE_WW8EXPORT_TEST(testBnc787942, "bnc787942.doc")
 {
 // The frame ended up on the second page instead of first.
-
 // this is on page 1 in Word
 parseDump("/root/page[1]/body/txt[4]/anchored");
 
 CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, 
getProperty(getShape(1), "Surround"));
+CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, 
getProperty(getShape(1), "HoriOrientRelation"));
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf133504_wrapNotBeside, 
"tdf133504_wrapNotBeside.doc")
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index ee70150ccfc8..71fd71997eac 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -418,11 +418,12 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, 
bool bTableRowEnd,
 to see if we are still in that frame.
 */
 
-aRet.m_bHasSprm37 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm 
!= nullptr;
-SprmResult aSrpm29 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B);
+aRet.m_bHasSprm37 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm 
!= nullptr; // sprmPWr
+SprmResult aSrpm29 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B); // 
sprmPPc
 const sal_uInt8 *pSrpm29 = aSrpm29.pSprm;
 aRet.m_bHasSprm29 = pSrpm29 != nullptr;
-aRet.m_nSprm29 = (pSrpm29 && aSrpm29.nRemainingData >= 1) ? *pSrpm29 : 0;
+const sal_Int16 nTPc = aRet.mpStyleApo ? aRet.mpStyleApo->nTPc : 0;
+aRet.m_nSprm29 = (pSrpm29 && aSrpm29.nRemainingData >= 1) ? *pSrpm29 : 
nTPc;
 
 // Is there some frame data here
 bool bNowApo = aRet.HasFrame() || pTopLevelTable;


[Libreoffice-commits] core.git: dbaccess/source include/sfx2 include/svl include/svx sc/inc sc/source sd/inc sd/source svx/source sw/source

2023-05-26 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx |4 +--
 dbaccess/source/ui/dlg/DbAdminImpl.cxx|6 ++---
 dbaccess/source/ui/dlg/adminpages.cxx |2 -
 dbaccess/source/ui/dlg/adminpages.hxx |3 +-
 dbaccess/source/ui/dlg/dbadmin.cxx|2 -
 dbaccess/source/ui/dlg/detailpages.hxx|2 -
 dbaccess/source/ui/inc/dsitems.hxx|   21 ++-
 include/sfx2/sfxsids.hrc  |4 +--
 include/svl/typedwhich.hxx|4 +--
 include/svx/svxids.hrc|   24 +++---
 sc/inc/sc.hrc |4 +--
 sc/source/ui/docshell/docsh4.cxx  |2 -
 sc/source/ui/view/cellsh.cxx  |6 ++---
 sc/source/ui/view/cellsh2.cxx |6 ++---
 sc/source/ui/view/tabvwsha.cxx|2 -
 sc/source/ui/view/tabvwshh.cxx|2 -
 sd/inc/sdattr.hrc |7 +++---
 sd/source/ui/dlg/dlgsnap.cxx  |4 +--
 sd/source/ui/dlg/present.cxx  |2 -
 sd/source/ui/func/fusldlg.cxx |2 -
 sd/source/ui/func/fusnapln.cxx|4 +--
 svx/source/form/fmshell.cxx   |4 +--
 svx/source/form/tbxform.cxx   |2 -
 svx/source/svdraw/svdedtv1.cxx|4 +--
 sw/source/ui/fldui/fldpage.cxx|2 -
 25 files changed, 64 insertions(+), 61 deletions(-)

New commits:
commit a4d4445e698b78ec0c2eb61a685869bd1d8bfd85
Author: Noel Grandin 
AuthorDate: Fri May 26 12:20:08 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri May 26 21:15:43 2023 +0200

use more TypedWhichId

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

diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx 
b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
index cd5d74156d4b..9f47fff7d9c9 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
@@ -143,7 +143,7 @@ namespace dbaui
 DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
 
 OUString  m_sDefaultJdbcDriverName;
-sal_uInt16  m_nPortId;
+TypedWhichId m_nPortId;
 
 std::unique_ptr m_xHeaderText;
 std::unique_ptr m_xFTHelpText;
@@ -238,7 +238,7 @@ namespace dbaui
 virtual void fillWindows(std::vector< 
std::unique_ptr >& _rControlList) override;
 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason 
) override;
 
-sal_uInt16  m_nPortId;
+TypedWhichId m_nPortId;
 
 std::unique_ptr m_xHeaderText;
 std::unique_ptr m_xFTHelpText;
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx 
b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 176eb0a9be49..0ce7a06afdb4 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -946,7 +946,7 @@ void 
ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
 {
 sal_Int32 nValue = 0;
 _rValue >>= nValue;
-_rSet.Put( SfxInt32Item( _nId, nValue ) );
+_rSet.Put( SfxInt32Item( TypedWhichId(_nId), 
nValue ) );
 }
 else {
 SAL_WARN( "dbaccess", 
"ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property 
value ("
@@ -1013,7 +1013,7 @@ void 
ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
 ::dbaccess::ODsnTypeCollection* pCollection = 
pTypeCollection->getCollection();
 OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type 
collection!");
 
-sal_uInt16 nPortNumberId= 0;
+TypedWhichId nPortNumberId(0);
 sal_Int32 nPortNumber   = -1;
 OUString sNewHostName;
 OUString sUrlPart;
@@ -1056,7 +1056,7 @@ void 
ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
 if ( !sNewHostName.isEmpty() )
 _rDest.Put(SfxStringItem(DSID_CONN_HOSTNAME, sNewHostName));
 
-if ( nPortNumber != -1 && nPortNumberId != 0 )
+if ( nPortNumber != -1 && nPortNumberId != TypedWhichId(0) )
 _rDest.Put(SfxInt32Item(nPortNumberId, nPortNumber));
 
 }
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx 
b/dbaccess/source/ui/dlg/adminpages.cxx
index e3346d6b9d8a..ec837e803657 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -208,7 +208,7 @@ namespace dbaui
 
 _bChangedSomething = true;
 }
-void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet, const 
weld::SpinButton* pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
+void OGenericA

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

2023-05-26 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/directsql.cxx |   17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit a4238b12ff0d5f77b3240a5f22c20ae8c0e2f828
Author: Julien Nabet 
AuthorDate: Fri May 26 14:00:32 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri May 26 19:22:47 2023 +0200

Related tdf#153317: extra check since we deal with signed integers

Thank you Michael Stahl for having spotted this! :-)

Change-Id: I4e643b562e6dc653a511109531837c228f0e0e0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152305
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
(cherry picked from commit 42547b6472cad484bced8aa47ecadd6d21d587ac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152312
Reviewed-by: Michael Stahl 

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index a82f8d4c10f8..856a20319b03 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -325,7 +325,7 @@ namespace dbaui
 // In this case, there's a good chance it's a "Bit" field
 // remark: for unknown reason, getByte(i) gives "\000" 
even if the bit is at 1.
 auto seq = xRow->getBytes(i);
-if ((seq.getLength() == 1) && (seq[0] <= 1))
+if ((seq.getLength() == 1) && (seq[0] >= 0) && (seq[0] <= 
1))
 {
 out.append(OUString::number(static_cast(seq[0])) 
+ ",");
 }
commit 6d0470ee00cbf9f9d293c92f92a759cdacbebef0
Author: Julien Nabet 
AuthorDate: Thu May 25 23:51:04 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri May 26 19:22:34 2023 +0200

tdf#153317: direct SQL: try to detect Bit field in Mysql/MariaDB

Change-Id: I462cb28c15a0cd1d3c93f2335bcac02ca09c78e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152289
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit a16ff0aa4123ce1682a971d66fff60f4ba4606f7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152224
Reviewed-by: Michael Stahl 

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index 9080e63dca3f..a82f8d4c10f8 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -318,8 +318,21 @@ namespace dbaui
 int i = 1;
 for (;;)
 {
-// be dumb, treat everything as a string
-out.append(xRow->getString(i) + ",");
+// be dumb, treat everything as a string unless below
+// tdf#153317, at least "Bit" type in Mysql/MariaDB gives: 
"\000" or "\001"
+// so retrieve Sequence from getBytes, test if it has a 
length of 1 (so we avoid BLOB/CLOB or other complex types)
+// and test if the value of first byte is one of those.
+// In this case, there's a good chance it's a "Bit" field
+// remark: for unknown reason, getByte(i) gives "\000" 
even if the bit is at 1.
+auto seq = xRow->getBytes(i);
+if ((seq.getLength() == 1) && (seq[0] <= 1))
+{
+out.append(OUString::number(static_cast(seq[0])) 
+ ",");
+}
+else
+{
+out.append(xRow->getString(i) + ",");
+}
 i++;
 }
 }


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

2023-05-26 Thread Michael Stahl (via logerrit)
 include/svx/sdr/contact/viewobjectcontact.hxx |3 
 svx/source/sdr/contact/viewobjectcontact.cxx  |7 +-
 sw/source/core/doc/notxtfrm.cxx   |3 
 vcl/qa/cppunit/pdfexport/data/tdf155190.odt   |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx|   88 ++
 vcl/source/gdi/pdfwriter_impl.cxx |5 -
 6 files changed, 102 insertions(+), 4 deletions(-)

New commits:
commit 370533da3f07169791c0a17013ca55c57df2f3c9
Author: Michael Stahl 
AuthorDate: Fri May 26 16:20:47 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri May 26 19:19:20 2023 +0200

tdf#155190 svx,sw: PDF export: don't tag SwNoTextFrame as Artifact

The problem is that inside of the Figure tag, in
SwNoTextFrame::ImplPaintPictureGraphic(), ViewContactOfSwNoTextFrame
and ViewObjectContactOfSwNoTextFrame are used to create and process
another primitive sequence.

ViewObjectContactOfSwNoTextFrame does not have access to a SdrObject,
because that was already processed by the outer layer of code that
called the SwFlyFrame painting code.

Avoid running the code that assumes anything without an SdrObject is an
artifact by disabling PDF tags altogether in
ViewObjectContactOfSwNoTextFrame.

(regression from commit 81ef84648515965bf67afaced946227d0f63a71e)

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

diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx 
b/include/svx/sdr/contact/viewobjectcontact.hxx
index 1be4cac81052..6046bd93fe6b 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -116,6 +116,9 @@ public:
 // This method will not handle included hierarchies and not check 
visibility.
 drawinglayer::primitive2d::Primitive2DContainer const & 
getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
 
+/// check if getPrimitive2DSequence() should create tag
+virtual bool isExportPDFTags() const;
+
 // test this VOC for visibility concerning model-view stuff like e.g. Layer
 virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
 
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index fb6f0fc73ff1..82b21d137ef1 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -341,6 +341,11 @@ void ViewObjectContact::createPrimitive2DSequence(const 
DisplayInfo& rDisplayInf
 rVisitor.visit(xRetval);
 }
 
+bool ViewObjectContact::isExportPDFTags() const
+{
+return GetObjectContact().isExportTaggedPDF();
+}
+
 drawinglayer::primitive2d::Primitive2DContainer const & 
ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
 {
 // only some of the top-level apps are any good at reliably invalidating 
us (e.g. writer is not)
@@ -387,7 +392,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & 
ViewObjectContact::getPr
 
 // Check if we need to embed to a StructureTagPrimitive2D, too. This
 // was done at ImplRenderPaintProc::createRedirectedPrimitive2DSequence 
before
-if (!xNewPrimitiveSequence.empty() && 
GetObjectContact().isExportTaggedPDF())
+if (!xNewPrimitiveSequence.empty() && isExportPDFTags())
 {
 if (nullptr != pSdrObj)
 {
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index eb0b4d96102a..ccf60904585d 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -993,6 +993,9 @@ protected:
 const sdr::contact::DisplayInfo& rDisplayInfo,
 drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) 
const override;
 
+// tdf#155190 disable this so superclass doesn't wrongly produce NonStruct
+virtual bool isExportPDFTags() const override { return false; }
+
 public:
 ViewObjectContactOfSwNoTextFrame(
 sdr::contact::ObjectContact& rObjectContact,
diff --git a/vcl/qa/cppunit/pdfexport/data/tdf155190.odt 
b/vcl/qa/cppunit/pdfexport/data/tdf155190.odt
new file mode 100644
index ..51930ad2992d
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf155190.odt differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index bf2ca137646f..0739cd25cd8a 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -3598,6 +3598,94 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf135192)
 CPPUNIT_ASSERT_EQUAL(int(1), nTable);
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf155190)
+{
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+
+// Enable PDF/UA
+uno::Sequence aFilterData(
+comphelper::InitPropertySequence({ { "PDFUACompliance", uno::Any(true) 
} }));
+aMediaDescript

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

2023-05-26 Thread Jean-Pierre Ledure (via logerrit)
 wizards/source/scriptforge/python/scriptforge.py |3 
 wizards/source/sfdialogs/SF_Dialog.xba   |   93 +++
 2 files changed, 81 insertions(+), 15 deletions(-)

New commits:
commit a83643dea9f5922d4706c9e1d8b9f53f71eb01d9
Author: Jean-Pierre Ledure 
AuthorDate: Fri May 26 17:13:04 2023 +0200
Commit: Jean-Pierre Ledure 
CommitDate: Fri May 26 19:06:07 2023 +0200

ScriptForge (SF_Dialog) new CloneControl() method

Duplicate an existing control of any type
in the actual dialog.

The duplicated control is left unchanged.
The new control can be relocated.
Args:
  SourceName: the name of the control to duplicate
  ControlName: the name of the new control.
It must not exist yet.
  Left, Top: the coordinates of the new control
expressed in "Map AppFont" units.
Returns:
  an instance of the SF_DialogControl class or Nothing

The method is available from Basic and Python user scripts

This change will require an update of the SF_Dialog help page.

Change-Id: I5c2a5404a14ad60b2d4df2ac7eabbf0ddd843170
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152333
Reviewed-by: Jean-Pierre Ledure 
Tested-by: Jenkins

diff --git a/wizards/source/scriptforge/python/scriptforge.py 
b/wizards/source/scriptforge/python/scriptforge.py
index 76845c71e75d..96474e4eb4de 100644
--- a/wizards/source/scriptforge/python/scriptforge.py
+++ b/wizards/source/scriptforge/python/scriptforge.py
@@ -1866,6 +1866,9 @@ class SFDialogs:
 parentobj = parent.objectreference if isinstance(parent, 
parentclasses) else parent
 return self.ExecMethod(self.vbMethod + self.flgObject + 
self.flgHardCode, 'Center', parentobj)
 
+def CloneControl(self, sourcename, controlname, left = 1, top = 1):
+return self.ExecMethod(self.vbMethod, 'CloneControl', sourcename, 
controlname, left, top)
+
 def Controls(self, controlname = ''):
 return self.ExecMethod(self.vbMethod + self.flgArrayRet + 
self.flgHardCode, 'Controls', controlname)
 
diff --git a/wizards/source/sfdialogs/SF_Dialog.xba 
b/wizards/source/sfdialogs/SF_Dialog.xba
index cf32bf92629b..21e307b5 100644
--- a/wizards/source/sfdialogs/SF_Dialog.xba
+++ b/wizards/source/sfdialogs/SF_Dialog.xba
@@ -571,6 +571,58 @@ Catch:
GoTo Finally
 End Function   '  SF_Documents.SF_Dialog.Center
 
+REM 
-
+Public Function CloneControl(Optional ByVal SourceName As Variant _
+   , Optional 
ByVal ControlName As Variant _
+   , Optional 
ByVal Left As Variant _
+   , Optional 
ByVal Top As Variant _
+   ) As Object
+''' Duplicate an existing control of any type in the actual 
dialog.
+''' The duplicated control is left unchanged. The new 
control can be relocated.
+''' Specific args:
+''' SourceName: the name of the control to duplicate
+''' ControlName: the name of the new control. It 
must not exist yet
+''' Left, Top: the coordinates of the new control 
expressed in "Map AppFont" units
+''' Returns:
+''' an instance of the SF_DialogControl class or 
Nothing
+''' Example:
+''' Set myButton2 = 
dialog.CloneControl("Button1", "Button2", 30, 30)
+
+Dim oControl As Object '  Return value
+Dim oSourceModel As Object '  com.sun.star.awt.XControlModel 
of the source
+Dim oControlModel As Object'  com.sun.star.awt.XControlModel 
of the new control
+Const cstThisSub = "SFDialogs.Dialog.CloneControl"
+Const cstSubArgs = "SourceName, ControlName, [Left=1], [Top=1]"
+
+Check:
+   Set oControl = Nothing
+
+   If IsMissing(Left) Or IsEmpty(Left) Then Left = 1
+   If IsMissing(Top) Or IsEmpty(Top) Then Top = 1
+
+   If Not _CheckNewControl(cstThisSub, cstSubArgs, ControlName, Place := 
Null) Then GoTo Finally
+
+   If Not ScriptForge.SF_Utils._Validate(SourceName, 
"SourceName", V_String, _DialogModel.getElementNames()) Then GoTo 
Finally
+   If Not ScriptForge.SF_Utils._Validate(Left, "Left", 
ScriptForge.V_NUMERIC) Then GoTo Finally
+   If Not ScriptForge.SF_Utils._Validate(Top, "Top", 
ScriptForge.V_NUMERIC) Then GoTo Finally
+
+Try:
+   '  All control types are presumes cloneable
+   Set oSourceModel = _DialogModel.getByName(SourceName)
+   Set oControlModel = oSourceModel.createClone()
+   oControlModel.Name = ControlName
+
+   '  Create the control
+   Set oControl = _CreateNewControl(oControlModel, ControlName, 
Array(Left, Top))
+
+Finally:
+   Set CloneControl = oControl
+   ScriptForge.SF_Utils._ExitFunction(cstThisSub)
+ 

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

2023-05-26 Thread Laurent Balland (via logerrit)
 sc/qa/unit/data/xlsx/seconds-without-truncate-and-decimals.xlsx |binary
 sc/qa/unit/subsequent_export_test4.cxx  |   18 
+++---
 svl/qa/unit/svl.cxx |   17 
+
 svl/source/numbers/zforscan.cxx |6 +++
 xmloff/source/style/xmlnumfe.cxx|8 ++--
 5 files changed, 42 insertions(+), 7 deletions(-)

New commits:
commit 6dd2ebbba23b20864d3cf74322540c628088375c
Author: Laurent Balland 
AuthorDate: Tue May 16 09:24:55 2023 +0200
Commit: Eike Rathke 
CommitDate: Fri May 26 18:20:26 2023 +0200

tdf#150028 Treat decimal separator after [SS]

Only decimal separator after S or SS was treated
This change adds [S] and [SS] to treat formats like
[SS].00
Update: correct export to XML
Add QA unit tests

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

diff --git a/sc/qa/unit/data/xlsx/seconds-without-truncate-and-decimals.xlsx 
b/sc/qa/unit/data/xlsx/seconds-without-truncate-and-decimals.xlsx
new file mode 100644
index ..a26b3630708e
Binary files /dev/null and 
b/sc/qa/unit/data/xlsx/seconds-without-truncate-and-decimals.xlsx differ
diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index 9d7dddc99c78..b34a8fcdadf6 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -1460,24 +1460,34 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf148820)
 
 namespace
 {
-void lcl_TestEmbeddedTextInDecimal(ScDocument& rDoc)
+void lcl_TestNumberFormat(ScDocument& rDoc, const OUString& rFormatStrOK)
 {
 sal_uInt32 nNumberFormat = rDoc.GetNumberFormat(0, 0, 0);
 const SvNumberformat* pNumberFormat = 
rDoc.GetFormatTable()->GetEntry(nNumberFormat);
 const OUString& rFormatStr = pNumberFormat->GetFormatstring();
 
-CPPUNIT_ASSERT_EQUAL(OUString("#,##0.000\" \"###\" \"###"), rFormatStr);
+CPPUNIT_ASSERT_EQUAL(rFormatStrOK, rFormatStr);
 }
 }
 
+CPPUNIT_TEST_FIXTURE(ScExportTest4, testSecondsWithoutTruncateAndDecimals)
+{
+createScDoc("xlsx/seconds-without-truncate-and-decimals.xlsx");
+lcl_TestNumberFormat(*getScDoc(), "[SS].00");
+
+// save to ODS and reload
+saveAndReload("calc8");
+lcl_TestNumberFormat(*getScDoc(), "[SS].00");
+}
+
 CPPUNIT_TEST_FIXTURE(ScExportTest4, testEmbeddedTextInDecimal)
 {
 createScDoc("xlsx/embedded-text-in-decimal.xlsx");
-lcl_TestEmbeddedTextInDecimal(*getScDoc());
+lcl_TestNumberFormat(*getScDoc(), "#,##0.000\" \"###\" \"###");
 
 // save to ODS and reload
 saveAndReload("calc8");
-lcl_TestEmbeddedTextInDecimal(*getScDoc());
+lcl_TestNumberFormat(*getScDoc(), "#,##0.000\" \"###\" \"###");
 }
 
 CPPUNIT_TEST_FIXTURE(ScExportTest4, testTotalsRowFunction)
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 06d018f3b624..8f5070c934bb 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -1728,6 +1728,23 @@ void Test::testUserDefinedNumberFormats()
 sExpected = "1900-01-02 23:53.605";
 checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
 }
+{   // tdf#150028 decimals of seconds fraction withtout truncate on 
overflow
+sCode = "[SS]";
+sExpected = "271434";
+checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+// One decimal.
+sCode = "[SS].0";
+sExpected = "271433.6";
+checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+// Two decimals.
+sCode = "[SS].00";
+sExpected = "271433.61";
+checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+// Three decimals.
+sCode = "[SS].000";
+sExpected = "271433.605";
+checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+}
 {   // tdf#33689 use English NfKeywords in non-English language
 eLang = LANGUAGE_DUTCH;
 sExpected = "Dutch: 1900/01/02 03:23:53";
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 10ff6a591b35..537c19415ff7 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1467,6 +1467,11 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
 }
 else if (pLoc->getTime100SecSep() == sStrArray[i])
 bDecSep = true;
+else if ( sStrArray[i][0] == ']' && i < nStringsCnt - 1 && 
pLoc->getTime100SecSep() == sStrArray[i+1] )
+{
+bDecSep = true;
+i++;
+}
 }
 eNewType = SvNumFormatType::UNDEFINED;
 break;
@@ -2592,6 +2597,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& 
rStrin

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

2023-05-26 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/uno/unotxdoc.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 31f2de053d89fc782f98f74785643dbd6e19ba73
Author: Caolán McNamara 
AuthorDate: Fri May 26 15:08:05 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 26 17:37:10 2023 +0200

Related: tdf#155507 disable HeaderFooter menu for tiled rendering

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

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index b57cea597759..fadfe90a82b6 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3603,6 +3603,10 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::SequenceGetRedlineAuthor(SW_MOD()->GetRedlineAuthor());
 OUString sAuthor;


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

2023-05-26 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1354d0ffcabc6e7f78767e8cac1e8c127d4e4b6c
Author: Caolán McNamara 
AuthorDate: Fri May 26 14:47:58 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 26 17:30:14 2023 +0200

Related: tdf#155507 Only need this invalidate if using header/footer 
controls

which is implied from the IsUseHeaderFooterMenu option

Change-Id: I0f9a32ed1a3e0e5e277c33c45206757d133d92e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152330
Reviewed-by: Michael Meeks 
Tested-by: Jenkins

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 1e07a0f4fcdc..147ae7b1d427 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2966,9 +2966,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 
 if ( !bActive )
 {
-// When in Hide-Whitespace mode, we don't want header
-// and footer controls.
-if (!rSh.GetViewOptions()->IsHideWhitespaceMode())
+// HeaderFooter menu implies header/footer controls, so only 
do this with IsUseHeaderFooterMenu enabled.
+// But, additionally, when in Hide-Whitespace mode, we don't 
want those controls.
+if (rSh.GetViewOptions()->IsUseHeaderFooterMenu() && 
!rSh.GetViewOptions()->IsHideWhitespaceMode())
 {
 SwPaM aPam(*rSh.GetCurrentShellCursor().GetPoint());
 const bool bWasInHeader = 
aPam.GetPoint()->GetNode().FindHeaderStartNode() != nullptr;
@@ -2993,7 +2993,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 // if the cursor cannot be positioned on-screen, then 
the user would need to scroll back again to use the control.
 // This should only be done for the footer. The cursor 
can always be re-positioned near the header. tdf#134023.
 if ( eControl == FrameControlType::Footer && 
!bSeparatorWasVisible
- && rSh.GetViewOptions()->IsUseHeaderFooterMenu() 
&& !Application::IsHeadlessModeEnabled() )
+ && !Application::IsHeadlessModeEnabled() )
 return;
 }
 }


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

2023-05-26 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/directsql.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 42547b6472cad484bced8aa47ecadd6d21d587ac
Author: Julien Nabet 
AuthorDate: Fri May 26 14:00:32 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri May 26 17:19:08 2023 +0200

Related tdf#153317: extra check since we deal with signed integers

Thank you Michael Stahl for having spotted this! :-)

Change-Id: I4e643b562e6dc653a511109531837c228f0e0e0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152305
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index a82f8d4c10f8..856a20319b03 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -325,7 +325,7 @@ namespace dbaui
 // In this case, there's a good chance it's a "Bit" field
 // remark: for unknown reason, getByte(i) gives "\000" 
even if the bit is at 1.
 auto seq = xRow->getBytes(i);
-if ((seq.getLength() == 1) && (seq[0] <= 1))
+if ((seq.getLength() == 1) && (seq[0] >= 0) && (seq[0] <= 
1))
 {
 out.append(OUString::number(static_cast(seq[0])) 
+ ",");
 }


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

2023-05-26 Thread Justin Luth (via logerrit)
 sw/qa/extras/ww8export/data/tdf133504_wrapNotBeside.doc |binary
 sw/qa/extras/ww8export/ww8export.cxx|8 +
 sw/source/filter/ww8/ww8par6.cxx|   24 
 3 files changed, 27 insertions(+), 5 deletions(-)

New commits:
commit 4f91e6c91b449ffe1e51cc517e8fc93179feca67
Author: Justin Luth 
AuthorDate: Thu May 25 12:19:16 2023 -0400
Commit: Justin Luth 
CommitDate: Fri May 26 16:19:38 2023 +0200

tdf#133504 doc import: set the correct wrap

Umm, I'm amazed that
1.) this hasn't been a bigger, burning issue, and
2.) that no one has ever investigated or fixed this.
It was super easy.

The code is mind boggling though. "Auto" and "Not Beside" are NONE,
but around, none, tight, and through are "Optimal"?

How about auto is optimal, around/tight are parallel,
none is none, and through is through.

Lets try that and see how it works.

Prior patchsets submitted searched for existing examples.
They suggest that MS Word's UI only allows for notBeside and around,
but I kept the others there just in case something can trigger them.

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

diff --git a/sw/qa/extras/ww8export/data/tdf133504_wrapNotBeside.doc 
b/sw/qa/extras/ww8export/data/tdf133504_wrapNotBeside.doc
new file mode 100644
index ..865023e34489
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/tdf133504_wrapNotBeside.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index d248c6ce6b26..fd4da5249319 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -577,6 +578,13 @@ DECLARE_WW8EXPORT_TEST(testBnc787942, "bnc787942.doc")
 
 // this is on page 1 in Word
 parseDump("/root/page[1]/body/txt[4]/anchored");
+
+CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, 
getProperty(getShape(1), "Surround"));
+}
+
+DECLARE_WW8EXPORT_TEST(testTdf133504_wrapNotBeside, 
"tdf133504_wrapNotBeside.doc")
+{
+CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_NONE, 
getProperty(getShape(1), "Surround"));
 }
 
 DECLARE_WW8EXPORT_TEST(testLayoutHanging, "fdo68967.doc")
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 671e25a97aa5..134acfba537d 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -1912,7 +1912,6 @@ eHRel(text::RelOrientation::PAGE_FRAME),
 eVRel(text::RelOrientation::FRAME),
 eVAlign(text::VertOrientation::NONE),
 eHAlign(text::HoriOrientation::NONE),
-eSurround(( rWW.nPWr > 1 ) ? css::text::WrapTextMode_DYNAMIC : 
css::text::WrapTextMode_NONE),
 nXBind(( rWW.nTPc & 0xc0 ) >> 6),
 nYBind(( rWW.nTPc & 0x30 ) >> 4),
 nNewNetWidth(MINFLY),
@@ -1920,10 +1919,25 @@ nLineSpace(0),
 bAutoWidth(false),
 bTogglePos(false)
 {
-//#i119466 mapping "Around" wrap setting to "Parallel" for table
-const bool bIsTable = 
rIo.m_xPlcxMan->HasParaSprm(NS_sprm::PFInTable::val).pSprm;
-if (bIsTable && rWW.nPWr == 2)
-eSurround = css::text::WrapTextMode_PARALLEL;
+switch(rWW.nPWr)
+{
+case 0: // ST_Wrap: auto
+eSurround = css::text::WrapTextMode_DYNAMIC;
+break;
+case 1: // ST_Wrap: notBeside
+case 3: // ST_Wrap: none
+eSurround = css::text::WrapTextMode_NONE;
+break;
+case 2: // ST_Wrap: around
+case 4: // ST_Wrap: tight
+eSurround = css::text::WrapTextMode_PARALLEL;
+break;
+case 5: // St_Wrap: through
+eSurround = css::text::WrapTextMode_THROUGH;
+break;
+default:
+eSurround = css::text::WrapTextMode_DYNAMIC;
+}
 
 /*
  #95905#, #83307# seems to have gone away now, so re-enable parallel


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

2023-05-26 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 94639b415729beb2a27bcb47da2cbd5205006861
Author: Caolán McNamara 
AuthorDate: Fri May 26 12:56:16 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 26 15:06:37 2023 +0200

SwViewShell::ToggleHeaderFooterEdit already calls GetWin()->Invalidate()

so this is a duplicate call, drop it

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

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 5bcbd4a9c843..1e07a0f4fcdc 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3006,12 +3006,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 rSh.SetShowHeaderFooterSeparator( FrameControlType::Footer, 
eControl == FrameControlType::Footer );
 
 if ( !rSh.IsHeaderFooterEdit() )
-{
 rSh.ToggleHeaderFooterEdit();
-
-// Repaint everything
-rSh.GetWin()->Invalidate();
-}
 }
 }
 }


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

2023-05-26 Thread Caolán McNamara (via logerrit)
 sw/source/core/crsr/crsrsh.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit c9581d7ada7d6a0e62653bdfa1e419ede6324970
Author: Caolán McNamara 
AuthorDate: Fri May 26 10:31:16 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 26 14:36:25 2023 +0200

tdf#155507 don't redraw numbering when cursor enters it, if...

"field shadings" are turned off and so the new output would be the same
as it already is. Which removes a potential source of whole document
invalidations in a multi-user collaborative scenario where participants
may be casually clicking around the place with an expectation that it
has limited effect on the other participants

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

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index aacc4da647b5..c34827f092d8 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -391,12 +391,18 @@ void SwCursorShell::MarkListLevel( const OUString& 
sListId,
 if (sListId == m_sMarkedListId && nListLevel == m_nMarkedListLevel)
 return;
 
-if ( !m_sMarkedListId.isEmpty() )
-mxDoc->MarkListLevel( m_sMarkedListId, m_nMarkedListLevel, false );
-
-if ( !sListId.isEmpty() )
-{
-mxDoc->MarkListLevel( sListId, nListLevel, true );
+// Writer redraws the "marked" list with the field shading, if there
+// is no field shading then the marked list would be redrawn for no
+// visually identifiable reason, so skip the mark if field shadings
+// are disabled.
+const bool bVisuallyMarked(GetViewOptions()->IsFieldShadings());
+if (bVisuallyMarked)
+{
+if ( !m_sMarkedListId.isEmpty() )
+mxDoc->MarkListLevel( m_sMarkedListId, m_nMarkedListLevel, false );
+
+if ( !sListId.isEmpty() )
+mxDoc->MarkListLevel( sListId, nListLevel, true );
 }
 
 m_sMarkedListId = sListId;


[Libreoffice-commits] core.git: cui/source editeng/source extensions/source include/editeng include/sfx2 include/svx reportdesign/source sc/inc sc/source sd/inc sd/source sfx2/source svx/source sw/inc

2023-05-26 Thread Noel Grandin (via logerrit)
 cui/source/options/optgenrl.cxx|2 -
 cui/source/tabpages/chardlg.cxx|8 ++---
 cui/source/tabpages/tpline.cxx |2 -
 cui/source/tabpages/tptrans.cxx|2 -
 editeng/source/items/paraitem.cxx  |4 +-
 editeng/source/items/textitem.cxx  |   14 
 editeng/source/items/writingmodeitem.cxx   |2 -
 extensions/source/propctrlr/fontdialog.cxx |5 +--
 include/editeng/charrotateitem.hxx |4 +-
 include/editeng/charscaleitem.hxx  |2 -
 include/editeng/editids.hrc|4 +-
 include/editeng/emphasismarkitem.hxx   |2 -
 include/editeng/paravertalignitem.hxx  |3 -
 include/editeng/writingmodeitem.hxx|2 -
 include/sfx2/sfxsids.hrc   |8 ++---
 include/sfx2/zoomitem.hxx  |2 -
 include/svx/svxids.hrc |   33 ++---
 reportdesign/source/ui/report/ReportController.cxx |8 ++---
 sc/inc/sc.hrc  |   12 +++
 sc/source/filter/xml/xmlcelli.cxx  |4 +-
 sc/source/ui/pagedlg/tptable.cxx   |2 -
 sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx |2 -
 sc/source/ui/styleui/styledlg.cxx  |2 -
 sc/source/ui/view/cellsh3.cxx  |4 +-
 sc/source/ui/view/formatsh.cxx |2 -
 sc/source/ui/view/prevwsh.cxx  |2 -
 sc/source/ui/view/tabvwsh3.cxx |2 -
 sc/source/ui/view/tabvwsha.cxx |2 -
 sd/inc/app.hrc |8 ++---
 sd/inc/sdattr.hrc  |   12 +++
 sd/source/ui/dlg/dlgpage.cxx   |2 -
 sd/source/ui/dlg/tpaction.cxx  |4 +-
 sd/source/ui/func/fuoaprms.cxx |   20 ++--
 sd/source/ui/func/fusnapln.cxx |3 -
 sd/source/ui/func/futext.cxx   |4 +-
 sd/source/ui/view/drviewsd.cxx |3 -
 sfx2/source/doc/zoomitem.cxx   |2 -
 svx/source/stbctrls/zoomctrl.cxx   |4 +-
 sw/inc/cmdid.h |   14 
 sw/inc/globals.hrc |2 -
 sw/source/ui/chrdlg/numpara.cxx|2 -
 sw/source/uibase/shells/tabsh.cxx  |2 -
 sw/source/uibase/shells/textsh1.cxx|4 +-
 43 files changed, 112 insertions(+), 115 deletions(-)

New commits:
commit 5315e6069e425aad88873beb5344bb8ea31e0c55
Author: Noel Grandin 
AuthorDate: Fri May 26 11:18:17 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri May 26 13:49:54 2023 +0200

use more TypedWhichId

which flushed out an inconsistency in how SID_NUMBER_TYPE_FORMAT was being 
used

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

diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index b3fb5cb02baf..474eaa5b0feb 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -365,7 +365,7 @@ void SvxGeneralTabPage::Reset( const SfxItemSet* rSet )
 
 if (rSet->GetItemState(SID_FIELD_GRABFOCUS) == SfxItemState::SET)
 {
-EditPosition nField = static_cast(static_cast(rSet->Get(SID_FIELD_GRABFOCUS)).GetValue());
+EditPosition nField = 
static_cast(rSet->Get(SID_FIELD_GRABFOCUS).GetValue());
 if (nField != EditPosition::UNKNOWN)
 {
 for (auto const & i: vFields)
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 87984d573281..7a8788728b46 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2241,7 +2241,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
 
 if (bChanged)
 {
-rSet->Put( SvxEmphasisMarkItem( eMark, nWhich ) );
+rSet->Put( SvxEmphasisMarkItem( eMark, 
TypedWhichId(nWhich) ) );
 bModified = true;
 }
 else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
@@ -2810,7 +2810,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
 m_xScaleWidthMF->set_value(100, FieldUnit::PERCENT);
 
 if ( rSet->GetItemState( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ) >= 
SfxItemState::DEFAULT )
-m_nScaleWidthItemSetVal = static_cast( 
rSet->Get( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE )).GetValue();
+m_nScaleWidthItemSetVal = rSet->Get( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE 
).GetValue();
 
 // Rotation
 nWhich = GetWhich( SID_ATTR_CHAR_ROTATED );
@@ -2971,7 +2971,7 @@ bool SvxCharPosit

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

2023-05-26 Thread Caolán McNamara (via logerrit)
 sw/source/filter/xml/xmlimp.cxx |   43 +---
 1 file changed, 23 insertions(+), 20 deletions(-)

New commits:
commit a82e7cc9ed17a2500ad8cb9ffe54c412b0d8063f
Author: Caolán McNamara 
AuthorDate: Fri May 26 09:32:36 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 26 13:46:58 2023 +0200

ofz#59338 Abrt failed_throw

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

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 7ae8c966c46e..594cb893ca4c 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1841,26 +1841,29 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool 
TestPDFExportFODT(SvStream &rStream)
 
 utl::ConnectFrameControllerModel(xTargetFrame, xController, xModel);
 
-utl::MediaDescriptor aMediaDescriptor;
-aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
-
-utl::TempFileNamed aTempFile;
-aTempFile.EnableKillingFile();
-
-uno::Reference xPDFFilter(
-
xMultiServiceFactory->createInstance("com.sun.star.document.PDFFilter"), 
uno::UNO_QUERY);
-uno::Reference xExporter(xPDFFilter, uno::UNO_QUERY);
-xExporter->setSourceDocument(xModel);
-
-SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE);
-uno::Reference xOutputStream(new 
utl::OStreamWrapper(aOutputStream));
-
-uno::Sequence 
aDescriptor(comphelper::InitPropertySequence({
-{ "FilterName", uno::Any(OUString("writer_pdf_Export")) },
-{ "OutputStream", uno::Any(xOutputStream) }
-}));
-xPDFFilter->filter(aDescriptor);
-aOutputStream.Close();
+if (ret)
+{
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+
+utl::TempFileNamed aTempFile;
+aTempFile.EnableKillingFile();
+
+uno::Reference xPDFFilter(
+
xMultiServiceFactory->createInstance("com.sun.star.document.PDFFilter"), 
uno::UNO_QUERY);
+uno::Reference xExporter(xPDFFilter, 
uno::UNO_QUERY);
+xExporter->setSourceDocument(xModel);
+
+SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE);
+uno::Reference xOutputStream(new 
utl::OStreamWrapper(aOutputStream));
+
+uno::Sequence 
aDescriptor(comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("writer_pdf_Export")) },
+{ "OutputStream", uno::Any(xOutputStream) }
+}));
+xPDFFilter->filter(aDescriptor);
+aOutputStream.Close();
+}
 
 css::uno::Reference xClose(xModel, 
css::uno::UNO_QUERY);
 xClose->close(false);


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

2023-05-26 Thread Julien Nabet (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_table.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8e4c2af59ad4901842b831c3e220411995b964a1
Author: Julien Nabet 
AuthorDate: Thu May 25 15:22:20 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri May 26 13:37:20 2023 +0200

Related tdf#155443: MySQL/MariaDB direct connect, use more of the new 
function

...getAlterTableColumnPart().

getName() and getTableName() don't deal with database/schema prefix + 
backticks

Change-Id: I31cc9dc98de0449dfe2f6f24305290d4edb9ecb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152276
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
(cherry picked from commit a04e0a9cca20d934a80fb6af6647b9a5dc7887dd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/15
Reviewed-by: Michael Stahl 

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_table.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_table.cxx
index aa2bd528e93e..eedcb35d6164 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_table.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_table.cxx
@@ -116,7 +116,7 @@ void SAL_CALL 
connectivity::mysqlc::Table::alterColumnByName(
 // precision, otherwise an exception is thrown -- however the base
 // gui then offers to delete and recreate the column.
 OUStringBuffer sSql(300);
-sSql.append("ALTER TABLE `" + getTableName() + "` MODIFY COLUMN `" + 
rColName + "` "
+sSql.append(getAlterTableColumnPart() + " MODIFY COLUMN `" + rColName 
+ "` "
 + ::dbtools::createStandardTypePart(rDescriptor, 
getConnection()));
 
 if 
(comphelper::getBOOL(rDescriptor->getPropertyValue("IsAutoIncrement")))


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

2023-05-26 Thread Xisco Fauli (via logerrit)
 sw/source/core/docnode/node.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d995cdd8f67a5015e71c5676e400c79a853a57a3
Author: Xisco Fauli 
AuthorDate: Tue May 23 12:39:50 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri May 26 13:34:09 2023 +0200

sw: fix crash in SwNode::GetFlyFormat()

FindFlyFrame() might return nullptr
See 
https://crashreport.libreoffice.org/stats/signature/SwNode::GetFlyFormat()

Change-Id: Id99a806e62f03b8912747525c8b0235c1b23232b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152156
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit e518624da1bdad5fcb24feb41349efa4301329e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152210

diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index c50435e076fb..ced3b00c78eb 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -745,7 +745,7 @@ SwFrameFormat* SwNode::GetFlyFormat() const
 if( IsContentNode() )
 {
 SwContentFrame* pFrame = SwIterator(*static_cast(this)).First();
-if( pFrame )
+if( pFrame && pFrame->FindFlyFrame())
 pRet = pFrame->FindFlyFrame()->GetFormat();
 }
 if( !pRet )


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

2023-05-26 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/htmlexport/data/listItemSubheader.fodt |   31 +++
 sw/qa/extras/htmlexport/htmlexport.cxx  |   48 +--
 sw/source/filter/html/htmlatr.cxx   |   21 +++-
 sw/source/filter/html/htmlnumwriter.cxx |   85 
 sw/source/filter/html/wrthtml.hxx   |3 
 5 files changed, 89 insertions(+), 99 deletions(-)

New commits:
commit 758f56e40a9bf0e931110517719580c058d30688
Author: Mike Kaganski 
AuthorDate: Thu May 25 19:41:32 2023 +0300
Commit: Miklos Vajna 
CommitDate: Fri May 26 13:30:43 2023 +0200

tdf#155496: Export list header to (X)HTML using 'display: block' style

This re-implements commit 013a4f1f5c9ea5fb511568c53a7e76d1b365a65d
(sw XHTML export: fix handling of list labels, 2021-05-13), and
instead of not putting headers (ODF 'text:list-header' elements)
into lists, this adds 'style="display: block"' attribute to the
respective list items. This makes sure that the items use proper
list indentation, and produces correct markup.

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

diff --git a/sw/qa/extras/htmlexport/data/listItemSubheader.fodt 
b/sw/qa/extras/htmlexport/data/listItemSubheader.fodt
new file mode 100644
index ..4c68ce887650
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/listItemSubheader.fodt
@@ -0,0 +1,31 @@
+
+
+
+ 
+  
+   
+   
+
+ list 1 item 1
+ 
+  
+   list 1 item 1 sub-header
+  
+ 
+
+   
+   
+   text
+   
+
+ 
+  
+   list 2 sub-header
+  
+ 
+
+   
+   
+  
+ 
+
\ No newline at end of file
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index b42eef6d83f5..0cac6b56af8c 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -1476,10 +1476,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testListHeading)
 CPPUNIT_ASSERT(pDoc);
 
 // Without the accompanying fix in place, this test would have failed:
-// - expected: ...
+// - expected: ...
 // - actual  : ...
 // because a  but no  is not well-formed and  with a non-li 
children is invalid.
-assertXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p", "list header");
+OUString aContent
+= getXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
+   "reqif-xhtml:li[@style='display: 
block']/reqif-xhtml:p");
+CPPUNIT_ASSERT_EQUAL(OUString("list header"), aContent.trim());
 }
 
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testPartiallyNumberedList)
@@ -2033,11 +2036,10 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testListsHeading)
 xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
 CPPUNIT_ASSERT(pDoc);
 
-// Without the accompanying fix in place, this test would have failed with:
-// - In <>, XPath '/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p' not 
found
-// Because the headers of list 1 were inside , not directly under 
.
-assertXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p",
-   "list 1, header 1");
+OUString aContent
+= getXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
+   "reqif-xhtml:li[@style='display: 
block']/reqif-xhtml:p");
+CPPUNIT_ASSERT_EQUAL(OUString("list 1, header 1"), aContent.trim());
 }
 
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testOleEmfPreviewToHtml)
@@ -2493,6 +2495,38 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155387)
 "l3");
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155496)
+{
+createSwDoc("listItemSubheader.fodt");
+ExportToReqif();
+
+SvMemoryStream aStream;
+WrapReqifFromTempFile(aStream);
+xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
+// Without the fix in place, this would fail
+CPPUNIT_ASSERT(pDoc);
+
+// Two top-level lists
+assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul", 2);
+// Single top-level item
+assertXPath(pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li");
+// One top-level paragraph in the item
+assertXPath(pDoc,
+
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:p");
+// One sublist in the item
+assertXPath(
+pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul");
+// One item in the sublist
+assertXPath(pDoc,
+
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul/"
+"reqif-xhtml:li");
+// Check its text
+OUString aContent = getXPathConten

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

2023-05-26 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   42 +
 sw/source/core/undo/docundo.cxx|2 -
 2 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 5f90963149509364d34fae5ecc759989620ee906
Author: Miklos Vajna 
AuthorDate: Wed May 24 15:40:35 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 26 13:30:16 2023 +0200

sw: fix wrong downcast in UndoManager::IsViewUndoActionIndependent()

In case a user types in one view, an other user types in an other view,
finally the first user deletes, then getting the undo state resulted in
a memory corruption.

This went wrong in commit 2875c65946e59f5dd7968155463bf00bd71d440b (sw,
out of order undo: allow a subset of a non-empty redo list, 2021-11-11),
the intention was to check if we have a redo item and it has the
expected type, but we checked the type of an earlier undo action that
belongs to the view.

Fix the problem by checking the type of the correct undo action, this
was probably a copy&paste error of mine.

Resolves .

(cherry picked from commit f0a9d4d4eea6562e98fd92a2797d16504e1d4db5)

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

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 3330e419dc8b..cc1dbd4947c2 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1322,6 +1322,48 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testUndoReorderingRedo)
 SfxViewShell::Current()->setLibreOfficeKitViewCallback(nullptr);
 }
 
+CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoReorderingRedo2)
+{
+// Create two views.
+SwXTextDocument* pXTextDocument = createDoc();
+SwWrtShell* pWrtShell1 = pXTextDocument->GetDocShell()->GetWrtShell();
+int nView1 = SfxLokHelper::getView();
+int nView2 = SfxLokHelper::createView();
+
pXTextDocument->initializeForTiledRendering(uno::Sequence());
+SwWrtShell* pWrtShell2 = pXTextDocument->GetDocShell()->GetWrtShell();
+
+// Type in the first view.
+SfxLokHelper::setView(nView1);
+pWrtShell1->SttEndDoc(/*bStt=*/true);
+pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'f', 0);
+pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'f', 0);
+Scheduler::ProcessEventsToIdle();
+
+// Type to the same paragraph in the second view.
+SfxLokHelper::setView(nView2);
+pWrtShell2->SttEndDoc(/*bStt=*/true);
+pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 's', 0);
+pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 's', 0);
+Scheduler::ProcessEventsToIdle();
+
+// Delete in the first view and undo.
+SfxLokHelper::setView(nView1);
+pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 
awt::Key::BACKSPACE);
+pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::BACKSPACE);
+Scheduler::ProcessEventsToIdle();
+dispatchCommand(mxComponent, ".uno:Undo", {});
+Scheduler::ProcessEventsToIdle();
+
+// Query the undo state, now that a "delete" is on the redo stack and an 
"insert" belongs to the
+// view on the undo stack, so the types are different.
+SwUndoId nUndoId(SwUndoId::EMPTY);
+// Without the accompanying fix in place, this test would have failed with:
+// runtime error: downcast which does not point to an object of type 
'const SwUndoInsert'
+// note: object is of type 'SwUndoDelete'
+// in an UBSan build.
+pWrtShell1->GetLastUndoInfo(nullptr, &nUndoId, &pWrtShell1->GetView());
+}
+
 CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testUndoReorderingMulti)
 {
 // Create two views and a document of 2 paragraphs.
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 07998e9404ef..ccff1b663cf3 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -415,7 +415,7 @@ bool UndoManager::IsViewUndoActionIndependent(const SwView* 
pView, sal_uInt16& r
 for (size_t i = 0; i < GetRedoActionCount(); ++i)
 {
 auto pRedoAction = dynamic_cast(GetRedoAction(i));
-if (!pRedoAction || pViewSwAction->GetId() != SwUndoId::TYPING)
+if (!pRedoAction || pRedoAction->GetId() != SwUndoId::TYPING)
 {
 return false;
 }


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

2023-05-26 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/impedit2.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7113ed198f7850b2bbd98f873f7787c76935cee6
Author: Caolán McNamara 
AuthorDate: Tue May 23 19:58:39 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 26 13:18:12 2023 +0200

tdf#155350 Do AutoCorrect of Input Method text

for all of SvxAutoCorrect::IsAutoCorrectChar() chars not just
quotes

Change-Id: I368836ea3c2dcdcc7fbe6906d7ae886f312d73d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152107
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit 1e206d5b53ed1e11f2bab2437dd6fccdab4586ce)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152225
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 9f2296ed957b..08413f123916 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -371,8 +371,9 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 // #102812# convert quotes in IME text
 // works on the last input character, this is especially in 
Korean text often done
 // quotes that are inside of the string are not replaced!
+// See also tdf#155350
 const sal_Unicode nCharCode = aSel.Min().GetNode()->GetChar( 
aSel.Min().GetIndex() );
-if ( ( GetStatus().DoAutoCorrect() ) && ( ( nCharCode == '\"' 
) || ( nCharCode == '\'' ) ) )
+if ( ( GetStatus().DoAutoCorrect() ) && 
SvxAutoCorrect::IsAutoCorrectChar(nCharCode) )
 {
 aSel = DeleteSelected( aSel );
 aSel = AutoCorrect( aSel, nCharCode, 
mpIMEInfos->bWasCursorOverwrite );


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

2023-05-26 Thread Heiko Tietze (via logerrit)
 svx/source/svdraw/svdpage.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit ca10ae200aac01e6b238567fa637cdc293f70f7a
Author: Heiko Tietze 
AuthorDate: Fri May 26 10:17:53 2023 +0200
Commit: Heiko Tietze 
CommitDate: Fri May 26 13:05:07 2023 +0200

Suppress variable not used warning

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

diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 55d3e7f5aa6b..175f58b2ad7a 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -139,7 +139,9 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList)
 
 mbObjOrdNumsDirty = false;
 mbRectsDirty = false;
+#ifdef DBG_UTIL
 size_t nCloneErrCnt(0);
+#endif
 const size_t nCount(rSrcList.GetObjCount());
 
 if(nullptr == getSdrObjectFromSdrObjList() && nullptr == 
getSdrPageFromSdrObjList())
@@ -162,10 +164,12 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList)
 NbcInsertObject(pDO.get(), SAL_MAX_SIZE);
 aCloneList.AddPair(pSO, pDO.get());
 }
+#ifdef DBG_UTIL
 else
 {
 nCloneErrCnt++;
 }
+#endif
 }
 
 // Wires up the connections


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

2023-05-26 Thread Heiko Tietze (via logerrit)
 sc/source/ui/view/hdrcont.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 306093f8f82a646a2a82ebfc57fbef70af2d30a7
Author: Heiko Tietze 
AuthorDate: Fri May 26 11:20:06 2023 +0200
Commit: Heiko Tietze 
CommitDate: Fri May 26 13:04:48 2023 +0200

Related tdf#145080 - Less obtrusive col/row header color on macOS

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

diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index d6e9b5dbeb3f..c6688ea11562 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -361,7 +361,14 @@ void ScHeaderControl::Paint( vcl::RenderContext& 
/*rRenderContext*/, const tools
 {
 // background for selection
 GetOutDev()->SetLineColor();
-GetOutDev()->SetFillColor( rStyleSettings.GetAccentColor() );
+Color aColor( rStyleSettings.GetAccentColor() );
+// merging the highlightcolor (which is used if accent does not exist) with 
the background
+// fails in many cases such as Breeze Dark (highlight is too close to 
background) and
+// Breeze Light (font color is white and not readable anymore)
+#ifdef MACOSX
+aColor.Merge( rStyleSettings.GetFaceColor(), 80 );
+#endif
+GetOutDev()->SetFillColor( aColor );
 GetOutDev()->DrawRect( aFillRect );
 }
 }


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

2023-05-26 Thread Dr. David Alan Gilbert (via logerrit)
 comphelper/source/misc/docpasswordhelper.cxx |5 ++---
 sc/source/ui/app/scmod.cxx   |4 ++--
 vcl/source/filter/graphicfilter.cxx  |2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit b480552d9c4ac9be1f53edc6cac21bc45cfe29ca
Author: Dr. David Alan Gilbert 
AuthorDate: Wed May 24 13:47:22 2023 +0100
Commit: Noel Grandin 
CommitDate: Fri May 26 12:49:14 2023 +0200

replace find_if by none_of

A set of cases where find_if is used just to test if there are no
matches; use none_of  as per

tdf#153109

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

diff --git a/comphelper/source/misc/docpasswordhelper.cxx 
b/comphelper/source/misc/docpasswordhelper.cxx
index d26a30e0ff20..5489690fae6a 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -621,11 +621,10 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
 
 if (eResult == DocPasswordVerifierResult::OK && !aPassword.isEmpty())
 {
-if (std::find_if(std::cbegin(aEncData), std::cend(aEncData),
+if (std::none_of(std::cbegin(aEncData), std::cend(aEncData),
  [](const css::beans::NamedValue& val) {
  return val.Name == 
PACKAGE_ENCRYPTIONDATA_SHA256UTF8;
- })
-== std::cend(aEncData))
+ }))
 {
 // tdf#118639: We need ODF encryption data for autorecovery, where 
password
 // will already be unavailable, so generate and append it here
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 2f84555fd3ca..93b74d70e68e 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2192,11 +2192,11 @@ void ScModule::RegisterRefController(sal_uInt16 
nSlotId, std::shared_ptr, 
weld::Window*>> & rlRefWindow = m_mapRefController[nSlotId];
 
-if (std::find_if(rlRefWindow.begin(), rlRefWindow.end(),
+if (std::none_of(rlRefWindow.begin(), rlRefWindow.end(),
  [rWnd](const 
std::pair, weld::Window*>& rCandidate)
  {
  return rCandidate.first.get() == rWnd.get();
- }) == rlRefWindow.end())
+ }))
 {
 rlRefWindow.emplace_back(rWnd, pWndAncestor);
 }
diff --git a/vcl/source/filter/graphicfilter.cxx 
b/vcl/source/filter/graphicfilter.cxx
index 441d32a28adf..bb478922b5a5 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -691,7 +691,7 @@ void 
GraphicFilter::MakeGraphicsAvailableThreaded(std::vector& graphic
 {
 // Graphic objects share internal ImpGraphic, do not process any 
of those twice.
 const auto predicate = [graphic](Graphic* item) { return 
item->ImplGetImpGraphic() == graphic->ImplGetImpGraphic(); };
-if( std::find_if(toLoad.begin(), toLoad.end(), predicate ) == 
toLoad.end())
+if( std::none_of(toLoad.begin(), toLoad.end(), predicate ))
 toLoad.push_back( graphic );
 }
 }


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

2023-05-26 Thread Stephan Bergmann (via logerrit)
 external/libxml2/libxml2-global-symbols.patch |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 8dd8df6c3532046f5e935f8868673d934297288d
Author: Stephan Bergmann 
AuthorDate: Fri May 26 09:13:04 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri May 26 12:41:16 2023 +0200

external/libxml2: Fix missing external symbols needed by xmllint

After 5b42f148e206cda19467e76c2f9915fc2b6fa5f6 "ExternalProject_libxml2 
still
needs to build the xmllint executable" (which I had happened to prepare on
macOS, so didn't originally notice the issue addressed here now), Linux 
builds
like  started to 
fail
with

>   CCLD xmllint
> /opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: 
xmllint-xmllint.o: in function `testSAX':
> 
/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/libxml2/xmllint.c:1646:
 undefined reference to `xmlNewSAXParserCtxt'
> /opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: 
xmllint-xmllint.o: in function `myReallocFunc':
> 
/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/libxml2/xmllint.c:357:
 undefined reference to `xmlMemSize'
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:1007: xmllint] Error 1
> make[1]: *** 
[/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/external/libxml2/ExternalProject_libxml2.mk:37:
 
/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/ExternalProject/libxml2/build]
 Error 1

Turns out that those two functions have been introduced after the previously
used libxml2 2.10.4.  No idea how things are supposed to work (given that
workdir/UnpackedTarball/libxml2/libxml2.syms starts off with "Retained for
backward compatibility. Don't add new symbols.", it appears that there 
should be
some other mechanism at play to make xmllint on Linux find the libxml2.so
symbols it needs, but which doesn't work as intended in our build), but 
just add
those two symbols to libxml2.syms for now.  (With a new version named
LIBXML2_2.11.4, even if the symbols can actually have been introduced in 
some
other version between 2.10.4 and 2.11.4, but who cares.)

Change-Id: Ib9d5c7901fe94b8014a87b049fc27ef5658fd954
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152292
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit fb3b27660a64a4f2b719f8ac243195d497dca488)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152227
Reviewed-by: Xisco Fauli 

diff --git a/external/libxml2/libxml2-global-symbols.patch 
b/external/libxml2/libxml2-global-symbols.patch
index cfec9c530281..cbbe5a622284 100644
--- a/external/libxml2/libxml2-global-symbols.patch
+++ b/external/libxml2/libxml2-global-symbols.patch
@@ -13,10 +13,16 @@
  } LIBXML2_2.6.28;
  
  LIBXML2_2.6.32 {
-@@ -2231,3 +2231,43 @@
+@@ -2231,3 +2231,49 @@
xmlPopOutputCallbacks;
  } LIBXML2_2.9.8;
  
++LIBXML2_2.11.4 {
++global:
++xmlMemSize;
++xmlNewSAXParserCtxt;
++} LIBXML2_2.9.11;
++
 +# HACK: export global variable accessor functions (globals.h)
 +LIBXML2_GLOBAL_VARIABLES {
 +global:


[Libreoffice-commits] core.git: cui/source editeng/source include/editeng include/sfx2 include/svx sc/inc starmath/inc sw/inc sw/source

2023-05-26 Thread Noel Grandin (via logerrit)
 cui/source/tabpages/page.cxx|4 ++--
 cui/source/tabpages/paragrph.cxx|8 
 editeng/source/rtf/rtfitem.cxx  |4 ++--
 include/editeng/editids.hrc |6 --
 include/sfx2/sfxsids.hrc|9 +
 include/svx/svxids.hrc  |   11 ++-
 sc/inc/sc.hrc   |4 ++--
 starmath/inc/starmath.hrc   |3 ++-
 sw/inc/cmdid.h  |6 +++---
 sw/source/uibase/uiview/viewtab.cxx |4 ++--
 10 files changed, 32 insertions(+), 27 deletions(-)

New commits:
commit 2d6dff8d9837c66d5961ea74921306110b9d747b
Author: Noel Grandin 
AuthorDate: Thu May 25 19:16:43 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri May 26 11:18:07 2023 +0200

use more TypedWhichId

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

diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index d939f0949018..d40fef92e8f6 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -723,14 +723,14 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
 }
 
 // paper tray
-nWhich = GetWhich( SID_ATTR_PAGE_PAPERBIN );
+TypedWhichId nPaperWhich = GetWhich( 
SID_ATTR_PAGE_PAPERBIN );
 sal_Int32 nPos = m_xPaperTrayBox->get_active();
 sal_uInt16 nBin = m_xPaperTrayBox->get_id(nPos).toInt32();
 pOld = GetOldItem( *rSet, SID_ATTR_PAGE_PAPERBIN );
 
 if ( !pOld || static_cast(pOld)->GetValue() != 
nBin )
 {
-rSet->Put( SvxPaperBinItem( nWhich, static_cast(nBin) ) );
+rSet->Put( SvxPaperBinItem( nPaperWhich, static_cast(nBin) 
) );
 bModified = true;
 }
 
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 483c41e6f9e2..ff06ee623c8e 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1779,14 +1779,14 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
 }
 
 // widows and orphans
-_nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
+TypedWhichId nWidowsWhich = GetWhich( SID_ATTR_PARA_WIDOWS 
);
 eState = m_xWidowBox->get_state();
 
 if ( m_xWidowBox->get_state_changed_from_saved() ||
  m_xWidowRowNo->get_value_changed_from_saved() )
 {
 SvxWidowsItem rItem( eState == TRISTATE_TRUE ?
- 
static_cast(m_xWidowRowNo->get_value()) : 0, _nWhich );
+ 
static_cast(m_xWidowRowNo->get_value()) : 0, nWidowsWhich );
 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_WIDOWS );
 
 if ( m_xWidowBox->get_state_changed_from_saved() || !pOld || !( 
*static_cast(pOld) == rItem ) )
@@ -1796,14 +1796,14 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
 }
 }
 
-_nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
+TypedWhichId nOrphansWhich = GetWhich( 
SID_ATTR_PARA_ORPHANS );
 eState = m_xOrphanBox->get_state();
 
 if ( m_xOrphanBox->get_state_changed_from_saved() ||
  m_xOrphanRowNo->get_value_changed_from_saved() )
 {
 SvxOrphansItem rItem( eState == TRISTATE_TRUE ?
- 
static_cast(m_xOrphanRowNo->get_value()) : 0, _nWhich );
+ 
static_cast(m_xOrphanRowNo->get_value()) : 0, nOrphansWhich );
 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_ORPHANS );
 
 if ( m_xOrphanBox->get_state_changed_from_saved() ||
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index e7e798df978b..bf6b002f971e 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -560,7 +560,7 @@ SET_FONTALIGNMENT:
 break;
 
 case RTF_EXPND:
-if (const sal_uInt16 wid = aPlainMap[SID_ATTR_CHAR_KERNING])
+if (TypedWhichId wid = 
aPlainMap[SID_ATTR_CHAR_KERNING])
 {
 if( -1 == nTokenValue )
 nTokenValue = 0;
@@ -586,7 +586,7 @@ SET_FONTALIGNMENT:
 break;
 
 case RTF_EXPNDTW:
-if (const sal_uInt16 wid = aPlainMap[SID_ATTR_CHAR_KERNING])
+if (TypedWhichId wid = 
aPlainMap[SID_ATTR_CHAR_KERNING])
 {
 if( -1 == nTokenValue )
 nTokenValue = 0;
diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc
index bf6b33afb4d7..f33972743aa0 100644
--- a/include/editeng/editids.hrc
+++ b/include/editeng/editids.hrc
@@ -50,6 +50,7 @@ class SvxKerningItem;
 class SvxLanguageItem;
 class SvxLineSpacingItem;
 class SvxLRSpaceItem;
+class SvxOrphansItem;
 class SvxOverlineItem;
 class SvxPageModelItem;
 class SvxParaVertAlignItem;
@@ -62,6 +63,7 @@ class SvxTwoLinesItem;
 class SvxUnderlineItem;
 class SvxULSpaceItem;
 class SvxWeightItem;
+class SvxWidowsItem;
 cla

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

2023-05-26 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/htmlexport/data/listItemSubheader.fodt |   31 +++
 sw/qa/extras/htmlexport/htmlexport.cxx  |   48 +--
 sw/source/filter/html/htmlatr.cxx   |   21 +++-
 sw/source/filter/html/htmlnumwriter.cxx |   85 
 sw/source/filter/html/wrthtml.hxx   |3 
 5 files changed, 89 insertions(+), 99 deletions(-)

New commits:
commit c50dfe066318b213c117b862065575c4cee9445f
Author: Mike Kaganski 
AuthorDate: Thu May 25 19:41:32 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri May 26 12:11:19 2023 +0300

tdf#155496: Export list header to (X)HTML using 'display: block' style

This re-implements commit 013a4f1f5c9ea5fb511568c53a7e76d1b365a65d
(sw XHTML export: fix handling of list labels, 2021-05-13), and
instead of not putting headers (ODF 'text:list-header' elements)
into lists, this adds 'style="display: block"' attribute to the
respective list items. This makes sure that the items use proper
list indentation, and produces correct markup.

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

diff --git a/sw/qa/extras/htmlexport/data/listItemSubheader.fodt 
b/sw/qa/extras/htmlexport/data/listItemSubheader.fodt
new file mode 100644
index ..4c68ce887650
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/listItemSubheader.fodt
@@ -0,0 +1,31 @@
+
+
+
+ 
+  
+   
+   
+
+ list 1 item 1
+ 
+  
+   list 1 item 1 sub-header
+  
+ 
+
+   
+   
+   text
+   
+
+ 
+  
+   list 2 sub-header
+  
+ 
+
+   
+   
+  
+ 
+
\ No newline at end of file
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 8c99342a46e3..82b0735dd9bb 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -1468,10 +1468,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testListHeading)
 CPPUNIT_ASSERT(pDoc);
 
 // Without the accompanying fix in place, this test would have failed:
-// - expected: ...
+// - expected: ...
 // - actual  : ...
 // because a  but no  is not well-formed and  with a non-li 
children is invalid.
-assertXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p", "list header");
+OUString aContent
+= getXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
+   "reqif-xhtml:li[@style='display: 
block']/reqif-xhtml:p");
+CPPUNIT_ASSERT_EQUAL(OUString("list header"), aContent.trim());
 }
 
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testPartiallyNumberedList)
@@ -2025,11 +2028,10 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testListsHeading)
 xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
 CPPUNIT_ASSERT(pDoc);
 
-// Without the accompanying fix in place, this test would have failed with:
-// - In <>, XPath '/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p' not 
found
-// Because the headers of list 1 were inside , not directly under 
.
-assertXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p",
-   "list 1, header 1");
+OUString aContent
+= getXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
+   "reqif-xhtml:li[@style='display: 
block']/reqif-xhtml:p");
+CPPUNIT_ASSERT_EQUAL(OUString("list 1, header 1"), aContent.trim());
 }
 
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testOleEmfPreviewToHtml)
@@ -2485,6 +2487,38 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155387)
 "l3");
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155496)
+{
+createSwDoc("listItemSubheader.fodt");
+ExportToReqif();
+
+SvMemoryStream aStream;
+WrapReqifFromTempFile(aStream);
+xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
+// Without the fix in place, this would fail
+CPPUNIT_ASSERT(pDoc);
+
+// Two top-level lists
+assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul", 2);
+// Single top-level item
+assertXPath(pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li");
+// One top-level paragraph in the item
+assertXPath(pDoc,
+
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:p");
+// One sublist in the item
+assertXPath(
+pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul");
+// One item in the sublist
+assertXPath(pDoc,
+
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul/"
+"reqif-xhtml:li");
+// Check its text
+OUString aContent = getXPathContent(
+pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xht

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

2023-05-26 Thread Noel Grandin (via logerrit)
 sd/source/ui/app/sdmod1.cxx  |6 +++---
 sd/source/ui/table/tableobjectbar.cxx|6 +++---
 svx/source/sdr/contact/viewobjectcontact.cxx |4 +++-
 3 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit d1b0dbcbd7016fea59b4a509d95045f643b9eeec
Author: Noel Grandin 
AuthorDate: Fri May 26 08:17:07 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri May 26 10:57:13 2023 +0200

sal_uLong->sal_uInt16

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

diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 573ee853069b..881d5aa1eefd 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -77,7 +77,7 @@ private:
 void SdModule::Execute(SfxRequest& rReq)
 {
 const SfxItemSet* pSet = rReq.GetArgs();
-sal_uLong nSlotId = rReq.GetSlot();
+sal_uInt16 nSlotId = rReq.GetSlot();
 
 switch ( nSlotId )
 {
@@ -160,9 +160,9 @@ void SdModule::Execute(SfxRequest& rReq)
 LanguageType eLanguage = static_cast(pItem)->GetValue();
 SdDrawDocument* pDoc = pDocSh->GetDoc();
 
-if( nSlotId == sal_uInt16(SID_ATTR_CHAR_CJK_LANGUAGE) )
+if( nSlotId == SID_ATTR_CHAR_CJK_LANGUAGE )
 pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE_CJK );
-else if( nSlotId == sal_uInt16(SID_ATTR_CHAR_CTL_LANGUAGE) 
)
+else if( nSlotId == SID_ATTR_CHAR_CTL_LANGUAGE )
 pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE_CTL );
 else
 pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE );
diff --git a/sd/source/ui/table/tableobjectbar.cxx 
b/sd/source/ui/table/tableobjectbar.cxx
index 62d81d9805df..6dfd86928530 100644
--- a/sd/source/ui/table/tableobjectbar.cxx
+++ b/sd/source/ui/table/tableobjectbar.cxx
@@ -116,7 +116,7 @@ void TableObjectBar::Execute( SfxRequest& rReq )
 SfxBindings* pBindings = &mpViewSh->GetViewFrame()->GetBindings();
 
 rtl::Reference< sdr::SelectionController > xController( 
mpView->getSelectionController() );
-sal_uLong nSlotId = rReq.GetSlot();
+sal_uInt16 nSlotId = rReq.GetSlot();
 if( xController.is() )
 {
 switch( nSlotId )
@@ -160,10 +160,10 @@ void TableObjectBar::Execute( SfxRequest& rReq )
 else
 nSlotId = SID_TABLE_INSERT_COL;
 
-rReq.AppendItem(SfxInt16Item(static_cast(nSlotId), 
nCount));
+rReq.AppendItem(SfxInt16Item(nSlotId, nCount));
 rReq.AppendItem(SfxBoolItem(SID_TABLE_PARAM_INSERT_AFTER, 
bInsertAfter));
 
-rReq.SetSlot( static_cast(nSlotId) );
+rReq.SetSlot( nSlotId );
 }
 }
 
commit 8061cd765c7854667550d6aafda5832715648876
Author: Michael Stahl 
AuthorDate: Thu May 25 19:43:56 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri May 26 10:57:03 2023 +0200

tdf#155436 svx: PDF export: fix crash on SdrMediaObj without URL

Both sw and sd don't call CreateScreen() if there is no URL.

(regression from commit e84b310b59825fd572d79def98c3d21566aac603)

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

diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 00f30f4248c5..fb6f0fc73ff1 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -433,7 +434,8 @@ drawinglayer::primitive2d::Primitive2DContainer const & 
ViewObjectContact::getPr
 }
 
 ::std::vector annotIds;
-if (eElement == vcl::PDFWriter::Annot)
+if (eElement == vcl::PDFWriter::Annot
+&& 
!static_cast(pSdrObj)->getURL().isEmpty())
 {
 auto const 
pPDFExtOutDevData(GetObjectContact().GetPDFExtOutDevData());
 assert(pPDFExtOutDevData);


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

2023-05-26 Thread Stephan Bergmann (via logerrit)
 external/libxml2/libxml2-global-symbols.patch |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 7d9b3393e2632247624d8a1e3129365290d1b60b
Author: Stephan Bergmann 
AuthorDate: Fri May 26 09:13:04 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri May 26 10:45:09 2023 +0200

external/libxml2: Fix missing external symbols needed by xmllint

After 5b42f148e206cda19467e76c2f9915fc2b6fa5f6 "ExternalProject_libxml2 
still
needs to build the xmllint executable" (which I had happened to prepare on
macOS, so didn't originally notice the issue addressed here now), Linux 
builds
like  started to 
fail
with

>   CCLD xmllint
> /opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: 
xmllint-xmllint.o: in function `testSAX':
> 
/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/libxml2/xmllint.c:1646:
 undefined reference to `xmlNewSAXParserCtxt'
> /opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: 
xmllint-xmllint.o: in function `myReallocFunc':
> 
/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/libxml2/xmllint.c:357:
 undefined reference to `xmlMemSize'
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:1007: xmllint] Error 1
> make[1]: *** 
[/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/external/libxml2/ExternalProject_libxml2.mk:37:
 
/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/ExternalProject/libxml2/build]
 Error 1

Turns out that those two functions have been introduced after the previously
used libxml2 2.10.4.  No idea how things are supposed to work (given that
workdir/UnpackedTarball/libxml2/libxml2.syms starts off with "Retained for
backward compatibility. Don't add new symbols.", it appears that there 
should be
some other mechanism at play to make xmllint on Linux find the libxml2.so
symbols it needs, but which doesn't work as intended in our build), but 
just add
those two symbols to libxml2.syms for now.  (With a new version named
LIBXML2_2.11.4, even if the symbols can actually have been introduced in 
some
other version between 2.10.4 and 2.11.4, but who cares.)

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

diff --git a/external/libxml2/libxml2-global-symbols.patch 
b/external/libxml2/libxml2-global-symbols.patch
index cfec9c530281..cbbe5a622284 100644
--- a/external/libxml2/libxml2-global-symbols.patch
+++ b/external/libxml2/libxml2-global-symbols.patch
@@ -13,10 +13,16 @@
  } LIBXML2_2.6.28;
  
  LIBXML2_2.6.32 {
-@@ -2231,3 +2231,43 @@
+@@ -2231,3 +2231,49 @@
xmlPopOutputCallbacks;
  } LIBXML2_2.9.8;
  
++LIBXML2_2.11.4 {
++global:
++xmlMemSize;
++xmlNewSAXParserCtxt;
++} LIBXML2_2.9.11;
++
 +# HACK: export global variable accessor functions (globals.h)
 +LIBXML2_GLOBAL_VARIABLES {
 +global:


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

2023-05-26 Thread Xisco Fauli (via logerrit)
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8ce5696c3cf9d7a95da581ebe4b7ebd0d7a114ca
Author: Xisco Fauli 
AuthorDate: Thu May 25 11:15:37 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 26 10:21:28 2023 +0200

desktop: check getDialog()

it might return nullptr

See 
https://crashreport.libreoffice.org/stats/signature/dp_gui::TheExtensionManager::ToTop()

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

diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx 
b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 10a2cfb1f136..e844f09c1b85 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -158,7 +158,8 @@ void TheExtensionManager::SetText( const OUString &rTitle )
 {
 const SolarMutexGuard guard;
 
-getDialog()->set_title( rTitle );
+if (weld::Window* pDialog = getDialog())
+pDialog->set_title( rTitle );
 }
 
 
@@ -166,7 +167,8 @@ void TheExtensionManager::ToTop()
 {
 const SolarMutexGuard guard;
 
-getDialog()->present();
+if (weld::Window* pDialog = getDialog())
+pDialog->present();
 }
 
 void TheExtensionManager::Close()


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

2023-05-26 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8export/ww8export4.cxx   |   22 
 sw/qa/filter/ww8/data/dont-break-wrapped-tables.doc |binary
 sw/qa/filter/ww8/ww8.cxx|   15 +
 sw/source/filter/ww8/wrtww8.cxx |3 ++
 sw/source/filter/ww8/ww8par.cxx |6 +
 sw/source/filter/ww8/ww8scan.cxx|8 +++
 sw/source/filter/ww8/ww8scan.hxx|   11 +-
 7 files changed, 60 insertions(+), 5 deletions(-)

New commits:
commit 63de1ea465ef72ecb8d4a7dcdaf5e92ea875eb00
Author: Miklos Vajna 
AuthorDate: Fri May 26 09:00:05 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 26 10:17:53 2023 +0200

sw floattable: handle fDontBreakWrappedTables in the DOC filter

This is the binary DOC import/export for the functionality added in
commit 08fa2903df1a7cf9a1647fcf967e4c8b57dad793 (sw floattable: add a
DoNotBreakWrappedTables compat flag, 2023-05-24).

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

diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index 9e4551fe872f..4a290a53f2d9 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -120,6 +120,28 @@ DECLARE_WW8EXPORT_TEST(testTdf155465_paraAdjustDistribute, 
"tdf155465_paraAdjust
 CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_LEFT, 
static_cast(nAdjust));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testDontBreakWrappedTables)
+{
+// Given a document with the DO_NOT_BREAK_WRAPPED_TABLES compat mode 
enabled:
+createSwDoc();
+{
+SwDoc* pDoc = getSwDoc();
+IDocumentSettingAccess& rIDSA = pDoc->getIDocumentSettingAccess();
+rIDSA.set(DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES, true);
+}
+
+// When saving to doc:
+reload(mpFilter, "dont-break-wrapped-tables.doc");
+
+// Then make sure the compat flag is serialized:
+SwDoc* pDoc = getSwDoc();
+IDocumentSettingAccess& rIDSA = pDoc->getIDocumentSettingAccess();
+bool bDontBreakWrappedTables = 
rIDSA.get(DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES);
+// Without the accompanying fix in place, this test would have failed, the 
compat flag was not
+// set.
+CPPUNIT_ASSERT(bDontBreakWrappedTables);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/filter/ww8/data/dont-break-wrapped-tables.doc 
b/sw/qa/filter/ww8/data/dont-break-wrapped-tables.doc
new file mode 100644
index ..01f355227274
Binary files /dev/null and 
b/sw/qa/filter/ww8/data/dont-break-wrapped-tables.doc differ
diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx
index 8f6266a86426..253317c0deac 100644
--- a/sw/qa/filter/ww8/ww8.cxx
+++ b/sw/qa/filter/ww8/ww8.cxx
@@ -327,6 +327,21 @@ CPPUNIT_TEST_FIXTURE(Test, testDoNotBreakWrappedTables)
 // i.e.  was not written.
 assertXPath(pXmlDoc, "/w:settings/w:compat/w:doNotBreakWrappedTables", 1);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testDOCfDontBreakWrappedTables)
+{
+// Given a document with fDontBreakWrappedTables:
+// When importing that document:
+createSwDoc("dont-break-wrapped-tables.doc");
+
+// Then make sure that the matching compat flag is set:
+SwDoc* pDoc = getSwDoc();
+IDocumentSettingAccess& rIDSA = pDoc->getIDocumentSettingAccess();
+bool bDontBreakWrappedTables = 
rIDSA.get(DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES);
+// Without the accompanying fix in place, this test would have failed, the 
compat flag was not
+// set.
+CPPUNIT_ASSERT(bDontBreakWrappedTables);
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 6c26910af08f..e22351e477df 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -557,6 +557,9 @@ static void WriteDop( WW8Export& rWrt )
 
 rDop.fExpShRtn = 
!rWrt.m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
 // #i56856#
 
+IDocumentSettingAccess& rIDSA = rWrt.m_rDoc.getIDocumentSettingAccess();
+rDop.fDontBreakWrappedTables = 
rIDSA.get(DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES);
+
 rDop.Write( *rWrt.m_pTableStrm, *rWrt.m_pFib );
 }
 
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 348d95d5cea0..1a328ebf8e54 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1938,6 +1938,12 @@ void SwWW8ImplReader::ImportDop()
 
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::CONTINUOUS_ENDNOTES, 
true);
 // rely on default for HYPHENATE_URLS=false
 
+IDocumentSettingAccess& rIDSA = m_rDoc.getIDocumentSettingAccess();
+if (m_xWDop->fDontBreakWrappedTables)
+{
+   

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

2023-05-26 Thread Armin Le Grand (allotropia) (via logerrit)
 basegfx/source/tools/bgradient.cxx  |  206 +++-
 basegfx/source/tools/gradienttools.cxx  |   97 ---
 include/basegfx/utils/bgradient.hxx |   29 +++-
 include/basegfx/utils/gradienttools.hxx |   11 +
 oox/source/drawingml/fillproperties.cxx |   98 ++-
 5 files changed, 306 insertions(+), 135 deletions(-)

New commits:
commit c2bea1bedd2ee8bc4007fd23c6cb839a692297a7
Author: Armin Le Grand (allotropia) 
AuthorDate: Wed May 24 12:31:48 2023 +0200
Commit: Armin Le Grand 
CommitDate: Fri May 26 10:08:52 2023 +0200

MCGR: Border restoration support

Due to tdf#155362 I added code to be able in case we
would need it to convert a BGradient using added
tooling from having offsets in the GradientSteps
and no border to adapted GradientSteps and border.

This is preferrable due to our GradientStyle_RECT
(and GradientStyle_ELLIPTICAL too) use that 'non-
linear' paint aka move-two-pixels-inside, someone
else called it 'frame-paint'. This does not bode
well with the border being applied 'linear' at the
same time (argh). Thus - while in principle all is
correct when re-importing a GradientStyle_RECT
with a border after export to pptx, it looks
slightly better ('correcter') wen doing so. That is
because when being able to and restoring a border
at least that border part *is* applied linearly.

I took the chance to further apply tooling, move
it to classes involved and instead of awt::Gradient2
use more basegfx::BGradient since it can and does
host tooling. This is also a preparation to be
able to adapt (restore) border in case of turn-
around in ODF where the importing instance is before
MCGR existance and has to handle Start/EndColor.

Needed to take more care with using BGradient instead
of awt::Gradient2 for initialization, also better
dividing/organization of tooling, already preparation
to use for other purposes.

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

diff --git a/basegfx/source/tools/bgradient.cxx 
b/basegfx/source/tools/bgradient.cxx
index 52aa721f36a6..b7ee0780a2cc 100644
--- a/basegfx/source/tools/bgradient.cxx
+++ b/basegfx/source/tools/bgradient.cxx
@@ -563,6 +563,100 @@ void BColorStops::reverseColorStops()
 candidate = BColorStop(1.0 - candidate.getStopOffset(), 
candidate.getStopColor());
 }
 
+// createSpaceAtStart creates fOffset space at start by
+// translating/scaling all entries to the right
+void BColorStops::createSpaceAtStart(double fOffset)
+{
+// nothing to do if empty
+if (empty())
+return;
+
+// correct offset to [0.0 .. 1.0]
+fOffset = std::max(std::min(1.0, fOffset), 0.0);
+
+// nothing to do if 0.0 == offset
+if (basegfx::fTools::equalZero(fOffset))
+return;
+
+BColorStops aNewStops;
+
+for (const auto& candidate : *this)
+{
+aNewStops.emplace_back(fOffset + (candidate.getStopOffset() * (1.0 - 
fOffset)),
+   candidate.getStopColor());
+}
+
+*this = aNewStops;
+}
+
+// removeSpaceAtStart removes fOffset space from start by
+// translating/scaling entries more or equal to fOffset
+// to the left. Entries less than fOffset will be removed
+void BColorStops::removeSpaceAtStart(double fOffset)
+{
+// nothing to do if empty
+if (empty())
+return;
+
+// correct factor to [0.0 .. 1.0]
+fOffset = std::max(std::min(1.0, fOffset), 0.0);
+
+// nothing to do if fOffset == 0.0
+if (basegfx::fTools::equalZero(fOffset))
+return;
+
+BColorStops aNewStops;
+const double fMul(basegfx::fTools::equal(fOffset, 1.0) ? 1.0 : 1.0 / (1.0 
- fOffset));
+
+for (const auto& candidate : *this)
+{
+if (basegfx::fTools::moreOrEqual(candidate.getStopOffset(), fOffset))
+{
+aNewStops.emplace_back((candidate.getStopOffset() - fOffset) * 
fMul,
+   candidate.getStopColor());
+}
+}
+
+*this = aNewStops;
+}
+
+// try to detect if an empty/no-color-change area exists
+// at the start and return offset to it. Returns 0.0 if not.
+double BColorStops::detectPossibleOffsetAtStart() const
+{
+BColor aSingleColor;
+const bool bSingleColor(isSingleColor(aSingleColor));
+
+// no useful offset for single color
+if (bSingleColor)
+return 0.0;
+
+// here we know that we have at least two colors, so we have a
+// color change. Find colors left and right of that first color change
+BColorStops::const_iterator aColorR(begin());
+BColorStops::const_iterator aColorL(aColorR++);
+
+// aColorR would 1st get equal to end(), so no need to also check aColorL
+// for end(). Loop as long as same color. Since we *have* a color change
+// not 

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

2023-05-26 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/htmlexport/data/listItemSubheader.fodt |   31 +++
 sw/qa/extras/htmlexport/htmlexport.cxx  |   48 +--
 sw/source/filter/html/htmlatr.cxx   |   21 +++-
 sw/source/filter/html/htmlnumwriter.cxx |   85 
 sw/source/filter/html/wrthtml.hxx   |3 
 5 files changed, 89 insertions(+), 99 deletions(-)

New commits:
commit 7d87770986fdfc43dd5d4b514f68026ff6ededcf
Author: Mike Kaganski 
AuthorDate: Thu May 25 19:41:32 2023 +0300
Commit: Miklos Vajna 
CommitDate: Fri May 26 09:34:22 2023 +0200

tdf#155496: Export list header to (X)HTML using 'display: block' style

This re-implements commit 013a4f1f5c9ea5fb511568c53a7e76d1b365a65d
(sw XHTML export: fix handling of list labels, 2021-05-13), and
instead of not putting headers (ODF 'text:list-header' elements)
into lists, this adds 'style="display: block"' attribute to the
respective list items. This makes sure that the items use proper
list indentation, and produces correct markup.

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

diff --git a/sw/qa/extras/htmlexport/data/listItemSubheader.fodt 
b/sw/qa/extras/htmlexport/data/listItemSubheader.fodt
new file mode 100644
index ..4c68ce887650
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/listItemSubheader.fodt
@@ -0,0 +1,31 @@
+
+
+
+ 
+  
+   
+   
+
+ list 1 item 1
+ 
+  
+   list 1 item 1 sub-header
+  
+ 
+
+   
+   
+   text
+   
+
+ 
+  
+   list 2 sub-header
+  
+ 
+
+   
+   
+  
+ 
+
\ No newline at end of file
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 710c4c0dc45c..105b19c7ea8d 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -1552,10 +1552,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testListHeading)
 CPPUNIT_ASSERT(pXmlDoc);
 
 // Without the accompanying fix in place, this test would have failed:
-// - expected: ...
+// - expected: ...
 // - actual  : ...
 // because a  but no  is not well-formed and  with a non-li 
children is invalid.
-assertXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p", "list header");
+OUString aContent
+= getXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
+   "reqif-xhtml:li[@style='display: 
block']/reqif-xhtml:p");
+CPPUNIT_ASSERT_EQUAL(OUString("list header"), aContent.trim());
 }
 
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testPartiallyNumberedList)
@@ -2151,11 +2154,10 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testListsHeading)
 xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
 CPPUNIT_ASSERT(pXmlDoc);
 
-// Without the accompanying fix in place, this test would have failed with:
-// - In <>, XPath '/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p' not 
found
-// Because the headers of list 1 were inside , not directly under 
.
-assertXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p",
-   "list 1, header 1");
+OUString aContent
+= getXPathContent(pXmlDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ol/"
+   "reqif-xhtml:li[@style='display: 
block']/reqif-xhtml:p");
+CPPUNIT_ASSERT_EQUAL(OUString("list 1, header 1"), aContent.trim());
 }
 
 CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testOleEmfPreviewToHtml)
@@ -2611,6 +2613,38 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155387)
 "l3");
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155496)
+{
+createSwDoc("listItemSubheader.fodt");
+ExportToReqif();
+
+SvMemoryStream aStream;
+WrapReqifFromTempFile(aStream);
+xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
+// Without the fix in place, this would fail
+CPPUNIT_ASSERT(pDoc);
+
+// Two top-level lists
+assertXPath(pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul", 2);
+// Single top-level item
+assertXPath(pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li");
+// One top-level paragraph in the item
+assertXPath(pDoc,
+
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:p");
+// One sublist in the item
+assertXPath(
+pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul");
+// One item in the sublist
+assertXPath(pDoc,
+
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:ul[1]/reqif-xhtml:li/reqif-xhtml:ul/"
+"reqif-xhtml:li");
+// Check its text
+OUString aContent = getXPathContent(
+pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqi

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

2023-05-26 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/directsql.cxx |   17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 16a8943f7dbf338377fe486cc75116b89742c7b0
Author: Julien Nabet 
AuthorDate: Thu May 25 23:51:04 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri May 26 09:09:53 2023 +0200

tdf#153317: direct SQL: try to detect Bit field in Mysql/MariaDB

Change-Id: I462cb28c15a0cd1d3c93f2335bcac02ca09c78e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152289
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index 9080e63dca3f..a82f8d4c10f8 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -318,8 +318,21 @@ namespace dbaui
 int i = 1;
 for (;;)
 {
-// be dumb, treat everything as a string
-out.append(xRow->getString(i) + ",");
+// be dumb, treat everything as a string unless below
+// tdf#153317, at least "Bit" type in Mysql/MariaDB gives: 
"\000" or "\001"
+// so retrieve Sequence from getBytes, test if it has a 
length of 1 (so we avoid BLOB/CLOB or other complex types)
+// and test if the value of first byte is one of those.
+// In this case, there's a good chance it's a "Bit" field
+// remark: for unknown reason, getByte(i) gives "\000" 
even if the bit is at 1.
+auto seq = xRow->getBytes(i);
+if ((seq.getLength() == 1) && (seq[0] <= 1))
+{
+out.append(OUString::number(static_cast(seq[0])) 
+ ",");
+}
+else
+{
+out.append(xRow->getString(i) + ",");
+}
 i++;
 }
 }


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

2023-05-26 Thread Miklos Vajna (via logerrit)
 sw/source/core/inc/rowfrm.hxx|2 ++
 sw/source/core/layout/tabfrm.cxx |   13 +
 sw/source/core/text/xmldump.cxx  |3 ---
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 0360b9940833609b80b7cf0dd782f124212b01bb
Author: Miklos Vajna 
AuthorDate: Thu May 25 20:23:55 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 26 09:02:39 2023 +0200

sw layout xml dump: extract SwRowFrame::dumpAsXml() from SwFrame

Ideally SwFrame should not really know anything about row frames.

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

diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index ebaae2e1dbc9..a48dacf6a37e 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -122,6 +122,8 @@ public:
 bool IsInSplit() const { return m_bIsInSplit; }
 void SetInSplit(bool bNew = true) { m_bIsInSplit = bNew; }
 void OnFrameSize(const SfxPoolItem&);
+
+void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
 };
 
 #endif
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 10d755d9bbf1..c3ebfacb13f8 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4159,6 +4159,19 @@ void SwRowFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 SwLayoutFrame::MakeAll(pRenderContext);
 }
 
+void SwRowFrame::dumpAsXml(xmlTextWriterPtr writer) const
+{
+(void)xmlTextWriterStartElement(writer, reinterpret_cast("row"));
+dumpAsXmlAttributes(writer);
+
+(void)xmlTextWriterStartElement(writer, BAD_CAST("infos"));
+dumpInfosAsXml(writer);
+(void)xmlTextWriterEndElement(writer);
+dumpChildrenAsXml(writer);
+
+(void)xmlTextWriterEndElement(writer);
+}
+
 tools::Long CalcHeightWithFlys( const SwFrame *pFrame )
 {
 SwRectFnSet aRectFnSet(pFrame);
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index a37eb6578cc1..4e1016522884 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -174,9 +174,6 @@ void SwFrame::dumpAsXml( xmlTextWriterPtr writer ) const
 
 switch ( GetType(  ) )
 {
-case SwFrameType::Row:
-name = "row";
-break;
 case SwFrameType::Cell:
 name = "cell";
 break;