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

2024-03-20 Thread Regina Henschel (via logerrit)
 oox/inc/drawingml/scene3dhelper.hxx  |   13 +
 oox/qa/unit/data/Scene3d_material_highlight.pptx |binary
 oox/qa/unit/data/Scene3d_material_wireframe.pptx |binary
 oox/qa/unit/testscene3d.cxx  |  168 +++
 oox/source/drawingml/scene3dhelper.cxx   |   93 
 oox/source/drawingml/shape.cxx   |4 
 6 files changed, 223 insertions(+), 55 deletions(-)

New commits:
commit 2eabd56ff5f65733c6fa1bcef14d4a39c21dddc7
Author: Regina Henschel 
AuthorDate: Fri Mar 15 00:00:51 2024 +0100
Commit: Regina Henschel 
CommitDate: Wed Mar 20 18:06:35 2024 +0100

tdf#70039 import material of extruded shapes

This patch continues the tdf#70039 related commits 98b06ed3 and 6e5529d7.
It adds further property-value pairs to the property map which is later
used in CustomShapeProperties.pushToPropSet() for property Extrusion.

OOXML defines a set of 15 material presets in section 20.1.10.50
ST_PresetMaterialType. The specification lists some values and it has
example pictures. The example shape uses Bevel. That is not implemented,
thus the examples are not really usable. Microsoft specifies the values
it uses in section 2.1.1331 in MS-OI29500] - v20231113. The values used
in the patch are based on these resources.

MS Office defines the material by the properties 'Specular-',
'Diffuse-', 'Ambient-' and 'Emissive-Color, 'Specular Power', 'Blinn
Hightlight', 'Diffuse-' and 'Alpha-Fresnel', and 'Metal'. But ODF, API
and current implementation have for material only the properties
'Diffusion', 'Specularity', 'Shininess', 'Metal' and 'MetalType'. The
patch tries to map the values as well as possible.

The mapping works well for the legacy-foo materials which reflect the
material in binary MS Office and is base of ODF and our implementation.
But the preset has also material where transparency is added to the
reflected light or the reflected light is blended or brightened with
White. That is not possible currently and such shapes look different
than in MS Office. These are especially the materials in the
'Translucent' section in the UI of MS Office. The material type 'flat'
uses 'Emissive Color'. Such is not available at all. So material 'flat'
looks noticable different too.

More details about the used values is contained in the attachment in
the bug report.

Change-Id: I16a242446cbe98efcbdf5452058e1a3bd88dcf56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164853
Tested-by: Jenkins
Reviewed-by: Patrick Luby 
Reviewed-by: Regina Henschel 

diff --git a/oox/inc/drawingml/scene3dhelper.hxx 
b/oox/inc/drawingml/scene3dhelper.hxx
index af72a0e0cf2a..0f79825b13ca 100644
--- a/oox/inc/drawingml/scene3dhelper.hxx
+++ b/oox/inc/drawingml/scene3dhelper.hxx
@@ -50,6 +50,19 @@ public:
 void setLightingProperties(const oox::drawingml::Shape3DPropertiesPtr 
p3DProperties,
const double& rRotZ, oox::PropertyMap& 
rPropertyMap);
 
