core.git: oox/source

2024-04-26 Thread Noel Grandin (via logerrit)
 oox/source/drawingml/table/predefined-table-styles.cxx |  352 -
 1 file changed, 175 insertions(+), 177 deletions(-)

New commits:
commit 54fced70718828bb73f5485b54445501ebf4fcdc
Author: Noel Grandin 
AuthorDate: Thu Apr 25 20:46:31 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 26 12:09:27 2024 +0200

mStyleIdMap can be static const

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

diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx 
b/oox/source/drawingml/table/predefined-table-styles.cxx
index 3e821456e3b3..6ca69eb958e4 100644
--- a/oox/source/drawingml/table/predefined-table-styles.cxx
+++ b/oox/source/drawingml/table/predefined-table-styles.cxx
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace oox;
 using namespace oox::drawingml::table;
@@ -29,173 +30,170 @@ using namespace oox::drawingml::table;
  * and change something easily when some styles change.
  */
 
-std::map> mStyleIdMap;
-
 // Create style-id map for using similar attributes of the groups.
 // (style ids used from here: 
https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/hh273476(v=office.14)?redirectedfrom=MSDN)
 // and checked all of them.
 
-static void createStyleIdMap()
-{
-mStyleIdMap[OUString("{2D5ABB26-0587-4C30-8999-92F81FD0307C}")]
-= std::make_pair(OUString("Themed-Style-1"), OUString(""));
-mStyleIdMap[OUString("{3C2FFA5D-87B4-456A-9821-1D502468CF0F}")]
-= std::make_pair(OUString("Themed-Style-1"), OUString("Accent1"));
-mStyleIdMap[OUString("{284E427A-3D55-4303-BF80-6455036E1DE7}")]
-= std::make_pair(OUString("Themed-Style-1"), OUString("Accent2"));
-mStyleIdMap[OUString("{69C7853C-536D-4A76-A0AE-DD22124D55A5}")]
-= std::make_pair(OUString("Themed-Style-1"), OUString("Accent3"));
-mStyleIdMap[OUString("{775DCB02-9BB8-47FD-8907-85C794F793BA}")]
-= std::make_pair(OUString("Themed-Style-1"), OUString("Accent4"));
-mStyleIdMap[OUString("{35758FB7-9AC5-4552-8A53-C91805E547FA}")]
-= std::make_pair(OUString("Themed-Style-1"), OUString("Accent5"));
-mStyleIdMap[OUString("{08FB837D-C827-4EFA-A057-4D05807E0F7C}")]
-= std::make_pair(OUString("Themed-Style-1"), OUString("Accent6"));
-
-mStyleIdMap[OUString("{5940675A-B579-460E-94D1-54222C63F5DA}")]
-= std::make_pair(OUString("Themed-Style-2"), OUString(""));
-mStyleIdMap[OUString("{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}")]
-= std::make_pair(OUString("Themed-Style-2"), OUString("Accent1"));
-mStyleIdMap[OUString("{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}")]
-= std::make_pair(OUString("Themed-Style-2"), OUString("Accent2"));
-mStyleIdMap[OUString("{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}")]
-= std::make_pair(OUString("Themed-Style-2"), OUString("Accent3"));
-mStyleIdMap[OUString("{E269D01E-BC32-4049-B463-5C60D7B0CCD2}")]
-= std::make_pair(OUString("Themed-Style-2"), OUString("Accent4"));
-mStyleIdMap[OUString("{327F97BB-C833-4FB7-BDE5-3F7075034690}")]
-= std::make_pair(OUString("Themed-Style-2"), OUString("Accent5"));
-mStyleIdMap[OUString("{638B1855-1B75-4FBE-930C-398BA8C253C6}")]
-= std::make_pair(OUString("Themed-Style-2"), OUString("Accent6"));
-
-mStyleIdMap[OUString("{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}")]
-= std::make_pair(OUString("Light-Style-1"), OUString(""));
-mStyleIdMap[OUString("{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}")]
-= std::make_pair(OUString("Light-Style-1"), OUString("Accent1"));
-mStyleIdMap[OUString("{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}")]
-= std::make_pair(OUString("Light-Style-1"), OUString("Accent2"));
-mStyleIdMap[OUString("{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}")]
-= std::make_pair(OUString("Light-Style-1"), OUString("Accent3"));
-mStyleIdMap[OUString("{D27102A9-8310-4765-A935-A1911B00CA55}")]
-= std::make_pair(OUString("Light-Style-1"), OUString("Accent4"));
-mStyleIdMap[OUString("{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}")]
-= std::make_pair(OUString("Light-Style-1"), OUString("Accent5"));
-mStyleIdMap[OUString("{68D230F3-CF80-4859-8CE7-A43EE81993B5}")]
-= std::make_pair(OUString("Light-Style-1"), OUString("Accent6"));
-
-mStyleIdMap[OUString("{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}")]
-= std::make_pair(OUString("Light-Style-2"), OUString(""));
-mStyleIdMap[OUString("{69012ECD-51FC-41F1-AA8D-1B2483CD663E}")]
-= std::make_pair(OUString("Light-Style-2"), OUString("Accent1"));
-mStyleIdMap[OUString("{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}")]
-= std::make_pair(OUString("Light-Style-2"), OUString("Accent2"));
-mStyleIdMap[OUString("{F2DE63D5-997A-4646-A377-4702673A728D}")]
-= std::make_pair(OUString("Light-Style-2"), OUString("Accent3"));

core.git: oox/source sc/qa

2024-04-12 Thread Mike Kaganski (via logerrit)
 oox/source/drawingml/drawingmltypes.cxx |   12 +---
 oox/source/export/drawingml.cxx |   18 +-
 sc/qa/unit/subsequent_export_test3.cxx  |8 
 3 files changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 6e3ed71f906c3571a6b6efb5335c26807b566a42
Author: Mike Kaganski 
AuthorDate: Fri Apr 12 09:16:12 2024 +0100
Commit: Mike Kaganski 
CommitDate: Sat Apr 13 01:19:00 2024 +0200

Use o3tl::convert in oox

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

diff --git a/oox/source/drawingml/drawingmltypes.cxx 
b/oox/source/drawingml/drawingmltypes.cxx
index 30fed83f4391..04668c6b9a72 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -92,22 +92,20 @@ float GetTextSize( std::u16string_view sValue )
 return fRet;
 }
 
-/** converts the ST_TextSpacingPoint to 1/100mm */
+/** converts the ST_TextSpacingPoint (1/100pt) to 1/100mm */
 sal_Int32 GetTextSpacingPoint( std::u16string_view sValue )
 {
 sal_Int32 nRet;
-if( ::sax::Converter::convertNumber( nRet, sValue, (SAL_MIN_INT32 + 360) / 
254, (SAL_MAX_INT32 - 360) / 254 ) )
+if( ::sax::Converter::convertNumber( nRet, sValue ) )
 nRet = GetTextSpacingPoint( nRet );
 return nRet;
 }
 
 sal_Int32 GetTextSpacingPoint(sal_Int32 nValue)
 {
-if (nValue > 0)
-nValue = (nValue * 254 + 360);
-else if (nValue < 0)
-nValue = (nValue * 254 - 360);
-return nValue / 720;
+constexpr auto mdFromPt = o3tl::getConversionMulDiv(o3tl::Length::pt, 
o3tl::Length::mm100);
+constexpr o3tl::detail::m_and_d md(mdFromPt.first, mdFromPt.second * 100);
+return o3tl::convertNarrowing(nValue);
 }
 
 float GetFontHeight( sal_Int32 nHeight )
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 92aa84438e62..d14fd037f237 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -167,6 +167,14 @@ const char* g_aPredefinedClrNames[] = {
 "hlink",
 "folHlink",
 };
+
+/** converts 1/100mm to the ST_TextSpacingPoint (1/100pt) */
+sal_Int64 toTextSpacingPoint(sal_Int64 mm100)
+{
+constexpr auto mdToPt = o3tl::getConversionMulDiv(o3tl::Length::mm100, 
o3tl::Length::pt);
+constexpr o3tl::detail::m_and_d md(mdToPt.first * 100, mdToPt.second);
+return o3tl::convert(mm100, md.m, md.d);
+}
 }
 
 namespace oox::drawingml {
@@ -2491,7 +2499,7 @@ void DrawingML::WriteRunProperties( const Reference< 
XPropertySet >& rRun, bool
 *therefore to get original value CharKerning need to be convert.
 *
https://opengrok.libreoffice.org/xref/core/oox/source/drawingml/drawingmltypes.cxx#95
 **/
-nCharKerning = ((nCharKerning * 720)-360) / 254;
+nCharKerning = toTextSpacingPoint(nCharKerning);
 
 if ((bComplex && GetProperty(rXPropSet, "CharWeightComplex"))
 || GetProperty(rXPropSet, "CharWeight"))
@@ -3445,7 +3453,7 @@ void DrawingML::WriteLinespacing(const LineSpacing& 
rSpacing, float fFirstCharHe
XML_val, 
OString::number(static_cast(rSpacing.Height)*1000));
 }
 else if (rSpacing.Mode == LineSpacingMode::MINIMUM
- && fFirstCharHeight > static_cast(rSpacing.Height) * 0.001 
* 72.0 / 2.54)
+ && fFirstCharHeight > o3tl::convert(rSpacing.Height, 
o3tl::Length::mm100, o3tl::Length::pt))
 {
 // 100% proportional line spacing = single line spacing
 mpFS->singleElementNS(XML_a, XML_spcPct, XML_val,
@@ -3454,7 +3462,7 @@ void DrawingML::WriteLinespacing(const LineSpacing& 
rSpacing, float fFirstCharHe
 else
 {
 mpFS->singleElementNS( XML_a, XML_spcPts,
-   XML_val, 
OString::number(std::lround(rSpacing.Height / 25.4 * 72)));
+   XML_val, 
OString::number(toTextSpacingPoint(rSpacing.Height)));
 }
 }
 
@@ -3582,7 +3590,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
 mpFS->startElementNS(XML_a, XML_spcBef);
 {
 mpFS->singleElementNS( XML_a, XML_spcPts,
-   XML_val, 
OString::number(std::lround(nParaTopMargin / 25.4 * 72)));
+   XML_val, 
OString::number(toTextSpacingPoint(nParaTopMargin)));
 }
 mpFS->endElementNS( XML_a, XML_spcBef );
 }
@@ -3592,7 +3600,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
 mpFS->startElementNS(XML_a, XML_spcAft);
 {
 mpFS->singleElementNS( XML_a, XML_spcPts,
-   XML_val, 
OString::number(std::lround(nParaBottomMargin / 25.4 * 72)));
+   XML_val, 
OString::number(toTextSpacingPoint(nParaBottomMargin)));
 }
 mpFS->endElementNS( XML_a, XML_spcAft );
 }
diff 

core.git: oox/source

2024-04-09 Thread Gabor Kelemen (via logerrit)
 oox/source/core/filterbase.cxx   |1 -
 oox/source/core/xmlfilterbase.cxx|1 -
 oox/source/drawingml/chart/chartspaceconverter.cxx   |1 -
 oox/source/drawingml/chart/objectformatter.cxx   |1 -
 oox/source/drawingml/chart/titleconverter.cxx|1 -
 oox/source/drawingml/clrschemecontext.cxx|2 --
 oox/source/drawingml/connectorshapecontext.cxx   |4 
 oox/source/drawingml/diagram/constraintlistcontext.cxx   |2 --
 oox/source/drawingml/diagram/datamodelcontext.cxx|1 -
 oox/source/drawingml/diagram/diagramdefinitioncontext.cxx|2 --
 oox/source/drawingml/diagram/diagramfragmenthandler.cxx  |2 --
 oox/source/drawingml/diagram/layoutatomvisitorbase.cxx   |1 -
 oox/source/drawingml/diagram/layoutatomvisitors.cxx  |2 --
 oox/source/drawingml/diagram/layoutnodecontext.cxx   |2 --
 oox/source/drawingml/effectpropertiescontext.cxx |1 -
 oox/source/drawingml/graphicshapecontext.cxx |3 ---
 oox/source/drawingml/guidcontext.cxx |2 --
 oox/source/drawingml/hyperlinkcontext.cxx|2 --
 oox/source/drawingml/linepropertiescontext.cxx   |2 --
 oox/source/drawingml/misccontexts.cxx|1 -
 oox/source/drawingml/objectdefaultcontext.cxx|2 --
 oox/source/drawingml/scene3dcontext.cxx  |2 --
 oox/source/drawingml/shape3dproperties.cxx   |2 --
 oox/source/drawingml/shapecontext.cxx|4 
 oox/source/drawingml/shapegroupcontext.cxx   |3 ---
 oox/source/drawingml/shapepropertiescontext.cxx  |2 --
 oox/source/drawingml/shapestylecontext.cxx   |2 --
 oox/source/drawingml/spdefcontext.cxx|1 -
 oox/source/drawingml/table/tablebackgroundstylecontext.cxx   |1 -
 oox/source/drawingml/table/tablepartstylecontext.cxx |2 --
 oox/source/drawingml/table/tablerow.cxx  |3 ---
 oox/source/drawingml/table/tablestylecellstylecontext.cxx|1 -
 oox/source/drawingml/table/tablestylecontext.cxx |2 --
 oox/source/drawingml/table/tablestylelistfragmenthandler.cxx |1 -
 oox/source/drawingml/table/tablestylepart.cxx|1 -
 oox/source/drawingml/table/tablestyletextstylecontext.cxx|2 --
 oox/source/drawingml/textbodypropertiescontext.cxx   |1 -
 oox/source/drawingml/textcharacterpropertiescontext.cxx  |2 --
 oox/source/drawingml/textfieldcontext.cxx|2 --
 oox/source/drawingml/textliststylecontext.cxx|2 --
 oox/source/drawingml/textspacingcontext.cxx  |1 -
 oox/source/drawingml/texttabstoplistcontext.cxx  |1 -
 oox/source/drawingml/themeelementscontext.cxx|1 -
 oox/source/dump/dumperbase.cxx   |2 --
 oox/source/export/shapes.cxx |1 -
 oox/source/helper/containerhelper.cxx|1 -
 oox/source/helper/graphichelper.cxx  |1 -
 oox/source/helper/zipstorage.cxx |1 -
 oox/source/ole/vbahelper.cxx |2 --
 oox/source/ole/vbamodule.cxx |1 -
 oox/source/ppt/animationtypes.cxx|1 -
 oox/source/ppt/animvariantcontext.cxx|1 -
 oox/source/ppt/backgroundproperties.cxx  |2 --
 oox/source/ppt/extdrawingfragmenthandler.cxx |2 --
 oox/source/ppt/headerfootercontext.cxx   |2 --
 oox/source/ppt/layoutfragmenthandler.cxx |3 ---
 oox/source/ppt/pptgraphicshapecontext.cxx|1 -
 oox/source/ppt/pptshapecontext.cxx   |1 -
 oox/source/ppt/pptshapegroupcontext.cxx  |2 --
 oox/source/ppt/pptshapepropertiescontext.cxx |1 -
 oox/source/ppt/slidemastertextstylescontext.cxx  |1 -
 oox/source/ppt/slidetimingcontext.cxx|4 
 oox/source/ppt/slidetransitioncontext.cxx|3 ---
 oox/source/ppt/soundactioncontext.cxx|1 -
 oox/source/ppt/timeanimvaluecontext.cxx  |2 --
 oox/source/ppt/timenodelistcontext.cxx   |1 -
 oox/source/ppt/timetargetelementcontext.cxx  |1 -
 67 files changed, 113 deletions(-)

New commits:
commit 9a4eead9958d887d37a5c9bab9465cc6ddd0b213
Author: Gabor Kelemen 
AuthorDate: Sun Mar 31 11:30:14 2024 +0200
Commit: Gabor Kelemen 

core.git: oox/source sd/qa sd/source

2024-03-29 Thread Tibor Nagy (via logerrit)
 oox/source/drawingml/shape.cxx  |   11 +++
 sd/qa/unit/data/pptx/tdf157285.pptx |binary
 sd/qa/unit/data/xml/n819614_0.xml   |2 +-
 sd/qa/unit/import-tests2.cxx|   23 +++
 sd/source/ui/unoidl/unopage.cxx |5 +
 5 files changed, 40 insertions(+), 1 deletion(-)

New commits:
commit 40d3d510fca99b555381deb74b9915c91c924de5
Author: Tibor Nagy 
AuthorDate: Fri Mar 29 15:19:10 2024 +0100
Commit: Nagy Tibor 
CommitDate: Fri Mar 29 23:38:18 2024 +0100

tdf#157285 PPTX import: fix placeholder height

The "TextAutoGrowHeight" property doesn't shrink the shape automatically
when its content is smaller than the current size.

Change-Id: Ia7f94d7452d1a1c3f004aebd73b6ed5cbfd9b43b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165551
Tested-by: Jenkins
Reviewed-by: Nagy Tibor 

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index bd81fa9b42bf..23be28b546b6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1251,6 +1251,17 @@ Reference< XShape > const & Shape::createAndInsert(
 {
 xSet->setPropertyValue("Decorative", Any(m_isDecorative));
 }
+
+// set the placeholder height to "0" if it has the 
'TextAutoGrowHeight' property
+// the placeholder height is set later to the correct size.
+bool bAutoGrowHeight = false;
+xSet->getPropertyValue("TextAutoGrowHeight") >>= bAutoGrowHeight;
+if (bAutoGrowHeight && 
mxShape->getShapeType().startsWith("com.sun.star.presentation."))
+{
+awt::Size aSize(mxShape->getSize().Width, 0);
+mxShape->setSize(aSize);
+}
+
 if (aServiceName != "com.sun.star.text.TextFrame")
 rxShapes->add( mxShape );
 
diff --git a/sd/qa/unit/data/pptx/tdf157285.pptx 
b/sd/qa/unit/data/pptx/tdf157285.pptx
new file mode 100644
index ..7fa9ec88f1b0
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf157285.pptx differ
diff --git a/sd/qa/unit/data/xml/n819614_0.xml 
b/sd/qa/unit/data/xml/n819614_0.xml
index c889b00c343a..0fa127c07d9b 100644
--- a/sd/qa/unit/data/xml/n819614_0.xml
+++ b/sd/qa/unit/data/xml/n819614_0.xml
@@ -1,6 +1,6 @@
 
 
- 
+ 
   
   
   
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index bf3cfee14dad..9ade40ad1917 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -74,6 +74,29 @@ protected:
 bool checkPattern(int nShapeNumber, std::vector& rExpected);
 };
 
+CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf157285)
+{
+createSdImpressDoc("pptx/tdf157285.pptx");
+
+uno::Reference xShape1(getShapeFromPage(0, 0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShape1.is());
+sal_Int32 nHeight1 = xShape1->getSize().Height;
+
+// Without the fix in place, this test would have failed with
+// Expected: placeholder height: 2541
+// Actual  : placeholder height: 3435
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2541), nHeight1);
+
+uno::Reference xShape2(getShapeFromPage(1, 0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShape2.is());
+sal_Int32 nHeight2 = xShape2->getSize().Height;
+
+// Without the fix in place, this test would have failed with
+// Expected: placeholder height: 1169
+// Actual  : placeholder height: 11303
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1169), nHeight2);
+}
+
 CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf152186)
 {
 createSdImpressDoc("pptx/tdf152186.pptx");
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 1462e08e369e..569116c96b61 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -486,6 +486,11 @@ rtl::Reference 
SdGenericDrawPage::CreateSdrObject_( const Reference<
 
 ::tools::Rectangle aRect( eObjKind == PresObjKind::Title ? 
GetPage()->GetTitleRect() : GetPage()->GetLayoutRect()  );
 
+// OOXML placeholder with auto grow height
+// do not set the height here yet
+if (xShape->getSize().Height == 0)
+aRect.setHeight(0);
+
 const awt::Point aPos( aRect.Left(), aRect.Top() );
 xShape->setPosition( aPos );
 


core.git: oox/source

2024-03-29 Thread Aaron Bourdeaux (via logerrit)
 oox/source/drawingml/customshapeproperties.cxx |2 +-
 oox/source/helper/propertymap.cxx  |2 +-
 oox/source/shape/WpsContext.cxx|8 
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 6c358c28c5cc2d1d8d8bb9d1238e3546a9bf3ce8
Author: Aaron Bourdeaux 
AuthorDate: Thu Mar 28 14:32:45 2024 -0400
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Fri Mar 29 14:58:23 2024 +0100

tdf#158237 Use C++20 contains() instead of find() and end()

Change-Id: I529096d97991a89bdc68ec7f5d490ec21744fc6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165499
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index 862ffd8624a3..a3e2dd5e10bb 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -111,7 +111,7 @@ void CustomShapeProperties::pushToPropSet(
 PropertyMap aPropertyMap;
 PropertySet aPropSet( xPropSet );
 
-if (maPresetDataMap.find(mnShapePresetType) != maPresetDataMap.end())
+if (maPresetDataMap.contains(mnShapePresetType))
 {
 SAL_INFO(
 "oox.drawingml",
diff --git a/oox/source/helper/propertymap.cxx 
b/oox/source/helper/propertymap.cxx
index d5a89e6f2388..d93fb41209bf 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -171,7 +171,7 @@ Property SAL_CALL GenericPropertySet::getPropertyByName( 
const OUString& rProper
 
 sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& 
rPropertyName )
 {
-return maPropMap.find( rPropertyName ) != maPropMap.end();
+return maPropMap.contains(rPropertyName);
 }
 
 } // namespace
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 6d7b3d117fc4..37c58d25029e 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -203,7 +203,7 @@ void lcl_getFillDetailsFromPropSeq(const 
uno::Sequence& rT
 if (!rTextFillSeq.hasElements())
 return;
 comphelper::SequenceAsHashMap aTextFillMap(rTextFillSeq);
-if (aTextFillMap.find(u"noFill"_ustr) != aTextFillMap.end())
+if (aTextFillMap.contains(u"noFill"_ustr))
 {
 rFillProperties.moFillType = oox::XML_noFill;
 return;
@@ -308,11 +308,11 @@ void lcl_getLineDetailsFromPropSeq(const 
uno::Sequence& rT
 
 // LineJoint
 comphelper::SequenceAsHashMap aTextOutlineMap(rTextOutlineSeq);
-if (aTextOutlineMap.find(u"bevel"_ustr) != aTextOutlineMap.end())
+if (aTextOutlineMap.contains(u"bevel"_ustr))
 rLineProperties.moLineJoint = oox::XML_bevel;
-else if (aTextOutlineMap.find(u"round"_ustr) != aTextOutlineMap.end())
+else if (aTextOutlineMap.contains(u"round"_ustr))
 rLineProperties.moLineJoint = oox::XML_round;
-else if (aTextOutlineMap.find(u"miter"_ustr) != aTextOutlineMap.end())
+else if (aTextOutlineMap.contains(u"miter"_ustr))
 {
 // LineProperties has no member to store a miter limit. Therefore some 
heuristic is
 // added here. 0 is default for attribute "lim" in MS Office. It is 
rendered same as bevel.


core.git: oox/source

2024-03-22 Thread Regina Henschel (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9556504b213519e2900e72c81aa26a470dc6353c
Author: Regina Henschel 
AuthorDate: Fri Mar 22 00:52:25 2024 +0100
Commit: Regina Henschel 
CommitDate: Fri Mar 22 10:21:32 2024 +0100

Revert "extruded shape import: tweak threePt light rig too"

This reverts commit aa341e79ee241fec0b5afe159b0c674cf85a52c0.

Reason for revert: The front faces become too light. A similar front face 
is more important than lighter extrusion faces.

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index cb0a85eb7ed0..acddea7643c4 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -840,10 +840,10 @@ void lcl_tweakLightRig(std::vector& 
rLightDirVec, PrstLightR
 rLightRig.fAmbient = 0.35; // instead 0.11 resp. 0.13
 }
 else if (rLightRig.sLightRigName == u"freezing" || rLightRig.sLightRigName 
== u"morning"
- || rLightRig.sLightRigName == u"sunrise" || 
rLightRig.sLightRigName == u"threePt")
+ || rLightRig.sLightRigName == u"sunrise")
 {
-// These rigs have no ambient color but three or four lights. The 
objects are too dark with
-// only two lights.
+// These rigs have no ambient color but four lights. The objects are 
too dark with only
+// two lights.
 rLightRig.fAmbient = 0.4;
 }
 else if (rLightRig.sLightRigName == u"sunset")


core.git: oox/source

2024-03-21 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a85aeb1b8354ad6c4da23fe5947147991a573aa5
Author: Andrea Gelmini 
AuthorDate: Wed Mar 20 22:34:33 2024 +0100
Commit: Julien Nabet 
CommitDate: Thu Mar 21 08:33:43 2024 +0100

Fix typo

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index eff649a71cd7..cb0a85eb7ed0 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -946,7 +946,7 @@ void Scene3DHelper::setLightingProperties(const 
oox::drawingml::Shape3DPropertie
 
 namespace
 /** This struct is used to hold material values for extruded custom shapes. 
Because we cannot yet
-render all material propertes MS Office uses, the values are adapted to 
our current abilities.*/
+render all material properties MS Office uses, the values are adapted to 
our current abilities.*/
 {
 struct MaterialValues
 {


core.git: oox/source

2024-03-19 Thread Regina Henschel (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit aa341e79ee241fec0b5afe159b0c674cf85a52c0
Author: Regina Henschel 
AuthorDate: Mon Mar 18 19:52:02 2024 +0100
Commit: Regina Henschel 
CommitDate: Tue Mar 19 12:13:19 2024 +0100

extruded shape import: tweak threePt light rig too

This is an addition to commit 98b06ed3. The light rig 'threePt' has the
same problem that with only two lights the shapes are too dark.
I simply overlooked this rig.

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index cfea2e93613b..d2b03ae97485 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -837,10 +837,10 @@ void lcl_tweakLightRig(std::vector& 
rLightDirVec, PrstLightR
 rLightRig.fAmbient = 0.35; // instead 0.11 resp. 0.13
 }
 else if (rLightRig.sLightRigName == u"freezing" || rLightRig.sLightRigName 
== u"morning"
- || rLightRig.sLightRigName == u"sunrise")
+ || rLightRig.sLightRigName == u"sunrise" || 
rLightRig.sLightRigName == u"threePt")
 {
-// These rigs have no ambient color but four lights. The objects are 
too dark with only
-// two lights.
+// These rigs have no ambient color but three or four lights. The 
objects are too dark with
+// only two lights.
 rLightRig.fAmbient = 0.4;
 }
 else if (rLightRig.sLightRigName == u"sunset")


core.git: oox/source

2024-03-14 Thread Julien Nabet (via logerrit)
 oox/source/core/filterbase.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2887ffbf240aa70330cb50bf810170cf9c896405
Author: Julien Nabet 
AuthorDate: Thu Mar 14 12:20:05 2024 +0100
Commit: Miklos Vajna 
CommitDate: Thu Mar 14 15:33:15 2024 +0100

tdf#160192: fix crash when trying to overwrite file in RO dir+lock file

Bug exposed with:
5259ab8104cfba60c40748ed0cd59d93df038c5b
sfx2 store: create temp files next to local files

bt:
6  0x7faac67ad9b5 in 
sax_fastparser::FastSaxSerializer::FastSaxSerializer(com::sun::star::uno::Reference
 const&) (this=0x559f316f0e70, xOutputStream=empty uno::Reference)
at sax/source/tools/fastserializer.cxx:68
7  0x7faac67c46e0 in 
sax_fastparser::FastSerializerHelper::FastSerializerHelper(com::sun::star::uno::Reference
 const&, bool)
(this=0x559f31721400, xOutputStream=empty uno::Reference, 
bWriteHeader=true) at sax/source/tools/fshelper.cxx:30
8  0x7fa9bfa1b4cc in 
std::_Construct, bool 
const&>(sax_fastparser::FastSerializerHelper*, 
com::sun::star::uno::Reference&&, bool 
const&) (__p=0x559f31721400, __args=..., __args=@0x7ffecd609207: true)
at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:119
...
15 0x7fa9bfa04087 in 
oox::core::XmlFilterBase::openFragmentStreamWithSerializer(rtl::OUString 
const&, rtl::OUString const&)
(this=0x559f318ed5f0, rStreamName="docProps/core.xml", 
rMediaType="application/vnd.openxmlformats-package.core-properties+xml") at 
oox/source/core/xmlfilterbase.cxx:511
16 0x7fa9bfa04999 in 
oox::core::writeCoreProperties(oox::core::XmlFilterBase&, 
com::sun::star::uno::Reference 
const&)
(rSelf=..., xProperties=uno::Reference to ((anonymous 
namespace)::SfxDocumentMetaData *) 0x559f2d673e28) at 
oox/source/core/xmlfilterbase.cxx:645
17 0x7fa9bfa047c2 in 
oox::core::XmlFilterBase::exportDocumentProperties(com::sun::star::uno::Reference
 const&, bool)
(this=0x559f318ed5f0, xProperties=uno::Reference to ((anonymous 
namespace)::SfxDocumentMetaData *) 0x559f2d673e28, 
bSecurityOptOpenReadOnly=false) at oox/source/core/xmlfilterbase.cxx:981
18 0x7fa9bee21bd4 in DocxExport::WriteProperties() 
(this=0x7ffecd609d78) at sw/source/filter/ww8/docxexport.cxx:952
19 0x7fa9bee24b0b in DocxExport::DocxExport(DocxExportFilter&, SwDoc&, 
std::shared_ptr&, SwPaM&, bool, bool)
(this=0x7ffecd609d78, rFilter=..., rDocument=..., 
pCurrentPam=std::shared_ptr (use count 1, weak count 1) = {...}, 
rOriginalPam=SwPaM = {...}, bDocm=false, bTemplate=false)
at sw/source/filter/ww8/docxexport.cxx:2149
20 0x7fa9bee4438e in DocxExportFilter::exportDocument() 
(this=0x559f318ed5f0) at sw/source/filter/ww8/docxexportfilter.cxx:112
21 0x7fa9bf9d6b8b in 
oox::core::FilterBase::filter(com::sun::star::uno::Sequence
 const&) (this=0x559f318ed5f0, rMediaDescSeq=uno::Sequence of length 12 = {...})
at oox/source/core/filterbase.cxx:494

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

Patch prevents LO from crashing + make LO displays error message:
Error saving the document :
Write Error.
The file could not be written

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

diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 6a2a51e47577..1fafb6ac9e4f 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -491,7 +491,7 @@ sal_Bool SAL_CALL FilterBase::filter( const Sequence< 
PropertyValue >& rMediaDes
 if( mxImpl->mxOutStream.is() )
 {
 mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream 
);
-bRet = mxImpl->mxStorage && exportDocument() && 
implFinalizeExport( getMediaDescriptor() );
+bRet = mxImpl->mxStorage && mxImpl->mxStorage->isStorage() 
&& exportDocument() && implFinalizeExport( getMediaDescriptor() );
 }
 break;
 }


core.git: oox/source

2024-03-14 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 4176b89523efd0052b2a8c817f816d316797d3a0
Author: Andrea Gelmini 
AuthorDate: Thu Mar 14 12:58:54 2024 +0100
Commit: Julien Nabet 
CommitDate: Thu Mar 14 13:45:32 2024 +0100

Fix typos

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index 39a6217c9ae6..cfea2e93613b 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -688,9 +688,9 @@ void lcl_getLightDirectionsFromRig(const 
PrstLightRigValues& rLightRig,
 
 /** Converts the directions from MSO specification to coordinates in the shape 
coordinate system.
 @details The extruded shape uses a left-hand Cartesian coordinate system 
with x-axis right, y-axis
-down and z-axis towards observer. When L(Lx,Ly,Lz) is the specified ligth 
direction, then
+down and z-axis towards observer. When L(Lx,Ly,Lz) is the specified light 
direction, then
 V(-Ly, -Lx, Lz) is the direction in the shape coordinate system.
-@param [in,out] rLightDirVec contains for each indiviual light its 
direction.*/
+@param [in,out] rLightDirVec contains for each individual light its 
direction.*/
 void lcl_AdaptAndNormalizeLightDirections(std::vector& 
rLightDirVec)
 {
 basegfx::B3DHomMatrix aTransform; // unit matrix
@@ -747,7 +747,7 @@ void 
lcl_ApplyShapeRotationToLights(std::vector& rLightDirVe
 have an element 'rot', that describes a rotation by spherical 
coordinates 'lat', 'lon' and
 'rev'. The element has precedence over the attribute.
 @param [in] p3DProperties contains info about light rig.
-@param {in, out] rLightDirVec contains for each indiviual light its 
direction in shape coordinate
+@param {in, out] rLightDirVec contains for each individual light its 
direction in shape coordinate
 system with x-axis right, y-axis down, z-axis toward observer.*/
 void lcl_IncorporateRigRotationIntoLightDirections(
 const oox::drawingml::Shape3DPropertiesPtr p3DProperties,


core.git: oox/source

2024-03-14 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/shape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit be29cfe3663d81b579895acade39adb089b942d1
Author: Andrea Gelmini 
AuthorDate: Thu Mar 14 12:58:30 2024 +0100
Commit: Julien Nabet 
CommitDate: Thu Mar 14 13:45:01 2024 +0100

Fix typo

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

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index aaf26527db5b..195b85f893df 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1471,7 +1471,7 @@ Reference< XShape > const & Shape::createAndInsert(
 xSet->setPropertyValue( rPropName, Any( false ) );
 
 // For extruded shapes, MSO uses the line color if no extrusion color 
is specified. LO uses
-// fill color in 'automatic' case. Thus we set extrusion color 
explicitely.
+// fill color in 'automatic' case. Thus we set extrusion color 
explicitly.
 if (bHas3DEffect && !aExtrusionColor.isUsed())
 {
 const OUString& rFillColor2PropName = 
PropertyMap::getPropertyName(PROP_FillColor2);


core.git: oox/source

2024-03-14 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ec99dac5c4e0d7e93b54a4a3043ac16a6054c2d5
Author: Andrea Gelmini 
AuthorDate: Thu Mar 14 13:00:18 2024 +0100
Commit: Julien Nabet 
CommitDate: Thu Mar 14 13:44:10 2024 +0100

Fix typo

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index 8f2d41b9bb12..39a6217c9ae6 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -734,7 +734,7 @@ void 
lcl_ApplyShapeRotationToLights(std::vector& rLightDirVe
 const double& fY, const double& fZ)
 {
 basegfx::B3DHomMatrix aTransform; // unit matrix
-// rotate has the order first x, than y, last z. We need order z, y, x.
+// rotate has the order first x, then y, last z. We need order z, y, x.
 aTransform.rotate(0.0, 0.0, -fZ);
 aTransform.rotate(0.0, -fY, 0.0);
 aTransform.rotate(fX, 0.0, 0.0);


core.git: oox/source

2024-03-10 Thread Noel Grandin (via logerrit)
 oox/source/core/filterbase.cxx |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit ae351d9d5fc4fc3c0e02853e0a974791e41786fe
Author: Noel Grandin 
AuthorDate: Sun Mar 10 20:46:23 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 11 06:31:18 2024 +0100

tdf#158773 reduce cost of importing binary data

no need to pass it via the internal buffer of SequenceOutputStream when
we can read it directly

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

diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 3f47283d0825..6a2a51e47577 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -386,14 +386,13 @@ bool FilterBase::importBinaryData( StreamDataSequence & 
orDataSeq, const OUStrin
 return false;
 
 // try to open the stream (this may fail - do not assert)
-BinaryXInputStream aInStrm( openInputStream( rStreamName ), true );
-if( aInStrm.isEof() )
+Reference xInStream = openInputStream( rStreamName );
+if (!xInStream)
 return false;
 
 // copy the entire stream to the passed sequence
-SequenceOutputStream aOutStrm( orDataSeq );
-aInStrm.copyToStream( aOutStrm );
-return true;
+sal_Int32 nBytesRead = xInStream->readBytes( orDataSeq, SAL_MAX_INT32);
+return nBytesRead != -1 && nBytesRead != 0;
 }
 
 // com.sun.star.lang.XServiceInfo interface


core.git: oox/source sw/qa

2024-03-06 Thread Justin Luth (via logerrit)
 oox/source/vml/vmlshape.cxx  |   17 +--
 sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport21.cxx   |   13 
 3 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit e0ef7d54b4e4ccbaaada5d2c4a42ba41d961ea69
Author: Justin Luth 
AuthorDate: Tue Mar 5 19:05:29 2024 -0500
Commit: Miklos Vajna 
CommitDate: Wed Mar 6 11:22:31 2024 +0100

tdf#160049 oox import: use margins with left/right HoriOrientRelation

I'm really surprised this wasn't found much earlier.
Even DOC format isn't handling this.

make CppunitTest_sw_ooxmlexport21 \
CPPUNIT_TEST_NAME=testTdf160049_anchorMarginVML

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

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 5284de176839..8f16c6267211 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -647,8 +647,13 @@ static void lcl_SetAnchorType(PropertySet& rPropSet, const 
ShapeTypeModel& rType
 rPropSet.setAnyProperty(PROP_VertOrient, 
Any(text::VertOrientation::TOP));
 }
 
+// if the anchor is not inline, and is relative to left or right, then 
apply the margins
+bool bHonorMargins = rTypeModel.maPosition == "relative" || 
rTypeModel.maPosition == "absolute";
 if ( rTypeModel.maPositionHorizontal == "center" )
+{
 rPropSet.setAnyProperty(PROP_HoriOrient, 
Any(text::HoriOrientation::CENTER));
+bHonorMargins = false;
+}
 else if ( rTypeModel.maPositionHorizontal == "left" )
 rPropSet.setAnyProperty(PROP_HoriOrient, 
Any(text::HoriOrientation::LEFT));
 else if ( rTypeModel.maPositionHorizontal == "right" )
@@ -663,6 +668,8 @@ static void lcl_SetAnchorType(PropertySet& rPropSet, const 
ShapeTypeModel& rType
 rPropSet.setAnyProperty(PROP_HoriOrient, 
Any(text::HoriOrientation::RIGHT));
 rPropSet.setAnyProperty(PROP_PageToggle, Any(true));
 }
+else
+bHonorMargins = false;
 
 if ( rTypeModel.maPositionHorizontalRelative == "page" )
 rPropSet.setAnyProperty(PROP_HoriOrientRelation, 
Any(text::RelOrientation::PAGE_FRAME));
@@ -674,9 +681,13 @@ static void lcl_SetAnchorType(PropertySet& rPropSet, const 
ShapeTypeModel& rType
 else if (rTypeModel.maPositionHorizontalRelative == "left-margin-area" ||
  rTypeModel.maPositionHorizontalRelative == "outer-margin-area")
 rPropSet.setProperty(PROP_HoriOrientRelation, 
text::RelOrientation::PAGE_LEFT);
-else if ( rTypeModel.maPositionHorizontalRelative == "text" )
-rPropSet.setProperty(PROP_HoriOrientRelation, 
text::RelOrientation::FRAME);
-
+else // "text"
+{
+if (bHonorMargins)
+rPropSet.setProperty(PROP_HoriOrientRelation, 
text::RelOrientation::PRINT_AREA);
+else
+rPropSet.setProperty(PROP_HoriOrientRelation, 
text::RelOrientation::FRAME);
+}
 if ( rTypeModel.maPositionVertical == "center" )
 rPropSet.setAnyProperty(PROP_VertOrient, 
Any(text::VertOrientation::CENTER));
 else if ( rTypeModel.maPositionVertical == "top" )
diff --git a/sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docx 
b/sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docx
new file mode 100644
index ..f8cb262f53c8
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index 2e6c10c99031..d045e18efa32 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -292,6 +293,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf158597, "tdf158597.docx")
 }
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf160049_anchorMarginVML, 
"tdf160049_anchorMarginVML.docx")
+{
+// given a VML (Word 2003) document with a LEFT "column/text" anchored 
image
+// (which will import as DML compat12 on the round-trip)
+if (isExported())
+return;
+// The image takes into account the margin, so it looks like it is in the 
middle of the doc,
+// which is "Paragraph text area"/PRINT_AREA/1, not "Entire paragraph 
area"/FRAME/0
+CPPUNIT_ASSERT_EQUAL(css::text::RelOrientation::PRINT_AREA,
+ getProperty(getShape(1), 
"HoriOrientRelation"));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, 
"tdf153909_followTextFlow.docx")
 {
 // Although MSO's UI reports "layoutInCell" for the rectangle, it isn't 
specified or honored


core.git: oox/source

2024-02-27 Thread Justin Luth (via logerrit)
 oox/source/drawingml/fillproperties.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 5920bc2d1a624021a6f3eb42a56ce9b96b53a39f
Author: Justin Luth 
AuthorDate: Tue Feb 27 08:23:44 2024 -0500
Commit: Justin Luth 
CommitDate: Tue Feb 27 19:50:57 2024 +0100

address shortcoming: document why I avoided axials for transparency

Hmm, I like to complain when other people
don't comment on why certain situations are excluded,
and yet I did the same thing here.

Thanks vmiklos for pointing that out.

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index f24208722cb5..596e18f2176e 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -543,6 +543,10 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 
 // convert DrawingML angle (in 1/6 degrees) to API 
angle (in 1/10 degrees)
 aGradient.SetAngle(Degree10(static_cast< sal_Int16 >( 
(8100 - (nDmlAngle / (PER_DEGREE / 10))) % 3600 )));
+
+// If this is symmetrical, set it as an axial gradient for 
better UI/export.
+// There were chart2 unit test failures when doing this to 
transparent gradients
+// so just avoid that case.
 if (!bContainsTransparency)
 aGradient.tryToConvertToAxial();
 }


core.git: oox/source

2024-02-27 Thread Caolán McNamara (via logerrit)
 oox/source/export/chartexport.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 137247a4ef563547a591bf3af845cbaf21a1800d
Author: Caolán McNamara 
AuthorDate: Tue Feb 27 09:04:05 2024 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 27 13:21:46 2024 +0100

cid#1592378 Logically dead code

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

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 58114eb2820e..f9c4c12d066d 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1720,7 +1720,6 @@ void ChartExport::exportPlotArea(const Reference< 
css::chart::XChartDocument >&
 case chart2::PieChartSubType_BAR:
 sSubType = "bar";
 break;
-case chart2::PieChartSubType_NONE:
 default:
 assert(false);
 }


core.git: oox/source

2024-02-27 Thread Caolán McNamara (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 5dc2fad7186ea5e03ae2aa453b14a3276b4a17d9
Author: Caolán McNamara 
AuthorDate: Tue Feb 27 08:53:19 2024 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 27 12:05:35 2024 +0100

cid#1592381 silence Out-of-bounds read

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index ac7f0fd0450e..96a7ca3e0574 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -228,8 +228,10 @@ void Scene3DHelper::getAPIAnglesFrom3DProperties(
 // ignore it. The preset cameras have no rotation.
 nRevolution = 0;
 }
-else if (47 <= mnPrstCameraIndex && mnPrstCameraIndex <= 61)
+else if (47 <= mnPrstCameraIndex)
 {
+assert(mnPrstCameraIndex <= 61
+   && "by definition we don't set anything >= nCameraPresetCount 
(62)");
 // perspective. MS Office has a strange rendering behavior: If the 
shape rotation is not zero
 // and the angle for rotation on x-axis (=latitude) is >90deg and 
<=270deg, then MSO renders
 // the shape with an addition 180deg rotation on the z-axis. This 
happens only with user
@@ -383,10 +385,11 @@ bool Scene3DHelper::setExtrusionProperties(const 
oox::drawingml::Shape3DProperti
 return false;
 
 const sal_Int32 nCameraPrstID((*p3DProperties).mnPreset.value());
-mnPrstCameraIndex
+sal_Int16 nPrstCameraIndex
 = 
getPrstCameraIndex(oox::drawingml::Generic3DProperties::getCameraPrstName(nCameraPrstID));
-if (mnPrstCameraIndex < 0 or mnPrstCameraIndex >= nCameraPresetCount)
+if (nPrstCameraIndex < 0 or nPrstCameraIndex >= nCameraPresetCount)
 return false; // error in document. OOXML specifies a fixed set of 
preset camera types.
+mnPrstCameraIndex = nPrstCameraIndex;
 
 // We use extrusion, if there is a rotation around x-axis or y-axis,
 // or if there is no such rotation but we have a perspective projection 
with true depth,


core.git: oox/source

2024-02-27 Thread Attila Szűcs (via logerrit)
 oox/source/drawingml/shape.cxx |   41 +
 1 file changed, 41 insertions(+)

New commits:
commit 0079f0e77e74a355d57b24d3a6b6d1a29f45eb79
Author: Attila Szűcs 
AuthorDate: Mon Feb 26 10:04:23 2024 +0100
Commit: Attila Szűcs 
CommitDate: Tue Feb 27 09:51:43 2024 +0100

tdf#67347 pptx import: stacked + horz/vert aligment

In case of Stacked, PP calculates in the vertical direction
with the horizontal alignment.

We simulate it by setting TextVerticalAdjust at import time
(from PPTX) based on the ParagraphAdjust of the 1. paragraph

It is not perfect, because we have 1 TextVerticalAdjust / 1 shape,
and it does not support justified,
while we can have many ParagraphAdjust / 1 shape
(if the shape have more paragraphs)

For a better solution we should re-implement the entire stacked
thing, but that is a much bigger task.

Change-Id: I4011be0f118b870ab7f9e2ddc15c6dc5a21f8a89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163934
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Attila Szűcs 

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 8f3aedf3488a..d9a3f8b8db59 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -90,6 +90,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1354,6 +1355,46 @@ Reference< XShape > const & Shape::createAndInsert(
 // add properties from textbody to shape properties
 if( mpTextBody )
 {
+// tdf#67347: In case of Stacked, PP calculates in the vertical 
direction with the
+// horizontal alignment.
+// In LO, we simulate it by setting TextVerticalAdjust based on 
the ParagraphAdjust
+// of the 1. paragraph
+// It is not perfect, because we have 1 TextVerticalAdjust / 1 
shape, and it
+// does not support justified, while we can have many 
ParagraphAdjust / 1 shape
+// (if the shape have more paragraphs)
+if 
(mpTextBody->getTextProperties().maPropertyMap.hasProperty(PROP_WritingMode)
+&& 
mpTextBody->getTextProperties().maPropertyMap.getProperty(PROP_WritingMode)
+   == uno::Any(text::WritingMode2::STACKED)
+&& mpTextBody->getParagraphs().size() > 0
+&& aServiceName != "com.sun.star.drawing.GroupShape")
+{
+std::optional& oParaAdjust
+= 
mpTextBody->getParagraphs()[0]->getProperties().getParaAdjust();
+
+if (oParaAdjust)
+{
+switch (*oParaAdjust)
+{
+case ParagraphAdjust::ParagraphAdjust_LEFT:
+mpTextBody->getTextProperties().meVA
+= TextVerticalAdjust::TextVerticalAdjust_TOP;
+break;
+case ParagraphAdjust::ParagraphAdjust_CENTER:
+mpTextBody->getTextProperties().meVA
+= 
TextVerticalAdjust::TextVerticalAdjust_CENTER;
+break;
+case ParagraphAdjust::ParagraphAdjust_RIGHT:
+mpTextBody->getTextProperties().meVA
+= 
TextVerticalAdjust::TextVerticalAdjust_BOTTOM;
+break;
+default:
+break;
+}
+mpTextBody->getTextProperties().maPropertyMap.setProperty(
+PROP_TextVerticalAdjust, 
mpTextBody->getTextProperties().meVA);
+}
+}
+
 
mpTextBody->getTextProperties().pushTextDistances(Size(aShapeRectHmm.Width, 
aShapeRectHmm.Height));
 aShapeProps.assignUsed( 
mpTextBody->getTextProperties().maPropertyMap );
 // Push char properties as well - specifically useful when this is 
a placeholder


core.git: oox/source sw/qa

2024-02-26 Thread Justin Luth (via logerrit)
 oox/source/drawingml/fillproperties.cxx   |2 +
 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx |   30 +++
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx |   26 +++-
 sw/qa/extras/rtfexport/rtfexport.cxx  |   47 +++---
 sw/qa/extras/rtfexport/rtfexport8.cxx |   15 +
 5 files changed, 42 insertions(+), 78 deletions(-)

New commits:
commit 38083e4c0b5638d69162593c3fbf599da6cd499f
Author: Justin Luth 
AuthorDate: Tue Feb 20 16:11:08 2024 -0500
Commit: Miklos Vajna 
CommitDate: Tue Feb 27 08:40:50 2024 +0100

related tdf#126533 dml/vml import: import radials as radials

... and not as symmetrical linear gradients.

The benefit is that our export code
will be able to intelligently export it.

Apparently RTF export code does not intelligently export axials,
(now fixed - tdf#159824)
but VML and DML (and doc) do it well.

Unfortunately charts can be badly affected,
(avoided by ignoring when transparent)
and unit tests are implementation-tested...

This affects existing unit tests:
-tdf128345_Legend_CS_TG_axial.pptx: label imports fine:
lost on export (no change)
-tdf128345_ChartWall_CS_TG.pptx: wall gradient now looks axial:
lost on export (no change)
-textframe-gradient.docx: still round-trips OK: no change
-textframe-gradient.rtf: round-trips as linear: lost axial-ness
 (now fixed: tdf#159824)
-fdo78663.docx: textbox font fill: still exports as solid: no change

I ran the assert check against chart2, oox, and sw

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index dec9ab9672cc..f24208722cb5 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -543,6 +543,8 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 
 // convert DrawingML angle (in 1/6 degrees) to API 
angle (in 1/10 degrees)
 aGradient.SetAngle(Degree10(static_cast< sal_Int16 >( 
(8100 - (nDmlAngle / (PER_DEGREE / 10))) % 3600 )));
+if (!bContainsTransparency)
+aGradient.tryToConvertToAxial();
 }
 
 if (awt::GradientStyle_RECT == aGradient.GetGradientStyle())
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index f8defa15d1a2..72072bc5bb03 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -577,34 +577,16 @@ DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, 
"textframe-gradient.docx")
 uno::Reference xFrame(getShape(1), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, 
getProperty(xFrame, "FillStyle"));
 awt::Gradient2 aGradient(getProperty(xFrame, 
"FillGradient"));
-
-// MCGR: Use the completely imported transparency gradient to check for 
correctness
-basegfx::BColorStops aColorStops = 
model::gradient::getColorStopsFromUno(aGradient.ColorStops);
-
-CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
-CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 
0.0));
-CPPUNIT_ASSERT_EQUAL(Color(0xd99594), 
Color(aColorStops[0].getStopColor()));
-CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 
0.5));
-CPPUNIT_ASSERT_EQUAL(Color(0xc0504d), 
Color(aColorStops[1].getStopColor()));
-CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[2].getStopOffset(), 
1.0));
-CPPUNIT_ASSERT_EQUAL(Color(0xd99594), 
Color(aColorStops[2].getStopColor()));
-CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_LINEAR, aGradient.Style);
+CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, 
aGradient.StartColor));
+CPPUNIT_ASSERT_EQUAL(Color(0xD99594), Color(ColorTransparency, 
aGradient.EndColor));
+CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style);;
 
 xFrame.set(getShape(2), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, 
getProperty(xFrame, "FillStyle"));
 aGradient = getProperty(xFrame, "FillGradient");
-
-// MCGR: Use the completely imported transparency gradient to check for 
correctness
-aColorStops = model::gradient::getColorStopsFromUno(aGradient.ColorStops);
-
-CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
-CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 
0.0));
-CPPUNIT_ASSERT_EQUAL(Color(0x66), 
Color(aColorStops[0].getStopColor()));
-CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 
0.5));
-CPPUNIT_ASSERT_EQUAL(Color(0x00), 
Color(aColorStops[1].getStopColor()));
-

core.git: oox/source sw/qa sw/source

2024-02-23 Thread Justin Luth (via logerrit)
 oox/source/vml/vmlformatting.cxx |   17 ++--
 sw/qa/extras/ooxmlexport/data/tdf126533_axialAngle2.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx|   27 +-
 sw/qa/extras/rtfexport/data/tdf159824_gradientAngle3.rtf |   17 
 sw/qa/extras/rtfexport/data/tdf159824_gradientAngle4.rtf |   17 
 sw/qa/extras/rtfexport/rtfexport8.cxx|   62 +--
 sw/source/filter/ww8/docxattributeoutput.cxx |   23 ++---
 sw/source/filter/ww8/rtfattributeoutput.cxx  |   37 
 8 files changed, 153 insertions(+), 47 deletions(-)

New commits:
commit 6dd6891a3deed8718bf2b0fcf564f229f676f8ba
Author: Justin Luth 
AuthorDate: Thu Feb 22 09:24:12 2024 -0500
Commit: Justin Luth 
CommitDate: Fri Feb 23 20:28:31 2024 +0100

related tdf#126533 tdf#159824 VML: don't export: negative angles

and stop an automatic 180 reversal on import.

Some documents had gradient reversals on every round trip,
typically when the angle was 0-179
(mainly seen in ODT examples,
since DOCX/RTF imports defaulted to be angle 180).

The negative sign has special meaning,
indicating that the start and end colors
should be swapped.

Well, swapping colors was not intentional in the export logic.
Previously there was a mistaken idea
that any angles > 180 needed to be swapped on import,
and likely that is what prompted this overly complicated formula
to try to avoid any angle > 180 during export
by allowing negative angles.

This tdf#126533 patchset has already eliminated import checks
for angles > 180, so now a sane formula can be applied on export.

In order to do that, we have to avoid emulating color swaps
with 180 degree rotations at import time.
So ONLY do color swapping with start/end,
and leave the angle alone.
That GREATLY helps unit tests (which otherwise would flip-flop
the angle and the color start/stop).

Very unhelpful was an undocumented, indecipherable
inversion when converting to DML angle.

Boy, I hope I got this right...

make CppunitTest_sw_rtfexport8 \
   CPPUNIT_TEST_NAME=testTdf159824_gradientAngle3
make CppunitTest_sw_rtfexport8 \
   CPPUNIT_TEST_NAME=testTdf159824_gradientAngle4
make CppunitTest_sw_ooxmlexport7 \
   CPPUNIT_TEST_NAME=testTdf126533_axialAngle2

Eliminating the inversion for ooxml7 test is fine
since inversion does nothing to an axial.

Otherwise, eliminating inversions corresponds to a color swap.

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

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index f4022d0639d6..5fb422e63b9d 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -800,22 +800,29 @@ void FillModel::pushToPropMap( ShapePropertyMap& 
rPropMap, const GraphicHelper&
 }
 else// focus of -100%, 0%, and 100% is linear gradient
 {
+// LO linear gradients: top == start, but for MSO 
bottom == start == moColor
+bool bSwapColors = true;
+
 /*  According to spec, a focus of -100% or 100% swaps 
the
 start and stop colors, effectively reversing the 
gradient.
 If the angle was provided as a negative,
 then the colors are also (again) reversed. */
 if( fFocus < -0.5 || fFocus > 0.5 )
-nVmlAngle = (nVmlAngle + 180) % 360;
+bSwapColors = !bSwapColors;
 if (moAngle.value_or(0) < 0)
-nVmlAngle = (nVmlAngle + 180) % 360;
+bSwapColors = !bSwapColors;
 
+const Color& rStartColor = bSwapColors ? aColor2 : 
aColor1;
+const Color& rEndColor = bSwapColors ? aColor1 : 
aColor2;
 // set the start and stop colors
-lcl_setGradientStop( 
aFillProps.maGradientProps.maGradientStops, 0.0, aColor1 );
-lcl_setGradientStop( 
aFillProps.maGradientProps.maGradientStops, 1.0, aColor2 );
+
lcl_setGradientStop(aFillProps.maGradientProps.maGradientStops, 0.0,
+rStartColor);
+
lcl_setGradientStop(aFillProps.maGradientProps.maGradientStops, 1.0,
+rEndColor);
 }
 
 // VML counts counterclockwise from bottom, DrawingML 
clockwise from left
-sal_Int32 nDmlAngle = (630 - nVmlAngle) 

core.git: oox/source sw/qa

2024-02-23 Thread Justin Luth (via logerrit)
 oox/source/vml/vmlformatting.cxx|   27 +++---
 sw/qa/extras/ooxmlexport/data/tdf126533_negativeAxialAngle.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx   |   45 
++
 3 files changed, 61 insertions(+), 11 deletions(-)

New commits:
commit 396ece804b3a31e4eddf56de4e557f3755331d8c
Author: Justin Luth 
AuthorDate: Wed Feb 14 18:16:29 2024 -0500
Commit: Miklos Vajna 
CommitDate: Fri Feb 23 10:53:40 2024 +0100

related tdf#126533 vml import: fix gradient color swapping

tdf#65295 already fixed one case
by removing the test for degrees > 180
for the linear-equivalent gradients.
Unfortunately the comment wasn't also removed,
so that was confusing: removed comment.

The test for degrees > 180 is not needed
for the axial-equivalent case either: removed.

The reason for that degrees > 180 case is likely due to
negative degrees, which is a documented reason
for swapping the colors: added swap if negative degrees.

All the affected, existing unit tests are improved now:
-tdf81345.docx: famous MS example: improved header gradient
-fdo78300.docx: fontworks: hard to tell without MCGR...

make CppunitTest_sw_ooxmlexport7 \
CPPUNIT_TEST_NAME=testTdf126533_negativeAxialAngle

make CppunitTest_sw_ooxmlexport7 \
CPPUNIT_TEST_NAME=testTdf77219_backgroundShape

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

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 6182950973ee..f4022d0639d6 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -777,15 +777,18 @@ void FillModel::pushToPropMap( ShapePropertyMap& 
rPropMap, const GraphicHelper&
 sal_Int32 nVmlAngle = getIntervalValue< sal_Int32, 
sal_Int32 >( moAngle.value_or( 0 ), 0, 360 );
 
 // focus of -50% or 50% is axial gradient
+// so approximate anything with a similar focus by using 
LO's axial gradient,
+// (otherwise drop the radial aspect; linear gradient 
becomes the closest match)
 if( ((-0.75 <= fFocus) && (fFocus <= -0.25)) || ((0.25 <= 
fFocus) && (fFocus <= 0.75)) )
 {
-/*  According to spec, focus of 50% is outer-to-inner,
+/*  According to spec, a focus of positive 50% is 
outer-to-inner,
 and -50% is inner-to-outer (color to color2).
-BUT: For angles >= 180 deg., the behaviour is
-reversed... that's not spec'ed of course. So,
-[0;180) deg. and 50%, or [180;360) deg. and -50% is
-outer-to-inner in fact. */
-bool bOuterToInner = (fFocus > 0.0) == (nVmlAngle < 
180);
+If the angle was provided as a negative,
+then the colors are also (again) reversed. */
+bool bOuterToInner = fFocus > 0.0;
+if (moAngle.value_or(0) < 0)
+bOuterToInner = !bOuterToInner;
+
 // simulate axial gradient by 3-step DrawingML gradient
 const Color& rOuterColor = bOuterToInner ? aColor1 : 
aColor2;
 const Color& rInnerColor = bOuterToInner ? aColor2 : 
aColor1;
@@ -797,13 +800,15 @@ void FillModel::pushToPropMap( ShapePropertyMap& 
rPropMap, const GraphicHelper&
 }
 else// focus of -100%, 0%, and 100% is linear gradient
 {
-/*  According to spec, focus of -100% or 100% swaps the
-start and stop colors, effectively reversing the
-gradient. BUT: For angles >= 180 deg., the
-behaviour is reversed. This means that in this case
-a focus of 0% swaps the gradient. */
+/*  According to spec, a focus of -100% or 100% swaps 
the
+start and stop colors, effectively reversing the 
gradient.
+If the angle was provided as a negative,
+then the colors are also (again) reversed. */
 if( fFocus < -0.5 || fFocus > 0.5 )
 nVmlAngle = (nVmlAngle + 180) % 360;
+if (moAngle.value_or(0) < 0)
+nVmlAngle = (nVmlAngle + 180) % 360;
+
 // set the start and stop colors
 lcl_setGradientStop( 
aFillProps.maGradientProps.maGradientStops, 0.0, aColor1 );
   

core.git: oox/source

2024-02-20 Thread Julien Nabet (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ff516105c2df13cc71629b5a7156e16ec16b6988
Author: Julien Nabet 
AuthorDate: Tue Feb 20 18:40:13 2024 +0100
Commit: Julien Nabet 
CommitDate: Wed Feb 21 08:48:10 2024 +0100

Fix potentially uninitialized local variable 'fY' used in Windows TB

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index 3bb537bbd7d7..b72ca4a38f78 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -392,8 +392,8 @@ bool Scene3DHelper::setExtrusionProperties(const 
oox::drawingml::Shape3DProperti
 // or if there is no such rotation but we have a perspective projection 
with true depth,
 // or we have a parallel projection other than a 'front' type.
 // In other cases the rendering as normal shape is better than any current 
extrusion.
-double fX;
-double fY;
+double fX = 0.0;
+double fY = 0.0;
 Scene3DHelper::getAPIAnglesFrom3DProperties(p3DProperties, 
rnMSOShapeRotation, fX, fY, rRotZ);
 sal_Int32 nDepthAmount = (*p3DProperties).mnExtrusionH.value_or(0);
 bool bIsParallel = aPrstCameraValuesArray[mnPrstCameraIndex].mbIsParallel;


core.git: oox/source sw/qa

2024-02-20 Thread Justin Luth (via logerrit)
 oox/source/vml/vmlformatting.cxx   |   48 
 sw/qa/extras/tiledrendering/data/tdf159626_blackPatternFill.docx   |binary
 sw/qa/extras/tiledrendering/data/tdf159626_yellowPatternFill.docx  |binary
 sw/qa/extras/tiledrendering/data/tdf159626_yellowPatternFillB.docx |binary
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   97 
++
 5 files changed, 145 insertions(+)

New commits:
commit 07521972bcd1cfbbd15b2f60ada84ffc69f8f997
Author: Justin Luth 
AuthorDate: Wed Feb 7 17:25:50 2024 -0500
Commit: Miklos Vajna 
CommitDate: Wed Feb 21 08:46:39 2024 +0100

tdf#159626 vml pattern import: add color, fix back/foreground

This depends on tdf#126533 which imports page style v:fill,
BUT ONLY IN ORDER TO support the unit tests.
The patch itself can stand alone
and fixes vml import into textboxes/shapes etc.
i.e. backporting could be possible by dropping the unit tests.

The pattern that VML uses to indicate foreground
and background is very different from what LO needs.
[Fortunately LO does not use the _guess_ from
vcl::bitmap::isHistorical8x8 to determine which
color is the background. Instead it always uses the first pixel.]

Documentation says that unspecified XML_fillcolor
and XML_color should be white, but observation
says it should be 25% gray (Word 2003).
25% gray == C0C0C0 == fillcolor="silver" == COL_LIGHTGRAY

Currently, we simply export as a colored, tiled image,
and not as a B type="pattern"
so no corresponding export changes need to be made to export.

Existing unit test documents that are affected:
-chart2export's PieChartDataLabels.docx (page background)
-ooxmlexport5's fdo77725.docx (minimized PieChartDataLabels.docx)
 * both foreground and background are set to white => solid white
-sw/qa/core/data/ooxml/pass/fdo79131.docx (shape "inline")

make CppunitTest_sw_tiledrendering \
CPPUNIT_TEST_NAME=testTdf159626_yellowPatternFill
make CppunitTest_sw_tiledrendering \
CPPUNIT_TEST_NAME=testTdf159626_yellowPatternFillB
make CppunitTest_sw_tiledrendering \
CPPUNIT_TEST_NAME=testTdf159626_blackPatternFill

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

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 029d5429d921..6182950973ee 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+
 #include 
 #include 
 #include 
@@ -46,6 +47,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 namespace oox::vml {
@@ -843,6 +846,51 @@ void FillModel::pushToPropMap( ShapePropertyMap& rPropMap, 
const GraphicHelper&
 aFillProps.maBlipProps.mxFillGraphic = 
rGraphicHelper.importEmbeddedGraphic(moBitmapPath.value());
 if (aFillProps.maBlipProps.mxFillGraphic.is())
 {
+if (nFillType == XML_pattern)
+{
+// VML provides an 8x8 black(background) and 
white(foreground) pattern
+// along with specified background(color2) and 
foreground(color) colors,
+// while LO needs the color applied directly to 
the pattern.
+const Graphic 
aGraphic(aFillProps.maBlipProps.mxFillGraphic);
+::Color nBackColor;
+::Color nPixelColor;
+bool bIs8x8 = 
vcl::bitmap::isHistorical8x8(aGraphic.GetBitmapEx(),
+   
nBackColor, nPixelColor);
+if (bIs8x8)
+{
+nBackColor
+= 
ConversionHelper::decodeColor(rGraphicHelper, moColor2,
+
moOpacity2, API_RGB_WHITE)
+  .getColor(rGraphicHelper);
+// Documentation says undefined == white; 
observation says lightgray
+nPixelColor
+= 
ConversionHelper::decodeColor(rGraphicHelper, moColor,
+moOpacity, 
COL_LIGHTGRAY)
+  .getColor(rGraphicHelper);
+
+XOBitmap aXOB(aGraphic.GetBitmapEx());
+aXOB.Bitmap2Array();
+// LO uses the first pixel's color to 
represent background pixels
+if (aXOB.GetBackgroundColor() == 

core.git: oox/source sw/qa writerfilter/source

2024-02-20 Thread Justin Luth (via logerrit)
 oox/source/vml/vmlshapecontext.cxx|1 
 sw/qa/extras/ooxmlexport/data/tdf126533_noPageBitmap.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport21.cxx|   21 +
 writerfilter/source/dmapper/DomainMapper.cxx  |   58 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |1 
 writerfilter/source/dmapper/PropertyMap.cxx   |   33 +++
 writerfilter/source/ooxml/model.xml   |3 
 7 files changed, 115 insertions(+), 2 deletions(-)

New commits:
commit c14574e7ad2d3ec2ada40808be3332fac71e9767
Author: Justin Luth 
AuthorDate: Sat Feb 3 10:08:56 2024 -0500
Commit: Miklos Vajna 
CommitDate: Tue Feb 20 16:54:57 2024 +0100

tdf#126533 docx import: page background vml fill

This patch imports bitmaps/tiled textures (primarily),
but also somewhat for gradients
(because of a gradient2 -> gradient mismatch somewhere)
and somewhat for patterns
(because patterns are not well imported in general).

Note that the imported fill likely will NOT match MSO,
because their background CHANGES BASED ON THE ZOOM LEVEL.
For example, my primary testing file (A6 landscape)
has a logo which is only 25% visible in Word 2003 at 100%,
but shows 90% of the logo at 200%, and many tiles of logos
when exported as PDF.
The same is true for gradients etc.

Changing background on zoom is an absolutely bizarre implementation,
and naturally LO could only accidentally look identical
(and should never try to do so).

make CppunitTest_sw_ooxmlexport21 \
CPPUNIT_TEST_NAME=testTdf126533_noPageBitmap

make CppunitTest_sw_ooxmlexport21 \
CPPUNIT_TEST_NAME=testTdf126533_pageGradient

This is slightly ugly, but I don't know how to make a COPY
of the XPropertySet UNO junk. All I have is references,
and dispose deletes everything, even the references.

I took some inspiration from RTF
which just disposes the shape after grabbing the background color.

Thus, just change the page style known to exist and be used,
and then simply remove the fill if it isn't needed in the end.
Any new page styles can just copy the default page style fill.

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

diff --git a/oox/source/vml/vmlshapecontext.cxx 
b/oox/source/vml/vmlshapecontext.cxx
index e3242368a334..20ce2fa37434 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -251,6 +251,7 @@ ContextHandlerRef ShapeContextBase::createShapeContext( 
ContextHandler2Helper co
 return new ShapeContext( rParent, rShapes.createShape< 
BezierShape >(), rAttribs );
 else
 return new ShapeContext( rParent, rShapes.createShape< 
ComplexShape >(), rAttribs );
+case VML_TOKEN(background):
 case VML_TOKEN( rect ):
 return new RectangleShapeContext( rParent, rAttribs, 
rShapes.createShape< RectangleShape >() );
 case VML_TOKEN( roundrect ):
diff --git a/sw/qa/core/data/ooxml/pass/fill.docx 
b/sw/qa/extras/ooxmlexport/data/fill.docx
similarity index 100%
rename from sw/qa/core/data/ooxml/pass/fill.docx
rename to sw/qa/extras/ooxmlexport/data/fill.docx
diff --git a/sw/qa/extras/ooxmlexport/data/tdf126533_noPageBitmap.docx 
b/sw/qa/extras/ooxmlexport/data/tdf126533_noPageBitmap.docx
new file mode 100644
index ..87dfff296be5
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf126533_noPageBitmap.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index f1d4a5e7121a..e455467a74ef 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -366,6 +367,26 @@ CPPUNIT_TEST_FIXTURE(Test, testPersonalMetaData)
 assertXPath(pCoreDoc, "/cp:coreProperties/cp:revision"_ostr, 0);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf126533_noPageBitmap, 
"tdf126533_noPageBitmap.docx")
+{
+// given a document with a v:background bitmap, but no w:background 
fillcolor
+uno::Reference 
xPageStyle(getStyles("PageStyles")->getByName("Standard"),
+   uno::UNO_QUERY);
+// the image (or any fill for that matter) should be ignored.
+CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE,
+ getProperty(xPageStyle, 
"FillStyle"));
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testTdf126533_pageGradient)
+{
+// given a document with a gradient page background
+loadFromFile(u"fill.docx");
+uno::Reference 
xPageStyle(getStyles("PageStyles")->getByName("Standard"),
+   

core.git: oox/source

2024-02-20 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 01c7eefbb8722e2e5ef835777c2161b8e3d5aad8
Author: Andrea Gelmini 
AuthorDate: Tue Feb 20 11:13:33 2024 +0100
Commit: Julien Nabet 
CommitDate: Tue Feb 20 16:26:59 2024 +0100

Fix typo

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index 2cacc8e60fb0..3bb537bbd7d7 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -290,7 +290,7 @@ void Scene3DHelper::addExtrusionDepthToMap(const 
oox::drawingml::Shape3DProperti
 if (nDepthAmount == 0 && nZPosition != 0)
 {
 // We cannot express the position relative to the extrusion depth.
-// Use an artifical, small depth of 1Hmm
+// Use an artificial, small depth of 1Hmm
 fDepthRelPos = fZPosition;
 fDepthAmount = 1.0; // unit Hmm
 }


core.git: oox/source

2024-02-20 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/scene3dhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 097978b98f457e91643e5d8c65f48e21855851fd
Author: Andrea Gelmini 
AuthorDate: Tue Feb 20 11:15:08 2024 +0100
Commit: Julien Nabet 
CommitDate: Tue Feb 20 16:25:45 2024 +0100

Fix typo

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

diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
index 274cc460b825..2cacc8e60fb0 100755
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -329,7 +329,7 @@ void Scene3DHelper::addProjectionGeometryToMap(
 // oblique projections (index [38..45]) need special treatment. MS 
Office rotates around the
 // z-axis after the projection was created. Thus the rotation affects 
the skew direction. ODF
 // rotates the shape before creating the projection. Thus we need to 
incorporate the shape
-// rotation into the shew angle.
+// rotation into the skew angle.
 if (38 <= mnPrstCameraIndex && mnPrstCameraIndex <= 45)
 {
 fSkewAngle -= rnMSOShapeRotation / 6.0;


core.git: oox/source

2024-02-16 Thread Justin Luth (via logerrit)
 oox/source/export/vmlexport.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5132255021aa61f8a1fa7d8de820cb3528699812
Author: Justin Luth 
AuthorDate: Fri Feb 16 14:11:11 2024 -0500
Commit: Justin Luth 
CommitDate: Sat Feb 17 03:57:47 2024 +0100

tdf#153761 vml export: avoid corrupt docx: don't write empty r:id

For the benefit of MSO, do not write r:id="",
since MSO refuses to open such a document.

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

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 1090b0857f5c..8438befa62af 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -741,8 +741,11 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
 Graphic aGraphic;
 GraphicConverter::Import(aStream, aGraphic);
 OUString aImageId = 
m_pTextExport->GetDrawingML().writeGraphicToStorage(aGraphic, false);
-pAttrList->add(FSNS(XML_r, XML_id), aImageId);
-imageData = true;
+if (!aImageId.isEmpty())
+{
+pAttrList->add(FSNS(XML_r, XML_id), aImageId);
+imageData = true;
+}
 }
 
 if (rProps.GetOpt(ESCHER_Prop_fNoFillHitTest, nValue))


core.git: oox/source

2024-02-15 Thread Noel Grandin (via logerrit)
 oox/source/helper/zipstorage.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit dcc9626eac53fef42b1a85c3235d1e4e48331bee
Author: Noel Grandin 
AuthorDate: Mon Feb 12 15:56:48 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 15 13:58:53 2024 +0100

SAL_WARN->SAL_INFO

reduce log noise

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

diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx
index db73b14bdd6c..ff74641d0860 100644
--- a/oox/source/helper/zipstorage.cxx
+++ b/oox/source/helper/zipstorage.cxx
@@ -65,7 +65,8 @@ ZipStorage::ZipStorage( const Reference< XComponentContext >& 
rxContext, const R
 }
 catch (Exception const&)
 {
-TOOLS_WARN_EXCEPTION("oox.storage", "ZipStorage::ZipStorage exception 
opening input storage");
+// this is normally a noise exception, because it happens during file 
format detection
+TOOLS_INFO_EXCEPTION("oox.storage", "ZipStorage::ZipStorage exception 
opening input storage");
 }
 }
 


core.git: oox/source package/source sfx2/source

2024-02-01 Thread Mike Kaganski (via logerrit)
 oox/source/core/xmlfilterbase.cxx |4 ++-
 package/source/zipapi/ZipFile.cxx |   42 --
 sfx2/source/doc/docfile.cxx   |   15 ++---
 3 files changed, 55 insertions(+), 6 deletions(-)

New commits:
commit 747463809e50c132557a95dcee6709a1fa82d760
Author: Mike Kaganski 
AuthorDate: Thu Feb 1 20:55:40 2024 +0600
Commit: Mike Kaganski 
CommitDate: Thu Feb 1 21:07:54 2024 +0100

tdf#154587: allow directory entries in ZIP packages

The problem in the bugdoc was the directory entries. These entries
are valid in ZIP packages (even if not common); they may be useful
to e.g. define per-directory permissions (ACLs).

In normal mode, ZipFile reads central directory; there we can read
if the entry has FAT file attributes; and then, if the entry is a
directory. Then it is OK to skip it.

In repair mode, central directory is not used, local file headers
don't contain a "directory" flag. A workaround is used, checking
if there are entries that represent directories of other entries.

Also this change fixes some places that didn't pass the recovery
flag correctly.

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

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 7afb84cad2c6..f6bda14e920a 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -288,8 +288,10 @@ void XmlFilterBase::importDocumentProperties()
 rtl::Reference< ::oox::core::FilterDetect > xDetector( new 
::oox::core::FilterDetect( xContext ) );
 xInputStream = xDetector->extractUnencryptedPackage( aMediaDesc );
 Reference< XComponent > xModel = getModel();
+const bool repairPackage = 
aMediaDesc.getUnpackedValueOrDefault("RepairPackage", false);
 Reference< XStorage > xDocumentStorage (
-::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( 
OFOPXML_STORAGE_FORMAT_STRING, xInputStream ) );
+::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
+OFOPXML_STORAGE_FORMAT_STRING, xInputStream, {}, repairPackage));
 Reference< XInterface > xTemp = 
xContext->getServiceManager()->createInstanceWithContext(
 "com.sun.star.document.OOXMLDocumentPropertiesImporter",
 xContext);
diff --git a/package/source/zipapi/ZipFile.cxx 
b/package/source/zipapi/ZipFile.cxx
index 474b73ff53db..71fd66f08196 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1073,7 +1074,7 @@ sal_Int32 ZipFile::readCEN()
 if ( nTestSig != CENSIG )
 throw ZipException("Invalid CEN header (bad signature)" );
 
-aMemGrabber.skipBytes ( 2 );
+sal_uInt16 versionMadeBy = aMemGrabber.ReadUInt16();
 aEntry.nVersion = aMemGrabber.ReadInt16();
 aEntry.nFlag = aMemGrabber.ReadInt16();
 
@@ -1093,7 +1094,8 @@ sal_Int32 ZipFile::readCEN()
 aEntry.nPathLen = aMemGrabber.ReadInt16();
 aEntry.nExtraLen = aMemGrabber.ReadInt16();
 nCommentLen = aMemGrabber.ReadInt16();
-aMemGrabber.skipBytes ( 8 );
+aMemGrabber.skipBytes ( 4 );
+sal_uInt32 externalFileAttributes = aMemGrabber.ReadUInt32();
 sal_uInt64 nOffset = aMemGrabber.ReadUInt32();
 
 if ( aEntry.nPathLen < 0 )
@@ -1132,6 +1134,15 @@ sal_Int32 ZipFile::readCEN()
 throw ZipException("Integer-overflow");
 
 aMemGrabber.skipBytes(nCommentLen);
+
+// Is this a FAT-compatible empty entry?
+if (aEntry.nSize == 0 && (versionMadeBy & 0xff00) == 0)
+{
+constexpr sal_uInt32 FILE_ATTRIBUTE_DIRECTORY = 16;
+if (externalFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+continue; // This is a directory entry, not a stream - 
skip it
+}
+
 aEntries[aEntry.sPath] = aEntry;
 }
 
@@ -1253,6 +1264,7 @@ void ZipFile::recover()
   
RTL_TEXTENCODING_UTF8 );
 aEntry.nPathLen = static_cast< sal_Int16 
>(aFileName.getLength());
 }
+aEntry.sPath = aEntry.sPath.replace('\', '/');
 
 // read 64bit header
 if (aEntry.nExtraLen > 0)
@@ -1294,7 +1306,33 @@ void ZipFile::recover()
 aEntry.nSize = 0;
 }
 
+// Do not add this entry, if it is empty 
and is a directory of
+// an 

core.git: oox/source

2024-01-29 Thread Justin Luth (via logerrit)
 oox/source/drawingml/chart/chartcontextbase.cxx |4 +++-
 oox/source/drawingml/chart/seriescontext.cxx|2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 301e27cbebf7d6e4c9b82290d7cd555c43f0c999
Author: Justin Luth 
AuthorDate: Thu Jan 25 10:30:33 2024 -0500
Commit: Miklos Vajna 
CommitDate: Mon Jan 29 15:47:31 2024 +0100

tdf#146756 pie chart2: import extLst manualLayout W and H

The width of text labels in pie charts is currently determined
completely arbitrarily.

If the file specifies X and Y coordinates along with W and H sizing,
then perhaps it is appropriate to use this?
We currently import but ignore X/Y,
so lets also make W/H available
so we at least have a chance to ignore those too.

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

diff --git a/oox/source/drawingml/chart/chartcontextbase.cxx 
b/oox/source/drawingml/chart/chartcontextbase.cxx
index 5423c52b3d35..283c8e03ad55 100644
--- a/oox/source/drawingml/chart/chartcontextbase.cxx
+++ b/oox/source/drawingml/chart/chartcontextbase.cxx
@@ -58,10 +58,12 @@ ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 
nElement, const Attr
 switch( getCurrentElement() )
 {
 case C_TOKEN( layout ):
+case C15_TOKEN(layout):
 switch( nElement )
 {
 case C_TOKEN( manualLayout ):
-mrModel.mbAutoLayout = false;
+if (getCurrentElement() == C_TOKEN(layout))
+mrModel.mbAutoLayout = false;
 return this;
 }
 break;
diff --git a/oox/source/drawingml/chart/seriescontext.cxx 
b/oox/source/drawingml/chart/seriescontext.cxx
index 5afc32c1497d..bfbc28304ab3 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -129,6 +129,8 @@ ContextHandlerRef DataLabelContext::onCreateContext( 
sal_Int32 nElement, const A
 mrModel.mobShowDataLabelsRange = rAttribs.getBool( XML_val 
);
 return nullptr;
 }
+else if (nElement == C15_TOKEN(layout))
+return new LayoutContext(*this, 
mrModel.mxLayout.getOrCreate());
 break;
 }
 }


core.git: oox/source sw/CppunitTest_sw_ooxmlexport21.mk sw/qa

2024-01-29 Thread Samuel Mehrbrodt (via logerrit)
 oox/source/core/xmlfilterbase.cxx   |   43 +++-
 sw/CppunitTest_sw_ooxmlexport21.mk  |4 +
 sw/qa/extras/ooxmlexport/data/personalmetadata.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport21.cxx  |   39 ++
 4 files changed, 77 insertions(+), 9 deletions(-)

New commits:
commit 1e49f469afcbf3d1abec25451117f5f10d3ba825
Author: Samuel Mehrbrodt 
AuthorDate: Mon Jan 29 11:25:17 2024 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jan 29 13:18:04 2024 +0100

Don't export personal metadata to OOXML in privacy mode

Change-Id: Iac0985783a0c7334bd6ee3cfcaf37c135ac452ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162682
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 2e7ce9a75cbc..7afb84cad2c6 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -622,6 +623,12 @@ writeElement( const FSHelperPtr& pDoc, sal_Int32 
nXmlElement, const LanguageTag&
 static void
 writeCoreProperties( XmlFilterBase& rSelf, const Reference< 
XDocumentProperties >& xProperties )
 {
+bool bRemovePersonalInfo
+= 
SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo);
+bool bRemoveUserInfo
+= bRemovePersonalInfo
+  && 
!SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::DocWarnKeepDocUserInfo);
+
 OUString sValue;
 if( rSelf.getVersion() == oox::core::ISOIEC_29500_2008  )
 {
@@ -670,8 +677,11 @@ writeCoreProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentProperties
 if (it->second >>= aValue)
 writeElement( pCoreProps, FSNS( XML_cp, XML_contentType ), aValue 
);
 }
-writeElement( pCoreProps, FSNS( XML_dcterms, XML_created ), 
xProperties->getCreationDate() );
-writeElement( pCoreProps, FSNS( XML_dc, XML_creator ),  
xProperties->getAuthor() );
+if (!bRemoveUserInfo)
+{
+writeElement(pCoreProps, FSNS(XML_dcterms, XML_created), 
xProperties->getCreationDate());
+writeElement(pCoreProps, FSNS(XML_dc, XML_creator), 
xProperties->getAuthor());
+}
 writeElement( pCoreProps, FSNS( XML_dc, XML_description ),  
xProperties->getDescription() );
 
 it = aUserDefinedProperties.find("OOXMLCorePropertyIdentifier");
@@ -683,10 +693,18 @@ writeCoreProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentProperties
 }
 writeElement( pCoreProps, FSNS( XML_cp, XML_keywords ), 
xProperties->getKeywords() );
 writeElement( pCoreProps, FSNS( XML_dc, XML_language ), 
LanguageTag( xProperties->getLanguage()) );
-writeElement( pCoreProps, FSNS( XML_cp, XML_lastModifiedBy ),   
xProperties->getModifiedBy() );
-writeElement( pCoreProps, FSNS( XML_cp, XML_lastPrinted ),  
xProperties->getPrintDate() );
-writeElement( pCoreProps, FSNS( XML_dcterms, XML_modified ),
xProperties->getModificationDate() );
-writeElement( pCoreProps, FSNS( XML_cp, XML_revision ), 
xProperties->getEditingCycles() );
+
+if (!bRemoveUserInfo)
+{
+writeElement(pCoreProps, FSNS(XML_cp, XML_lastModifiedBy), 
xProperties->getModifiedBy());
+writeElement(pCoreProps, FSNS(XML_cp, XML_lastPrinted), 
xProperties->getPrintDate());
+writeElement(pCoreProps, FSNS(XML_dcterms, XML_modified),
+ xProperties->getModificationDate());
+}
+if (!bRemovePersonalInfo)
+{
+writeElement(pCoreProps, FSNS(XML_cp, XML_revision), 
xProperties->getEditingCycles());
+}
 writeElement( pCoreProps, FSNS( XML_dc, XML_subject ),  
xProperties->getSubject() );
 writeElement( pCoreProps, FSNS( XML_dc, XML_title ),
xProperties->getTitle() );
 
@@ -706,6 +724,11 @@ writeCoreProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentProperties
 static void
 writeAppProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties 
>& xProperties )
 {
+bool bRemovePersonalInfo
+= 
SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo);
+bool bRemoveUserInfo
+= bRemovePersonalInfo
+  && 
!SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::DocWarnKeepDocUserInfo);
 rSelf.addRelation(
 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties;,
 u"docProps/app.xml" );
@@ -720,7 +743,8 @@ writeAppProperties( XmlFilterBase& rSelf, const Reference< 
XDocumentProperties >
 comphelper::SequenceAsHashMap 
aUserDefinedProperties(xUserDefinedProperties->getPropertyValues());
 comphelper::SequenceAsHashMap::iterator it;
 
-writeElement( pAppProps, XML_Template,  
xProperties->getTemplateName() );
+if 

core.git: oox/source

2024-01-25 Thread Caolán McNamara (via logerrit)
 oox/source/drawingml/chart/chartspaceconverter.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 9485d88da541c8614582b9f927ae40b1c8991c56
Author: Caolán McNamara 
AuthorDate: Wed Jan 24 20:24:12 2024 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 25 11:47:38 2024 +0100

crashtesting: crash seen on import of forum-mso-en4-278652.xlsx

probably an issue since:

commit 135ce256ce9e879663d828ec6e699de521fad867
Date:   Mon Aug 14 15:59:18 2023 +0200

tdf#146487 Don't show generic diagram title when there is an empty 
title given

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

diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx 
b/oox/source/drawingml/chart/chartspaceconverter.cxx
index f9b370e04d8f..9280d42ff25c 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -191,7 +191,8 @@ void ChartSpaceConverter::convertFromModel( const 
Reference< XShapes >& rxExtern
&& mrModel.mxTitle->mxTextProp.is()
&& mrModel.mxTitle->mxTextProp->isEmpty();
 // Also for tdf#146487
-bool bEmptyRichText = mrModel.mxTitle->mxText.is()
+bool bEmptyRichText = mrModel.mxTitle
+&& mrModel.mxTitle->mxText.is()
 && mrModel.mxTitle->mxText->mxTextBody.is()
 && mrModel.mxTitle->mxText->mxTextBody->isEmpty();
 


core.git: oox/source sd/qa

2024-01-22 Thread Tibor Nagy (via logerrit)
 oox/source/drawingml/table/predefined-table-styles.cxx |   20 
 oox/source/drawingml/table/tablecell.cxx   |   12 ++
 sd/qa/unit/data/pptx/tdf156718.pptx|binary
 sd/qa/unit/import-tests.cxx|   70 +
 4 files changed, 98 insertions(+), 4 deletions(-)

New commits:
commit 27a1eccae1763b8efa17c909820f57f84361d308
Author: Tibor Nagy 
AuthorDate: Mon Jan 22 11:24:51 2024 +0100
Commit: Nagy Tibor 
CommitDate: Mon Jan 22 13:34:32 2024 +0100

tdf#156718 PPTX import: fix the different formatting in table style

when the PPTX file only has table style id, but no table style content.

Change-Id: Ia3416478716a50beb6837988e98697fd88e916d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162368
Tested-by: Jenkins
Reviewed-by: Nagy Tibor 

diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx 
b/oox/source/drawingml/table/predefined-table-styles.cxx
index 7df96036137d..3e821456e3b3 100644
--- a/oox/source/drawingml/table/predefined-table-styles.cxx
+++ b/oox/source/drawingml/table/predefined-table-styles.cxx
@@ -231,6 +231,12 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 std::unique_ptr pTableStyle;
 pTableStyle.reset(new TableStyle());
 
+// Text Style definitions for table parts
+
+bool bFirstRowTextBoldStyle = false;
+bool bFirstColTextBoldStyle = false;
+bool bLastColTextBoldStyle = false;
+
 // Text Color definitions for table parts
 
 ::oox::drawingml::Color wholeTblTextColor;
@@ -406,6 +412,7 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 pWholeTblBottomBorder->moLineWidth = 12700;
 pWholeTblInsideHBorder->moLineWidth = 12700;
 pWholeTblInsideVBorder->moLineWidth = 12700;
+pFirstRowBottomBorder->moLineWidth = 12700;
 
 pWholeTblLeftBorder->moPresetDash = XML_solid;
 pWholeTblRightBorder->moPresetDash = XML_solid;
@@ -413,6 +420,7 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 pWholeTblBottomBorder->moPresetDash = XML_solid;
 pWholeTblInsideHBorder->moPresetDash = XML_solid;
 pWholeTblInsideVBorder->moPresetDash = XML_solid;
+pFirstRowBottomBorder->moPresetDash = XML_solid;
 
 // Start to handle all style groups.
 
@@ -553,7 +561,13 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
 setBorderLineType(pLastRowTopBorder, XML_solidFill);
 
+bFirstRowTextBoldStyle = true;
+bFirstColTextBoldStyle = true;
+bLastColTextBoldStyle = true;
+
 wholeTblTextColor.setSchemeClr(XML_tx1);
+firstRowTextColor.setSchemeClr(XML_tx1);
+lastColTextColor.setSchemeClr(XML_tx1);
 
 sal_Int32 accent_val;
 
@@ -567,8 +581,6 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
 
-firstRowTextColor.setSchemeClr(accent_val);
-
 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
 
@@ -891,6 +903,10 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 pTableStyle->getStyleId() = styleId;
 pTableStyle->getStyleName() = style_name;
 
+pTableStyle->getFirstRow().getTextBoldStyle() = bFirstRowTextBoldStyle;
+pTableStyle->getFirstCol().getTextBoldStyle() = bFirstColTextBoldStyle;
+pTableStyle->getLastCol().getTextBoldStyle() = bLastColTextBoldStyle;
+
 pTableStyle->getWholeTbl().getTextColor() = wholeTblTextColor;
 pTableStyle->getFirstRow().getTextColor() = firstRowTextColor;
 pTableStyle->getFirstCol().getTextColor() = firstColTextColor;
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 687c987fe242..78ec4f61feeb 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -358,10 +358,18 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 }
 if ( rProperties.isBandRow() )
 {
+bool bHasFirstColFillColor
+= (rProperties.isFirstCol() && 
rTable.getFirstCol().getFillProperties()
+   && 
rTable.getFirstCol().getFillProperties()->maFillColor.isUsed());
+
+bool bHasLastColFillColor
+= (rProperties.isLastCol() && 
rTable.getLastCol().getFillProperties()
+   && 
rTable.getLastCol().getFillProperties()->maFillColor.isUsed());
+
 if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) &&
 ( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) &&
-( !rProperties.isFirstCol() || ( nColumn != 0 ) ) &&
-( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) )
+( !rProperties.isFirstCol() || ( nColumn != 0 ) || 

core.git: oox/source

2024-01-19 Thread Stephan Bergmann (via logerrit)
 oox/source/drawingml/chart/plotareaconverter.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3fb9859c6aa4a32f2333d86fa438e9f1d6ef7f55
Author: Stephan Bergmann 
AuthorDate: Fri Jan 19 08:42:13 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 19 10:20:57 2024 +0100

PlotAreaConverter::mbSingleSeriesTitle is apparently read uninitialized

...in code newly introduced in 135ce256ce9e879663d828ec6e699de521fad867
"tdf#146487 Don't show generic diagram title when there is an empty title
given", which caused CppunitTest_chart2_export2 to fail with

> /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62: runtime error: load 
of value 222, which is not a valid value for type 'bool'
> #0 0x7f95cd9ed87c in 
oox::drawingml::chart::PlotAreaConverter::isSingleSeriesTitle() const 
/oox/inc/drawingml/chart/plotareaconverter.hxx:78:62
> #1 0x7f95cd9e506f in 
oox::drawingml::chart::ChartSpaceConverter::convertFromModel(com::sun::star::uno::Reference
 const&, com::sun::star::awt::Point const&) 
/oox/source/drawingml/chart/chartspaceconverter.cxx:189:53
> #2 0x7f95cd9b6c34 in 
oox::drawingml::chart::ChartConverter::convertFromModel(oox::core::XmlFilterBase&,
 oox::drawingml::chart::ChartSpaceModel&, 
com::sun::star::uno::Reference const&, 
com::sun::star::uno::Reference const&, 
com::sun::star::awt::Point const&, com::sun::star::awt::Size const&) 
/oox/source/drawingml/chart/chartconverter.cxx:93:20
> #3 0x7f95ce548f59 in 
oox::drawingml::Shape::finalizeXShape(oox::core::XmlFilterBase&, 
com::sun::star::uno::Reference const&) 
/oox/source/drawingml/shape.cxx:2245:50
> #4 0x7f95438150b2 in 
oox::xls::Shape::finalizeXShape(oox::core::XmlFilterBase&, 
com::sun::star::uno::Reference const&) 
/sc/source/filter/oox/drawingfragment.cxx:113:30
> #5 0x7f95ce5267bb in 
oox::drawingml::Shape::createAndInsert(oox::core::XmlFilterBase&, rtl::OUString 
const&, oox::drawingml::Theme const*, 
com::sun::star::uno::Reference const&, bool, 
bool, basegfx::B2DHomMatrix&, oox::drawingml::FillProperties const&, 
std::shared_ptr) /oox/source/drawingml/shape.cxx:1964:9
> #6 0x7f95ce4edb54 in 
oox::drawingml::Shape::addShape(oox::core::XmlFilterBase&, 
oox::drawingml::Theme const*, 
com::sun::star::uno::Reference const&, 
basegfx::B2DHomMatrix const&, oox::drawingml::FillProperties const&, 
std::__debug::map, 
std::less, std::allocator > > >*, 
std::shared_ptr) /oox/source/drawingml/shape.cxx:366:41
> #7 0x7f954381ef79 in oox::xls::DrawingFragment::onEndElement() 
/sc/source/filter/oox/drawingfragment.cxx:335:30
> #8 0x7f95cdcaee54 in 
oox::core::ContextHandler2Helper::implEndElement(int) 
/oox/source/core/contexthandler2.cxx:125:9
> #9 0x7f95cdd5c116 in oox::core::FragmentHandler2::endFastElement(int) 
/oox/source/core/fragmenthandler2.cxx:91:5
> #10 0x7f95caf68fca in (anonymous namespace)::Entity::endElement() 
/sax/source/fastparser/fastparser.cxx:514:27
> #11 0x7f95caf68998 in 
sax_fastparser::FastSaxParserImpl::callbackEndElement() 
/sax/source/fastparser/fastparser.cxx:1331:17
> #12 0x7f95caf58444 in (anonymous 
namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char 
const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18
> #13 0x7f960adebeda in xmlParseEndTag2 
/workdir/UnpackedTarball/libxml2/parser.c:10090:2
> #14 0x7f960ad929b5 in xmlParseTryOrFinish 
/workdir/UnpackedTarball/libxml2/parser.c:11868:14
> #15 0x7f960ad86334 in xmlParseChunk 
/workdir/UnpackedTarball/libxml2/parser.c:12151:5
> #16 0x7f95caf53231 in sax_fastparser::FastSaxParserImpl::parse() 
/sax/source/fastparser/fastparser.cxx:1085:21
> #17 0x7f95caf4cd18 in 
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
 const&) /sax/source/fastparser/fastparser.cxx:890:9
> #18 0x7f95caf6e950 in 
sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
 const&) /sax/source/fastparser/fastparser.cxx:1470:13
> #19 0x7f95cdce50d1 in 
oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource 
const&, bool) /oox/source/core/fastparser.cxx:121:15
> #20 0x7f95cdce5868 in 
oox::core::FastParser::parseStream(com::sun::star::uno::Reference
 const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
> #21 0x7f95cddbb234 in 
oox::core::XmlFilterBase::importFragment(rtl::Reference
 const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21
> #22 0x7f95cddb9b8d in 
oox::core::XmlFilterBase::importFragment(rtl::Reference
 const&) /oox/source/core/xmlfilterbase.cxx:344:12
> #23 0x7f95441ceaa8 in 
oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference
 const&) /sc/source/filter/oox/workbookhelper.cxx:1046:27
> #24 0x7f95442797f1 in oox::xls::WorksheetGlobals::finalizeDrawings() 

core.git: oox/source

2024-01-18 Thread Stephan Bergmann (via logerrit)
 oox/source/crypto/CryptTools.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 71d4abc51b556e147ab53a9a52b15be36fc710a3
Author: Stephan Bergmann 
AuthorDate: Thu Jan 18 13:16:56 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 18 21:09:30 2024 +0100

-Werror,-Wdeprecated-declarations (Emscripten)

> oox/source/crypto/CryptTools.cxx:57:40: error: 'HMAC_CTX_free' is 
deprecated [-Werror,-Wdeprecated-declarations]
> void operator()(HMAC_CTX* p) { HMAC_CTX_free(p); }
>^
> workdir/UnpackedTarball/openssl/include/openssl/hmac.h:35:1: note: 
'HMAC_CTX_free' has been explicitly marked deprecated here
> OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: 
expanded from macro 'OSSL_DEPRECATEDIN_3_0'
> #   define OSSL_DEPRECATEDIN_3_0OSSL_DEPRECATED(3.0)
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: 
expanded from macro 'OSSL_DEPRECATED'
> # define OSSL_DEPRECATED(since) __attribute__((deprecated))
>^
> oox/source/crypto/CryptTools.cxx:112:29: error: 'HMAC_CTX_new' is 
deprecated [-Werror,-Wdeprecated-declarations]
> mpHmacContext.reset(HMAC_CTX_new());
> ^
> workdir/UnpackedTarball/openssl/include/openssl/hmac.h:33:1: note: 
'HMAC_CTX_new' has been explicitly marked deprecated here
> OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: 
expanded from macro 'OSSL_DEPRECATEDIN_3_0'
> #   define OSSL_DEPRECATEDIN_3_0OSSL_DEPRECATED(3.0)
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: 
expanded from macro 'OSSL_DEPRECATED'
> # define OSSL_DEPRECATED(since) __attribute__((deprecated))
>^
> oox/source/crypto/CryptTools.cxx:125:9: error: 'HMAC_Init_ex' is 
deprecated [-Werror,-Wdeprecated-declarations]
> HMAC_Init_ex(mpHmacContext.get(), rKey.data(), rKey.size(), 
aEvpMd, nullptr);
> ^
> workdir/UnpackedTarball/openssl/include/openssl/hmac.h:43:1: note: 
'HMAC_Init_ex' has been explicitly marked deprecated here
> OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, 
int len,
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: 
expanded from macro 'OSSL_DEPRECATEDIN_3_0'
> #   define OSSL_DEPRECATEDIN_3_0OSSL_DEPRECATED(3.0)
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: 
expanded from macro 'OSSL_DEPRECATED'
> # define OSSL_DEPRECATED(since) __attribute__((deprecated))
>^
> oox/source/crypto/CryptTools.cxx:499:12: error: 'HMAC_Update' is 
deprecated [-Werror,-Wdeprecated-declarations]
> return HMAC_Update(mpImpl->mpHmacContext.get(), rInput.data(), 
nActualInputLength) != 0;
>^
> workdir/UnpackedTarball/openssl/include/openssl/hmac.h:45:1: note: 
'HMAC_Update' has been explicitly marked deprecated here
> OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char 
*data,
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: 
expanded from macro 'OSSL_DEPRECATEDIN_3_0'
> #   define OSSL_DEPRECATEDIN_3_0OSSL_DEPRECATED(3.0)
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: 
expanded from macro 'OSSL_DEPRECATED'
> # define OSSL_DEPRECATED(since) __attribute__((deprecated))
>^
> oox/source/crypto/CryptTools.cxx:512:12: error: 'HMAC_Final' is 
deprecated [-Werror,-Wdeprecated-declarations]
> (void) HMAC_Final(mpImpl->mpHmacContext.get(), aHash.data(), 
);
>^
> workdir/UnpackedTarball/openssl/include/openssl/hmac.h:47:1: note: 
'HMAC_Final' has been explicitly marked deprecated here
> OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:182:49: note: 
expanded from macro 'OSSL_DEPRECATEDIN_3_0'
> #   define OSSL_DEPRECATEDIN_3_0OSSL_DEPRECATED(3.0)
> ^
> workdir/UnpackedTarball/openssl/include/openssl/macros.h:62:52: note: 
expanded from macro 'OSSL_DEPRECATED'
> # define OSSL_DEPRECATED(since) __attribute__((deprecated))
> 

core.git: oox/source sd/qa

2024-01-17 Thread Mike Kaganski (via logerrit)
 oox/source/drawingml/shape.cxx |   37 +++--
 sd/qa/unit/export-tests-ooxml4.cxx |   22 +-
 2 files changed, 16 insertions(+), 43 deletions(-)

New commits:
commit 67ba6ccd5a75ee6ade0e6aaa8bdc33f651a0d82c
Author: Mike Kaganski 
AuthorDate: Wed Jan 17 21:21:24 2024 +0600
Commit: Mike Kaganski 
CommitDate: Thu Jan 18 05:28:38 2024 +0100

tdf#140912, tdf#159219: fix import of graphic placeholder with custom prompt

Importing the text marks the object as not empty. Then, the object would
behave as an outliner object. This includes showing in slide show; allowing
text esiting; stretching the placeholder image, which required a workaround
implemented in commit 7b3be7f6f3d800e2ad86f5a043e6e9b21ed4409f (tdf#140912
Better handling of the picture placeholders, 2021-12-01).

Instead, drop the custom prompt. More correct solution would be making sure
to mark the object as empty after setting the text; but this doesn't round-
trip to ODF; and it crashes export to PPTX. Proper support for the sustom
placeholder prompt feature should be done separately.

The new workaround (dropping the text) makes previous workaround (special
handling of the placeholder graphic) unnecessary. The unit test is updated.

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

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 5df335be727d..b4c50a91f730 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -95,7 +95,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1539,35 +1538,6 @@ Reference< XShape > const & Shape::createAndInsert(
 
propertySet->setPropertyValue("InteropGrabBag",uno::Any(aGrabBag));
 }
 
-// If the shape is a picture placeholder.
-if (aServiceName == "com.sun.star.presentation.GraphicObjectShape" 
&& !bClearText)
-{
-// Placeholder text should be in center of the shape.
-aShapeProps.setProperty(PROP_TextContourFrame, false);
-
-/* Placeholder icon should be at the center of the parent 
shape.
- * We use negative graphic crop property because of that we 
don't
- * have padding support.
- */
-uno::Reference 
xGraphic(xSet->getPropertyValue("Graphic"), uno::UNO_QUERY);
-if (xGraphic.is())
-{
-awt::Size aBitmapSize;
-xGraphic->getPropertyValue("Size100thMM") >>= aBitmapSize;
-sal_Int32 nXMargin = (aShapeRectHmm.Width - 
aBitmapSize.Width) / 2;
-sal_Int32 nYMargin = (aShapeRectHmm.Height - 
aBitmapSize.Height) / 2;
-if (nXMargin > 0 && nYMargin > 0)
-{
-text::GraphicCrop aGraphicCrop;
-aGraphicCrop.Top = nYMargin * -1;
-aGraphicCrop.Bottom = nYMargin * -1;
-aGraphicCrop.Left = nXMargin * -1;
-aGraphicCrop.Right = nXMargin * -1;
-aShapeProps.setProperty(PROP_GraphicCrop, 
aGraphicCrop);
-}
-}
-}
-
 PropertySet( xSet ).setProperties( aShapeProps );
 
 if (mpTablePropertiesPtr && aServiceName == 
"com.sun.star.drawing.TableShape")
@@ -1873,6 +1843,13 @@ Reference< XShape > const & Shape::createAndInsert(
 aPropertySet.setAnyProperty( PROP_VertOrientPosition, Any( 
maPosition.Y ) );
 }
 
+// Make sure to not set text to placeholders. Doing it here would 
eventually call
+// SvxTextEditSourceImpl::UpdateData, 
SdrObject::SetEmptyPresObj(false), and that
+// would make the object behave like a standard outline object.
+// TODO/FIXME: support custom prompt text in placeholders.
+if (rServiceName == "com.sun.star.presentation.GraphicObjectShape")
+mpTextBody.reset();
+
 // in some cases, we don't have any text body.
 if( mpTextBody && ( !bDoNotInsertEmptyTextBody || 
!mpTextBody->isEmpty() ) )
 {
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index cd3b5f5d5de4..9ebb88208cc1 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -751,22 +751,18 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf147121)
 
 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf140912_PicturePlaceholder)
 {
-// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
-// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
-// -8490 in the test 

core.git: oox/source

2024-01-15 Thread Caolán McNamara (via logerrit)
 oox/source/export/chartexport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6da480d086a599f6a0159c5244ce8fe0ae4131b8
Author: Caolán McNamara 
AuthorDate: Mon Jan 15 11:18:06 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Jan 15 14:13:02 2024 +0100

crashtesting: null deref of xValueSeq

since:

commit 0bf4338cfe406a0d527ac78ce76ff7dd3837df03 (HEAD)
Date:   Mon Jan 8 13:52:03 2024 -0500

tdf#137691 chart2 export: preserve NumberFormat of DataSeries

make CppunitTest_chart2_export3 CPPUNIT_TEST_NAME=tdf137691

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

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 7de4cee0c4c0..c80e8c1ba688 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2959,7 +2959,7 @@ void ChartExport::exportSeriesValues( const Reference< 
chart2::data::XDataSequen
 pFS->startElement(FSNS(XML_c, XML_numCache));
 pFS->startElement(FSNS(XML_c, XML_formatCode));
 OUString sNumberFormatString("General");
-const sal_Int32 nKey = xValueSeq->getNumberFormatKeyByIndex(-1);
+const sal_Int32 nKey = xValueSeq.is() ? 
xValueSeq->getNumberFormatKeyByIndex(-1) : 0;
 if (nKey > 0)
 sNumberFormatString = getNumberFormatCode(nKey);
 pFS->writeEscaped(sNumberFormatString);


core.git: oox/source

2024-01-07 Thread Caolán McNamara (via logerrit)
 oox/source/drawingml/diagram/diagram.cxx |  198 ---
 1 file changed, 104 insertions(+), 94 deletions(-)

New commits:
commit a46db49e301e71d78b356c57adfae6e79d3c38b5
Author: Caolán McNamara 
AuthorDate: Sat Jan 6 20:16:14 2024 +
Commit: Caolán McNamara 
CommitDate: Sun Jan 7 13:58:38 2024 +0100

ofz#65567 unset DiagramFontHeights on exception

git diff -w is your friend

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

diff --git a/oox/source/drawingml/diagram/diagram.cxx 
b/oox/source/drawingml/diagram/diagram.cxx
index ce8a7cfb1db4..029c2c56e962 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -310,121 +310,131 @@ void loadDiagram( ShapePtr const & pShape,
 DiagramLayoutPtr pLayout = std::make_shared(*pDiagram);
 pDiagram->setLayout( pLayout );
 
-// set DiagramFontHeights at filter
-rFilter.setDiagramFontHeights(>getDiagramFontHeights());
-
-// data
-if( !rDataModelPath.isEmpty() )
+try
 {
-rtl::Reference< core::FragmentHandler > xRefDataModel(
-new DiagramDataFragmentHandler( rFilter, rDataModelPath, pData 
));
+// set DiagramFontHeights at filter
+rFilter.setDiagramFontHeights(>getDiagramFontHeights());
 
-importFragment(rFilter,
-   loadFragment(rFilter,xRefDataModel),
-   "OOXData",
-   pDiagram,
-   xRefDataModel);
+// data
+if( !rDataModelPath.isEmpty() )
+{
+rtl::Reference< core::FragmentHandler > xRefDataModel(
+new DiagramDataFragmentHandler( rFilter, rDataModelPath, 
pData ));
 
-pDiagram->getDataRelsMap() = 
pShape->resolveRelationshipsOfTypeFromOfficeDoc( rFilter,
-xRefDataModel->getFragmentPath(), u"image" );
+importFragment(rFilter,
+   loadFragment(rFilter,xRefDataModel),
+   "OOXData",
+   pDiagram,
+   xRefDataModel);
 
-// Pass the info to pShape
-for (auto const& extDrawing : pData->getExtDrawings())
-{
-OUString aFragmentPath = 
rRelations.getFragmentPathFromRelId(extDrawing);
-// Ignore RelIds which don't resolve to a fragment path.
-if (aFragmentPath.isEmpty())
-continue;
-
-sal_Int32 nCounter = 0;
-rtl::Reference xCounter(
-new DiagramShapeCounter(rFilter, aFragmentPath, nCounter));
-rFilter.importFragment(xCounter);
-// Ignore ext drawings which don't actually have any shapes.
-if (nCounter == 0)
-continue;
-
-pShape->addExtDrawingRelId(extDrawing);
+pDiagram->getDataRelsMap() = 
pShape->resolveRelationshipsOfTypeFromOfficeDoc( rFilter,
+xRefDataModel->getFragmentPath(), u"image" );
+
+// Pass the info to pShape
+for (auto const& extDrawing : pData->getExtDrawings())
+{
+OUString aFragmentPath = 
rRelations.getFragmentPathFromRelId(extDrawing);
+// Ignore RelIds which don't resolve to a fragment path.
+if (aFragmentPath.isEmpty())
+continue;
+
+sal_Int32 nCounter = 0;
+rtl::Reference xCounter(
+new DiagramShapeCounter(rFilter, aFragmentPath, nCounter));
+rFilter.importFragment(xCounter);
+// Ignore ext drawings which don't actually have any shapes.
+if (nCounter == 0)
+continue;
+
+pShape->addExtDrawingRelId(extDrawing);
+}
 }
-}
 
-// extLst is present, lets bet on that and ignore the rest of the data 
from here
-if( pShape->getExtDrawings().empty() )
-{
-// layout
-if( !rLayoutPath.isEmpty() )
+// extLst is present, lets bet on that and ignore the rest of the data 
from here
+if( pShape->getExtDrawings().empty() )
 {
-rtl::Reference< core::FragmentHandler > xRefLayout(
-new DiagramLayoutFragmentHandler( rFilter, rLayoutPath, 
pLayout ));
+// layout
+if( !rLayoutPath.isEmpty() )
+{
+rtl::Reference< core::FragmentHandler > xRefLayout(
+new DiagramLayoutFragmentHandler( rFilter, 
rLayoutPath, pLayout ));
+
+importFragment(rFilter,
+loadFragment(rFilter,xRefLayout),
+"OOXLayout",
+pDiagram,
+xRefLayout);
+}
 
-importFragment(rFilter,
-   

core.git: oox/source

2023-12-31 Thread Caolán McNamara (via logerrit)
 oox/source/drawingml/table/predefined-table-styles.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 43c03ebc221db18b6980fbe592cce11cbb46dd49
Author: Caolán McNamara 
AuthorDate: Sat Dec 30 20:04:37 2023 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 31 13:33:44 2023 +0100

cid#1545219 COPY_INSTEAD_OF_MOVE

and a bunch more like that

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

diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx 
b/oox/source/drawingml/table/predefined-table-styles.cxx
index 451759036835..26b05612d010 100644
--- a/oox/source/drawingml/table/predefined-table-styles.cxx
+++ b/oox/source/drawingml/table/predefined-table-styles.cxx
@@ -216,7 +216,7 @@ void setBorderLineType(const 
oox::drawingml::LinePropertiesPtr& pLineProp, sal_I
 }
 
 void insertBorderLine(TableStylePart& aTableStylePart, sal_Int32 nToken,
-  oox::drawingml::LinePropertiesPtr pLineProp)
+  const oox::drawingml::LinePropertiesPtr& pLineProp)
 {
 if (pLineProp->maLineFill.moFillType.has_value())
 {


core.git: oox/source sd/qa sd/source xmloff/source

2023-12-18 Thread Balazs Varga (via logerrit)
 oox/source/ppt/slidepersist.cxx  |6 
 sd/qa/unit/data/pptx/tdf157740.pptx  |binary
 sd/qa/unit/export-tests-ooxml1.cxx   |4 
 sd/qa/unit/export-tests-ooxml2.cxx   |4 
 sd/qa/unit/export-tests-ooxml4.cxx   |   16 +
 sd/source/core/drawdoc3.cxx  |   38 +++-
 sd/source/filter/eppt/epptbase.hxx   |2 
 sd/source/filter/eppt/epptooxml.hxx  |6 
 sd/source/filter/eppt/pptx-epptooxml.cxx |  284 +++
 xmloff/source/draw/ximpbody.cxx  |   19 ++
 10 files changed, 142 insertions(+), 237 deletions(-)

New commits:
commit bff76421e234df7246a7f49c71a11432f86e09d1
Author: Balazs Varga 
AuthorDate: Sun Dec 3 23:41:01 2023 +0100
Commit: Balazs Varga 
CommitDate: Mon Dec 18 15:10:54 2023 +0100

tdf#157740 FILESAVE PPTX: fix explosion of the number of master slides

- Export correctly the "supported" master slides with the actual slides 
names.
- Set SlideLayout property at ODF import as well for MasterSlides layout 
type.
- When we copy a slide with the master slide also copy the SlideLayout 
property
value as well.

Change-Id: Idb6b88ebe87a83818d8eb27a1fa087652a002c0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160290
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-by: Balazs Varga 

diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index cd42ef6bcdb6..a4225f95cd43 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -105,6 +105,7 @@ sal_Int16 SlidePersist::getLayoutFromValueToken() const
 case XML_titleOnly: nLayout = 19; break;
 case XML_twoObj:
 case XML_twoColTx:  nLayout =  3; break;
+case XML_twoObjAndObj:
 case XML_twoObjAndTx:   nLayout = 15; break;
 case XML_twoObjOverTx:  nLayout = 16; break;
 case XML_tx:nLayout =  1; break;
@@ -112,19 +113,18 @@ sal_Int16 SlidePersist::getLayoutFromValueToken() const
 case XML_txAndClipArt:  nLayout =  6; break;
 case XML_txAndMedia:nLayout =  6; break;
 case XML_txAndObj:  nLayout = 10; break;
+case XML_objAndTwoObj:
 case XML_txAndTwoObj:   nLayout = 12; break;
 case XML_txOverObj: nLayout = 17; break;
 case XML_vertTitleAndTx:nLayout = 22; break;
 case XML_vertTitleAndTxOverChart: nLayout = 21; break;
 case XML_vertTx:nLayout = 23; break;
+case XML_objOnly:   nLayout = 32; break;
 
 case XML_twoTxTwoObj:
-case XML_twoObjAndObj:
 case XML_objTx:
 case XML_picTx:
 case XML_secHead:
-case XML_objOnly:
-case XML_objAndTwoObj:
 case XML_mediaAndTx:
 case XML_dgm:
 case XML_cust:
diff --git a/sd/qa/unit/data/pptx/tdf157740.pptx 
b/sd/qa/unit/data/pptx/tdf157740.pptx
new file mode 100644
index ..009e9eeb1da0
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf157740.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index deab0ea2de24..9f87fd5d92c4 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -111,11 +111,11 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf149128)
 
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn"_ostr,
-"id"_ostr, "42");
+"id"_ostr, "8");
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:stCxn"_ostr,
 "idx"_ostr, "0");
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn"_ostr,
-"id"_ostr, "43");
+"id"_ostr, "9");
 assertXPath(pXmlDoc, 
"/p:sld/p:cSld/p:spTree/p:cxnSp/p:nvCxnSpPr/p:cNvCxnSpPr/a:endCxn"_ostr,
 "idx"_ostr, "2");
 }
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 0583233c9f06..4498f66bf03a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1343,7 +1343,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867)
 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/"
 
"p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/"
 "p:cBhvr/p:tgtEl/p:spTgt"_ostr,
-"spid"_ostr, "42");
+"spid"_ostr, "67");
 }
 
 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280)
@@ -1740,7 +1740,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor)
 xmlDocUniquePtr pXmlDocTheme1 = parseExport("ppt/theme/theme1.xml");
 assertXPath(pXmlDocTheme1, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr"_ostr,
   

core.git: oox/source sd/qa sw/qa

2023-12-08 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/misccontexts.cxx  |2 +-
 sd/qa/unit/export-tests.cxx|2 +-
 sw/qa/extras/globalfilter/globalfilter.cxx |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b3122d56af5eefbb170de105579b59b097f34d58
Author: Andrea Gelmini 
AuthorDate: Fri Dec 8 20:47:21 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 8 22:48:19 2023 +0100

Fix typos

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

diff --git a/oox/source/drawingml/misccontexts.cxx 
b/oox/source/drawingml/misccontexts.cxx
index 93d2c8ee411b..6c05654e5d14 100644
--- a/oox/source/drawingml/misccontexts.cxx
+++ b/oox/source/drawingml/misccontexts.cxx
@@ -630,7 +630,7 @@ ContextHandlerRef 
BlipExtensionContext::onCreateContext(sal_Int32 nElement, cons
 // Read the graphic from the fragment path
 auto xGraphic = 
getFilter().getGraphicHelper().importEmbeddedGraphic(aFragmentPath);
 
-// Overwrite the fill graphic with the one contining SVG
+// Overwrite the fill graphic with the one containing SVG
 mrBlipProps.mxFillGraphic = xGraphic;
 if (mpBlipFill)
 mpBlipFill->mxGraphic = xGraphic;
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 428b09e983a1..7ee6e3a5e8cd 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1959,7 +1959,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testSvgImageSupport)
 // Access the Graphic
 Graphic aGraphic(xGraphic);
 
-// Check if it contian a VectorGraphicData struct
+// Check if it contains a VectorGraphicData struct
 auto pVectorGraphic = aGraphic.getVectorGraphicData();
 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pVectorGraphic);
 
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx 
b/sw/qa/extras/globalfilter/globalfilter.cxx
index 9d7c28b83ff8..7442de87f6d3 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -2251,7 +2251,7 @@ void Test::testSvgImageSupport()
 // Access the Graphic
 Graphic aGraphic(xGraphic);
 
-// Check if it contian a VectorGraphicData struct
+// Check if it contains a VectorGraphicData struct
 auto pVectorGraphic = aGraphic.getVectorGraphicData();
 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pVectorGraphic);
 


core.git: oox/source sd/qa sw/qa

2023-12-07 Thread Tomaž Vajngerl (via logerrit)
 oox/source/drawingml/misccontexts.cxx  |6 +-
 sd/qa/unit/export-tests.cxx|   15 +--
 sw/qa/extras/globalfilter/globalfilter.cxx |   17 +
 3 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit a010567c2cdb8ea0fe059b0b64fd5d1f2fd99a03
Author: Tomaž Vajngerl 
AuthorDate: Wed Dec 6 16:55:01 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Dec 8 03:55:42 2023 +0100

tdf#126084 document OOXML SVG tests and import

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

diff --git a/oox/source/drawingml/misccontexts.cxx 
b/oox/source/drawingml/misccontexts.cxx
index 244d17d9fc62..93d2c8ee411b 100644
--- a/oox/source/drawingml/misccontexts.cxx
+++ b/oox/source/drawingml/misccontexts.cxx
@@ -619,20 +619,24 @@ ContextHandlerRef 
BlipExtensionContext::onCreateContext(sal_Int32 nElement, cons
 case OOX_TOKEN(a14, imgProps):
 return new ArtisticEffectContext(*this, mrBlipProps.maEffect);
 
+// Import the SVG Blip
 case OOX_TOKEN(asvg, svgBlip):
 {
 if (rAttribs.hasAttribute(R_TOKEN(embed)))
 {
-// internal picture URL
 OUString aFragmentPath = 
getFragmentPathFromRelId(rAttribs.getStringDefaulted(R_TOKEN(embed)));
 if (!aFragmentPath.isEmpty())
 {
+// Read the graphic from the fragment path
 auto xGraphic = 
getFilter().getGraphicHelper().importEmbeddedGraphic(aFragmentPath);
+
+// Overwrite the fill graphic with the one contining SVG
 mrBlipProps.mxFillGraphic = xGraphic;
 if (mpBlipFill)
 mpBlipFill->mxGraphic = xGraphic;
 }
 }
+// TODO - link
 }
 break;
 }
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 92b36ecacce7..428b09e983a1 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1933,10 +1933,12 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testSvgImageSupport)
 {
 // Load the original file
 createSdImpressDoc("odp/SvgImageTest.odp");
-const OString sFailedMessage = "Failed on filter: " + rFormat.toUtf8();
+// Save into the target format
 saveAndReload(rFormat);
 
-// Check whether graphic was exported well
+const OString sFailedMessage = "Failed on filter: " + rFormat.toUtf8();
+
+// Check whether SVG graphic was exported as expected
 uno::Reference 
xDrawPagesSupplier(mxComponent,

uno::UNO_QUERY_THROW);
 CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), sal_Int32(1),
@@ -1944,15 +1946,24 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testSvgImageSupport)
 uno::Reference xDrawPage(
 xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xDrawPage.is());
+
+// Get the image
 uno::Reference xImage(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
 uno::Reference xPropertySet(xImage, 
uno::UNO_QUERY_THROW);
 
+// Convert to a XGraphic
 uno::Reference xGraphic;
 xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xGraphic.is());
+
+// Access the Graphic
 Graphic aGraphic(xGraphic);
+
+// Check if it contian a VectorGraphicData struct
 auto pVectorGraphic = aGraphic.getVectorGraphicData();
 CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pVectorGraphic);
+
+// Which should be of type SVG, which means we have a SVG file
 CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 
VectorGraphicDataType::Svg,
  pVectorGraphic->getType());
 }
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx 
b/sw/qa/extras/globalfilter/globalfilter.cxx
index 3eda6b6354e8..9d7c28b83ff8 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -2225,28 +2225,37 @@ void Test::testSvgImageSupport()
 
 for (OUString const & rFilterName : aFilterNames)
 {
-// Check whether the export code swaps in the image which was swapped 
out before by auto mechanism
+// Use case to import a document containing a SVG image, export in 
target format, import and check if the
+// SVG image is present and as expected in the document
 
+// Import ODT file
 createSwDoc("SvgImageTest.odt");
 
-// Export the document and import again for a check
+// Export the document in target format and import again
 saveAndReload(rFilterName);
 
-

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

2023-11-15 Thread Andrea Gelmini (via logerrit)
 oox/source/shape/ShapeContextHandler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6e4ea6d73b2a4f3ae56169933d82596f92e88f0d
Author: Andrea Gelmini 
AuthorDate: Wed Nov 15 12:52:49 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 15 23:47:22 2023 +0100

Fix typo

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

diff --git a/oox/source/shape/ShapeContextHandler.cxx 
b/oox/source/shape/ShapeContextHandler.cxx
index 1d4ad9d323e4..19c2deb71f57 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -524,7 +524,7 @@ ShapeContextHandler::getShape()
 oox::drawingml::ShapeIdMap aShapeMap;
 lcl_createShapeMap(pShape, aShapeMap);
 
-// Travers aShapeMap and generate edge related properties.
+// Traverse aShapeMap and generate edge related properties.
 for (auto& rIt : aShapeMap)
 {
 if ((rIt.second)->getServiceName() == 
"com.sun.star.drawing.ConnectorShape")


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

2023-11-15 Thread Andrea Gelmini (via logerrit)
 oox/source/shape/ShapeContextHandler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 201e288e9886987eae467035b42863ac032f7e8f
Author: Andrea Gelmini 
AuthorDate: Wed Nov 15 12:51:55 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 15 23:46:50 2023 +0100

Fix typo

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

diff --git a/oox/source/shape/ShapeContextHandler.cxx 
b/oox/source/shape/ShapeContextHandler.cxx
index 53ddd3f575be..1d4ad9d323e4 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -538,7 +538,7 @@ ShapeContextHandler::getShape()

ConnectorHelper::applyBentHandleAdjustments(rIt.second);
 }
 // else use the default path of LibreOffice
-// curveConnecto2 and bentConnector2 do not have 
handles.
+// curvedConnector2 and bentConnector2 do not have 
handles.
 // ToDo: OOXML defines a path for curveConnector3, 
curveConnector4 and
 // curveConnector5 that is basically incompatible with 
the way LibreOffice
 // creates the path.


[Libreoffice-commits] core.git: oox/source sc/source shell/source sw/source toolkit/source

2023-11-15 Thread Noel Grandin (via logerrit)
 oox/source/export/drawingml.cxx  |5 +++--
 oox/source/export/vmlexport.cxx  |5 +++--
 oox/source/ole/oleobjecthelper.cxx   |5 +++--
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |5 +++--
 shell/source/win32/ooofilereader/simpletag.cxx   |7 ---
 sw/source/core/doc/dbgoutsw.cxx  |6 --
 sw/source/filter/ww8/docxattributeoutput.cxx |5 +++--
 sw/source/uibase/envelp/labelcfg.cxx |4 ++--
 sw/source/uibase/utlui/content.cxx   |5 +++--
 toolkit/source/controls/unocontrolmodel.cxx  |   15 +--
 10 files changed, 37 insertions(+), 25 deletions(-)

New commits:
commit d0e848dab096160b16c4778ba25a40d1e5ff82af
Author: Noel Grandin 
AuthorDate: Wed Nov 15 10:48:27 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Nov 15 12:04:31 2023 +0100

avoid double map lookup

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ebe1df3a72d8..4bce89943ba3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -4320,8 +4320,9 @@ void DrawingML::WritePresetShape( const OString& pShape, 
MSO_SPT eShapeType, boo
 static std::map< OString, std::vector > aAdjMap = 
lcl_getAdjNames();
 // If there are predefined adj names for this shape type, look them up now.
 std::vector aAdjustments;
-if (aAdjMap.find(pShape) != aAdjMap.end())
-aAdjustments = aAdjMap[pShape];
+auto it = aAdjMap.find(pShape);
+if (it != aAdjMap.end())
+aAdjustments = it->second;
 
 mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape);
 mpFS->startElementNS(XML_a, XML_avLst);
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 2ed2903bfe27..cfaa815aa964 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1236,8 +1236,9 @@ static OUString lcl_getAnchorIdFromGrabBag(const 
SdrObject* pSdrObject)
 if (xShape->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
 {
 comphelper::SequenceAsHashMap 
aInteropGrabBag(xShape->getPropertyValue("InteropGrabBag"));
-if (aInteropGrabBag.find("AnchorId") != aInteropGrabBag.end())
-aInteropGrabBag["AnchorId"] >>= aResult;
+auto it = aInteropGrabBag.find("AnchorId");
+if (it != aInteropGrabBag.end())
+it->second >>= aResult;
 }
 
 return aResult;
diff --git a/oox/source/ole/oleobjecthelper.cxx 
b/oox/source/ole/oleobjecthelper.cxx
index 1816773db82d..f99e4a897ec0 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -100,8 +100,9 @@ void SaveInteropProperties(uno::Reference 
const& xModel,
 
 // get EmbeddedObjects property inside grab bag
 comphelper::SequenceAsHashMap objectsList;
-if (aGrabBag.find(sEmbeddingsPropName) != aGrabBag.end())
-objectsList << aGrabBag[sEmbeddingsPropName];
+auto grabIt = aGrabBag.find(sEmbeddingsPropName);
+if (grabIt != aGrabBag.end())
+objectsList << grabIt->second;
 
 uno::Sequence< beans::PropertyValue > aGrabBagAttribute{ 
comphelper::makePropertyValue("ProgID",

rProgId) };
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index fa57dd1a4fe7..7aaa7237ccac 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -1170,8 +1170,9 @@ uno::Reference SAL_CALL
 throw lang::IndexOutOfBoundsException();
 }
 ScMyAddress addr = 
CalcScAddressFromRangeList(mpMarkedRanges.get(),nSelectedChildIndex);
-if( m_mapSelectionSend.find(addr) != m_mapSelectionSend.end() )
-xAccessible = m_mapSelectionSend[addr];
+auto it = m_mapSelectionSend.find(addr);
+if( it != m_mapSelectionSend.end() )
+xAccessible = it->second;
 else
 xAccessible = getAccessibleCellAt(addr.Row(), addr.Col());
 }
diff --git a/shell/source/win32/ooofilereader/simpletag.cxx 
b/shell/source/win32/ooofilereader/simpletag.cxx
index 82b85aec5ce3..d4ceab77fe10 100644
--- a/shell/source/win32/ooofilereader/simpletag.cxx
+++ b/shell/source/win32/ooofilereader/simpletag.cxx
@@ -48,10 +48,11 @@ std::wstring CSimpleTag::getTagContent( )
 
 ::std::wstring CSimpleTag::getTagAttribute( ::std::wstring const & attrname )
 {
-if  ( m_SimpleAttributes.find(attrname) != m_SimpleAttributes.end())
-return m_SimpleAttributes[attrname];
+auto it = 

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

2023-10-31 Thread Henry Castro (via logerrit)
 oox/source/ppt/presentationfragmenthandler.cxx |6 +
 sd/qa/unit/export-tests-ooxml2.cxx |6 -
 sd/qa/unit/export-tests-ooxml3.cxx |4 
 sd/source/filter/eppt/epptooxml.hxx|4 
 sd/source/filter/eppt/pptx-epptooxml.cxx   |  128 +++--
 sd/source/ui/inc/unopage.hxx   |1 
 sd/source/ui/unoidl/unopage.cxx|   13 ++
 7 files changed, 147 insertions(+), 15 deletions(-)

New commits:
commit d590f094ccd28ca449eff91692c2178058d5c621
Author: Henry Castro 
AuthorDate: Tue Oct 17 07:42:52 2023 -0400
Commit: Henry Castro 
CommitDate: Tue Oct 31 12:01:43 2023 +0100

tdf#155512: sd: filter: eppt: add "SlideLayout" property to Slide Master

If it is importing all Slide Master from pptx file, unfortunately
it breaks the exporting to pptx due to save and reload unit test failures

According to the documentation
http://officeopenxml.com/prSlideLayout.php, so the file pptx has a
relationship Slide -> Slide Layout -> Slide Master

The Slide Layout is a template an unique to be reused
with Slide Master, so exporting requires to compare
the templates due to LibreOffice relation Slide -> Slide Master

Adjust unit test values:

SdOOXMLExportTest2::testTdf106867
revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad

SdOOXMLExportTest2::testTdf112280
revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad

SdOOXMLExportTest2::testThemeColors and
SdOOXMLExportTest3::testTdf114848
The file tdf84205.pptx does not contain theme2.xml,
and save and reload it does not caintain theme2.xml too
fix "An uncaught exception of type 
com.sun.star.container.NoSuchElementException"

Signed-off-by: Henry Castro 
Change-Id: I622e9d5d68c406ff520387f3903808613d1cd3d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158084
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158676
Tested-by: Jenkins

diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 8c5fbf261414..edb523161c9e 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -230,6 +230,9 @@ SlidePersistPtr 
PresentationFragmentHandler::importMasterSlide(const ReferencegetFragmentPathFromRelation(rEntry.second);
 
 sal_Int32 nIndex;
@@ -286,6 +289,9 @@ SlidePersistPtr 
PresentationFragmentHandler::importMasterSlide(const ReferencecreateBackground( rFilter );
 pMasterPersistPtr->createXShapes( rFilter );
 
+uno::Reference< beans::XPropertySet > 
xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW);
+xSet->setPropertyValue("SlideLayout", 
Any(pMasterPersistPtr->getLayoutFromValueToken()));
+
 oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme();
 if (pTheme)
 {
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 625c04953006..30301c6e4c16 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1313,7 +1313,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867)
 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/"
 
"p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/"
 "p:cBhvr/p:tgtEl/p:spTgt",
-"spid", "491");
+"spid", "42");
 }
 
 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280)