+/** Puts the material properties of the 3D-shape into the property map
+@details OOXML and MSO describe the material properties using Specular 
Color (RGBA), Diffuse
+Color (RGBA), Ambient Color (RGBA), Emissive Color (RGBA), 
Specular Power (positive int),
+Diffuse Fresnel (int), Alpha Fresnel (int), Metal (bool) and Blinn 
Highlight (bool). ODF
+and API have Diffusion (double), Specularity (double), Shininess 
(double), Metal (bool),
+MetalType (enum). Thus a directly use of the MSO values is not 
possible and some material
+types cannot be rendered. The method uses workarounds and 
approximations.
+@param [in] p3DProperties contains besides other properties the 
material preset name
+@param [in, out] rPropertyMap has properties directly usable in
+CustomShapeProperties.pushToPropSet() for property Extrusion.*/
+static void setMaterialProperties(const 
oox::drawingml::Shape3DPropertiesPtr p3DProperties,
+  oox::PropertyMap& rPropertyMap);
+
 private:
 /** Calculates angles suitable for API from OOXML scene3d angles.
 @param [in] nLat, nLon, nRev in unit 1/6 deg with same orientation 
as the attributes lat,
diff --git a/oox/qa/unit/data/Scene3d_material_highlight.pptx 
b/oox/qa/unit/data/Scene3d_material_highlight.pptx
new file mode 100644
index ..c299c21bc68c
Binary files /dev/null and b/oox/qa/unit/data/Scene3d_material_highlight.pptx 
differ
diff --git a/oox/qa/unit/data/Scene3d_material_wireframe.pptx 
b/oox/qa/unit/data/Scene3d_material_wireframe.pptx
new file mode 100644
index ..f72baeb25178
Binary files /dev/null and b/oox/qa/unit/data/Scene3d_material_wireframe.pptx 
differ
diff --git a/oox/qa/unit/testscene3d.cxx b/oox/qa/unit/testscene3d.cxx
index 

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

2024-02-20 Thread Andrea Gelmini (via logerrit)
 0 files changed

New commits:
commit b9946c42977fce2273e53e9dffe369dcab534856
Author: Andrea Gelmini 
AuthorDate: Tue Feb 20 10:41:21 2024 +0100
Commit: Julien Nabet 
CommitDate: Tue Feb 20 16:26:31 2024 +0100

Remove exec bits from source file

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

diff --git a/oox/inc/drawingml/scene3dhelper.hxx 
b/oox/inc/drawingml/scene3dhelper.hxx
old mode 100755
new mode 100644
diff --git a/oox/qa/unit/testscene3d.cxx b/oox/qa/unit/testscene3d.cxx
old mode 100755
new mode 100644
diff --git a/oox/source/drawingml/scene3dhelper.cxx 
b/oox/source/drawingml/scene3dhelper.cxx
old mode 100755
new mode 100644


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

2023-02-21 Thread Regina Henschel (via logerrit)
 oox/inc/drawingml/fontworkhelpers.hxx  |   52 +
 oox/qa/unit/data/tdf51195_Fontwork_DirectColor.odt |binary
 oox/qa/unit/data/tdf51195_Fontwork_Distance.odt|binary
 oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.odt  |binary
 oox/qa/unit/export.cxx |  105 +++
 oox/source/drawingml/fontworkhelpers.cxx   |  609 +
 oox/source/export/drawingml.cxx|   36 +
 7 files changed, 801 insertions(+), 1 deletion(-)

New commits:
commit b94336ac3d29180504e4bd7ada4d29ed5b6d3fda
Author: Regina Henschel 
AuthorDate: Tue Feb 14 01:36:50 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Feb 22 07:12:19 2023 +

tdf#51195 Improve DML export of Fontwork shapes for docx

Fontwork in Writer has fill and outline as shape properties. The 'abc
transform' in Word uses character properties. Output of character
properties happens in DocxAttributeOutput methods in LO.

The patch modifies the character properties of the Fontwork shape,
in particular the contents of the CharInteropGrabBag, so that
DocxAttributeOutput produces a reasonably suitable markup.

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

diff --git a/oox/inc/drawingml/fontworkhelpers.hxx 
b/oox/inc/drawingml/fontworkhelpers.hxx
index f1861f266bde..7d8d0a9692dd 100644
--- a/oox/inc/drawingml/fontworkhelpers.hxx
+++ b/oox/inc/drawingml/fontworkhelpers.hxx
@@ -19,6 +19,7 @@
 
 #pragma once
 
+#include 
 #include 
 #include 
 #include 
@@ -26,7 +27,11 @@
 #include "customshapeproperties.hxx"
 
 #include 
+#include 
+#include 
+#include 
 #include 
+#include 
 
 namespace FontworkHelpers
 {
@@ -46,5 +51,52 @@ void putCustomShapeIntoTextPathMode(
 If eShapeType is not a Fontwork shape type or the special type is not yet 
implemented,
 it returns an empty string.*/
 OString GetVMLFontworkShapetypeMarkup(const MSO_SPT eShapeType);
+
+/** Collects the properties "CharColor", "CharLumMod", "CharLumOff", 
"CharColorTheme",
+"CharColorThemeReference" and "CharTransparence" from the first non-empty 
run in rXText and puts
+them into rCharPropVec.*/
+void collectCharColorProps(const css::uno::Reference& rXText,
+   std::vector& 
rCharPropVec);
+
+/** Applies all properties in rTextPropVec excluding "CharInteropGrabBag" to 
all non-empty runs in
+rXText.*/
+void applyPropsToRuns(const std::vector& 
rTextPropVec,
+  css::uno::Reference& rXText);
+
+/** Generates the properties "CharColor", "CharLumMod", "CharLumOff", 
"CharColorTheme",
+"CharColorThemeReference" and "CharTransparence" from the shape properties 
"FillColor",
+"FillColorLumMod, "FillColorLumOff", "FillColorTheme", 
"FillColorThemeReference" and
+"FillTransparence" and puts them into rCharPropVec.*/
+void createCharFillPropsFromShape(const 
css::uno::Reference& rXPropSet,
+  std::vector& 
rCharPropVec);
+
+/** Creates the properties "CharTextFillTextEffect", 
"CharTextOutlineTextEffect", "CharThemeColor",
+"CharThemeColorShade" or "CharThemeColorTint", and 
"CharThemeOriginalColor" from the FillFoo and
+LineBar properties of the shape and puts them into rUpdatePropVec.*/
+void createCharInteropGrabBagUpdatesFromShapeProps(
+const css::uno::Reference& rXPropSet,
+std::vector& rUpdatePropVec);
+
+/** Puts all properties in rUpdatePropVec into the "CharInteropGrabBag" of all 
non-empty runs in rXText.
+Existing properties are overwritten.*/
+void applyUpdatesToCharInteropGrabBag(const 
std::vector& rUpdatePropVec,
+  css::uno::Reference& 
rXText);
+
+// ToDo: This is essentially the same as contained in methode 
DrawingML::WriteOutline. Change it
+// there to use this method too, perhaps move this method to a common location.
+/** Uses LineDash and LineCap to detect, whether the dashing comes from a 
prstDash in MS Office.
+If prstDash is detected, the method puts the corresponding string for 
markup into rsPrstDash
+and returns true.
+If no prstDash is detected, the method leaves rsPrstDash unchanged and 
returns false. */
+bool createPrstDashFromLineDash(const css::drawing::LineDash& rLineDash,
+const css::drawing::LineCap& rLineCap, 
OUString& rsPrstDash);
+
+/** Returns true if a theme color with other type than 
model::ThemeColorType::Unknown was found.
+The theme color is then in aThemeColor.
+Returns false otherwise. aThemeColor is then unchanged or its type is
+model::ThemeColorType::Unknown */
+bool getThemeColorFromShape(const OUString& rPropertyName,
+const 
css::uno::Reference& xPropertySet,
+model::ThemeColor& aThemeColor);
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab 

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

2023-02-01 Thread Regina Henschel (via logerrit)
 oox/inc/drawingml/fontworkhelpers.hxx |6 
 oox/qa/unit/data/tdf153296_VML_export_ArchUpCurve.odt |binary
 oox/qa/unit/data/tdf153296_VML_export_SlantUp.odt |binary
 oox/qa/unit/export.cxx|   51 +
 oox/source/drawingml/fontworkhelpers.cxx  |  628 ++
 oox/source/export/vmlexport.cxx   |   24 
 6 files changed, 706 insertions(+), 3 deletions(-)

New commits:
commit b1fda9b2c4986ad44245020b98ddcc2e81c299bf
Author: Regina Henschel 
AuthorDate: Mon Jan 30 01:26:23 2023 +0100
Commit: Regina Henschel 
CommitDate: Wed Feb 1 17:17:51 2023 +

tdf#153296 improved markup for VML shapetype of Fontwork

In the current version of 'vml-shape-types' file the markup for the
Fontwork shapes is missing or is so, that Word does not accept it as
WordArt markup. So Word treats it as custom geometry and saves it that
way. But LO cannot import custom geometry for WordArt.

The patch changes it so, that for Fontwork shapes a dedicated markup
map is used with markup, that Word accepts as WordArt. Non-Fontwork
shapes still use the 'vml-shape-types' file for VML export.