@@ -1694,7 +1694,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor)
 "70ad47");
 xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml");
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val",
-"70ad47");
+"deb340");
 
 // Without the accompanying fix in place, this test would have failed with:
 // - Expected: Motyw pakietu Office
@@ -1709,7 +1709,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors)
 createSdImpressDoc("pptx/tdf84205.pptx");
 save("Impress Office Open XML");
 
-xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml");
+xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme1.xml");
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val",
 "44546a");
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val",
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 409a8affc8d5..74bcfebb40a5 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -75,10 +75,6 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf114848)
 xmlDocUniquePtr pXmlDocTheme1 = 

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

2023-09-19 Thread Tomaž Vajngerl (via logerrit)
 oox/source/export/shapes.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8a9c3e82386d700549cac30f2555952046e021cb
Author: Tomaž Vajngerl 
AuthorDate: Mon Sep 18 14:51:59 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Sep 19 14:02:41 2023 +0200

oox: change frozen::make_set to "conventional" frozen::set construction

Fixes compile issue with bisect repo started with commit: 
b839c09760919d4f4a21ed1819885b5385f27e31 
(https://gerrit.libreoffice.org/c/core/+/157003)

Log:

/home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: error: 
no matching function for call to ‘make_set()’
 });
  ^
In file included from 
/home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0:

/home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:223:16:
 note: candidate: template constexpr auto 
frozen::make_set(frozen::bits::ignored_arg)
 constexpr auto make_set(bits::ignored_arg = {}/* for consistency with the 
initializer below for N = 0*/) {
^~~~

/home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:223:16:
 note:   template argument deduction/substitution failed:
/home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: note:   
cannot convert ‘{"b\000l\000o\000c\000k\000-\000a\000r\000c\000\000", 
"r\000e\000c\000t\000a\000n\000g\000l\000e\000\000", 
"e\000l\000l\000i\000p\000s\000e\000\000", "r\000i\000n\000g\000\000", 
"c\000a\000n\000\000", "c\000u\000b\000e\000\000", 
"p\000a\000p\000e\000r\000\000", "f\000r\000a\000m\000e\000\000", 
"f\000o\000r\000b\000i\000d\000d\000e\000n\000\000", 
"s\000m\000i\000l\000e\000y\000\000", "s\000u\000n\000\000", 
"f\000l\000o\000w\000e\000r\000\000", 
"b\000r\000a\000c\000k\000e\000t\000-\000p\000a\000i\000r\000\000", 
"b\000r\000a\000c\000e\000-\000p\000a\000i\000r\000\000", 
"q\000u\000a\000d\000-\000b\000e\000v\000e\000l\000\000", 
"r\000o\000u\000n\000d\000-\000r\000e\000c\000t\000a\000n\000g\000u\000l\000a\000r\000-\000c\000a\000l\000l\000o\000u\000t\000\000",
 
"r\000e\000c\000t\000a\000n\000g\000u\000l\000a\000r\000-\000c\000a\000l\000l\000o\000u\000t\000\000",
 "r\000o\000u\000n\000d\000-\000c\
 000a\000l\000l\000o\000u\000t\000\000", 
"c\000l\000o\000u\000d\000-\000c\000a\000l\000l\000o\000u\000t\000\000", 
"l\000i\000n\000e\000-\000c\000a\000l\000l\000o\000u\000t\000-\0001\000\000", 
"l\000i\000n\000e\000-\000c\000a\000l\000l\000o\000u\000t\000-\0002\000\000", 
"l\000i\000n\000e\000-\000c\000a\000l\000l\000o\000u\000t\000-\0003\000\000", 
"p\000a\000p\000e\000r\000\000", 
"v\000e\000r\000t\000i\000c\000a\000l\000-\000s\000c\000r\000o\000l\000l\000\000",
 
"h\000o\000r\000i\000z\000o\000n\000t\000a\000l\000-\000s\000c\000r\000o\000l\000l\000\000",
 "m\000s\000o\000-\000s\000p\000t\0003\0004\000\000", 
"m\000s\000o\000-\000s\000p\000t\0007\0005\000\000", 
"m\000s\000o\000-\000s\000p\000t\0001\0006\0004\000\000", 
"m\000s\000o\000-\000s\000p\000t\0001\0008\\000\000", 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000r\000o\000c\000e\000s\000s\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000a\000l\000t\000e\000r\000n\000a\000t\000e\000-\000p\000r\000o\000c\000e\000
 s\000s\000\000", 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000e\000c\000i\000s\000i\000o\000n\000\000",
 "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000a\000t\000a\000\000", 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000r\000e\000d\000e\000f\000i\000n\000e\000d\000-\000p\000r\000o\000c\000e\000s\000s\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000i\000n\000t\000e\000r\000n\000a\000l\000-\000s\000t\000o\000r\000a\000g\000e\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000o\000c\000u\000m\000e\000n\000t\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000u\000l\000t\000i\000d\000o\000c\000u\000m\000e\000n\000t\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000t\000e\000r\000m\000i\000n\000a\000t\000o\000r\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000r\000e\000p\000a\000r\000a\000t\000i\000o\000n\000\000",
 "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000a\000n\000u\000a\000
 l\000-\000i\000n\000p\000u\000t\000\000", 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000a\000n\000u\000a\000l\000-\000o\000p\000e\000r\000a\000t\000i\000o\000n\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000c\000o\000n\000n\000e\000c\000t\000o\000r\000\000",
 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000o\000f\000f\000-\000p\000a\000g\000e\000-\000c\000o\000n\000n\000e\000c\000t\000o\000r\000\000",
 "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000c\000a\000r\000d\000\000", 
"f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000u\000n\000c\000h\000e\000d\000-\000t\000a\000p\000e\000\000",
 

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

2023-09-17 Thread Tomaž Vajngerl (via logerrit)
 oox/source/export/chartexport.cxx |   72 ++-
 oox/source/export/shapes.cxx  |  235 +++---
 2 files changed, 159 insertions(+), 148 deletions(-)

New commits:
commit b839c09760919d4f4a21ed1819885b5385f27e31
Author: Tomaž Vajngerl 
AuthorDate: Sun Sep 17 22:25:01 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Sep 18 07:54:27 2023 +0200

oox: some more conversions to frozen map and set

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

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index c9db6f8cc431..0265c2b7db8d 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -107,6 +107,10 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 
@@ -440,41 +444,41 @@ static ::std::vector< double > 
lcl_getAllValuesFromSequence( const Reference< ch
 return aResult;
 }
 
-static sal_Int32 lcl_getChartType( std::u16string_view sChartType )
+namespace
+{
+
+constexpr auto constChartTypeMap = 
frozen::make_unordered_map(
+{
+{ u"com.sun.star.chart.BarDiagram", chart::TYPEID_BAR },
+{ u"com.sun.star.chart2.ColumnChartType",  chart::TYPEID_BAR },
+{ u"com.sun.star.chart.AreaDiagram",  chart::TYPEID_AREA },
+{ u"com.sun.star.chart2.AreaChartType",  chart::TYPEID_AREA },
+{ u"com.sun.star.chart.LineDiagram",  chart::TYPEID_LINE },
+{ u"com.sun.star.chart2.LineChartType",  chart::TYPEID_LINE },
+{ u"com.sun.star.chart.PieDiagram",  chart::TYPEID_PIE },
+{ u"com.sun.star.chart2.PieChartType",  chart::TYPEID_PIE },
+{ u"com.sun.star.chart.DonutDiagram",  chart::TYPEID_DOUGHNUT },
+{ u"com.sun.star.chart2.DonutChartType",  chart::TYPEID_DOUGHNUT },
+{ u"com.sun.star.chart.XYDiagram",  chart::TYPEID_SCATTER },
+{ u"com.sun.star.chart2.ScatterChartType",  chart::TYPEID_SCATTER },
+{ u"com.sun.star.chart.NetDiagram",  chart::TYPEID_RADARLINE },
+{ u"com.sun.star.chart2.NetChartType",  chart::TYPEID_RADARLINE },
+{ u"com.sun.star.chart.FilledNetDiagram",  chart::TYPEID_RADARAREA },
+{ u"com.sun.star.chart2.FilledNetChartType",  chart::TYPEID_RADARAREA },
+{ u"com.sun.star.chart.StockDiagram",  chart::TYPEID_STOCK },
+{ u"com.sun.star.chart2.CandleStickChartType",  chart::TYPEID_STOCK },
+{ u"com.sun.star.chart.BubbleDiagram",  chart::TYPEID_BUBBLE },
+{ u"com.sun.star.chart2.BubbleChartType",  chart::TYPEID_BUBBLE },
+});
+
+} // end anonymous namespace
+
+static sal_Int32 lcl_getChartType(std::u16string_view sChartType)
 {
-chart::TypeId eChartTypeId = chart::TYPEID_UNKNOWN;
-if( sChartType == u"com.sun.star.chart.BarDiagram"
-|| sChartType == u"com.sun.star.chart2.ColumnChartType" )
-eChartTypeId = chart::TYPEID_BAR;
-else if( sChartType == u"com.sun.star.chart.AreaDiagram"
- || sChartType == u"com.sun.star.chart2.AreaChartType" )
-eChartTypeId = chart::TYPEID_AREA;
-else if( sChartType == u"com.sun.star.chart.LineDiagram"
- || sChartType == u"com.sun.star.chart2.LineChartType" )
-eChartTypeId = chart::TYPEID_LINE;
-else if( sChartType == u"com.sun.star.chart.PieDiagram"
- || sChartType == u"com.sun.star.chart2.PieChartType" )
-eChartTypeId = chart::TYPEID_PIE;
-else if( sChartType == u"com.sun.star.chart.DonutDiagram"
- || sChartType == u"com.sun.star.chart2.DonutChartType" )
-eChartTypeId = chart::TYPEID_DOUGHNUT;
-else if( sChartType == u"com.sun.star.chart.XYDiagram"
- || sChartType == u"com.sun.star.chart2.ScatterChartType" )
-eChartTypeId = chart::TYPEID_SCATTER;
-else if( sChartType == u"com.sun.star.chart.NetDiagram"
- || sChartType == u"com.sun.star.chart2.NetChartType" )
-eChartTypeId = chart::TYPEID_RADARLINE;
-else if( sChartType == u"com.sun.star.chart.FilledNetDiagram"
- || sChartType == u"com.sun.star.chart2.FilledNetChartType" )
-eChartTypeId = chart::TYPEID_RADARAREA;
-else if( sChartType == u"com.sun.star.chart.StockDiagram"
- || sChartType == u"com.sun.star.chart2.CandleStickChartType" )
-eChartTypeId = chart::TYPEID_STOCK;
-else if( sChartType == u"com.sun.star.chart.BubbleDiagram"
- || sChartType == u"com.sun.star.chart2.BubbleChartType" )
-eChartTypeId = chart::TYPEID_BUBBLE;
-
-return eChartTypeId;
+auto aIterator = constChartTypeMap.find(sChartType);
+if (aIterator == constChartTypeMap.end())
+return chart::TYPEID_UNKNOWN;
+return aIterator->second;
 }
 
 static sal_Int32 lcl_generateRandomValue()
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 78614b7efbcc..08c3c38e4446 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx

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

2023-09-16 Thread Tomaž Vajngerl (via logerrit)
 oox/source/drawingml/fillproperties.cxx |  150 
 1 file changed, 59 insertions(+), 91 deletions(-)

New commits:
commit 5fd0d769a2a0106b6b12faed28dc81d90153c16c
Author: Tomaž Vajngerl 
AuthorDate: Sat Sep 16 12:59:17 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sat Sep 16 18:41:12 2023 +0200

oox: use frozen unordered_map for mapping the name string to token

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index ff78f3183831..dec9ab9672cc 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -49,6 +49,11 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::graphic;
@@ -992,101 +997,64 @@ OUString ArtisticEffectProperties::getEffectString( 
sal_Int32 nToken )
 return OUString();
 }
 
-sal_Int32 ArtisticEffectProperties::getEffectToken( const OUString& sName )
+constexpr auto constEffectTokenForEffectNameMap = 
frozen::make_unordered_map(
 {
 // effects
-if( sName == "artisticBlur" )
-return XML_artisticBlur;
-else if( sName == "artisticCement" )
-return XML_artisticCement;
-else if( sName == "artisticChalkSketch" )
-return XML_artisticChalkSketch;
-else if( sName == "artisticCrisscrossEtching" )
-return XML_artisticCrisscrossEtching;
-else if( sName == "artisticCutout" )
-return XML_artisticCutout;
-else if( sName == "artisticFilmGrain" )
-return XML_artisticFilmGrain;
-else if( sName == "artisticGlass" )
-return XML_artisticGlass;
-else if( sName == "artisticGlowDiffused" )
-return XML_artisticGlowDiffused;
-else if( sName == "artisticGlowEdges" )
-return XML_artisticGlowEdges;
-else if( sName == "artisticLightScreen" )
-return XML_artisticLightScreen;
-else if( sName == "artisticLineDrawing" )
-return XML_artisticLineDrawing;
-else if( sName == "artisticMarker" )
-return XML_artisticMarker;
-else if( sName == "artisticMosiaicBubbles" )
-return XML_artisticMosiaicBubbles;
-else if( sName == "artisticPaintStrokes" )
-return XML_artisticPaintStrokes;
-else if( sName == "artisticPaintBrush" )
-return XML_artisticPaintBrush;
-else if( sName == "artisticPastelsSmooth" )
-return XML_artisticPastelsSmooth;
-else if( sName == "artisticPencilGrayscale" )
-return XML_artisticPencilGrayscale;
-else if( sName == "artisticPencilSketch" )
-return XML_artisticPencilSketch;
-else if( sName == "artisticPhotocopy" )
-return XML_artisticPhotocopy;
-else if( sName == "artisticPlasticWrap" )
-return XML_artisticPlasticWrap;
-else if( sName == "artisticTexturizer" )
-return XML_artisticTexturizer;
-else if( sName == "artisticWatercolorSponge" )
-return XML_artisticWatercolorSponge;
-else if( sName == "brightnessContrast" )
-return XML_brightnessContrast;
-else if( sName == "colorTemperature" )
-return XML_colorTemperature;
-else if( sName == "saturation" )
-return XML_saturation;
-else if( sName == "sharpenSoften" )
-return XML_sharpenSoften;
+{ u"artisticBlur", XML_artisticBlur },
+{ u"artisticCement", XML_artisticCement },
+{ u"artisticChalkSketch", XML_artisticChalkSketch },
+{ u"artisticCrisscrossEtching", XML_artisticCrisscrossEtching },
+{ u"artisticCutout", XML_artisticCutout },
+{ u"artisticFilmGrain", XML_artisticFilmGrain },
+{ u"artisticGlass", XML_artisticGlass },
+{ u"artisticGlowDiffused", XML_artisticGlowDiffused },
+{ u"artisticGlowEdges", XML_artisticGlowEdges },
+{ u"artisticLightScreen", XML_artisticLightScreen },
+{ u"artisticLineDrawing", XML_artisticLineDrawing },
+{ u"artisticMarker", XML_artisticMarker },
+{ u"artisticMosiaicBubbles", XML_artisticMosiaicBubbles },
+{ u"artisticPaintStrokes", XML_artisticPaintStrokes },
+{ u"artisticPaintBrush", XML_artisticPaintBrush },
+{ u"artisticPastelsSmooth", XML_artisticPastelsSmooth },
+{ u"artisticPencilGrayscale", XML_artisticPencilGrayscale },
+{ u"artisticPencilSketch", XML_artisticPencilSketch },
+{ u"artisticPhotocopy", XML_artisticPhotocopy },
+{ u"artisticPlasticWrap", XML_artisticPlasticWrap },
+{ u"artisticTexturizer", XML_artisticTexturizer },
+{ u"artisticWatercolorSponge", XML_artisticWatercolorSponge },
+{ u"brightnessContrast", XML_brightnessContrast },
+{ u"colorTemperature", XML_colorTemperature },
+{ u"saturation", XML_saturation },
+{ u"sharpenSoften", XML_sharpenSoften },
 
 // 

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

2023-09-08 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/fillproperties.cxx |4 +++-
 sd/qa/unit/data/pptx/tdf156649.pptx |binary
 sd/qa/unit/export-tests.cxx |   14 ++
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit b0e8ce9967acf3a759e5b85c4a0d16d7dad275fe
Author: Sarper Akdemir 
AuthorDate: Thu Sep 7 13:53:25 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Sep 8 08:58:02 2023 +0200

tdf#156649: oox: correct import alphaModFix for custom shapes

alphaModFix should be imported into PROP_FillTransparency
for custom shapes.

Change-Id: I19621e424a64b097d5e6881877d60de253be636d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156660
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 9f18e7d65f7d..ff78f3183831 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -866,7 +866,9 @@ void GraphicProperties::pushToPropMap( PropertyMap& 
rPropMap, const GraphicHelpe
 
 if ( maBlipProps.moAlphaModFix.has_value() )
 {
-rPropMap.setProperty(PROP_Transparency, static_cast(100 
- (maBlipProps.moAlphaModFix.value() / PER_PERCENT)));
+rPropMap.setProperty(
+mbIsCustomShape ? PROP_FillTransparence : PROP_Transparency,
+static_cast(100 - 
(maBlipProps.moAlphaModFix.value() / PER_PERCENT)));
 }
 }
 rPropMap.setProperty(PROP_GraphicColorMode, eColorMode);
diff --git a/sd/qa/unit/data/pptx/tdf156649.pptx 
b/sd/qa/unit/data/pptx/tdf156649.pptx
new file mode 100644
index ..2b3b12a9a092
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf156649.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 61f6736fc33f..92971d4b4221 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1577,6 +1577,20 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf140714)
 CPPUNIT_ASSERT_EQUAL(OUString{ "com.sun.star.drawing.CustomShape" }, 
xShape->getShapeType());
 }
 
+CPPUNIT_TEST_FIXTURE(SdExportTest, testTdf156649)
+{
+createSdImpressDoc("pptx/tdf156649.pptx");
+saveAndReload("Impress Office Open XML");
+
+auto xShapeProps(getShapeFromPage(0, 0));
+// Without the fix in place, this test would have failed with
+//- Expected: 55
+//- Actual  : 0
+// i.e. alphaModFix wasn't imported as fill transparency for the custom 
shape
+CPPUNIT_ASSERT_EQUAL(sal_Int16(55),
+ 
xShapeProps->getPropertyValue("FillTransparence").get());
+}
+
 CPPUNIT_TEST_FIXTURE(SdExportTest, testMasterPageBackgroundFullSize)
 {
 createSdImpressDoc("odp/background.odp");


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

2023-08-30 Thread Tibor Nagy (via logerrit)
 oox/source/drawingml/customshapeproperties.cxx|   16 
 oox/source/token/properties.txt   |1 
 sd/qa/unit/data/pptx/tdf156829.pptx   |binary
 sd/qa/unit/data/xml/n762695_0.xml |1 
 sd/qa/unit/data/xml/n762695_1.xml |2 +
 sd/qa/unit/data/xml/tdf109317_0.xml   |3 ++
 sd/qa/unit/import-tests.cxx   |   28 ++
 svx/source/customshapes/EnhancedCustomShape2d.cxx |2 -
 8 files changed, 52 insertions(+), 1 deletion(-)

New commits:
commit 7b93531ba7f3edf98a54392cfc83dcf3185888bd
Author: Tibor Nagy 
AuthorDate: Sun Aug 27 18:39:17 2023 +0200
Commit: László Németh 
CommitDate: Wed Aug 30 11:57:11 2023 +0200

tdf#156829 PPTX import: fix connector regression at missing glue points

Glue points weren't imported if the custom shape type is
"non-primitive", resulting broken line connectors, moreover
broken graphic design, as attached to the original bug report.

~Regression from commit cbf66ec3e60d07efb7c3cceed9b4f0fb4f0510c8
"tdf#89449 PPTX import: fix line connectors".

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

diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index ac6fba8e7d53..766876385c64 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -228,6 +228,22 @@ void CustomShapeProperties::pushToPropSet(
 aPath.setProperty( PROP_TextFrames, aTextFrames);
 }
 
+if (!maConnectionSiteList.empty())
+{
+css::uno::Sequence seqGluePoints;
+seqGluePoints.realloc(maConnectionSiteList.size());
+sal_Int32 nId = 0;
+for (auto& rGluePoint : asNonConstRange(seqGluePoints))
+{
+rGluePoint.First.Value = 
maConnectionSiteList[nId].pos.First.Value;
+rGluePoint.First.Type = 
maConnectionSiteList[nId].pos.First.Type;
+rGluePoint.Second.Value = 
maConnectionSiteList[nId].pos.Second.Value;
+rGluePoint.Second.Type = 
maConnectionSiteList[nId].pos.Second.Type;
+nId++;
+}
+aPath.setProperty(PROP_GluePoints, seqGluePoints);
+}
+
 sal_uInt32 nParameterPairs = 0;
 for ( auto const & i: maPath2DList )
 nParameterPairs += i.parameter.size();
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index a6de5458b663..b5a3478f45b0 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -224,6 +224,7 @@ GenerateVbaEvents
 Geometry3D
 GlowEffect
 GlowEffectRadius
+GluePoints
 GradientName
 HatchName
 Graphic
diff --git a/sd/qa/unit/data/pptx/tdf156829.pptx 
b/sd/qa/unit/data/pptx/tdf156829.pptx
new file mode 100644
index ..423588377279
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf156829.pptx differ
diff --git a/sd/qa/unit/data/xml/n762695_0.xml 
b/sd/qa/unit/data/xml/n762695_0.xml
index ae755e644de7..59b226e0d5f8 100644
--- a/sd/qa/unit/data/xml/n762695_0.xml
+++ b/sd/qa/unit/data/xml/n762695_0.xml
@@ -63,6 +63,7 @@

   
  
+ 
  
   

diff --git a/sd/qa/unit/data/xml/n762695_1.xml 
b/sd/qa/unit/data/xml/n762695_1.xml
index a43924138f45..02d3b735da86 100644
--- a/sd/qa/unit/data/xml/n762695_1.xml
+++ b/sd/qa/unit/data/xml/n762695_1.xml
@@ -67,6 +67,7 @@

   
  
+ 
  
   

@@ -151,6 +152,7 @@

   
  
+ 
  
   

diff --git a/sd/qa/unit/data/xml/tdf109317_0.xml 
b/sd/qa/unit/data/xml/tdf109317_0.xml
index f34beafbdc80..74559e74 100644
--- a/sd/qa/unit/data/xml/tdf109317_0.xml
+++ b/sd/qa/unit/data/xml/tdf109317_0.xml
@@ -22,6 +22,7 @@


 
+ 
  
  
  
@@ -130,6 +131,7 @@


 
+ 
  
  
  
@@ -406,6 +408,7 @@


 
+ 
  
  
  
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 2345e17ee7a4..adc7c12e4632 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -203,6 +203,34 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testDocumentLayout)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SdImportTest, testFreeformShapeGluePoints)
+{
+createSdImpressDoc("pptx/tdf156829.pptx");
+uno::Reference xFreeformShape(getShapeFromPage(0, 0));
+uno::Sequence aProps;
+xFreeformShape->getPropertyValue("CustomShapeGeometry") >>= aProps;
+
+uno::Sequence aPathProps;
+for (beans::PropertyValue const& rProp : std::as_const(aProps))
+{
+if (rProp.Name == "Path")
+aPathProps = 
rProp.Value.get>();
+}
+
+uno::Sequence seqGluePoints;
+for (beans::PropertyValue 

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

2023-08-29 Thread Caolán McNamara (via logerrit)
 oox/source/drawingml/textparagraphproperties.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 7cdefb880ed6fd413b9e31fa45352cdeb074a24f
Author: Caolán McNamara 
AuthorDate: Tue Aug 29 08:39:52 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 29 11:07:39 2023 +0200

supplement setting SYMBOL encoded charset with SymbolFont flag

as well as using the well-known symbol font names

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

diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 9dd3a6c3c181..f011878f3dbf 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -314,19 +314,22 @@ void BulletList::pushToPropMap( const 
::oox::core::XmlFilterBase* pFilterBase, P
 if( pFilterBase) {
 bool bFollowTextFont = false;
 mbBulletFontFollowText >>= bFollowTextFont;
-if (!bFollowTextFont && maBulletFont.getFontData( aBulletFontName, 
nBulletFontPitch, nBulletFontFamily, nullptr, *pFilterBase ) )
+if (!bFollowTextFont && maBulletFont.getFontData( aBulletFontName, 
nBulletFontPitch, nBulletFontFamily, , *pFilterBase ) )
 {
 FontDescriptor aFontDesc;
 sal_Int16 nFontSize = 0;
 if( mnFontSize >>= nFontSize )
 aFontDesc.Height = nFontSize;
 
-// TODO either use getFontData encoding hint, or move this to the 
TextFont struct.
+// TODO It is likely that bSymbolFont from getFontData is 
sufficient to check here
+// and looking at the font name is not necessary, if it is 
necessary then moving
+// the name lookup into getFontData is likely the best fix
 aFontDesc.Name = aBulletFontName;
 aFontDesc.Pitch = nBulletFontPitch;
 aFontDesc.Family = nBulletFontFamily;
 aFontDesc.Weight = nBulletFontWeight;
-if ( aBulletFontName.equalsIgnoreAsciiCase("Wingdings") ||
+if ( bSymbolFont ||
+ aBulletFontName.equalsIgnoreAsciiCase("Wingdings") ||
  aBulletFontName.equalsIgnoreAsciiCase("Wingdings 2") ||
  aBulletFontName.equalsIgnoreAsciiCase("Wingdings 3") ||
  aBulletFontName.equalsIgnoreAsciiCase("Monotype Sorts") ||


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

2023-08-25 Thread Samuel Mehrbrodt (via logerrit)
 oox/source/export/drawingml.cxx|2 +-
 sd/qa/unit/data/odp/tdf150316.odp  |binary
 sd/qa/unit/export-tests-ooxml1.cxx |9 +
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 6e042b1e26bedcc8d8bdcf105ec750b03665c7b0
Author: Samuel Mehrbrodt 
AuthorDate: Fri Aug 25 15:05:42 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Fri Aug 25 20:50:00 2023 +0200

tdf#150316 Fix missing first line indent in pptx export

Change-Id: Ib2cac800b151823b77e44831100c2de9bbda8a16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156107
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 1230517eda81..98496aa2c1f8 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3440,7 +3440,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
 mpFS->startElementNS( XML_a, nElement,
XML_lvl, 
sax_fastparser::UseIf(OString::number(nLevel), nLevel > 0),
XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)),
 nParaLeftMargin > 0),
-   XML_indent, 
sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? 
oox::drawingml::convertHmmToEmu(nParaFirstLineIndent) : 0), (bForceZeroIndent 
|| (nParaFirstLineIndent != 0))),
+   XML_indent, 
sax_fastparser::UseIf(OString::number((bForceZeroIndent && nParaFirstLineIndent 
== 0) ? 0 : oox::drawingml::convertHmmToEmu(nParaFirstLineIndent)), 
(bForceZeroIndent || nParaFirstLineIndent != 0)),
XML_algn, GetAlignment( nAlignment ),
XML_defTabSz, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaDefaultTabSize)),
 nParaDefaultTabSize > 0),
XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), 
bRtl));
diff --git a/sd/qa/unit/data/odp/tdf150316.odp 
b/sd/qa/unit/data/odp/tdf150316.odp
new file mode 100644
index ..dab2971711f8
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf150316.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 2962456ffd49..0a9f82a27e59 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -1588,6 +1588,15 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, 
testNarrationMimeType)
 assertXPath(pSlideDoc, "//p:childTnLst/p:audio", "isNarration", "1");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf150316)
+{
+createSdImpressDoc("odp/tdf150316.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
+assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:p/a:pPr", 
"indent", "-343080");
+}
+
 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf140865Wordart3D)
 {
 createSdImpressDoc("pptx/tdf140865Wordart3D.pptx");


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

2023-08-18 Thread Samuel Mehrbrodt (via logerrit)
 oox/source/export/drawingml.cxx|   15 +++
 sd/qa/unit/data/pptx/tdf151134.odp |binary
 sd/qa/unit/export-tests-ooxml1.cxx |9 +
 3 files changed, 20 insertions(+), 4 deletions(-)

New commits:
commit 0367a168cd01f4a2c16101726714f696ba023a6f
Author: Samuel Mehrbrodt 
AuthorDate: Fri Aug 18 13:42:23 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Fri Aug 18 22:15:59 2023 +0200

tdf#151134 Always write inset properties when exporting placeholder shapes

The default value works for text boxes, but not for these special
presentation placeholder objects - here the values need to be written
explicitly.

Change-Id: Id606bd5e6b63dee2fd3b385435ce13ecec63b5f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155838
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 351c1b7cf265..6b464cf774ba 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -4010,6 +4010,9 @@ void DrawingML::WriteText(const Reference& 
rXIface, bool bBodyPr, bo
 sVertOverflow = "clip";
 }
 
+// tdf#151134 When writing placeholder shapes, inset must be 
explicitly specified
+bool bRequireInset = GetProperty(rXPropSet, "IsPresentationObject") && 
rXPropSet->getPropertyValue("IsPresentationObject").get();
+
 mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), 
XML_bodyPr,
XML_numCol, 
sax_fastparser::UseIf(OString::number(nCols), nCols > 0),
XML_spcCol, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nColSpacing)),
 nCols > 0 && nColSpacing >= 0),
@@ -4017,10 +4020,14 @@ void DrawingML::WriteText(const Reference& 
rXIface, bool bBodyPr, bo
XML_horzOverflow, sHorzOverflow,
XML_vertOverflow, sVertOverflow,
XML_fromWordArt, sax_fastparser::UseIf("1", 
bFromWordArt),
-   XML_lIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeft)), 
nLeft != constDefaultLeftRightInset),
-   XML_rIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRight)), 
nRight != constDefaultLeftRightInset),
-   XML_tIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nTop)), 
nTop != constDefaultTopBottomInset),
-   XML_bIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nBottom)),
 nBottom != constDefaultTopBottomInset),
+   XML_lIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeft)),
+   bRequireInset 
|| nLeft != constDefaultLeftRightInset),
+   XML_rIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRight)),
+   bRequireInset 
|| nRight != constDefaultLeftRightInset),
+   XML_tIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nTop)),
+   bRequireInset 
|| nTop != constDefaultTopBottomInset),
+   XML_bIns, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nBottom)),
+   bRequireInset 
|| nBottom != constDefaultTopBottomInset),
XML_anchor, sAnchor,
XML_anchorCtr, sax_fastparser::UseIf("1", 
bAnchorCtr),
XML_vert, sWritingMode,
diff --git a/sd/qa/unit/data/pptx/tdf151134.odp 
b/sd/qa/unit/data/pptx/tdf151134.odp
new file mode 100644
index ..56ea86a3144c
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf151134.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index ffc3530f40b6..1e7c05390d39 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -1666,6 +1666,15 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf137675)
 "none");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf151134)
+{
+createSdImpressDoc("pptx/tdf151134.odp");
+save("Impress Office Open XML");
+
+xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
+assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr", 
"lIns", "91440");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-08-15 Thread Mike Kaganski (via logerrit)
 oox/source/drawingml/fillproperties.cxx   |   24 
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |8 
 2 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit d2c7cbc7d724d608f6d37bbb0233ad2b39eb938e
Author: Mike Kaganski 
AuthorDate: Tue Aug 15 21:09:27 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Aug 15 21:41:24 2023 +0200

Simplify and improve conversion