I have added two unit tests. But a true test is not possible, because
for that you would need to open and save the files with MS Word.

This patch solves at the same time some of the handle problems for the
special case of Fontwork shapes, see tdf#152913.

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

diff --git a/oox/inc/drawingml/fontworkhelpers.hxx 
b/oox/inc/drawingml/fontworkhelpers.hxx
index 2a48f422abbf..f1861f266bde 100644
--- a/oox/inc/drawingml/fontworkhelpers.hxx
+++ b/oox/inc/drawingml/fontworkhelpers.hxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 
 #include "customshapeproperties.hxx"
 
@@ -40,5 +41,10 @@ void putCustomShapeIntoTextPathMode(
 const css::uno::Reference& xShape,
 const oox::drawingml::CustomShapePropertiesPtr& pCustomShapePropertiesPtr,
 const OUString& sMSPresetType, const bool bFromWordArt);
+
+/** Returns the markup for the v:shapetype element for export of a Fontwork 
shape to VML.
+If eShapeType is not a Fontwork shape type or the special type is not yet 
implemented,
+it returns an empty string.*/
+OString GetVMLFontworkShapetypeMarkup(const MSO_SPT eShapeType);
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
\ No newline at end of file
diff --git a/oox/qa/unit/data/tdf153296_VML_export_ArchUpCurve.odt 
b/oox/qa/unit/data/tdf153296_VML_export_ArchUpCurve.odt
new file mode 100644
index ..37e0f779d02a
Binary files /dev/null and 
b/oox/qa/unit/data/tdf153296_VML_export_ArchUpCurve.odt differ
diff --git a/oox/qa/unit/data/tdf153296_VML_export_SlantUp.odt 
b/oox/qa/unit/data/tdf153296_VML_export_SlantUp.odt
new file mode 100644
index ..223ec5d169b5
Binary files /dev/null and b/oox/qa/unit/data/tdf153296_VML_export_SlantUp.odt 
differ
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index f25bf4493b17..64c97b56a24d 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -832,6 +832,57 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkFontProperties)
 sStyle = getXPath(pXmlDoc, "(//v:shape)[5]/v:textpath", "style");
 CPPUNIT_ASSERT(sStyle.indexOf("v-same-letter-heights:t") > -1);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkSlantUp)