Using o3tl::convert makes sure that rounding is correct, which
shows in the improved unit test, that now doesn't need different
values before and after roundtrip.

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index a11aeb6236ee..8cc400257155 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -105,9 +105,9 @@ std::optional 
CropQuotientsFromSrcRect(geometry::IntegerRectangle2D a
 aSrcRect.X2 = std::max(aSrcRect.X2, sal_Int32(0));
 aSrcRect.Y1 = std::max(aSrcRect.Y1, sal_Int32(0));
 aSrcRect.Y2 = std::max(aSrcRect.Y2, sal_Int32(0));
-if (aSrcRect.X1 + aSrcRect.X2 >= 100'000 || aSrcRect.Y1 + aSrcRect.Y2 >= 
100'000)
+if (aSrcRect.X1 + aSrcRect.X2 >= MAX_PERCENT || aSrcRect.Y1 + aSrcRect.Y2 
>= MAX_PERCENT)
 return {}; // Cropped everything
-return getQuotients(aSrcRect, 100'000.0, 100'000.0);
+return getQuotients(aSrcRect, MAX_PERCENT, MAX_PERCENT);
 }
 
 // ECMA-376 Part 1 20.1.8.30 fillRect (Fill Rectangle)
@@ -118,8 +118,8 @@ std::optional 
CropQuotientsFromFillRect(geometry::IntegerRectangle2D
 aFillRect.Y1 = std::min(aFillRect.Y1, sal_Int32(0));
 aFillRect.Y2 = std::min(aFillRect.Y2, sal_Int32(0));
 // Negative divisor and negative relative offset give positive value 
wanted in lclCropGraphic
-return getQuotients(aFillRect, -100'000.0 + aFillRect.X1 + aFillRect.X2,
--100'000.0 + aFillRect.Y1 + aFillRect.Y2);
+return getQuotients(aFillRect, -MAX_PERCENT + aFillRect.X1 + aFillRect.X2,
+-MAX_PERCENT + aFillRect.Y1 + aFillRect.Y2);
 }
 
 // Crops a piece of the bitmap. lclCropGraphic doesn't handle growing.
@@ -624,13 +624,13 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 {
 text::GraphicCrop aGraphCrop( 0, 0, 0, 0 );
 if ( aFillRect.X1 )
-aGraphCrop.Left = static_cast< sal_Int32 >( ( 
static_cast< double >( aOriginalSize.Width ) * aFillRect.X1 ) / 10 );
+aGraphCrop.Left = o3tl::convert(aFillRect.X1, 
aOriginalSize.Width, MAX_PERCENT);
 if ( aFillRect.Y1 )
-aGraphCrop.Top = static_cast< sal_Int32 >( ( 
static_cast< double >( aOriginalSize.Height ) * aFillRect.Y1 ) / 10 );
+aGraphCrop.Top = o3tl::convert(aFillRect.Y1, 
aOriginalSize.Height, MAX_PERCENT);
 if ( aFillRect.X2 )
-aGraphCrop.Right = static_cast< sal_Int32 >( ( 
static_cast< double >( aOriginalSize.Width ) * aFillRect.X2 ) / 10 );
+aGraphCrop.Right = o3tl::convert(aFillRect.X2, 
aOriginalSize.Width, MAX_PERCENT);
 if ( aFillRect.Y2 )
-aGraphCrop.Bottom = static_cast< sal_Int32 >( 
( static_cast< double >( aOriginalSize.Height ) * aFillRect.Y2 ) / 10 );
+aGraphCrop.Bottom = 
o3tl::convert(aFillRect.Y2, aOriginalSize.Height, MAX_PERCENT);
 
 bool bHasCropValues = aGraphCrop.Left != 0 || 
aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0;
 // Negative GraphicCrop values means "crop" here.
@@ -817,13 +817,13 @@ void GraphicProperties::pushToPropMap( PropertyMap& 
rPropMap, const GraphicHelpe
 {
 text::GraphicCrop aGraphCrop( 0, 0, 0, 0 );
 if ( oClipRect.X1 )
-aGraphCrop.Left = rtl::math::round( ( static_cast< double 
>( aOriginalSize.Width ) * oClipRect.X1 ) / 10 );
+aGraphCrop.Left = o3tl::convert(oClipRect.X1, 
aOriginalSize.Width, MAX_PERCENT);
 if ( oClipRect.Y1 )
-aGraphCrop.Top = rtl::math::round( ( static_cast< double 
>( aOriginalSize.Height ) * oClipRect.Y1 ) / 10 );
+aGraphCrop.Top = o3tl::convert(oClipRect.Y1, 
aOriginalSize.Height, MAX_PERCENT);
 if ( oClipRect.X2 )
-aGraphCrop.Right = rtl::math::round( ( static_cast< double 
>( aOriginalSize.Width ) * oClipRect.X2 ) / 10 );
+

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

2023-08-15 Thread Mike Kaganski (via logerrit)
 oox/source/drawingml/fillproperties.cxx   |   10 ++-
 sd/qa/unit/data/pptx/tdf153008-srcRect-smallNegBound.pptx |binary
 sd/qa/unit/import-tests2.cxx  |   19 ++
 3 files changed, 23 insertions(+), 6 deletions(-)

New commits:
commit 6c06c8a2be3d8cbbcb8ab1aaaeb04db95114dfcb
Author: Mike Kaganski 
AuthorDate: Tue Aug 15 14:42:20 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Aug 15 16:45:47 2023 +0200

tdf#153008: srcRect may have some members negative

The overly strict check (implying that all members must be non-negative,
to perform the crop) excluded valid cases where some of the members were
negative, and some positive.

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 7e2f5185b7f6..5edc71b8bc12 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -826,13 +826,11 @@ void GraphicProperties::pushToPropMap( PropertyMap& 
rPropMap, const GraphicHelpe
 aGraphCrop.Bottom = rtl::math::round( ( static_cast< 
double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 10 );
 rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
 
-bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right 
!=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0;
-// Positive GraphicCrop values means "crop" here.
-bool bNeedCrop = aGraphCrop.Left >= 0 && aGraphCrop.Right >= 0 
&& aGraphCrop.Top >= 0 && aGraphCrop.Bottom >= 0;
-
-if(mbIsCustomShape && bHasCropValues && bNeedCrop)
+if(mbIsCustomShape)
 {
-xGraphic = lclCropGraphic(xGraphic, 
CropQuotientsFromSrcRect(oClipRect));
+// Positive GraphicCrop values means "crop" here.
+if (aGraphCrop.Left > 0 || aGraphCrop.Right > 0 || 
aGraphCrop.Top > 0 || aGraphCrop.Bottom > 0)
+xGraphic = lclCropGraphic(xGraphic, 
CropQuotientsFromSrcRect(oClipRect));
 }
 }
 }
diff --git a/sd/qa/unit/data/pptx/tdf153008-srcRect-smallNegBound.pptx 
b/sd/qa/unit/data/pptx/tdf153008-srcRect-smallNegBound.pptx
new file mode 100644
index ..9870e3f2e2e9
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/tdf153008-srcRect-smallNegBound.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 4d197b364449..4e535c7749c7 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1918,6 +1918,25 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, 
testIndentDuplication)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nIndent2);
 }
 
+CPPUNIT_TEST_FIXTURE(SdImportTest2, test_srcRect_smallNegBound)
+{
+// Given a cropped custom shape, with a srcRect having a small negative 
value in one of bounds
+createSdImpressDoc("pptx/tdf153008-srcRect-smallNegBound.pptx");
+
+uno::Reference xGraphic(
+getShapeFromPage(0, 0)->getPropertyValue("FillBitmap"), 
uno::UNO_QUERY_THROW);
+
+BitmapEx aBitmap(Graphic(xGraphic).GetBitmapEx());
+
+// Properly cropped bitmap should have black pixels close to left edge, 
near vertical center.
+// Before the fix, the gear was distorted, and this area was white.
+auto yMiddle = aBitmap.GetSizePixel().Height() / 2;
+auto x5Percent = aBitmap.GetSizePixel().Width() / 20;
+CPPUNIT_ASSERT(aBitmap.GetPixelColor(x5Percent, yMiddle).IsDark());
+// Just in case, check that the corner is bright (it is in fact yellow)
+CPPUNIT_ASSERT(aBitmap.GetPixelColor(0, 0).IsBright());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-08-11 Thread Noel Grandin (via logerrit)
 oox/source/drawingml/textparagraphproperties.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 996890180dc143df1de97072c81799ec1f1de083
Author: Noel Grandin 
AuthorDate: Fri Aug 11 12:08:14 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 11 14:15:44 2023 +0200

reduce noise in debug logs

Only set this property if the object supports it

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

diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index df3d36a21003..949ee3f22d6b 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -420,7 +420,8 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 }
 else if ( pMasterBuList && pMasterBuList->mnNumberingType.hasValue() )
 pMasterBuList->mnNumberingType >>= nNumberingType;
-if ( nNumberingType == NumberingType::NUMBER_NONE )
+if ( nNumberingType == NumberingType::NUMBER_NONE
+&& aPropSet.hasProperty(PROP_NumberingLevel) )
 aPropSet.setProperty< sal_Int16 >( PROP_NumberingLevel, -1 );
 
 maBulletList.pushToPropMap( pFilterBase, rioBulletMap );


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

2023-08-07 Thread Szymon Kłos (via logerrit)
 oox/source/ppt/pptshape.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit b430cc2c3fba0ef2e56a1eb8610681c66714ef80
Author: Szymon Kłos 
AuthorDate: Fri Jul 28 12:16:36 2023 +0200
Commit: Szymon Kłos 
CommitDate: Mon Aug 7 10:07:44 2023 +0200

pptx: import ellipse shape correctly

Preset geometry "ellipse" was ignored:


Don't change service name to com.sun.star.presentation.OutlinerShape
it should stay CustomShape to be correctly shown as an ellipse.

Added next case: XML_body subtype in Layout and Slide mode.

This is continuation for:
commit 6df267780c4d41b41101c1be0a954b2f16ee8012
tdf#132557: PPTX import: Workaround for slide footer shape presets

Signed-off-by: Szymon Kłos 
Change-Id: Ifb914c58203a1ad533f9cc9b1857a48983354de6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155015
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 
(cherry picked from commit e63a9553c022a9976d59113938df068f9d2b5d6c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155233
Tested-by: Jenkins

diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index a68ad18cf5b2..7b5b46546e3d 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -336,8 +336,10 @@ void PPTShape::addShape(
 // Need to use service name css.drawing.CustomShape if they have a non 
default shape.
 // This workaround has the drawback of them not really being processed 
as placeholders
 // so it is only done for slide footers...
-if ((mnSubType == XML_sldNum || mnSubType == XML_dt || mnSubType == 
XML_ftr)
-&& meShapeLocation == Slide && 
!mpCustomShapePropertiesPtr->representsDefaultShape())
+bool convertInSlideMode = meShapeLocation == Slide &&
+(mnSubType == XML_sldNum || mnSubType == XML_dt || mnSubType == 
XML_ftr || mnSubType == XML_body);
+bool convertInLayoutMode = meShapeLocation == Layout && (mnSubType == 
XML_body);
+if ((convertInSlideMode || convertInLayoutMode) && 
!mpCustomShapePropertiesPtr->representsDefaultShape())
 {
 sServiceName = "com.sun.star.drawing.CustomShape";
 }


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

2023-08-04 Thread Szymon Kłos (via logerrit)
 oox/source/ppt/pptshape.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ccd07c3bf5849a7939ea02a46b1c160ede16f03c
Author: Szymon Kłos 
AuthorDate: Wed Aug 2 08:57:54 2023 +0200
Commit: Szymon Kłos 
CommitDate: Fri Aug 4 09:14:37 2023 +0200

oox: don't use master style by default

By default a shape with empty type attribute in placeholder tag: 
will get subtype = XML_obj (oox/source/drawingml/shapecontext.cxx:81)

When it is not referencing any master style shape by idx attribute
we shouldn't use master list style to be compatible with MSO.

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

diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index daa482eab94f..b6dd0f1c4603 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -206,7 +206,8 @@ void PPTShape::addShape(
case XML_obj :
 {
 sServiceName = sOutlinerShapeService;
-aMasterTextListStyle = rSlidePersist.getMasterPersist() ? 
rSlidePersist.getMasterPersist()->getBodyTextStyle() : 
rSlidePersist.getBodyTextStyle();
+if (getSubTypeIndex().has_value())
+aMasterTextListStyle = 
rSlidePersist.getMasterPersist() ? 
rSlidePersist.getMasterPersist()->getBodyTextStyle() : 
rSlidePersist.getBodyTextStyle();
 }
 break;
 case XML_body :


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

2023-07-05 Thread Xisco Fauli (via logerrit)
 oox/source/export/shapes.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4567008914239b26533c1968820bf461d606f96d
Author: Xisco Fauli 
AuthorDate: Wed Jul 5 09:55:18 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jul 5 12:10:43 2023 +0200

oox: fix crash in lcl_GetGluePointId

See 
https://crashreport.libreoffice.org/stats/signature/static%20long%20oox::drawingml::lcl_GetGluePointId(const%20class%20com::sun::star::uno::Reference%3Ccom::sun::star::drawing::XShape%3E%20&%20const,%20long)

Regression from b7c542b5085374f1d031183cb86ceeefcf24964d
"tdf#154363 sd: fix line connectors regression of mirrored shapes"

Change-Id: I926d32f5b68582df588c28a800b0ec10e7e3e19f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154021
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index efde8de56f72..fc702c1c3a22 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1675,7 +1675,8 @@ static sal_Int32 lcl_GetGluePointId(const 
Reference& xShape, sal_Int32 n
 bool bFlipH = false;
 bool bFlipV = false;
 Reference xShapeProps(xShape, UNO_QUERY);
-if 
(xShapeProps->getPropertySetInfo()->hasPropertyByName("CustomShapeGeometry"))
+if (xShapeProps.is() && xShapeProps->getPropertySetInfo()
+&& 
xShapeProps->getPropertySetInfo()->hasPropertyByName("CustomShapeGeometry"))
 {
 Sequence aGeometrySeq;
 xShapeProps->getPropertyValue("CustomShapeGeometry") >>= 
aGeometrySeq;


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

2023-06-28 Thread Tünde Tóth (via logerrit)
 oox/source/export/shapes.cxx|5 -
 sw/qa/extras/ooxmlexport/data/tdf155903.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx  |6 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 863a32171ed8efdf1aaee59918e49613e7ccd7a9
Author: Tünde Tóth 
AuthorDate: Mon Jun 26 15:01:26 2023 +0200
Commit: László Németh 
CommitDate: Wed Jun 28 13:38:22 2023 +0200

tdf155903 DOCX export: fix corrupt file with embedded media

Regression from commit bc72514f90d90e1ab3fed8167663e835edf03508
"tdf#53970 PPTX: fix export of embedded media files".

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

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index dceb4ee706f8..efde8de56f72 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1272,7 +1272,10 @@ void ShapeExport::WriteGraphicObjectShapePart( const 
Reference< XShape >& xShape
 xShapeProps->getPropertyValue("Graphic") >>= xGraphic;
 }
 
-bool bHasMediaURL = xShapeProps.is() && 
xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL") && 
(xShapeProps->getPropertyValue("MediaURL") >>= sMediaURL);
+// tdf#155903 Only for PPTX, Microsoft does not support this feature in 
Word and Excel.
+bool bHasMediaURL = GetDocumentType() == DOCUMENT_PPTX && xShapeProps.is()
+&& 
xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL")
+&& (xShapeProps->getPropertyValue("MediaURL") >>= 
sMediaURL);
 
 if (!xGraphic.is() && !bHasMediaURL)
 {
diff --git a/sw/qa/extras/ooxmlexport/data/tdf155903.odt 
b/sw/qa/extras/ooxmlexport/data/tdf155903.odt
new file mode 100644
index ..97ba58d892dd
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf155903.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 9183863c8af7..4d1136f24c42 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -864,6 +864,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf155736, 
"tdf155736_PageNumbers_footer.docx")
 CPPUNIT_ASSERT_EQUAL(OUString("Page * of *"), 
parseDump("/root/page[2]/footer/txt/text()"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf155903, "tdf155903.odt")
+{
+// Without the accompanying fix in place, this test would have crashed,
+// because the exported file was corrupted.
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-06-20 Thread Tünde Tóth (via logerrit)
 oox/source/export/chartexport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6b3e29536ca770d7c2c42429390785c326d223ae
Author: Tünde Tóth 
AuthorDate: Thu Jun 1 15:25:45 2023 +0200
Commit: László Németh 
CommitDate: Tue Jun 20 13:10:15 2023 +0200

tdf#145651 Chart OOXML export: fix write error in exportSolidFill

Don't export the background color, if the FillColor property is empty.

Steps to reproduce:

1. E.g. in Impress, insert a chart (Insert > Chart...).

2. In chart editing mode, select the legend, use the "sidebar > Area >
Fill" and change from "none" to "color". Notice how the default blue
that is used does not correspond to the colour in the colour picker
right underneath.

3. Save as > OOXML format.

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

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 29f25b82b944..f0a301f79136 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1889,9 +1889,9 @@ void ChartExport::exportSolidFill(const Reference< 
XPropertySet >& xPropSet)
 // Similar to DrawingML::WriteSolidFill, but gradient access via name
 // and currently no InteropGrabBag
 // get fill color
-if (!GetProperty( xPropSet, "FillColor" ))
+sal_uInt32 nFillColor = 0;
+if (!GetProperty(xPropSet, "FillColor") || !(mAny >>= nFillColor))
 return;
-sal_uInt32 nFillColor = mAny.get();
 
 sal_Int32 nAlpha = MAX_PERCENT;
 if (GetProperty( xPropSet, "FillTransparence" ))


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

2023-06-19 Thread Tomaž Vajngerl (via logerrit)
 oox/source/export/ThemeExport.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 23a7fb9582fba4e5b699f0ea4bb270719256b403
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:25:40 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 19 10:07:28 2023 +0200

oox: ThemeExport - add "relationship" xml:r namespace

Blips are referenced by r:embed element, which needs the xmlns:r
to be present, so add it at the toplevel.

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

diff --git a/oox/source/export/ThemeExport.cxx 
b/oox/source/export/ThemeExport.cxx
index 8d2d90fe1598..87cb5f2bc0bc 100644
--- a/oox/source/export/ThemeExport.cxx
+++ b/oox/source/export/ThemeExport.cxx
@@ -52,7 +52,8 @@ void ThemeExport::write(OUString const& rPath, model::Theme 
const& rTheme)
 OUString aThemeName = rTheme.GetName();
 
 mpFS->startElementNS(XML_a, XML_theme, FSNS(XML_xmlns, XML_a),
- mpFilterBase->getNamespaceURL(OOX_NS(dml)), XML_name, 
aThemeName);
+ mpFilterBase->getNamespaceURL(OOX_NS(dml)), 
FSNS(XML_xmlns, XML_r),
+ mpFilterBase->getNamespaceURL(OOX_NS(officeRel)), 
XML_name, aThemeName);
 
 mpFS->startElementNS(XML_a, XML_themeElements);
 


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

2023-06-17 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/table/predefined-table-styles.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 48af1ee603149f09236f980c7b323997696bd946
Author: Andrea Gelmini 
AuthorDate: Sat Jun 17 15:12:07 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Jun 17 20:53:48 2023 +0200

Fix typo in code

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

diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx 
b/oox/source/drawingml/table/predefined-table-styles.cxx
index 513637e3c7ee..451759036835 100644
--- a/oox/source/drawingml/table/predefined-table-styles.cxx
+++ b/oox/source/drawingml/table/predefined-table-styles.cxx
@@ -204,9 +204,9 @@ constexpr frozen::unordered_map tokens{
 
 sal_Int32 resolveToken(OUString const& rString)
 {
-auto interator = tokens.find(rString);
-if (interator != tokens.end())
-return interator->second;
+auto iterator = tokens.find(rString);
+if (iterator != tokens.end())
+return iterator->second;
 return XML_dk1;
 }
 


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

2023-06-14 Thread Noel Grandin (via logerrit)
 oox/source/drawingml/shapecontext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit de9107b2b875aa485f2375300cc1ce2c16ffdf89
Author: Noel Grandin 
AuthorDate: Wed Jun 14 11:52:23 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 14 13:00:11 2023 +0200

SAL_WARN->SAL_INFO in oox::ShapeContext

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

diff --git a/oox/source/drawingml/shapecontext.cxx 
b/oox/source/drawingml/shapecontext.cxx
index 3ac32abd11aa..d14864ede331 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -124,7 +124,7 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 
aElementToken, const
 case XML_nvSpPr:
 break;
 default:
-SAL_WARN("oox", "ShapeContext::onCreateContext: unhandled element: " 
<< getBaseToken(aElementToken));
+SAL_INFO("oox", "ShapeContext::onCreateContext: unhandled element: " 
<< getBaseToken(aElementToken));
 break;
 }
 


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

2023-06-13 Thread Henry Castro (via logerrit)
 oox/source/token/tokens.txt   |1 +
 sc/source/filter/inc/condformatbuffer.hxx |3 +++
 sc/source/filter/oox/condformatbuffer.cxx |   15 +++
 sc/source/filter/oox/extlstcontext.cxx|6 ++
 4 files changed, 25 insertions(+)

New commits:
commit aebf004ae72e914540526269499bae27f39e04bf
Author: Henry Castro 
AuthorDate: Fri Mar 17 10:34:15 2023 -0400
Commit: Henry Castro 
CommitDate: Tue Jun 13 17:45:46 2023 +0200

sc: filter: oox: add missing tag "fillcolor"

To fill the positive color of the conditional format data bar:


 
 
 
 
 


Signed-off-by: Henry Castro 
Change-Id: I17e83a01a292ff941d92f6ae59954aa246ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149064
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152965
Tested-by: Jenkins

diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index dee9010df789..eb5239d8a8ac 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -2228,6 +2228,7 @@ fileType
 fileVersion
 filetime
 fill
+fillColor
 fillClrLst
 fillFormulas
 fillId
diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index 992f14e041a8..1180b1e0aa74 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -237,6 +237,7 @@ struct ExCfRuleModel
 ExCfRuleModel() : mnAxisColor( ColorTransparency, UNSIGNED_RGB_TRANSPARENT 
), mnNegativeColor( ColorTransparency, UNSIGNED_RGB_TRANSPARENT ), mbGradient( 
false ), mbIsLower( true ) {}
 // AxisColor
 ::Color mnAxisColor;
+::Color mnPositiveColor;
 // NegativeFillColor
 ::Color mnNegativeColor;
 OUString maAxisPosition; // DataBar
@@ -250,6 +251,7 @@ class ExtCfDataBarRule : public WorksheetHelper
 enum RuleType
 {
 DATABAR,
+POSITIVEFILLCOLOR,
 NEGATIVEFILLCOLOR,
 AXISCOLOR,
 CFVO,
@@ -263,6 +265,7 @@ public:
 ExtCfDataBarRule(ScDataBarFormatData* pTarget, const WorksheetHelper& 
rParent);
 void finalizeImport();
 void importDataBar(  const AttributeList& rAttribs );
+void importPositiveFillColor(  const AttributeList& rAttribs );
 void importNegativeFillColor(  const AttributeList& rAttribs );
 void importAxisColor(  const AttributeList& rAttribs );
 void importCfvo(  const AttributeList& rAttribs );
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index ac5c2738aa47..63e75170a367 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1322,6 +1322,12 @@ void ExtCfDataBarRule::finalizeImport()
 pDataBar->maAxisColor = maModel.mnAxisColor;
 break;
 }
+case POSITIVEFILLCOLOR:
+{
+ScDataBarFormatData* pDataBar = mpTarget;
+pDataBar->maPositiveColor = maModel.mnPositiveColor;
+break;
+}
 case NEGATIVEFILLCOLOR:
 {
 ScDataBarFormatData* pDataBar = mpTarget;
@@ -1367,6 +1373,15 @@ void ExtCfDataBarRule::importDataBar( const 
AttributeList& rAttribs )
 maModel.maAxisPosition = rAttribs.getString( XML_axisPosition, "automatic" 
);
 }
 
+void ExtCfDataBarRule::importPositiveFillColor( const AttributeList& rAttribs )
+{
+mnRuleType = POSITIVEFILLCOLOR;
+ThemeBuffer& rThemeBuffer = getTheme();
+GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+::Color aColor = importOOXColor(rAttribs, rThemeBuffer, rGraphicHelper);
+maModel.mnPositiveColor = aColor;
+}
+
 void ExtCfDataBarRule::importNegativeFillColor( const AttributeList& rAttribs )
 {
 mnRuleType = NEGATIVEFILLCOLOR;
diff --git a/sc/source/filter/oox/extlstcontext.cxx 
b/sc/source/filter/oox/extlstcontext.cxx
index 45e60e7c6f5e..760ba26c1727 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -56,6 +56,12 @@ void ExtCfRuleContext::onStartElement( const AttributeList& 
rAttribs )
 xRule->importDataBar( rAttribs );
 break;
 }
+case XLS14_TOKEN( fillColor ):
+{
+ExtCfDataBarRuleRef xRule = 
getCondFormats().createExtCfDataBarRule(mpTarget);
+xRule->importPositiveFillColor( rAttribs );
+break;
+}
 case XLS14_TOKEN( negativeFillColor ):
 {
 ExtCfDataBarRuleRef xRule = 
getCondFormats().createExtCfDataBarRule(mpTarget);


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

2023-06-13 Thread Caolán McNamara (via logerrit)
 oox/source/export/drawingml.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit f412c1e448b0268294ccbccee4f3a6a9e76a7b98
Author: Caolán McNamara 
AuthorDate: Tue Jun 13 14:37:56 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 13 16:55:07 2023 +0200

cid#1532377 Dereference before null check

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 5b0772550471..dca260895af8 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -761,6 +761,14 @@ void DrawingML::WriteGradientFill(
 basegfx::utils::prepareColorStops(*pTransparenceGradient, aAlphaStops, 
aSingleAlpha);
 }
 
+if (nullptr == pGradient)
+{
+// an error - see comment in header - is to give neither pColorGradient
+// nor pTransparenceGradient
+assert(false && "pColorGradient or pTransparenceGradient should be 
set");
+return;
+}
+
 // apply steps if used. Need to do that before synchronizeColorStops
 // since that may add e.g. for AlphaStops all-the-same no-data entries,
 // so the number of entries might change
@@ -775,12 +783,10 @@ void DrawingML::WriteGradientFill(
 // method (at import time) will be exported again
 basegfx::utils::synchronizeColorStops(aColorStops, aAlphaStops, 
aSingleColor, aSingleAlpha);
 
-if (aColorStops.size() != aAlphaStops.size() || nullptr == pGradient)
+if (aColorStops.size() != aAlphaStops.size())
 {
 // this is an error - synchronizeColorStops above *has* to create that
 // state, see description there (!)
-// also an error - see comment in header - is to give neither 
pColorGradient
-// nor pTransparenceGradient
 assert(false && "oox::WriteGradientFill: non-synchronized gradients 
(!)");
 return;
 }


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

2023-06-11 Thread Tomaž Vajngerl (via logerrit)
 oox/source/drawingml/textcharacterproperties.cxx|2 
 oox/source/token/properties.txt |1 
 sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx  |   16 +++
 sw/source/filter/ww8/docxattributeoutput.cxx|   10 +-
 writerfilter/source/dmapper/DomainMapper.cxx|   42 
++
 writerfilter/source/dmapper/PropertyIds.cxx |1 
 writerfilter/source/dmapper/PropertyIds.hxx |1 
 8 files changed, 70 insertions(+), 3 deletions(-)

New commits:
commit 953ef30494661788b2e980ece84b62c653d77321
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 11 00:50:08 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 12 05:26:11 2023 +0200

ooxml: import and export char underline theme colors

This adds support to import and export char underline theme color
properties.

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

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 0e1e2830a67f..1217c19441ae 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -206,6 +206,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 {
 rPropMap.setProperty( PROP_CharUnderlineHasColor, true);
 rPropMap.setProperty( PROP_CharUnderlineColor, 
maUnderlineColor.getColor( rFilter.getGraphicHelper() ));
+model::ComplexColor aComplexColor = maUnderlineColor.getComplexColor();
+rPropMap.setProperty( PROP_CharUnderlineComplexColor, 
model::color::createXComplexColor(aComplexColor));
 }
 else
 {
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 40988ffb0222..025b0628b9d8 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -91,6 +91,7 @@ CharStyleName
 CharTransparence
 CharUnderline
 CharUnderlineColor
+CharUnderlineComplexColor
 CharUnderlineHasColor
 CharWeight
 CharWeightAsian
diff --git a/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx 
b/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx
new file mode 100644
index ..3ee3cdf457f0
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx 
b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
index 3804f4606187..f9e7155859ea 100644
--- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
@@ -81,6 +81,22 @@ DECLARE_SW_ROUNDTRIP_TEST(testThemePortionBorderColor_DOCX, 
"Test_ThemeBorderCol
 CPPUNIT_ASSERT(isPropertyVoid(xParagraph, "RightBorderComplexColor"));
 }
 
+DECLARE_SW_ROUNDTRIP_TEST(testCharUnderlineTheme_DOCX, 
"Test_CharUnderlineThemeColor.docx", nullptr,
+  Test)
+{
+auto xParagraph = getParagraph(1);
+CPPUNIT_ASSERT(xParagraph.is());
+auto xRun = getRun(xParagraph, 1);
+auto xComplexColor
+= getProperty>(xRun, 
"CharUnderlineComplexColor");
+auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, 
aComplexColor.getSchemeType());
+auto const& rTransforms = aComplexColor.getTransformations();
+CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size());
+CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, 
rTransforms[0].meType);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index f5742eae4515..a75682761d84 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7953,10 +7953,14 @@ void DocxAttributeOutput::CharUnderline( const 
SvxUnderlineItem& rUnderline )
 bool  bUnderlineHasColor = !aUnderlineColor.IsTransparent();
 if (bUnderlineHasColor)
 {
+model::ComplexColor const& rComplexColor = 
rUnderline.getComplexColor();
 // Underline has a color
-m_pSerializer->singleElementNS( XML_w, XML_u,
-FSNS( XML_w, XML_val ), 
pUnderlineValue,
-FSNS( XML_w, XML_color ), 
msfilter::util::ConvertColor(aUnderlineColor) );
+rtl::Reference pAttrList = 
FastSerializerHelper::createAttrList();
+pAttrList->add(FSNS(XML_w, XML_val), pUnderlineValue);
+pAttrList->add(FSNS(XML_w, XML_color), 
msfilter::util::ConvertColor(aUnderlineColor));
+ 

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

2023-05-23 Thread Armin Le Grand (allotropia) (via logerrit)
 oox/source/export/drawingml.cxx |   61 ++--
 svx/source/xoutdev/xattr.cxx|7 
 2 files changed, 48 insertions(+), 20 deletions(-)

New commits:
commit e6ad415037b0b0bc77cd742af8260d99c1610c11
Author: Armin Le Grand (allotropia) 
AuthorDate: Mon May 22 12:13:25 2023 +0200
Commit: Armin Le Grand 
CommitDate: Tue May 23 10:11:48 2023 +0200

MCGR: Check correctly for used FillTransparenceGradient

To correctly check using UNO API if a FillTransparence-
Gradient is used it is necessary to check if a Name for
it is set. This corresponds to the IsEnabled() state
of the XFillFloatTransparenceItem in the core.

This was not consequently done that way and e.g. was
done by checking if the FTG was 'default' in the sense
that the StartColor was COL_BLACK. This was never
sufficient and is not with MCGRs, too.

Important in this case is the UnitTest checking for
file fdo66688.docx - the re-export/roundtrip goes
wrong when not doing this correctly.

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8bfcc8df5577..bd58cbf21249 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -473,15 +473,22 @@ void DrawingML::WriteSolidFill( const Reference< 
XPropertySet >& rXPropSet )
 // OOXML has no separate transparence gradient but uses transparency in 
the gradient stops.
 // So we merge transparency and color and use gradient fill in such case.
 basegfx::BGradient aTransparenceGradient;
+OUString sFillTransparenceGradientName;
 bool bNeedGradientFill(false);
 
-if (GetProperty(rXPropSet, "FillTransparenceGradient"))
+if (GetProperty(rXPropSet, "FillTransparenceGradientName")
+&& (mAny >>= sFillTransparenceGradientName)
+&& !sFillTransparenceGradientName.isEmpty()
+&& GetProperty(rXPropSet, "FillTransparenceGradient"))
 {
 aTransparenceGradient = basegfx::BGradient(mAny);
 basegfx::BColor aSingleColor;
 bNeedGradientFill = 
!aTransparenceGradient.GetColorStops().isSingleColor(aSingleColor);
 
-if (!bNeedGradientFill && aSingleColor != basegfx::BColor())
+// we no longer need to 'guess' if FillTransparenceGradient is used by
+// comparing it's 1st color to COL_BLACK after having tested that the
+// FillTransparenceGradientName is set
+if (!bNeedGradientFill)
 {
 // Our alpha is a gray color value.
 const sal_uInt8 nRed(aSingleColor.getRed() * 255.0);
@@ -639,13 +646,11 @@ void DrawingML::WriteGradientFill( const Reference< 
XPropertySet >& rXPropSet )
 
 if (GetProperty(rXPropSet, "FillTransparenceGradientName")
 && (mAny >>= sFillTransparenceGradientName)
-&& !sFillTransparenceGradientName.isEmpty())
+&& !sFillTransparenceGradientName.isEmpty()
+&& GetProperty(rXPropSet, "FillTransparenceGradient"))
 {
-if (GetProperty(rXPropSet, "FillTransparenceGradient"))
-{
-aTransparenceGradient = basegfx::BGradient(mAny);
-}
-
+// TransparenceGradient is only used when name is not empty
+aTransparenceGradient = basegfx::BGradient(mAny);
 pTransparenceGradient = 
 }
 else if (GetProperty(rXPropSet, "FillTransparence"))
@@ -5314,19 +5319,35 @@ void DrawingML::WriteFill(const 
Reference& xPropSet, const awt::Si
 xPropSet->getPropertyValue( "FillStyle" ) >>= aFillStyle;
 
 // map full transparent background to no fill
-if ( aFillStyle == FillStyle_SOLID && GetProperty( xPropSet, 
"FillTransparence" ) )
-{
-sal_Int16 nVal = 0;
-xPropSet->getPropertyValue( "FillTransparence" ) >>= nVal;
-if ( nVal == 100 )
-aFillStyle = FillStyle_NONE;
-}
-if (aFillStyle == FillStyle_SOLID && GetProperty( xPropSet, 
"FillTransparenceGradient"))
+if (aFillStyle == FillStyle_SOLID)
 {
-awt::Gradient aTransparenceGradient;
-mAny >>= aTransparenceGradient;
-if (aTransparenceGradient.StartColor == 0xff && 
aTransparenceGradient.EndColor == 0xff)
-aFillStyle = FillStyle_NONE;
+OUString sFillTransparenceGradientName;
+
+if (GetProperty(xPropSet, "FillTransparenceGradientName")
+&& (mAny >>= sFillTransparenceGradientName)
+&& !sFillTransparenceGradientName.isEmpty()
+&& GetProperty(xPropSet, "FillTransparenceGradient"))
+{
+// check if a fully transparent TransparenceGradient is used
+// use BGradient constructor & tooling here now
+const basegfx::BGradient aTransparenceGradient(mAny);
+   

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

2023-05-19 Thread Andrea Gelmini (via logerrit)
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0a8648f6d334a5aee4e39e265acacb655ae1d5b1
Author: Andrea Gelmini 
AuthorDate: Fri May 19 11:22:52 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri May 19 13:44:28 2023 +0200

Fix typo

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ef4e4ea2b445..8bfcc8df5577 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -611,7 +611,7 @@ void DrawingML::WriteGradientFill( const Reference< 
XPropertySet >& rXPropSet )
 if( rProp.Name == "GradFillDefinition" )
 rProp.Value >>= aGradientStops;
 else if( rProp.Name == "OriginalGradFill" )
-// use BGradient constructor direcly, it will take care of 
Gradient/Gradient2
+// use BGradient constructor directly, it will take care of 
Gradient/Gradient2
 aOriginalGradient = basegfx::BGradient(rProp.Value);
 }
 


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

2023-05-09 Thread Andrea Gelmini (via logerrit)
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 91bdd2fa1a8d602a2af26dfbc38cdd09f2e8394e
Author: Andrea Gelmini 
AuthorDate: Wed May 3 19:55:51 2023 +0200
Commit: Julien Nabet 
CommitDate: Tue May 9 19:25:18 2023 +0200

Fix typo

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ad07308ada62..9f705a20cf9e 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -860,7 +860,7 @@ void DrawingML::WriteGradientFill(
 // Caution: do not add 1st entry again, that would be double 
since it was
 // already added as last element of the inverse run above. But 
only if
 // the gradient has a start entry for 0.0 aka StartColor, else 
it is correct.
-// Since aColorStops and aAlphaStops are already syched (see
+// Since aColorStops and aAlphaStops are already synched (see
 // synchronizeColorStops above), testing one of them is 
sufficient here.
 aCurrColor++;
 aCurrAlpha++;


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

2023-05-08 Thread Eike Rathke (via logerrit)
 oox/source/helper/attributelist.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c742ab96ccac05465d87e860838c92f1f370aea3
Author: Eike Rathke 
AuthorDate: Mon May 8 14:25:28 2023 +0200
Commit: Eike Rathke 
CommitDate: Mon May 8 23:18:46 2023 +0200

Do not copy decodeXString() string and analyse if there is nothing to decode

... which usually isn't.

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

diff --git a/oox/source/helper/attributelist.cxx 
b/oox/source/helper/attributelist.cxx
index 037483cefb5a..7a973975f3d2 100644
--- a/oox/source/helper/attributelist.cxx
+++ b/oox/source/helper/attributelist.cxx
@@ -98,6 +98,9 @@ OUString AttributeConversion::decodeXString( const OUString& 
rValue )
 // string shorter than one encoded character - no need to decode
 if( rValue.getLength() < XSTRING_ENCCHAR_LEN )
 return rValue;
+if (rValue.indexOf(u"_x") == -1)
+return rValue;
+
 OUStringBuffer aBuffer;
 const sal_Unicode* pcStr = rValue.getStr();
 const sal_Unicode* pcEnd = pcStr + rValue.getLength();


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

2023-04-26 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/drawingmltypes.cxx |4 ++--
 sd/qa/unit/export-tests-ooxml3.cxx  |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7dd994f8303a2b9396ed3848104028ff724e3bab
Author: Sarper Akdemir 
AuthorDate: Tue Apr 25 08:48:36 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Apr 26 21:13:31 2023 +0200

pptx export: fix export of vertical table text

The mapping (implemented in 77655fc3dca05d4bb2366e67ccea228e3886bfe2)
used on export and the accompanying roundtrip test was incorrect. This
patch fixes both.

Rotation value of
- 9000 maps to vert270
- 27000 maps to vert

Change-Id: I9a9f889a2bff0241e62ee685492034eec6d0cccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150955
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/oox/source/drawingml/drawingmltypes.cxx 
b/oox/source/drawingml/drawingmltypes.cxx
index ff8c46050c15..30fed83f4391 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -382,9 +382,9 @@ std::optional GetTextVerticalType(sal_Int32 
nRotateAngle)
 switch (nRotateAngle)
 {
   case 9000:
-  return "vert";
-  case 27000:
   return "vert270";
+  case 27000:
+  return "vert";
   default:
   return {};
 }
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index d8d92ca54ae8..6fdf10a5bcce 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1991,8 +1991,8 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testTableCellVerticalPropertyRoundtrip)
 
 xmlDocUniquePtr pXml = parseExport("ppt/slides/slide1.xml");
 
-assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert270");
-assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[1]", "vert", "vert");
+assertXPath(pXml, "(//a:tcPr)[2]", "vert", "vert270");
 assertXPath(pXml, "(//a:tcPr)[3]", "vert", "wordArtVert");
 }
 


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

2023-04-25 Thread Tünde Tóth (via logerrit)
 oox/source/export/drawingml.cxx|3 ++-
 sc/qa/unit/data/xlsx/tdf91332.xlsx |binary
 sc/qa/unit/subsequent_export_test2.cxx |   19 +++
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 2ef83c8782ed947b47f9292a12355fc3bb078078
Author: Tünde Tóth 
AuthorDate: Wed Apr 19 14:48:33 2023 +0200
Commit: László Németh 
CommitDate: Tue Apr 25 15:04:09 2023 +0200

tdf#91332 XLSX export: fix missing solidFill

Background color of shape inherited from theme
lost after export.

Regression from commit bc0a9076aa43a0782bcf81e55d3f84f6af0f68e8
"ooxml: Preserve shape theme attribute for solid fill".

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 60a5cdd62d7e..77c4c1b02186 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -530,7 +530,8 @@ void DrawingML::WriteSolidFill( const Reference< 
XPropertySet >& rXPropSet )
 WriteSolidFill(::Color(ColorTransparency, nFillColor & 0xff), 
nAlpha);
 }
 }
-else if ( !sColorFillScheme.isEmpty() )
+// tdf#91332 LO doesn't export the actual theme.xml in XLSX.
+else if ( !sColorFillScheme.isEmpty() && GetDocumentType() != 
DOCUMENT_XLSX )
 {
 // the shape had a scheme color and the user didn't change it
 WriteSolidFill( sColorFillScheme, aTransformations, nAlpha );
diff --git a/sc/qa/unit/data/xlsx/tdf91332.xlsx 
b/sc/qa/unit/data/xlsx/tdf91332.xlsx
new file mode 100644
index ..5f1d119e8ee7
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf91332.xlsx differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index 7a9579f3dfa0..403bffc3112f 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -1224,6 +1224,25 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf126024XLSX)
 assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship", 
"TargetMode", "External");
 }
 
+CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf91332)
+{
+createScDoc("xlsx/tdf91332.xlsx");
+saveAndReload("Calc Office Open XML");
+
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
+uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY_THROW);
+uno::Reference xShapeProps(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: rgba[90cf47ff]
+// - Actual  : rgba[]
+// i.e. fill color inherited from theme lost after export.
+Color nColor;
+xShapeProps->getPropertyValue("FillColor") >>= nColor;
+CPPUNIT_ASSERT_EQUAL(Color(0x90cf47), nColor);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-04-25 Thread Tünde Tóth (via logerrit)
 oox/source/export/drawingml.cxx|7 +--
 sc/qa/unit/data/xlsx/tdf119565.xlsx|binary
 sc/qa/unit/subsequent_export_test4.cxx |   26 ++
 3 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit 5ee52d401e2086f79f794a4ec1a1d7beec8aa582
Author: Tünde Tóth 
AuthorDate: Tue Apr 18 12:01:18 2023 +0200
Commit: László Németh 
CommitDate: Tue Apr 25 14:52:02 2023 +0200

tdf#119565 XLSX export: fix lost line properties inherited from theme

Line properties (LineWidth and LineJoint) of shape
inherited from theme lost after export.

Perhaps regression from commit 5391d4872e71d1edba7acc4ad2d2e3b5b97e1723
"ooxml: Preserve shape style and theme attributes for line".

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index aaad66b4d083..60a5cdd62d7e 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1263,7 +1263,8 @@ void DrawingML::WriteOutline( const 
Reference& rXPropSet, Referenc
 mpFS->startElementNS( XML_a, XML_ln,
   XML_cap, cap,
   XML_w, 
sax_fastparser::UseIf(OString::number(nEmuLineWidth),
-  nLineWidth == 0 || (nLineWidth > 1 && 
nStyleLineWidth != nLineWidth)) );
+  nLineWidth == 0 || GetDocumentType() == 
DOCUMENT_XLSX// tdf#119565 LO doesn't export the actual theme.xml in XLSX.
+  || (nLineWidth > 1 && nStyleLineWidth != 
nLineWidth)));
 
 if( bColorSet )
 {
@@ -1431,7 +1432,9 @@ void DrawingML::WriteOutline( const 
Reference& rXPropSet, Referenc
 {
 LineJoint eLineJoint = mAny.get();
 
-if( aStyleLineJoint == LineJoint_NONE || aStyleLineJoint != eLineJoint 
)
+// tdf#119565 LO doesn't export the actual theme.xml in XLSX.
+if (aStyleLineJoint == LineJoint_NONE || GetDocumentType() == 
DOCUMENT_XLSX
+|| aStyleLineJoint != eLineJoint)
 {
 // style-defined line joint does not exist, or is different from 
the shape's joint
 switch( eLineJoint )
diff --git a/sc/qa/unit/data/xlsx/tdf119565.xlsx 
b/sc/qa/unit/data/xlsx/tdf119565.xlsx
new file mode 100644
index ..de530c0131f2
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf119565.xlsx differ
diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index 8cb9a73a5f4e..79b5441c8f17 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1612,6 +1613,31 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf119565)
+{
+createScDoc("xlsx/tdf119565.xlsx");
+saveAndReload("Calc Office Open XML");
+
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
+uno::Reference 
xPage(xDoc->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY_THROW);
+uno::Reference xShapeProps(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 35
+// - Actual  : 0
+// i.e. line width inherited from theme lost after export.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(35),
+ 
xShapeProps->getPropertyValue("LineWidth").get());
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 3
+// - Actual  : 4
+// i.e. line joint inherited from theme lost after export.
+CPPUNIT_ASSERT_EQUAL(drawing::LineJoint_MITER,
+ 
xShapeProps->getPropertyValue("LineJoint").get());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-04-21 Thread Sarper Akdemir (via logerrit)
 oox/source/drawingml/table/tablecell.cxx |   37 +++
 sd/qa/unit/layout-tests.cxx  |   14 +++
 2 files changed, 33 insertions(+), 18 deletions(-)

New commits:
commit 4232907e0a8a5bd87c673afd9df0031dce74d798
Author: Sarper Akdemir 
AuthorDate: Thu Apr 20 23:31:20 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Apr 21 10:02:00 2023 +0200

related tdf#154501: pptx import: push cell's RotateAngle after text

It appears to matter whether "RotateAngle" property is set
before or after insertion of the text for cells.

It only renders correctly when it is pushed after the text insertion.

RotateAngle appears to end up in the property set either way with
correct values, so I don't really know why this is the case.

Adds a unit test that covers rendering of vertical text in table cells
on import from an example pptx file.

Change-Id: Ifb8caa0b74920758fea2815b16dae7fd60587cc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150712
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index b0849b7002f3..9d16bce09d17 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -569,7 +569,24 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("TextWritingMode", 
Any(css::text::WritingMode_TB_RL));
 }
-else if ( getVertToken() == XML_vert )
+
+getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
+
+// tdf#144092 For empty cells push character styles & endParaRPr to the 
Cell's properties
+const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
+if (rParagraphs.size() == 1)
+{
+const auto pFirstParagraph = rParagraphs.at(0);
+if (pFirstParagraph->getRuns().empty())
+{
+TextCharacterProperties aTextCharacterProps{ 
pFirstParagraph->getCharacterStyle(
+aTextStyleProps, *pMasterTextListStyle, 
getTextBody()->getTextListStyle()) };
+
aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
+aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
+}
+}
+
+if ( getVertToken() == XML_vert )
 {
 xPropSet->setPropertyValue("RotateAngle", Any(short(27000)));
 }
@@ -577,7 +594,7 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 {
 xPropSet->setPropertyValue("RotateAngle", Any(short(9000)));
 }
-else if ( getVertToken() != XML_horz )
+else if ( getVertToken() != XML_horz && getVertToken() != XML_eaVert )
 {
 // put the vert value in the grab bag for roundtrip
 const Sequence& aTokenNameSeq = 
StaticTokenMap().getUtf8TokenName(getVertToken());
@@ -599,22 +616,6 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 }
 xPropSet->setPropertyValue("CellInteropGrabBag", Any(aGrabBag));
 }
-
-getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, 
pMasterTextListStyle );
-
-// tdf#144092 For empty cells push character styles & endParaRPr to the 
Cell's properties
-const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs();
-if (rParagraphs.size() == 1)
-{
-const auto pFirstParagraph = rParagraphs.at(0);
-if (pFirstParagraph->getRuns().empty())
-{
-TextCharacterProperties aTextCharacterProps{ 
pFirstParagraph->getCharacterStyle(
-aTextStyleProps, *pMasterTextListStyle, 
getTextBody()->getTextListStyle()) };
-
aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties());
-aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
-}
-}
 }
 
 }
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index e401f2d0822b..5e9d0e26537b 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -340,6 +340,20 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf148966)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTableVerticalText)
+{
+xmlDocUniquePtr pXmlDoc = load("pptx/tcPr-vert-roundtrip.pptx");
+
+// Without the accompanying fix, would fail with:
+// - Expected: -900
+// - Actual  : 0
+// - In <>, attribute 'orientation' of '//font[1]' incorrect value.
+// i.e. table cell text that was supposed to be vertical (rotated 90
+// degrees) was not vertical.
+assertXPath(pXmlDoc, "//font[1]", "orientation", "-900");
+assertXPath(pXmlDoc, "//font[2]", "orientation", "900");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-04-17 Thread Andrea Gelmini (via logerrit)
 oox/source/export/drawingml.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5713871497f81bd4b4196a217c9084f2db3e6614
Author: Andrea Gelmini 
AuthorDate: Mon Apr 17 18:01:41 2023 +0200
Commit: Caolán McNamara 
CommitDate: Mon Apr 17 20:39:46 2023 +0200

Fix typos

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 58b2b1fbb2a7..9f02652f2b04 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -910,7 +910,7 @@ void DrawingML::WriteGradientFill2(
 basegfx::ColorStops aNewColorStops;
 basegfx::ColorStops aNewAlphaStops;
 
-// add mirrored gadients, scaled to [0.0 .. 0.5]
+// add mirrored gradients, scaled to [0.0 .. 0.5]
 basegfx::ColorStops::const_reverse_iterator 
aRevCurrColor(aColorStops.rbegin());
 basegfx::ColorStops::const_reverse_iterator 
aRevCurrAlpha(aAlphaStops.rbegin());
 
@@ -947,7 +947,7 @@ void DrawingML::WriteGradientFill2(
 // case awt::GradientStyle_RECT:
 // case awt::GradientStyle_SQUARE:
 {
-// all these types need the gadiens to be mirrored
+// all these types need the gradients to be mirrored
 basegfx::utils::reverseColorStops(aColorStops);
 basegfx::utils::reverseColorStops(aAlphaStops);
 


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

2023-04-16 Thread Noel Grandin (via logerrit)
 oox/source/ppt/presentationfragmenthandler.cxx|   10 +-
 sd/source/ui/unoidl/unopage.cxx   |   10 +-
 test/source/a11y/AccessibilityTools.cxx   |9 ++---
 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |6 +++---
 4 files changed, 19 insertions(+), 16 deletions(-)

New commits:
commit e870d996efb4a856f667c601032e02e5b21c5b82
Author: Noel Grandin 
AuthorDate: Sun Apr 16 21:05:27 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Apr 17 07:54:12 2023 +0200

use more string_view

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

diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 5f35dbdfdb1c..7a5788259921 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -140,11 +140,11 @@ void 
PresentationFragmentHandler::importSlideNames(XmlFilterBase& rFilter, const
 {
 Reference xDrawPage(xDrawPages->getByIndex(i), 
UNO_QUERY);
 Reference xNamed(xDrawPage, 
UNO_QUERY_THROW);
-OUString sRest;
-if (xNamed->getName().startsWith(aTitleText, )
-&& (sRest.isEmpty()
-|| (sRest.startsWith(" (") && sRest.endsWith(")")
-&& o3tl::toInt32(sRest.subView(2, 
sRest.getLength() - 3)) > 0)))
+std::u16string_view sRest;
+if (o3tl::starts_with(xNamed->getName(), aTitleText, 
)
+&& (sRest.empty()
+|| (o3tl::starts_with(sRest, u" (") && 
o3tl::ends_with(sRest, u")")
+&& o3tl::toInt32(sRest.substr(2, sRest.size() 
- 3)) > 0)))
 nCount++;
 }
 Reference 
xName(rSlidePersist[nPage]->getPage(), UNO_QUERY_THROW);
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 6ff2958f85b9..8e55d1f1ab99 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2272,17 +2272,17 @@ void SAL_CALL SdDrawPage::setName( const OUString& 
rName )
 return;
 
 // check if this is the default 'page1234' name
-OUString aNumber;
-if(aName.startsWith( sEmptyPageName,  ))
+std::u16string_view aNumber;
+if(o3tl::starts_with(aName, sEmptyPageName,  ))
 {
 // ok, it maybe is, aNumber is the number part after 'page'
 
 // create the page number
-sal_Int32 nPageNumber = aNumber.toInt32();
+sal_Int32 nPageNumber = o3tl::toInt32(aNumber);
 
 // check if there are non number characters in the number part
-const sal_Int32 nChars = aNumber.getLength();
-const sal_Unicode* pString = aNumber.getStr();
+const sal_Int32 nChars = aNumber.size();
+const sal_Unicode* pString = aNumber.data();
 sal_Int32 nChar;
 for( nChar = 0; nChar < nChars; nChar++, pString++ )
 {
diff --git a/test/source/a11y/AccessibilityTools.cxx 
b/test/source/a11y/AccessibilityTools.cxx
index 15a7cec17bc3..33270505f3a6 100644
--- a/test/source/a11y/AccessibilityTools.cxx
+++ b/test/source/a11y/AccessibilityTools.cxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace css;
 
@@ -165,9 +166,9 @@ bool AccessibilityTools::nameEquals(const 
uno::ReferencegetAccessibleName();
-OUString rest;
+std::u16string_view rest;
 
-if (!ctxName.startsWith(name, ))
+if (!o3tl::starts_with(ctxName, name, ))
 return false;
 if (rest == u"")
 return true;
@@ -193,7 +194,9 @@ bool AccessibilityTools::nameEquals(const 
uno::ReferenceGetWindow()->GetType();
-if (rest == u" (Type = " + 
OUString::number(static_cast(windowType)) + ")")
+if (rest
+== Concat2View(u" (Type = " + 
OUString::number(static_cast(windowType))
+   + ")"))
 return true;
 }
 #endif
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx 
b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index 7f68a11fed20..980dd8e0572d 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -170,7 +170,7 @@ 
XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext(
 }
 }
 
-OUString sClass;
+std::u16string_view sClass;
 static std::u16string_view const prefixes[] = {
 u"application/vnd.oasis.openoffice.",
 u"application/x-vnd.oasis.openoffice.",
@@ -178,13 +178,13 @@ 
XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext(
 u"application/x-vnd.oasis.opendocument."};
 for (auto const & p: 

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

2023-04-14 Thread Andrea Gelmini (via logerrit)
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4fffaa538e38d7e12553f204f61fdd45795efdcf
Author: Andrea Gelmini 
AuthorDate: Fri Apr 14 12:04:39 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Apr 14 14:29:08 2023 +0200

Fix typo

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 61467bd37053..d02890375514 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -946,7 +946,7 @@ void DrawingML::WriteGradientFill(
 
 if (nullptr == pColorGradient)
 {
-// create complete tempoay copy to keep orig export working
+// create complete temporary copy to keep orig export working
 aColorGradient = *pTransparenceGradient;
 
 // change parameters specific for PseudoColorGradient


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

2023-04-14 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/fillproperties.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a47829dd9af35d31bb38a52e07a32a7e452d4ab3
Author: Andrea Gelmini 
AuthorDate: Fri Apr 14 12:05:44 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Apr 14 14:28:13 2023 +0200

Fix typo

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index d4e691338ea6..963d5f6e449d 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -579,7 +579,7 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 //(a) ignored consequently everywhere or
 //(b) be set/added consequently everywhere
 //   since this is - in principle - redundant data.
-//   Be aware thet e.g. cases like 
DrawingML::EqualGradients
+//   Be aware that e.g. cases like 
DrawingML::EqualGradients
 //   and others would have to be identified and adapted (!)
 //   Since awt::Gradient2 is UNO API data there might
 //   be cases where just awt::Gradient is transferred, so 
(b)


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

2023-04-14 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/fillproperties.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2150414400400efe76fc103286bf2abafccd8fd7
Author: Andrea Gelmini 
AuthorDate: Fri Apr 14 12:06:10 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Apr 14 14:27:25 2023 +0200

Fix typo

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index a9f105e32521..d4e691338ea6 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -582,7 +582,7 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 //   Be aware thet e.g. cases like 
DrawingML::EqualGradients
 //   and others would have to be identified and adapted (!)
 //   Since awt::Gradient2 is UNO API data there might
-//   be cases where just awt::Gradient is transfered, so 
(b)
+//   be cases where just awt::Gradient is transferred, so 
(b)
 //   is far better backwards compatible and thus more 
safe, so
 //   all changes will make use of additionally 
using/setting
 //   these additionally, but will only make use of the 
given


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

2023-04-14 Thread Andrea Gelmini (via logerrit)
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f26d8531038e1b208450deec88c23678782db926
Author: Andrea Gelmini 
AuthorDate: Fri Apr 14 12:03:49 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Apr 14 14:25:56 2023 +0200

Fix typo

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index b8b35352033e..61467bd37053 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -869,7 +869,7 @@ void DrawingML::WriteGradientFill2(
 basegfx::utils::prepareColorStops(*pTransparenceGradient, aAlphaStops, 
aSingleAlpha);
 }
 
-// synchronize ColorStops and AlphaStops as peparation to export
+// synchronize ColorStops and AlphaStops as preparation to export
 // so also gradients 'coupled' indirectly using the 
'FillTransparenceGradient'
 // method (at import time) will be exported again
 basegfx::utils::synchronizeColorStops(aColorStops, aAlphaStops, 
aSingleColor, aSingleAlpha);


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

2023-04-14 Thread Andrea Gelmini (via logerrit)
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fe65fdce9468c87767364a2a7d0ce4025cbdd093
Author: Andrea Gelmini 
AuthorDate: Fri Apr 14 12:01:31 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Apr 14 14:24:12 2023 +0200

Fix typo

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index e604ca6b39b6..b8b35352033e 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -897,7 +897,7 @@ void DrawingML::WriteGradientFill2(
 else
 {
 // this is an error - synchronizeColorStops above *has* to create that
-// state, see desciption there (!)
+// state, see description there (!)
 assert(false && "oox::WriteGradientFill: non-synchronized gradients 
(!)");
 }
 


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

2023-04-14 Thread Andrea Gelmini (via logerrit)
 oox/source/export/drawingml.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bf2a30068915924ef0d1293fc33886e6268b45b0
Author: Andrea Gelmini 
AuthorDate: Fri Apr 14 12:01:52 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Apr 14 14:23:47 2023 +0200

Fix typo

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index f2de44be6767..e604ca6b39b6 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -853,7 +853,7 @@ void DrawingML::WriteGradientFill2(
 // remember basic Gradient definition to use
 aGradient = *pColorGradient;
 
-// extract and corrrect/process ColorStops
+// extract and correct/process ColorStops
 basegfx::utils::prepareColorStops(*pColorGradient, aColorStops, 
aSingleColor);
 }
 
@@ -865,7 +865,7 @@ void DrawingML::WriteGradientFill2(
 aGradient = *pTransparenceGradient;
 }
 
-// extract and corrrect/process AlphaStops
+// extract and correct/process AlphaStops
 basegfx::utils::prepareColorStops(*pTransparenceGradient, aAlphaStops, 
aSingleAlpha);
 }
 


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

2023-04-11 Thread Tibor Nagy (via logerrit)
 oox/source/export/shapes.cxx|   37 
 oox/source/ppt/slidepersist.cxx |   15 +-
 sd/qa/unit/data/pptx/tdf154363.pptx |binary
 sd/qa/unit/import-tests.cxx |   24 +++
 4 files changed, 63 insertions(+), 13 deletions(-)

New commits:
commit b7c542b5085374f1d031183cb86ceeefcf24964d
Author: Tibor Nagy 
AuthorDate: Wed Mar 29 09:00:47 2023 +0200
Commit: László Németh 
CommitDate: Tue Apr 11 19:32:45 2023 +0200

tdf#154363 sd: fix line connectors regression of mirrored shapes

caused by commit cbf66ec3e60d07efb7c3cceed9b4f0fb4f0510c8
(tdf#89449 PPTX import: fix line connectors).

Note: partial revert of commit 9ab16e2738b4b9bd324c9aded8acb2ecba0fd2b0
"oox: fix crash in lcl_GetGluePointId by removing unused code".

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

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 372b4376fe22..eab82a86336d 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1640,17 +1640,38 @@ static void lcl_GetConnectorAdjustValue(const 
Reference& xShape, tools::
 }
 }
 
-static sal_Int32 lcl_GetGluePointId(sal_Int32 nGluePointId)
+static sal_Int32 lcl_GetGluePointId(const Reference& xShape, sal_Int32 
nGluePointId)
 {
 if (nGluePointId > 3)
 return nGluePointId - 4;
 else
 {
-// change id of the bounding box (1 <-> 3)
-if (nGluePointId == 1)
-return 3; // Right
-else if (nGluePointId == 3)
-return 1; // Left
+bool bFlipH = false;
+bool bFlipV = false;
+Reference xShapeProps(xShape, UNO_QUERY);
+if 
(xShapeProps->getPropertySetInfo()->hasPropertyByName("CustomShapeGeometry"))
+{
+Sequence aGeometrySeq;
+xShapeProps->getPropertyValue("CustomShapeGeometry") >>= 
aGeometrySeq;
+for (int i = 0; i < aGeometrySeq.getLength(); i++)
+{
+const PropertyValue& rProp = aGeometrySeq[i];
+if (rProp.Name == "MirroredX")
+rProp.Value >>= bFlipH;
+
+if (rProp.Name == "MirroredY")
+rProp.Value >>= bFlipV;
+}
+}
+
+if ((!bFlipH && !bFlipV) || (bFlipH && bFlipV))
+{
+// change id of the bounding box (1 <-> 3)
+if (nGluePointId == 1)
+nGluePointId = 3; // Right
+else if (nGluePointId == 3)
+nGluePointId = 1; // Left
+}
 }
 
 return nGluePointId;
@@ -1708,12 +1729,12 @@ ShapeExport& ShapeExport::WriteConnectorShape( const 
Reference< XShape >& xShape
 if (GetProperty(rXPropSet, "StartGluePointIndex"))
 mAny >>= nStartGlueId;
 if (nStartGlueId != -1)
-nStartGlueId = lcl_GetGluePointId(nStartGlueId);
+nStartGlueId = lcl_GetGluePointId(rXShapeA, nStartGlueId);
 
 if (GetProperty(rXPropSet, "EndGluePointIndex"))
 mAny >>= nEndGlueId;
 if (nEndGlueId != -1)
-nEndGlueId = lcl_GetGluePointId(nEndGlueId);
+nEndGlueId = lcl_GetGluePointId(rXShapeB, nEndGlueId);
 
 // Position is relative to group in Word, but relative to anchor of group 
in API.
 if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is())
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index bb673b52442e..0f7479e8ede9 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -659,11 +659,16 @@ void SlidePersist::createConnectorShapeConnection()
 nGlueId += 4;
 else
 {
-// change id of the left and right glue points of the 
bounding box (1 <-> 3)
-if (nGlueId == 1)
-nGlueId = 3; // Right
-else if (nGlueId == 3)
-nGlueId = 1; // Left
+bool bFlipH = pShape->second->getFlipH();
+bool bFlipV = pShape->second->getFlipV();
+if ((!bFlipH && !bFlipV) || (bFlipH && bFlipV))
+{
+// change id of the left and right glue points of 
the bounding box (1 <-> 3)
+if (nGlueId == 1)
+nGlueId = 3; // Right
+else if (nGlueId == 3)
+nGlueId = 1; // Left
+}
 }
 
 bool bStart = aConnectorShapeProperties[j].mbStartShape;
diff --git a/sd/qa/unit/data/pptx/tdf154363.pptx 
b/sd/qa/unit/data/pptx/tdf154363.pptx
new file mode 100644
index ..b549fda90135
Binary files 

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

2023-04-09 Thread Tomaž Vajngerl (via logerrit)
 oox/source/drawingml/colorchoicecontext.cxx |   56 +
 sw/qa/core/theme/ThemeTest.cxx  |  163 
 2 files changed, 197 insertions(+), 22 deletions(-)

New commits:
commit f707834e8538c0a183716b26ebdf04381482ca6d
Author: Tomaž Vajngerl 
AuthorDate: Mon Feb 27 21:20:49 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 9 15:39:29 2023 +0200

oox: write color transforms to model::ColorDefinition

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

diff --git a/oox/source/drawingml/colorchoicecontext.cxx 
b/oox/source/drawingml/colorchoicecontext.cxx
index 3d559299f4c2..927ff41de9c0 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -30,7 +30,7 @@ namespace oox::drawingml {
 namespace
 {
 
-std::unordered_map constSystemColorMap =
+const std::unordered_map 
constSystemColorMap =
 {
 { XML_scrollBar, model::SystemColorType::ScrollBar },
 { XML_background, model::SystemColorType::Background },
@@ -63,6 +63,39 @@ std::unordered_map 
constSystemColorMap =
 { XML_menuHighlight, model::SystemColorType::MenuHighlight },
 { XML_menuBar, model::SystemColorType::MenuBar }
 };
+
+const std::unordered_map 
constTransformTypeMap =
+{
+{ XML_alpha, model::TransformationType::Alpha },
+{ XML_alphaMod, model::TransformationType::AlphaMod },
+{ XML_alphaOff, model::TransformationType::AlphaOff },
+{ XML_blue, model::TransformationType::Blue },
+{ XML_blueMod, model::TransformationType::BlueMod },
+{ XML_blueOff, model::TransformationType::BlueOff },
+{ XML_hue, model::TransformationType::Hue },
+{ XML_hueMod, model::TransformationType::HueMod},
+{ XML_hueOff, model::TransformationType::HueOff },
+{ XML_lum, model::TransformationType::Lum },
+{ XML_lumMod, model::TransformationType::LumMod },
+{ XML_lumOff, model::TransformationType::LumOff },
+{ XML_green, model::TransformationType::Green },
+{ XML_greenMod, model::TransformationType::GreenMod },
+{ XML_greenOff, model::TransformationType::GreenOff },
+{ XML_red, model::TransformationType::Red },
+{ XML_redMod, model::TransformationType::RedMod },
+{ XML_redOff, model::TransformationType::RedOff },
+{ XML_sat, model::TransformationType::Sat },
+{ XML_satMod, model::TransformationType::SatMod },
+{ XML_satOff, model::TransformationType::SatMod },
+{ XML_shade, model::TransformationType::Shade },
+{ XML_tint, model::TransformationType::Tint },
+{ XML_comp, model::TransformationType::Comp },
+{ XML_gamma, model::TransformationType::Gamma },
+{ XML_gray, model::TransformationType::Gray },
+{ XML_inv, model::TransformationType::Inv },
+{ XML_invGamma, model::TransformationType::InvGamma }
+};
+
 }
 
 ColorValueContext::ColorValueContext(ContextHandler2Helper const & rParent, 
Color& rColor, model::ColorDefinition* pColorDefinition)
@@ -168,6 +201,7 @@ void ColorValueContext::onStartElement( const 
AttributeList& rAttribs )
 mrColor.setPrstClr(nToken);
 if (mpColorDefinition)
 {
+// TODO - just converted to RGB for now
 ::Color nRgbValue = Color::getDmlPresetColor(nToken, 
API_RGB_TRANSPARENT);
 mpColorDefinition->mnComponent1 = nRgbValue.GetRed();
 mpColorDefinition->mnComponent2 = nRgbValue.GetGreen();
@@ -227,6 +261,26 @@ void ColorValueContext::onStartElement( const 
AttributeList& rAttribs )
 mrColor.addTransformation( nElement );
 break;
 }
+
+if (mpColorDefinition)
+{
+auto aIterator = constTransformTypeMap.find(getBaseToken(nElement));
+if (aIterator != constTransformTypeMap.end())
+{
+auto const& aPair = *aIterator;
+model::TransformationType eType = aPair.second;
+
+OUString aValueString = rAttribs.getStringDefaulted(XML_val);
+sal_Int32 nValue = 0;
+if (aValueString.endsWith("%"))
+nValue = aValueString.toDouble() * PER_PERCENT;
+else
+nValue = rAttribs.getInteger(XML_val, 0);
+
+mpColorDefinition->maTransformations.push_back({eType, 
sal_Int16(nValue / 10.0)});
+}
+}
+
 return nullptr;
 }
 
diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx
index c94b195eef0e..f9270663a5bb 100644
--- a/sw/qa/core/theme/ThemeTest.cxx
+++ b/sw/qa/core/theme/ThemeTest.cxx
@@ -87,54 +87,175 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, 
testDrawPageThemeExistsDOCX)
 CPPUNIT_ASSERT_EQUAL(size_t(3), rFormatScheme.getFillStyleList().size());
 CPPUNIT_ASSERT_EQUAL(size_t(3), 
rFormatScheme.getBackgroundFillStyleList().size());
 
+// Fill style 1
 {
 model::FillStyle const& rFillStyle = 

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

2023-04-06 Thread Caolán McNamara (via logerrit)
 oox/source/drawingml/fillproperties.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2940491e2670610ca68288dd55af65238306d947
Author: Caolán McNamara 
AuthorDate: Thu Apr 6 13:05:58 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 6 16:46:35 2023 +0200

cid#1524677 attempt to silence Explicit null dereferenced

ctor iterator to point to start of container

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

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index fd3ba99b2c3f..34a0db6dc940 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -725,7 +725,7 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 // First look for the largest segment in the gradient.
 GradientFillProperties::GradientStopMap::iterator 
aIt(aGradientStops.begin());
 double nWidestWidth = -1;
-GradientFillProperties::GradientStopMap::iterator 
aWidestSegmentStart;
+GradientFillProperties::GradientStopMap::iterator 
aWidestSegmentStart(aIt);
 ++aIt;
 while( aIt != aGradientStops.end() )
 {


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

2023-04-06 Thread ektagoel12 (via logerrit)
 oox/source/export/DMLPresetShapeExport.cxx   |   36 +++
 stoc/test/registry_tdprovider/testregistrytdprovider.cxx |4 -
 2 files changed, 19 insertions(+), 21 deletions(-)

New commits:
commit 87f52dbf4faf8dcd6fcc1b070e070b9ca8584ac4
Author: ektagoel12 
AuthorDate: Wed Jan 25 22:43:15 2023 +
Commit: Hossein 
CommitDate: Thu Apr 6 12:09:49 2023 +0200

tdf#145538 Use range based for loops

Change-Id: Ib74318a36898270c7b6e45e5e064ddd696a91be8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145905
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/oox/source/export/DMLPresetShapeExport.cxx 
b/oox/source/export/DMLPresetShapeExport.cxx
index a2d08ec3e2e2..1eaef29927fa 100644
--- a/oox/source/export/DMLPresetShapeExport.cxx
+++ b/oox/source/export/DMLPresetShapeExport.cxx
@@ -43,47 +43,45 @@ DMLPresetShapeExporter::DMLPresetShapeExporter(DrawingML* 
pDMLExporter,
 = xShapeProps->getPropertyValue("CustomShapeGeometry")
   .get>();
 
-for (sal_uInt32 i = 0; i < aCustomShapeGeometry.size(); i++)
+for (auto const& rCustomShapeGeometryItem : aCustomShapeGeometry)
 {
-if (aCustomShapeGeometry[i].Name == "Type")
+if (rCustomShapeGeometryItem.Name == "Type")
 {
-m_sPresetShapeType = aCustomShapeGeometry[i].Value.get();
+m_sPresetShapeType = 
rCustomShapeGeometryItem.Value.get();
 }
-if (aCustomShapeGeometry[i].Name == "Handles")
+if (rCustomShapeGeometryItem.Name == "Handles")
 {
 m_bHasHandleValues = true;
 m_HandleValues
-= aCustomShapeGeometry[i]
-  .Value
+= rCustomShapeGeometryItem.Value
   
.get>>();
 }
-if (aCustomShapeGeometry[i].Name == "AdjustmentValues")
+if (rCustomShapeGeometryItem.Name == "AdjustmentValues")
 {
 m_AdjustmentValues
-= aCustomShapeGeometry[i]
-  .Value
+= rCustomShapeGeometryItem.Value
   
.get>();
 }
-if (aCustomShapeGeometry[i].Name == "MirroredX")
+if (rCustomShapeGeometryItem.Name == "MirroredX")
 {
-m_bIsFlipped.first = aCustomShapeGeometry[i].Value.get();
+m_bIsFlipped.first = rCustomShapeGeometryItem.Value.get();
 }
-if (aCustomShapeGeometry[i].Name == "MirroredY")
+if (rCustomShapeGeometryItem.Name == "MirroredY")
 {
-m_bIsFlipped.second = aCustomShapeGeometry[i].Value.get();
+m_bIsFlipped.second = rCustomShapeGeometryItem.Value.get();
 }
-//if (aCustomShapeGeometry[i].Name == "Equations")
+//if (rCustomShapeGeometryItem.Name == "Equations")
 //{
-//m_Equations = 
aCustomShapeGeometry[i].Value.get>();
+//m_Equations = 
rCustomShapeGeometryItem.Value.get>();
 //}
-//if (aCustomShapeGeometry[i].Name == "Path")
+//if (rCustomShapeGeometryItem.Name == "Path")
 //{
-//m_Path = aCustomShapeGeometry[i]
+//m_Path = rCustomShapeGeometryItem
 // 
.Value.get>();
 //}
-//if (aCustomShapeGeometry[i].Name == "ViewBox")
+//if (rCustomShapeGeometryItem.Name == "ViewBox")
 //{
-//m_ViewBox = 
aCustomShapeGeometry[i].Value.get();
+//m_ViewBox = 
rCustomShapeGeometryItem.Value.get();
 //}
 }
 };
diff --git a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx 
b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
index 359c4b789f3b..879859b92e27 100644
--- a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
+++ b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
@@ -776,9 +776,9 @@ bool writeInfo(void * registryKey, OUString const & 
implementationName,
 return false;
 }
 bool success = true;
-for (sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
+for (auto const& rServiceName : serviceNames) {
 try {
-key->createKey(serviceNames[i]);
+key->createKey(rServiceName);
 } catch (css::registry::InvalidRegistryException &) {
 success = false;
 break;


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

2023-04-06 Thread Xisco Fauli (via logerrit)
 oox/source/export/shapes.cxx |   44 +++
 1 file changed, 20 insertions(+), 24 deletions(-)

New commits:
commit 2ca70301a97172b04c170f5f2e486c33114243ff
Author: Xisco Fauli 
AuthorDate: Wed Apr 5 20:25:01 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 6 09:04:31 2023 +0200

oox: drop macros

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

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 3a1a3e2ad723..372b4376fe22 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -321,16 +321,6 @@ uno::Reference GetOLEObjectStream(
 
 namespace oox::drawingml {
 
-#define GETA(propName) \
-GetProperty( rXPropSet, #propName)
-
-#define GETAD(propName) \
-( GetPropertyAndState( rXPropSet, rXPropState, #propName, eState ) && 
eState == beans::PropertyState_DIRECT_VALUE )
-
-#define GET(variable, propName) \
-if ( GETA(propName) ) \
-mAny >>= variable;
-
 ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, 
ShapeHashMap* pShapeMap, XmlFilterBase* pFB, DocumentType eDocumentType, 
DMLTextExport* pTextExport, bool bUserShapes )
 : DrawingML( std::move(pFS), pFB, eDocumentType, pTextExport )
 , m_nEmbeddedObjects(0)
@@ -746,7 +736,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const 
Reference< XShape >& xShape )
 bool bHasGeometrySeq(false);
 Sequence< PropertyValue > aGeometrySeq;
 OUString sShapeType("non-primitive"); // default in ODF
-if (GETA(CustomShapeGeometry))
+if (GetProperty(rXPropSet, "CustomShapeGeometry"))
 {
 SAL_INFO("oox.shape", "got custom shape geometry");
 if (mAny >>= aGeometrySeq)
@@ -816,7 +806,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const 
Reference< XShape >& xShape )
 if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes)
 {
 bool bUseBackground = false;
-if (GETA(FillUseSlideBackground))
+if (GetProperty(rXPropSet, "FillUseSlideBackground"))
 mAny >>= bUseBackground;
 if (bUseBackground)
 mpFS->startElementNS(mnXmlNamespace, XML_sp, XML_useBgFill, "1");
@@ -824,7 +814,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const 
Reference< XShape >& xShape )
 mpFS->startElementNS(mnXmlNamespace, XML_sp);
 
 bool isVisible = true ;
-if( GETA (Visible))
+if( GetProperty(rXPropSet, "Visible"))
 {
 mAny >>= isVisible;
 }
@@ -834,7 +824,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const 
Reference< XShape >& xShape )
 OString::number(GetShapeID(xShape) == -1 ? GetNewShapeID(xShape) : 
GetShapeID(xShape)),
 XML_name, GetShapeName(xShape), XML_hidden, 
sax_fastparser::UseIf("1", !isVisible));
 
-if( GETA( URL ) )
+if( GetProperty(rXPropSet, "URL") )
 {
 OUString sURL;
 mAny >>= sURL;
@@ -850,10 +840,10 @@ ShapeExport& ShapeExport::WriteCustomShape( const 
Reference< XShape >& xShape )
 }
 
 OUString sBookmark;
-if (GETA(Bookmark))
+if (GetProperty(rXPropSet, "Bookmark"))
 mAny >>= sBookmark;
 
-if (GETA(OnClick))
+if (GetProperty(rXPropSet, "OnClick"))
 {
 OUString sPPAction;
 presentation::ClickAction eClickAction = 
presentation::ClickAction_NONE;
@@ -1687,7 +1677,8 @@ ShapeExport& ShapeExport::WriteConnectorShape( const 
Reference< XShape >& xShape
 Reference< XShape > rXShapeB;
 PropertyState eState;
 ConnectorType eConnectorType = ConnectorType_STANDARD;
-GET(eConnectorType, EdgeKind);
+if (GetProperty(rXPropSet, "EdgeKind"))
+mAny >>= eConnectorType;
 
 switch( eConnectorType ) {
 case ConnectorType_CURVE:
@@ -1703,19 +1694,24 @@ ShapeExport& ShapeExport::WriteConnectorShape( const 
Reference< XShape >& xShape
 break;
 }
 
-if( GETAD( EdgeStartPoint ) ) {
+if (GetPropertyAndState( rXPropSet, rXPropState, "EdgeStartPoint", eState 
) && eState == beans::PropertyState_DIRECT_VALUE )
+{
 mAny >>= aStartPoint;
-if( GETAD( EdgeEndPoint ) ) {
+if (GetPropertyAndState( rXPropSet, rXPropState, "EdgeEndPoint", 
eState ) && eState == beans::PropertyState_DIRECT_VALUE )
 mAny >>= aEndPoint;
-}
 }
-GET( rXShapeA, EdgeStartConnection );
-GET( rXShapeB, EdgeEndConnection );
+if (GetProperty(rXPropSet, "EdgeStartConnection"))
+mAny >>= rXShapeA;
+if (GetProperty(rXPropSet, "EdgeEndConnection"))
+mAny >>= rXShapeB;
 
-GET(nStartGlueId, StartGluePointIndex);
+if (GetProperty(rXPropSet, "StartGluePointIndex"))
+mAny >>= nStartGlueId;
 if (nStartGlueId != -1)
 nStartGlueId = lcl_GetGluePointId(nStartGlueId);
-

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

2023-04-06 Thread Xisco Fauli (via logerrit)
 oox/source/export/shapes.cxx |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 9ab16e2738b4b9bd324c9aded8acb2ecba0fd2b0
Author: Xisco Fauli 
AuthorDate: Wed Apr 5 20:03:06 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 6 09:02:33 2023 +0200

oox: fix crash in lcl_GetGluePointId by removing unused code

See

https://crashreport.libreoffice.org/stats/signature/oox::drawingml::lcl_GetGluePointId

Change-Id: I7737568b12a18a2195f24f023917d30dd838ea12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150064
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-by: Xisco Fauli 

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 6993a7c9c304..3a1a3e2ad723 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1650,20 +1650,17 @@ static void lcl_GetConnectorAdjustValue(const 
Reference& xShape, tools::
 }
 }
 
-static sal_Int32 lcl_GetGluePointId(const Reference& xShape, 
sal_Int32& nGluePointId)
+static sal_Int32 lcl_GetGluePointId(sal_Int32 nGluePointId)
 {
-uno::Reference xSupplier(xShape, 
uno::UNO_QUERY);
-uno::Reference 
xGluePoints(xSupplier->getGluePoints(),
- uno::UNO_QUERY);
 if (nGluePointId > 3)
-nGluePointId -= 4;
+return nGluePointId - 4;
 else
 {
 // change id of the bounding box (1 <-> 3)
 if (nGluePointId == 1)
-nGluePointId = 3; // Right
+return 3; // Right
 else if (nGluePointId == 3)
-nGluePointId = 1; // Left
+return 1; // Left
 }
 
 return nGluePointId;
@@ -1717,10 +1714,10 @@ ShapeExport& ShapeExport::WriteConnectorShape( const 
Reference< XShape >& xShape
 
 GET(nStartGlueId, StartGluePointIndex);
 if (nStartGlueId != -1)
-lcl_GetGluePointId(rXShapeA, nStartGlueId);
+nStartGlueId = lcl_GetGluePointId(nStartGlueId);
 GET(nEndGlueId, EndGluePointIndex);
 if (nEndGlueId != -1)
-lcl_GetGluePointId(rXShapeB, nEndGlueId);
+nEndGlueId = lcl_GetGluePointId(nEndGlueId);
 
 // Position is relative to group in Word, but relative to anchor of group 
in API.
 if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is())


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

2023-03-27 Thread Tünde Tóth (via logerrit)
 oox/source/drawingml/shape.cxx  |   12 
 sw/qa/extras/ooxmlimport/data/grouped_link.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx   |   10 ++
 3 files changed, 22 insertions(+)

New commits:
commit 7f4f88b883f81fbce975f72aea0f66a54e269ead
Author: Tünde Tóth 
AuthorDate: Thu Mar 9 16:01:03 2023 +0100
Commit: László Németh 
CommitDate: Mon Mar 27 14:22:05 2023 +

tdf#145147 DOCX import: fix hyperlink in group shape

Hyperlink inserted to shape lost, if the shape was
inside a group shape.

Test: ungroup the grouped shape and move the mouse
over the shapes, or use Edit Hyperlink... in their
context menu.

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

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index b8cac0d8f385..e3923c1b647d 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -406,6 +406,18 @@ void Shape::addShape(
  ? 
*getTextBody()->getTextProperties().moInsets[3]
  : 0));
 }
+
+// tdf#145147 Set the Hyperlink property to the child wps 
shape.
+if (getShapeProperties().hasProperty(PROP_URL)) try
+{
+uno::Any aAny = getShapeProperties().getProperty(PROP_URL);
+OUString sUrl = aAny.get();
+if (!sUrl.isEmpty())
+
xChildWPSProperties->setPropertyValue(UNO_NAME_HYPERLINK, aAny);
+}
+catch (const Exception&)
+{
+}
 }
 
 if( meFrameType == FRAMETYPE_DIAGRAM )
diff --git a/sw/qa/extras/ooxmlimport/data/grouped_link.docx 
b/sw/qa/extras/ooxmlimport/data/grouped_link.docx
new file mode 100644
index ..8c5657b708b4
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/grouped_link.docx 
differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 6436d68ec89e..c201e585e997 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -1092,6 +1092,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154319)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf145147)
+{
+createSwDoc("grouped_link.docx");
+uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("https://www.libreoffice.org;),
+ getProperty(xGroupShape->getByIndex(0), 
"Hyperlink"));
+CPPUNIT_ASSERT_EQUAL(OUString("https://www.documentfoundation.org;),
+ getProperty(xGroupShape->getByIndex(1), 
"Hyperlink"));
+}
+
 // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in 
ooxmlEXPORT
 
 CPPUNIT_PLUGIN_IMPLEMENT();


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

2023-03-27 Thread Ilmari Lauhakangas (via logerrit)
 oox/source/export/ooxml-export-notes.txt |1 -
 1 file changed, 1 deletion(-)

New commits:
commit f51ea7a8ec9150006c0fa8d9a9cfccadb61c014b
Author: Ilmari Lauhakangas 
AuthorDate: Mon Mar 27 14:09:58 2023 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Mon Mar 27 11:34:16 2023 +

tdf#153362 oox: remove dead link from ooxml-export-notes.txt

Change-Id: Iccb91f586bdbd2533f7684a9ef0307d8e492a7a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149627
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/oox/source/export/ooxml-export-notes.txt 
b/oox/source/export/ooxml-export-notes.txt
index 36c42fc53df4..1da7ffd2f12a 100644
--- a/oox/source/export/ooxml-export-notes.txt
+++ b/oox/source/export/ooxml-export-notes.txt
@@ -20,7 +20,6 @@ OOXML generally
 ---
 
 - http://www.ecma-international.org/publications/standards/Ecma-376.htm
-- http://www.asahi-net.or.jp/~eb2m-mrt/ooxml/dependencies.html
 
 Related modules
 ---


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

2023-03-27 Thread Noel Grandin (via logerrit)
 oox/source/drawingml/chart/chartconverter.cxx |3 --
 oox/source/dump/dumperbase.cxx|3 --
 oox/source/export/vmlexport.cxx   |3 --
 oox/source/ole/vbacontrol.cxx |3 --
 opencl/source/openclwrapper.cxx   |5 +--
 pyuno/source/loader/pyuno_loader.cxx  |3 --
 pyuno/source/module/pyuno.cxx |   20 +++
 pyuno/source/module/pyuno_module.cxx  |   33 +++---
 pyuno/source/module/pyuno_util.cxx|3 --
 9 files changed, 32 insertions(+), 44 deletions(-)

New commits:
commit 7f91e4a982672969c80e6117d09ae816a8dc5f21
Author: Noel Grandin 
AuthorDate: Sat Mar 25 16:41:29 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 27 11:04:46 2023 +

loplugin:stringadd in oox..pyuno

after my patch to merge the bufferadd loplugin into stringadd

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

diff --git a/oox/source/drawingml/chart/chartconverter.cxx 
b/oox/source/drawingml/chart/chartconverter.cxx
index 725b28c3bfe2..3f004ffd2c9e 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -47,8 +47,7 @@ const sal_Unicode API_TOKEN_ARRAY_COLSEP= ';';
 static OUString lclGenerateApiArray(const std::vector& rRow, sal_Int32 
nStart, sal_Int32 nCount)
 {
 OSL_ENSURE( !rRow.empty(), "ChartConverter::lclGenerateApiArray - missing 
matrix values" );
-OUStringBuffer aBuffer;
-aBuffer.append( API_TOKEN_ARRAY_OPEN );
+OUStringBuffer aBuffer(( OUStringChar(API_TOKEN_ARRAY_OPEN) ));
 for (auto aBeg = rRow.begin() + nStart, aIt = aBeg, aEnd = aBeg + nCount; 
aIt != aEnd; ++aIt)
 {
 double fValue = 0.0;
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index 0263396928c1..cfc53d944232 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -1097,8 +1097,7 @@ OUString FlagsList::implGetName( const Config& /*rCfg*/, 
sal_Int64 nKey ) const
 setFlag( nKey, nFound, false );
 if( nKey != 0 )
 {
-OUStringBuffer aUnknown( OOX_DUMP_UNKNOWN );
-aUnknown.append( OOX_DUMP_ITEMSEP );
+OUStringBuffer aUnknown( OUString::Concat(OOX_DUMP_UNKNOWN) + 
OUStringChar(OOX_DUMP_ITEMSEP) );
 StringHelper::appendShortHex( aUnknown, nKey );
 StringHelper::enclose( aUnknown, '(', ')' );
 StringHelper::appendToken( aName, aUnknown );
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 2844be0bc8da..7cbfe1f14bfa 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1080,8 +1080,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
 if ( opt.nProp.size() )
 {
 const sal_uInt8 *pIt = opt.nProp.data();
-OStringBuffer buf;
-buf.append( "( " );
+OStringBuffer buf( "( " );
 for ( int nCount = opt.nProp.size(); nCount; --nCount )
 {
 buf.append( 
OString::number(static_cast(*pIt), 16) + " ");
diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx
index bdfe6b363556..217fc32fcf2e 100644
--- a/oox/source/ole/vbacontrol.cxx
+++ b/oox/source/ole/vbacontrol.cxx
@@ -225,8 +225,7 @@ OUString VbaSiteModel::getSubStorageName() const
 {
 if( mnId >= 0 )
 {
-OUStringBuffer aBuffer;
-aBuffer.append( 'i' );
+OUStringBuffer aBuffer( "i" );
 if( mnId < 10 )
 aBuffer.append( '0' );
 aBuffer.append( mnId );
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index dd1850976c08..8d840d65c181 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -77,12 +77,11 @@ OString generateMD5(const void* pData, size_t length)
 pBuffer, RTL_DIGEST_LENGTH_MD5);
 SAL_WARN_IF(aError != rtl_Digest_E_None, "opencl", "md5 generation 
failed");
 
-OStringBuffer aBuffer;
+OStringBuffer aBuffer(length * 2);
 const char* const pString = "0123456789ABCDEF";
 for(sal_uInt8 val : pBuffer)
 {
-aBuffer.append(pString[val/16]);
-aBuffer.append(pString[val%16]);
+aBuffer.append(OStringChar(pString[val/16]) + 
OStringChar(pString[val%16]));
 }
 return aBuffer.makeStringAndClear();
 }
diff --git a/pyuno/source/loader/pyuno_loader.cxx 
b/pyuno/source/loader/pyuno_loader.cxx
index da0467f450c6..e9cbc807ebf3 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -72,8 +72,7 @@ static void raiseRuntimeExceptionWhenNeeded()
 PyErr_Fetch(reinterpret_cast(), 
reinterpret_cast(), 

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

2023-03-16 Thread Sarper Akdemir (via logerrit)
 oox/source/export/drawingml.cxx|6 ++
 sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx |binary
 sd/qa/unit/export-tests-ooxml3.cxx |   22 
++
 3 files changed, 28 insertions(+)

New commits:
commit f039fe0da31907a58a4c3b6717cf29caf2685101
Author: Sarper Akdemir 
AuthorDate: Fri Mar 3 19:22:30 2023 +0300
Commit: Miklos Vajna 
CommitDate: Thu Mar 16 15:47:29 2023 +

tdf#102261: pptx export: implement defTabSz ParaTabStopDefaultDistance

Adds export of ParaTabStopDefaultDistance property into defTabSz.

Also adds a unit test that checks pptx roundtrip of the property.

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8f16b1ebc95e..5335dca58486 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3290,6 +3290,10 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
 return false;
 }
 
+sal_Int32 nParaDefaultTabSize = 0;
+if (GetProperty(rXPropSet, "ParaTabStopDefaultDistance"))
+mAny >>= nParaDefaultTabSize;
+
 // for autofitted textboxes, scale the indents
 if (GetProperty(rXShapePropSet, "TextFitToSize") && 
mAny.get() == TextFitToSizeType_AUTOFIT)
 {
@@ -3314,6 +3318,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)),
 nParaLeftMargin > 0),
XML_indent, 
sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? 
oox::drawingml::convertHmmToEmu(nParaFirstLineIndent) : 0), (bForceZeroIndent 
|| (nParaFirstLineIndent != 0))),
XML_algn, GetAlignment( nAlignment ),
+   XML_defTabSz, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaDefaultTabSize)),
 nParaDefaultTabSize > 0),
XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), 
bRtl));
 else
 mpFS->startElementNS( XML_a, nElement,
@@ -3321,6 +3326,7 @@ bool DrawingML::WriteParagraphProperties(const 
Reference& rParagra
XML_marL, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)),
 nLeftMargin > 0),
XML_indent, 
sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? 
oox::drawingml::convertHmmToEmu(nLineIndentation) : 0), (bForceZeroIndent || ( 
nLineIndentation != 0))),
XML_algn, GetAlignment( nAlignment ),
+   XML_defTabSz, 
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaDefaultTabSize)),
 nParaDefaultTabSize > 0),
XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), 
bRtl));
 
 
diff --git a/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx 
b/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx
new file mode 100644
index ..88438d7b5494
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/tdf102261_testParaTabStopDefaultDistance.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 997dd15009fd..ccbfc6e35335 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -1965,6 +1965,28 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testLinkedOLE)
 assertXPath(pXml, "//p:oleObj", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, 
testTdf102261_testParaTabStopDefaultDistance)
+{
+createSdImpressDoc("pptx/tdf102261_testParaTabStopDefaultDistance.pptx");
+saveAndReload("Impress Office Open XML");
+
+uno::Reference xShape(getShapeFromPage(0, 0));
+{
+uno::Reference xPropSet(getParagraphFromShape(0, 
xShape),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(
+sal_Int32{ 1270 },
+
xPropSet->getPropertyValue("ParaTabStopDefaultDistance").get());
+}
+{
+uno::Reference xPropSet(getParagraphFromShape(1, 
xShape),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(
+sal_Int32{ 2540 },
+
xPropSet->getPropertyValue("ParaTabStopDefaultDistance").get());
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-03-11 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/fontworkhelpers.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 60827355e483351886f7a96b5de12d810f35f0e6
Author: Andrea Gelmini 
AuthorDate: Thu Mar 9 14:04:23 2023 +0100
Commit: Julien Nabet 
CommitDate: Sat Mar 11 09:08:50 2023 +

Fix typo

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

diff --git a/oox/source/drawingml/fontworkhelpers.cxx 
b/oox/source/drawingml/fontworkhelpers.cxx
index e29ecf4a61e3..547c9382d0a9 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -1215,7 +1215,7 @@ sal_Int16 lcl_getAlphaFromTransparenceGradient(const 
awt::Gradient& rTransparenc
 / (100.0 - nBorder) * 100 / 255.0);
 }
 
-// GradientStopColor has components ::Color RGBColor and modul::ThemeColor 
TTColor
+// GradientStopColor has components ::Color RGBColor and model::ThemeColor 
TTColor
 GradientStopColor
 lcl_createGradientStopColor(const uno::Reference& 
rXPropSet,
 const uno::Reference& 
rXPropSetInfo,


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

2023-03-10 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/fontworkhelpers.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 125287c157e1d0db199f5e14364948181c572c11
Author: Andrea Gelmini 
AuthorDate: Thu Mar 9 14:01:38 2023 +0100
Commit: Julien Nabet 
CommitDate: Sat Mar 11 05:43:01 2023 +

Fix typo

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

diff --git a/oox/source/drawingml/fontworkhelpers.cxx 
b/oox/source/drawingml/fontworkhelpers.cxx
index 403dceb4788e..e29ecf4a61e3 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -1223,7 +1223,7 @@ lcl_createGradientStopColor(const 
uno::Reference& rXPropSet
 const awt::Gradient& rTransparenceGradient,
 const bool& rbHasTransparenceGradient, const 
sal_Int32& rnPos)
 {
-// Component mnValue of Tranformation struct is in 1/100th percent (e.g 
80% = 8000) in range
+// Component mnValue of Transformation struct is in 1/100th percent (e.g 
80% = 8000) in range
 // -1 to +1. Constants are used in converting from API values 
below.
 constexpr sal_Int16 nFactorToHthPerc = 100;
 constexpr sal_Int16 nMaxHthPerc = 1;


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

2023-03-10 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/fontworkhelpers.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bb3f9cc58d9cbd896722cc1b2d6b4d5e0f0ec433
Author: Andrea Gelmini 
AuthorDate: Thu Mar 9 13:59:05 2023 +0100
Commit: Julien Nabet 
CommitDate: Sat Mar 11 05:35:10 2023 +

Fix typo

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

diff --git a/oox/source/drawingml/fontworkhelpers.cxx 
b/oox/source/drawingml/fontworkhelpers.cxx
index 7c84f7e6bd86..403dceb4788e 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -1425,7 +1425,7 @@ void 
FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
 rXPropSet->getPropertyValue(u"FillStyle") >>= eFillStyle;
 
 // We might have a solid fill but a transparency gradient. That needs to 
be exported as gradFill
-// too, because Word has transparency not separat but in the color stops 
in a color gradient.
+// too, because Word has transparency not separated but in the color stops 
in a color gradient.
 // A gradient exists, if the GradientName is not empty.
 OUString sTransparenceGradientName;
 if (eFillStyle == drawing::FillStyle_SOLID


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

2023-03-10 Thread Andrea Gelmini (via logerrit)
 oox/source/drawingml/fontworkhelpers.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bba20dfa2d69df6ae1e367022471c4eecf1079d6
Author: Andrea Gelmini 
AuthorDate: Fri Mar 10 15:48:13 2023 +0100
Commit: Julien Nabet 
CommitDate: Sat Mar 11 05:32:26 2023 +

Fix typo

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

diff --git a/oox/source/drawingml/fontworkhelpers.cxx 
b/oox/source/drawingml/fontworkhelpers.cxx
index 3a09ff618d0a..7c84f7e6bd86 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -1291,7 +1291,7 @@ lcl_createGradientStopColor(const 
uno::Reference& rXPropSet
 else
 {
 // solid color and solid transparency
-SAL_WARN("oox.drawingml", "methode should not be called in this case");
+SAL_WARN("oox.drawingml", "method should not be called in this case");
 if 
(!(FontworkHelpers::getThemeColorFromShape("FillColorThemeReference", rXPropSet,
   aStopColor.TTColor)))
 {
@@ -1817,4 +1817,4 @@ void FontworkHelpers::applyUpdatesToCharInteropGrabBag(
 }
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */


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

2023-03-09 Thread Regina Henschel (via logerrit)
 oox/source/drawingml/fontworkhelpers.cxx |   19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

New commits:
commit be7455813557f4289b31d5bb1b68ce1a44a86669
Author: Regina Henschel 
AuthorDate: Thu Mar 9 21:09:09 2023 +0100
Commit: Regina Henschel 
CommitDate: Thu Mar 9 22:20:51 2023 +

rename struct gradientStopColor to GradientStopColor

This is a follow-up to commit d95a09c1fca70d658207b8c48761af32dd2df213.
The change has been requested by reviewer Miklos Vajna.

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

diff --git a/oox/source/drawingml/fontworkhelpers.cxx 
b/oox/source/drawingml/fontworkhelpers.cxx
index cebe7bcf707e..3a09ff618d0a 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -1024,7 +1024,8 @@ bool FontworkHelpers::getThemeColorFromShape(
 
 namespace
 {
-struct gradientStopColor
+// Contains information about one gradient stop. Each gradient has at least 2 
of these.
+struct GradientStopColor
 {
 // RGBColor contains no transformations. In case TTColor has other type 
than
 // ThemeColorType::Unknown, it has precedence. The color transformations 
in TTColor are used
@@ -1037,7 +1038,7 @@ struct gradientStopColor
 // 'first' contains the position in the range 0 (=0%) to 10 (=100%) in the 
gradient as needed for
 // the 'pos' attribute in  element in oox, 'second' contains color and 
color transformations
 // at this position. The map contains all information needed for a  
element in oox.
-typedef std::multimap ColorMapType;
+typedef std::multimap ColorMapType;
 
 namespace
 {
@@ -1214,8 +1215,8 @@ sal_Int16 lcl_getAlphaFromTransparenceGradient(const 
awt::Gradient& rTransparenc
 / (100.0 - nBorder) * 100 / 255.0);
 }
 
-// gradientStopColor has components ::Color RGBColor and modul::ThemeColor 
TTColor
-gradientStopColor
+// GradientStopColor has components ::Color RGBColor and modul::ThemeColor 
TTColor
+GradientStopColor
 lcl_createGradientStopColor(const uno::Reference& 
rXPropSet,
 const uno::Reference& 
rXPropSetInfo,
 const awt::Gradient& rColorGradient, const bool& 
rbHasColorGradient,
@@ -1226,7 +1227,7 @@ lcl_createGradientStopColor(const 
uno::Reference& rXPropSet
 // -1 to +1. Constants are used in converting from API values 
below.
 constexpr sal_Int16 nFactorToHthPerc = 100;
 constexpr sal_Int16 nMaxHthPerc = 1;
-gradientStopColor aStopColor;
+GradientStopColor aStopColor;
 if (rbHasTransparenceGradient)
 {
 // Color
@@ -1339,18 +1340,18 @@ ColorMapType lcl_createColorMapFromShapeProps(
  aTransparenceGradient.EndIntensity);
 }
 
-// A gradientStopColor includes color and transparency.
+// A GradientStopColor includes color and transparency.
 // The key of aColorMap has same unit as the w14:pos attribute of  
element in oox.
-gradientStopColor aStartStopColor
+GradientStopColor aStartStopColor
 = lcl_createGradientStopColor(rXPropSet, rXPropSetInfo, 
aColorGradient, rbHasColorGradient,
   aTransparenceGradient, 
rbHasTransparenceGradient, 0);
 aColorMap.insert(std::pair{ 0, aStartStopColor });
-gradientStopColor aEndStopColor
+GradientStopColor aEndStopColor
 = lcl_createGradientStopColor(rXPropSet, rXPropSetInfo, 
aColorGradient, rbHasColorGradient,
   aTransparenceGradient, 
rbHasTransparenceGradient, 100);
 aColorMap.insert(std::pair{ 10, aEndStopColor });
 
-// We add additional gradientStopColor in case of borders.
+// We add additional GradientStopColor in case of borders.
 if (rbHasColorGradient)
 {
 // We only use the color border for now. If the transparency gradient 
has a total different


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

2023-03-01 Thread Caolán McNamara (via logerrit)
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2e2578732588d3f4b9dd10fef91ff3087836f11d
Author: Caolán McNamara 
AuthorDate: Wed Mar 1 17:33:46 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 1 19:55:26 2023 +

cid#1521560 Division or modulo by float zero

and

cid#1521558 Division or modulo by float zero

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index d3fb8a3daf97..26858cac40cf 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1970,7 +1970,7 @@ void 
DrawingML::WriteXGraphicCustomPosition(uno::Reference
 }
 
 sal_Int32 nL = 0, nT = 0, nR = 0, nB = 0;
-if (GetProperty(rXPropSet, "FillBitmapRectanglePoint"))
+if (GetProperty(rXPropSet, "FillBitmapRectanglePoint") && rSize.Width != 0 
&& rSize.Height != 0)
 {
 sal_Int32 nWidth = (1 - (nSizeX / rSize.Width)) * 10;
 sal_Int32 nHeight = (1 - (nSizeY / rSize.Height)) * 10;


  1   2   3   4   5   6   7   8   9   10   >