+{
+// The document has a Fontwork shape type 'textSlantUp' (172). When 
exporting to docx, Word does
+// not recognize its markup as preset WordArt, because the used markup 
differs from what Word
+// expects for this type of shape. As a result Word saves the shape as 
having custom geometry
+// and such is not understand by LibreOffice.
+loadFromURL(u"tdf153296_VML_export_SlantUp.odt");
+
+// FIXME: tdf#153183 validation error in OOXML export: Errors: 1
+// Attribute 'ID' is not allowed to appear in element 'v:shape'.
+skipValidation();
+
+// Save to DOCX:
+save("Office Open XML Text");
+
+// Examine the saved markup. I could identify the following two problems 
to hinder Word from
+// accepting the markup. There might exist more problems.
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+// Make sure a  element exists and has an o:connecttype attribute
+assertXPath(pXmlDoc, "//v:shapetype/v:path", 1);
+assertXPath(pXmlDoc, "//v:shapetype/v:path[@o:connecttype]", 1);
+
+// Make sure the handle position is written without reference to a formula
+OUString sPosition = getXPath(pXmlDoc, "//v:h", "position");
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), sPosition.indexOf("@"));
+CPPUNIT_ASSERT_EQUAL(OUString("topLeft,#0"), sPosition);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testVMLFontworkArchUp)
+{

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

2022-10-31 Thread Regina Henschel (via logerrit)
 oox/inc/drawingml/customshapeproperties.hxx |1 
 oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx |binary
 oox/qa/unit/drawingml.cxx   |   20 
 oox/source/drawingml/customshapeproperties.cxx  |4 ++-
 4 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit cf972fb9856957f199eb97464b83d8dc2698
Author: Regina Henschel 
AuthorDate: Sun Oct 30 22:53:55 2022 +0100
Commit: Regina Henschel 
CommitDate: Mon Oct 31 12:20:34 2022 +0100

tdf#113187 exclude angle conversion from count of maGuideList

The ooxml import uses the special viewBox value '0 0 0 0' to indicate
that the point coordinates are relative to shape size and not to
viewBox and need special treatment. To detect this case the number of
guides in maGuideList was used. But that number might be larger than
the guides in ooxml because each arcTo command introduces two
additional guides for the conversion from 1/6 degree in ooxml to
degree in LibreOffice.

The patch excludes these guides from count. Thus now a path which has
no references in its points will get a viewBox with non-zero width
and height in all cases and is rendered now.

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

diff --git a/oox/inc/drawingml/customshapeproperties.hxx 
b/oox/inc/drawingml/customshapeproperties.hxx
index c009a0fb7db0..61a151d9aa09 100644
--- a/oox/inc/drawingml/customshapeproperties.hxx
+++ b/oox/inc/drawingml/customshapeproperties.hxx
@@ -123,6 +123,7 @@ public:
 static sal_Int32 GetCustomShapeGuideValue( const std::vector< 
CustomShapeGuide >& rGuideList, std::u16string_view rFormulaName );
 
 sal_Int32 getArcNum() { return mnArcNum++; }
+sal_Int32 countArcTo() { return mnArcNum; }
 
 /**
Returns whether or not the current CustomShapeProperties
diff --git a/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx 
b/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx
new file mode 100644
index ..1862c0257f29
Binary files /dev/null and 
b/oox/qa/unit/data/tdf113187_arcTo_withoutReferences.pptx differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index 95e593627909..6150e4499eed 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -529,6 +529,26 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTextRot)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf113187ConstantArcTo)
+{
+loadFromURL(u"tdf113187_arcTo_withoutReferences.pptx");
+
+// Get ViewBox of shape
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xShapeProps(xShape, uno::UNO_QUERY);
+uno::Sequence aGeoPropSeq;
+xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeoPropSeq;
+comphelper::SequenceAsHashMap aGeoPropMap(aGeoPropSeq);
+
+// Without the fix width and height of the ViewBox were 0 and thus the 
shape was not shown.
+auto aViewBox = aGeoPropMap["ViewBox"].get();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(360), aViewBox.Width);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(360), aViewBox.Height);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index ef164194e7f0..9cdbb4ee8801 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -198,7 +198,9 @@ void CustomShapeProperties::pushToPropSet(
 // This size specifically affects scaling.
 // Note 2: Width and Height are set to 0 to force scaling to 1.
 awt::Rectangle aViewBox( 0, 0, aSize.Width, aSize.Height );
-if( !maGuideList.empty() )
+// tdf#113187 Each ArcTo introduces two additional equations for 
converting start and swing
+// angles. They do not count for test for use of standard ooxml 
coordinates
+if (maGuideList.size() - 2 * countArcTo() > 0)
 aViewBox = awt::Rectangle( 0, 0, 0, 0 );
 aPropertyMap.setProperty( PROP_ViewBox, aViewBox);
 


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

2022-02-15 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/customshapeproperties.hxx|6 +++
 oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx |binary
 oox/qa/unit/drawingml.cxx  |   29 +
 oox/source/drawingml/customshapeproperties.cxx |7 
 oox/source/drawingml/shape.cxx |5 +-
 oox/source/ppt/pptshape.cxx|   15 
 6 files changed, 59 insertions(+), 3 deletions(-)

New commits:
commit 6df267780c4d41b41101c1be0a954b2f16ee8012
Author: Sarper Akdemir 
AuthorDate: Mon Feb 14 07:33:56 2022 +0300
Commit: Jan Holesovsky 
CommitDate: Tue Feb 15 09:56:47 2022 +0100

tdf#132557: PPTX import: Workaround for slide footer shape presets

It appears that placeholder shapes with service names:
  - com.sun.star.presentation.TitleTextShape
  - com.sun.star.presentation.DateTimeShape
  - com.sun.star.presentation.FooterShape
  - com.sun.star.presentation.SlideNumberShape
  ...

Are unable to have custom shapes in Impress. (i.e. can't be
ellipse, triangle etc.). These presets get specified in OOXML
with  inside spPr (shape properties).

Therefore with similar results to the PPT import, a workaround
is applied where slide footers which have non default shapes
are imported with com.sun.star.drawing.CustomShapes service.

The layout/master footers are left as is since if they were to
be imported as CustomShapes they would appear on each slide
even if the slide had those footers enabled or not.

Change-Id: Ic8a8ab3f6dfb7367ecd2c619ce888bf77abef460
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129889
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/oox/inc/drawingml/customshapeproperties.hxx 
b/oox/inc/drawingml/customshapeproperties.hxx
index 55bf387282dc..779003412fbb 100644
--- a/oox/inc/drawingml/customshapeproperties.hxx
+++ b/oox/inc/drawingml/customshapeproperties.hxx
@@ -124,6 +124,12 @@ public:
 
 sal_Int32 getArcNum() { return mnArcNum++; }
 
+/**
+   Returns whether or not the current CustomShapeProperties
+   represent a default shape preset that is rectangular.
+*/
+bool representsDefaultShape() const;
+
 private:
 
 sal_Int32   mnShapePresetType;
diff --git a/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx 
b/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx
new file mode 100755
index ..4dbf3717d1fd
Binary files /dev/null and 
b/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index ccfa0fa80633..9ae434717fb8 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -480,6 +480,35 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme)
  
xPortion->getPropertyValue("CharColorLumOff").get());
 }
 
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf132557_footerCustomShapes)
+{
+// slide with date, footer, slide number with custom shapes
+OUString aURL
+= m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"testTdf132557_footerCustomShapes.pptx";
+// When importing the document:
+load(aURL);
+
+uno::Reference 
xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+
+// Test if we were able to import the footer shapes with CustomShape 
service.
+uno::Reference xShapeDateTime(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"),
+ xShapeDateTime->getShapeType());
+// Without the accompanying fix in place, this test would have failed with:
+// An uncaught exception of type 
com.sun.star.lang.IndexOutOfBoundsException
+// i.e. the shape wasn't on the slide there since it was imported as a 
property, not a shape.
+
+uno::Reference xShapeFooter(xDrawPage->getByIndex(1), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"),
+ xShapeFooter->getShapeType());
+
+uno::Reference xShapeSlideNum(xDrawPage->getByIndex(2), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"),
+ xShapeSlideNum->getShapeType());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index 977afab04a6a..efe7c0ad03af 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -88,6 +88,13 @@ sal_Int32 CustomShapeProperties::GetCustomShapeGuideValue( 
const std::vector< Cu
 return nIndex;
 }
 
+bool CustomShapeProperties::representsDefaultShape() 

[Libreoffice-commits] core.git: oox/inc oox/qa oox/source solenv/clang-format

2020-11-19 Thread Philipp Hofer (via logerrit)
 oox/inc/drawingml/objectdefaultcontext.hxx  |   10 +--
 oox/inc/drawingml/shapepropertiescontext.hxx|   12 ++--
 oox/inc/drawingml/shapestylecontext.hxx |   12 ++--
 oox/inc/drawingml/spdefcontext.hxx  |   10 +--
 oox/inc/drawingml/table/tablecellcontext.hxx|   13 ++--
 oox/inc/drawingml/table/tablecontext.hxx|   11 +---
 oox/inc/drawingml/table/tablerow.hxx|   13 +---
 oox/inc/drawingml/table/tablerowcontext.hxx |   13 ++--
 oox/inc/drawingml/textliststyle.hxx |   20 +++
 oox/inc/drawingml/themeelementscontext.hxx  |   10 +--
 oox/qa/unit/vba_encryption.cxx  |1 
 oox/source/crypto/DocumentDecryption.cxx|   54 +++-
 oox/source/drawingml/diagram/layoutatomvisitors.cxx |   33 +++-
 oox/source/drawingml/embeddedwavaudiofile.cxx   |   15 ++---
 oox/source/drawingml/table/tablerow.cxx |7 +-
 oox/source/drawingml/table/tablestyle.cxx   |7 --
 oox/source/drawingml/table/tablestylelist.cxx   |   11 +---
 oox/source/drawingml/table/tablestylepart.cxx   |7 --
 oox/source/drawingml/textspacingcontext.hxx |   12 ++--
 oox/source/mathml/export.cxx|5 -
 oox/source/ppt/animationtypes.cxx   |   13 ++--
 oox/source/ppt/animationtypes.hxx   |9 +--
 oox/source/ppt/comments.cxx |   18 ++
 oox/source/token/namespacemap.cxx   |5 -
 oox/source/token/propertynames.cxx  |   15 ++---
 solenv/clang-format/excludelist |   25 -
 26 files changed, 159 insertions(+), 202 deletions(-)

New commits:
commit c4ab5393e1c2332d92ea6672d3c8ffc3a6220afa
Author: Philipp Hofer 
AuthorDate: Thu Nov 12 13:08:56 2020 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Nov 19 19:22:02 2020 +0100

tdf#123936 Formatting files in module oox with clang-format

Change-Id: Ie061189450e0f9004ca503bb28164885812f2acc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105694
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/oox/inc/drawingml/objectdefaultcontext.hxx 
b/oox/inc/drawingml/objectdefaultcontext.hxx
index 703b03097673..45873c8253ff 100644
--- a/oox/inc/drawingml/objectdefaultcontext.hxx
+++ b/oox/inc/drawingml/objectdefaultcontext.hxx
@@ -22,20 +22,20 @@
 
 #include 
 
-namespace oox::drawingml {
-
+namespace oox::drawingml
+{
 class Theme;
 
 class objectDefaultContext final : public oox::core::ContextHandler2
 {
 public:
-objectDefaultContext( ::oox::core::ContextHandler2Helper const & rParent, 
Theme& rTheme );
-virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const ::oox::AttributeList& rAttribs ) override;
+objectDefaultContext(::oox::core::ContextHandler2Helper const& rParent, 
Theme& rTheme);
+virtual ::oox::core::ContextHandlerRef
+onCreateContext(::sal_Int32 Element, const ::oox::AttributeList& rAttribs) 
override;
 
 private:
 Theme& mrTheme;
 };
-
 }
 
 #endif // INCLUDED_OOX_DRAWINGML_OBJECTDEFAULTCONTEXT_HXX
diff --git a/oox/inc/drawingml/shapepropertiescontext.hxx 
b/oox/inc/drawingml/shapepropertiescontext.hxx
index 6736403f6063..9d047c15c224 100644
--- a/oox/inc/drawingml/shapepropertiescontext.hxx
+++ b/oox/inc/drawingml/shapepropertiescontext.hxx
@@ -23,19 +23,19 @@
 #include 
 #include 
 
-namespace oox::drawingml {
-
+namespace oox::drawingml
+{
 class ShapePropertiesContext : public ::oox::core::ContextHandler2
 {
 public:
-ShapePropertiesContext( ::oox::core::ContextHandler2Helper const & 
rParent, Shape& rShape );
+ShapePropertiesContext(::oox::core::ContextHandler2Helper const& rParent, 
Shape& rShape);
 
-virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const ::oox::AttributeList& rAttribs ) override;
+virtual ::oox::core::ContextHandlerRef
+onCreateContext(::sal_Int32 Element, const ::oox::AttributeList& rAttribs) 
override;
 
 protected:
-Shape&  mrShape;
+Shape& mrShape;
 };
-
 }
 
 #endif // INCLUDED_OOX_DRAWINGML_SHAPEPROPERTIESCONTEXT_HXX
diff --git a/oox/inc/drawingml/shapestylecontext.hxx 
b/oox/inc/drawingml/shapestylecontext.hxx
index 8a2cf9f904fd..02faa22a7670 100644
--- a/oox/inc/drawingml/shapestylecontext.hxx
+++ b/oox/inc/drawingml/shapestylecontext.hxx
@@ -23,20 +23,20 @@
 #include 
 #include 
 
-namespace oox::drawingml {
-
+namespace oox::drawingml
+{
 class ShapeStyleContext final : public ::oox::core::ContextHandler2
 {
 public:
-ShapeStyleContext( ::oox::core::ContextHandler2Helper const & rParent, 
Shape& rShape );
+ShapeStyleContext(::oox::core::ContextHandler2Helper const& rParent, 
Shape& rShape);
 virtual ~ShapeStyleContext() override;
 
-virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const