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

2023-12-01 Thread Andrea Gelmini (via logerrit)
 oox/inc/drawingml/connectorhelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 39c4fa298a7c90353a1714b48d1a79df830ed1ef
Author: Andrea Gelmini 
AuthorDate: Fri Dec 1 12:09:28 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 1 17:03:56 2023 +0100

Fix typo

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

diff --git a/oox/inc/drawingml/connectorhelper.hxx 
b/oox/inc/drawingml/connectorhelper.hxx
index f353decc15ab..16544007abc7 100644
--- a/oox/inc/drawingml/connectorhelper.hxx
+++ b/oox/inc/drawingml/connectorhelper.hxx
@@ -76,7 +76,7 @@ void getLOBentHandlePositionsHmm(const 
oox::drawingml::ShapePtr& pConnector,
  std::vector& 
rHandlePositions);
 
 /**
- * Calulates the handle positions of a connector of type ConnectorType_CURVE 
for which OOXML
+ * Calculates the handle positions of a connector of type ConnectorType_CURVE 
for which OOXML
  * compatible routing is enabled. Such connector corresponds to the OOXML 
curvedConnector shapes. The
  * calculation is based on the actual polygon of the connector. The 
coordinates are always returned
  * in Hmm, even for shapes on a text document draw page.


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

2023-11-15 Thread Andrea Gelmini (via logerrit)
 oox/inc/drawingml/connectorhelper.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5fe2bf914c251009ec4709fa8fdc45c3b53f676b
Author: Andrea Gelmini 
AuthorDate: Wed Nov 15 12:51:08 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 15 23:50:56 2023 +0100

Fix typo

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

diff --git a/oox/inc/drawingml/connectorhelper.hxx 
b/oox/inc/drawingml/connectorhelper.hxx
index cfbf4b75d27c..1e875ab8ee95 100644
--- a/oox/inc/drawingml/connectorhelper.hxx
+++ b/oox/inc/drawingml/connectorhelper.hxx
@@ -103,6 +103,6 @@ void applyConnections(oox::drawingml::ShapePtr& rConnector, 
oox::drawingml::Shap
 */
 void applyBentHandleAdjustments(oox::drawingml::ShapePtr pConnector);
 
-} // end namespace ConnecorHelper
+} // end namespace ConnectorHelper
 
-/* 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/inc

2023-11-15 Thread Andrea Gelmini (via logerrit)
 oox/inc/drawingml/connectorhelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5f72ab66b16d39db124eed5834fc715f8807da21
Author: Andrea Gelmini 
AuthorDate: Wed Nov 15 12:50:16 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 15 23:48:32 2023 +0100

Fix typo

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

diff --git a/oox/inc/drawingml/connectorhelper.hxx 
b/oox/inc/drawingml/connectorhelper.hxx
index dec1deb6a238..cfbf4b75d27c 100644
--- a/oox/inc/drawingml/connectorhelper.hxx
+++ b/oox/inc/drawingml/connectorhelper.hxx
@@ -70,7 +70,7 @@ void getOOXHandlePositionsHmm(const oox::drawingml::ShapePtr& 
pConnector,
 basegfx::B2DHomMatrix getConnectorTransformMatrix(const 
oox::drawingml::ShapePtr& pConnector);
 
 /**
- * Calulates the handle positions of a connector of type 
ConnectorType_STANDARD. Such connector
+ * Calculates the handle positions of a connector of type 
ConnectorType_STANDARD. Such connector
  * corresponds to the OOXML bentConnector shapes, aka "ElbowConnector". The 
calculation is based on
  * the actual polygon of the connector. The coordinates are always returned in 
Hmm, even for shapes
  * on a text document draw page.


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

2023-08-29 Thread Caolán McNamara (via logerrit)
 oox/inc/drawingml/textfont.hxx   |4 +++-
 oox/source/drawingml/shape.cxx   |   18 +-
 oox/source/drawingml/textcharacterproperties.cxx |   12 ++--
 oox/source/drawingml/textfont.cxx|   10 ++
 oox/source/drawingml/textparagraphproperties.cxx |6 +++---
 oox/source/drawingml/textrun.cxx |7 ++-
 6 files changed, 33 insertions(+), 24 deletions(-)

New commits:
commit 7f1c2b6ccf318d3b6bbf46f6559b2a3017a72821
Author: Caolán McNamara 
AuthorDate: Mon Aug 28 20:54:50 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 29 09:26:34 2023 +0200

pptx using Wingdings didn't fallback to OpenSymbol


 ^

The charset indicating that it was symbol encoded wasn't
applied.

There are quite a few uses of GetFontData so make this
an optional request and only apply it right now to the
problematic case.

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

diff --git a/oox/inc/drawingml/textfont.hxx b/oox/inc/drawingml/textfont.hxx
index 1c6da232d443..e5f245a43380 100644
--- a/oox/inc/drawingml/textfont.hxx
+++ b/oox/inc/drawingml/textfont.hxx
@@ -50,6 +50,7 @@ public:
 OUString& rFontName,
 sal_Int16& rnFontPitch,
 sal_Int16& rnFontFamily,
+bool* pbSymbol,
 const ::oox::core::XmlFilterBase& rFilter ) const;
 
 void fillThemeFont(model::ThemeFont& rThemeFont) const;
@@ -60,7 +61,8 @@ private:
 boolimplGetFontData(
 OUString& rFontName,
 sal_Int16& rnFontPitch,
-sal_Int16& rnFontFamily ) const;
+sal_Int16& rnFontFamily,
+bool* pbSymbol ) const;
 
 private:
 OUString maTypeface;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 4f600528b56a..b4e0a05ba7a6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -639,7 +639,7 @@ static void lcl_copyCharPropsToShape(const 
uno::Reference& xSha
 // minor Latin
 if (const TextFont* pFont = pTheme->resolveFont(u"+mn-lt"))
 {
-bRet = pFont->getFontData(sFontName, nFontPitch, 
nFontFamily, rFilter);
+bRet = pFont->getFontData(sFontName, nFontPitch, 
nFontFamily, nullptr, rFilter);
 if (bRet)
 {
 xSet->setPropertyValue(u"CharFontName", 
uno::Any(sFontName));
@@ -650,7 +650,7 @@ static void lcl_copyCharPropsToShape(const 
uno::Reference& xSha
 // minor Asian
 if (const TextFont* pFont = pTheme->resolveFont(u"+mn-ea"))
 {
-bRet = pFont->getFontData(sFontName, nFontPitch, 
nFontFamily, rFilter);
+bRet = pFont->getFontData(sFontName, nFontPitch, 
nFontFamily, nullptr, rFilter);
 if (bRet)
 {
 xSet->setPropertyValue(u"CharFontNameAsian", 
uno::Any(sFontName));
@@ -661,7 +661,7 @@ static void lcl_copyCharPropsToShape(const 
uno::Reference& xSha
 // minor Complex
 if (const TextFont* pFont = pTheme->resolveFont(u"+mn-cs"))
 {
-bRet = pFont->getFontData(sFontName, nFontPitch, 
nFontFamily, rFilter);
+bRet = pFont->getFontData(sFontName, nFontPitch, 
nFontFamily, nullptr, rFilter);
 if (bRet)
 {
 xSet->setPropertyValue(u"CharFontNameComplex", 
uno::Any(sFontName));
@@ -673,10 +673,10 @@ static void lcl_copyCharPropsToShape(const 
uno::Reference& xSha
 
 // Replace theme fonts with formatting at run if any. ToDo: 
Inspect paragraph too?
 // Latin
-bRet = rCharProps.maLatinFont.getFontData(sFontName, nFontPitch, 
nFontFamily, rFilter);
+bRet = rCharProps.maLatinFont.getFontData(sFontName, nFontPitch, 
nFontFamily, nullptr, rFilter);
 if (!bRet)
 // In case there is no direct font, try to look it up as a 
theme reference.
-bRet = rCharProps.maLatinThemeFont.getFontData(sFontName, 
nFontPitch, nFontFamily,
+bRet = rCharProps.maLatinThemeFont.getFontData(sFontName, 
nFontPitch, nFontFamily, nullptr,
rFilter);
 
 if (bRet)
@@ -686,10 +686,10 @@ static void lcl_copyCharPropsToShape(const 
uno::Reference& xSha
 xSet->setPropertyValue(u"CharFontFamily", 

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

2023-08-16 Thread Mike Kaganski (via logerrit)
 oox/inc/drawingml/chart/chartspacemodel.hxx   |4 ++
 oox/source/drawingml/chart/chartspacefragment.cxx |   19 +
 oox/source/drawingml/shape.cxx|   26 ++
 sd/qa/unit/data/pptx/chart_pt_color_bg1.pptx  |binary
 sd/qa/unit/import-tests2.cxx  |   31 ++
 5 files changed, 75 insertions(+), 5 deletions(-)

New commits:
commit 953e586dbce1c3195ecb07b2491b6e1a20a2cd7f
Author: Mike Kaganski 
AuthorDate: Wed Aug 16 22:06:23 2023 +0300
Commit: Mike Kaganski 
CommitDate: Wed Aug 16 23:31:06 2023 +0200

tdf#153012: import chart's c:clrMapOvr element

Otherwise, a wrong mapping could be used, e.g. from slide.

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

diff --git a/oox/inc/drawingml/chart/chartspacemodel.hxx 
b/oox/inc/drawingml/chart/chartspacemodel.hxx
index 0aa564fefd7e..dda0f577ae32 100644
--- a/oox/inc/drawingml/chart/chartspacemodel.hxx
+++ b/oox/inc/drawingml/chart/chartspacemodel.hxx
@@ -20,6 +20,9 @@
 #ifndef INCLUDED_OOX_DRAWINGML_CHART_CHARTSPACEMODEL_HXX
 #define INCLUDED_OOX_DRAWINGML_CHART_CHARTSPACEMODEL_HXX
 
+#include 
+
+#include 
 #include 
 #include 
 #include 
@@ -46,6 +49,7 @@ struct ChartSpaceModel
 View3DRef   mxView3D;   /// 3D settings.
 TitleRefmxTitle;/// Chart main title.
 LegendRef   mxLegend;   /// Chart legend.
+ClrMapPtr   mpClrMap;   /// Optionally passed color map to 
update
 OUStringmaDrawingPath;  /// Path to drawing fragment with 
embedded shapes.
 OUStringmaSheetPath;/// Path to embedded charts.
 sal_Int32   mnDispBlanksAs; /// Mode how to display blank 
values.
diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx 
b/oox/source/drawingml/chart/chartspacefragment.cxx
index 7f0a6cd549f9..f43908d65cb5 100644
--- a/oox/source/drawingml/chart/chartspacefragment.cxx
+++ b/oox/source/drawingml/chart/chartspacefragment.cxx
@@ -75,6 +75,25 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( 
sal_Int32 nElement, const
 case C_TOKEN (externalData):
 mrModel.maSheetPath = 
getFragmentPathFromRelId(rAttribs.getStringDefaulted(R_TOKEN(id)));
 return nullptr;
+case C_TOKEN(clrMapOvr):
+if (mrModel.mpClrMap)
+for (auto nClrToken : {
+ XML_bg1,
+ XML_tx1,
+ XML_bg2,
+ XML_tx2,
+ XML_accent1,
+ XML_accent2,
+ XML_accent3,
+ XML_accent4,
+ XML_accent5,
+ XML_accent6,
+ XML_hlink,
+ XML_folHlink,
+ })
+if (auto oMappedToken = 
rAttribs.getToken(nClrToken))
+mrModel.mpClrMap->setColorMap(nClrToken, 
*oMappedToken);
+return nullptr;
 }
 break;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 78a20b46861b..4f600528b56a 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -2190,13 +2190,24 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, 
const Reference< XShapes >&
 // in the imported chart data
 bool bMSO2007Doc = rFilter.isMSO2007Document();
 chart::ChartSpaceModel aModel(bMSO2007Doc);
+oox::ppt::PowerPointImport* pPowerPointImport
+= dynamic_cast();
+
+ClrMapPtr pClrMap; // The original color map
+if (pPowerPointImport)
+{
+// Use a copy of current color map, which the fragment may 
override locally
+pClrMap = 
pPowerPointImport->getActualSlidePersist()->getClrMap();
+aModel.mpClrMap = pClrMap ? 
std::make_shared(*pClrMap)
+  : std::make_shared();
+
pPowerPointImport->getActualSlidePersist()->setClrMap(aModel.mpClrMap);
+}
+
 rtl::Reference pChartSpaceFragment 
= new chart::ChartSpaceFragment(
 rFilter, mxChartShapeInfo->maFragmentPath, aModel );
 const OUString aThemeOverrideFragmentPath( 
pChartSpaceFragment->
 
getFragmentPathFromFirstTypeFromOfficeDoc(u"themeOverride") );
 rFilter.importFragment( pChartSpaceFragment );
-   

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

2023-03-27 Thread Tibor Nagy (via logerrit)
 oox/inc/drawingml/fillproperties.hxx|2 
 oox/source/drawingml/fillproperties.cxx |   89 ++--
 oox/source/drawingml/shape.cxx  |6 +-
 oox/source/ppt/slidepersist.cxx |7 ++
 oox/source/shape/WpsContext.cxx |3 -
 sd/qa/unit/data/pptx/tdf153466.pptx |binary
 sd/qa/unit/import-tests.cxx |   20 +++
 7 files changed, 110 insertions(+), 17 deletions(-)

New commits:
commit a41dbf0bd726613204d975fb4fc5e50c23d61410
Author: Tibor Nagy 
AuthorDate: Wed Mar 8 16:26:10 2023 +0100
Commit: László Németh 
CommitDate: Mon Mar 27 08:32:50 2023 +

tdf#153466 PPTX import: fix "Custom position/size" background image

Custom sized background with the value "tile" was imported as
"stretched", losing the preset size. Restore also the exported
preset positions, and map the other values to the preset positions
supported by OpenDocument/Impress.

Follow-up to commit 11451781d4c562f506a3aae3732e35b92387b4db
(tdf#153105 PPTX export: fix "Custom position/size" background image)

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

diff --git a/oox/inc/drawingml/fillproperties.hxx 
b/oox/inc/drawingml/fillproperties.hxx
index 828c858e12f2..3323907fcad8 100644
--- a/oox/inc/drawingml/fillproperties.hxx
+++ b/oox/inc/drawingml/fillproperties.hxx
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -147,6 +148,7 @@ struct FillProperties
 const GraphicHelper& rGraphicHelper,
 sal_Int32 nShapeRotation = 0,
 ::Color nPhClr = API_RGB_TRANSPARENT,
+const css::awt::Size& rSize = {},
 sal_Int16 nPhClrTheme = -1,
 bool bFlipH = false,
 bool bFlipV = false,
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index d193653d7189..98a048d7f8ac 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -423,9 +423,10 @@ Color FillProperties::getBestSolidColor() const
 return aSolidColor;
 }
 
-void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
-const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation, ::Color 
nPhClr, sal_Int16 nPhClrTheme,
-bool bFlipH, bool bFlipV, bool bIsCustomShape) const
+void FillProperties::pushToPropMap(ShapePropertyMap& rPropMap, const 
GraphicHelper& rGraphicHelper,
+   sal_Int32 nShapeRotation, ::Color nPhClr,
+   const css::awt::Size& rSize, sal_Int16 
nPhClrTheme, bool bFlipH,
+   bool bFlipV, bool bIsCustomShape) const
 {
 if( !moFillType.has_value() )
 return;
@@ -824,7 +825,6 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 {
 // bitmap mode (single, repeat, stretch)
 BitmapMode eBitmapMode = lclGetBitmapMode( 
maBlipProps.moBitmapMode.value_or( XML_TOKEN_INVALID ) );
-rPropMap.setProperty( ShapeProperty::FillBitmapMode, 
eBitmapMode );
 
 // additional settings for repeated bitmap
 if( eBitmapMode == BitmapMode_REPEAT )
@@ -872,21 +872,82 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 // Negative GraphicCrop values means "crop" here.
 bool bNeedCrop = aGraphCrop.Left <= 0 && 
aGraphCrop.Right <= 0 && aGraphCrop.Top <= 0 && aGraphCrop.Bottom <= 0;
 
-if(bIsCustomShape && bHasCropValues && bNeedCrop)
+if (bHasCropValues)
 {
-// Physically crop the image
-// In this case, don't set the 
PROP_GraphicCrop because that
-// would lead to applying the crop twice after 
roundtrip
-xGraphic = lclCropGraphic(xGraphic, 
CropQuotientsFromFillRect(aFillRect));
-if 
(rPropMap.supportsProperty(ShapeProperty::FillBitmapName))
-
rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic);
+if (bIsCustomShape && bNeedCrop)
+{
+// Physically crop the image
+// In this case, don't set the 
PROP_GraphicCrop because that
+// would lead to applying the crop twice 
after roundtrip
+xGraphic = lclCropGraphic(xGraphic, 

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

2023-03-16 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textparagraphproperties.hxx   |2 ++
 oox/source/drawingml/textparagraphproperties.cxx|7 +++
 oox/source/drawingml/textparagraphpropertiescontext.cxx |   12 
 oox/source/token/properties.txt |1 +
 sd/qa/unit/import-tests2.cxx|4 ++--
 5 files changed, 20 insertions(+), 6 deletions(-)

New commits:
commit 44271f3997f2374d81a2336131fef7ac79499048
Author: Sarper Akdemir 
AuthorDate: Tue Feb 28 16:36:40 2023 +0300
Commit: Miklos Vajna 
CommitDate: Thu Mar 16 14:12:00 2023 +

tdf#102261: pptx import: handle defTabSz

Introduce import of defTabSz using ParaTabStopDefaultDistance.

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

diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 083b61e37da7..d3742e7377e0 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -89,6 +89,7 @@ public:
 TextSpacing&getParaBottomMargin() { return 
maParaBottomMargin; }
 std::optional< sal_Int32 >&   getParaLeftMargin(){ return 
moParaLeftMargin; }
 std::optional< sal_Int32 >&   getFirstLineIndentation(){ return 
moFirstLineIndentation; }
+std::optional& getDefaultTabSize() { return 
moDefaultTabSize; }
 
 std::optional< css::style::ParagraphAdjust >&   getParaAdjust() { 
return moParaAdjust; }
 voidsetParaAdjust( 
css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; }
@@ -125,6 +126,7 @@ private:
 std::optional< sal_Int32 >moParaLeftMargin;
 std::optional< sal_Int32 >moFirstLineIndentation;
 std::optional< css::style::ParagraphAdjust >moParaAdjust;
+std::optional< sal_Int32 >  moDefaultTabSize;
 sal_Int16   mnLevel;
 TextSpacing maLineSpacing;
 };
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 0006b7530a76..af65e0037d16 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -395,6 +395,8 @@ void TextParagraphProperties::apply( const 
TextParagraphProperties& rSourceProps
 moParaLeftMargin = rSourceProps.moParaLeftMargin;
 if ( rSourceProps.moFirstLineIndentation )
 moFirstLineIndentation = rSourceProps.moFirstLineIndentation;
+if ( rSourceProps.moDefaultTabSize )
+moDefaultTabSize = rSourceProps.moDefaultTabSize;
 if( rSourceProps.mnLevel )
 mnLevel = rSourceProps.mnLevel;
 if( rSourceProps.moParaAdjust )
@@ -501,6 +503,11 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 }
 }
 
+if ( moDefaultTabSize )
+{
+aPropSet.setProperty( PROP_ParaTabStopDefaultDistance, 
*moDefaultTabSize );
+}
+
 if ( moParaAdjust )
 {
 aPropSet.setProperty( PROP_ParaAdjust, *moParaAdjust);
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 4e83d2ece24b..e75d65913cd9 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -93,10 +93,14 @@ 
TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H
 // TODO see to do the same with RubyAdjust
 
 // ST_Coordinate32
-//  sValue = rAttribs.getString( XML_defTabSz ).get();SJ: we need to be 
able to set the default tab size for each text object,
-//  this is possible 
at the moment only for the whole document.
-//  sal_Int32 nDefTabSize = ( sValue.getLength() == 0 ? 0 : GetCoordinate(  
sValue ) );
-// TODO
+if ( rAttribs.hasAttribute(XML_defTabSz))
+{
+sValue = rAttribs.getStringDefaulted(XML_defTabSz);
+if(!sValue.isEmpty())
+{
+mrTextParagraphProperties.getDefaultTabSize() = 
GetCoordinate(sValue);
+}
+}
 
 //  bool bEaLineBrk = rAttribs.getBool( XML_eaLnBrk, true );
 if ( rAttribs.hasAttribute( XML_latinLnBrk ) )
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 43bed81c5d62..edf799c2c8df 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -385,6 +385,7 @@ ParaLeftMargin
 ParaLineSpacing
 ParaRightMargin
 ParaTabStops
+ParaTabStopDefaultDistance
 ParaTopMargin
 Path
 PercentageNumberFormat
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 37a185c4d3f8..9d44f11552d8 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1343,8 +1343,8 

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

2023-02-22 Thread Andrea Gelmini (via logerrit)
 oox/inc/drawingml/fontworkhelpers.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3d95141d6350a63c09f190639c435136b20a8936
Author: Andrea Gelmini 
AuthorDate: Wed Feb 22 14:35:16 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Feb 22 13:55:40 2023 +

Fix typo

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

diff --git a/oox/inc/drawingml/fontworkhelpers.hxx 
b/oox/inc/drawingml/fontworkhelpers.hxx
index 7d8d0a9692dd..b7d4c5594854 100644
--- a/oox/inc/drawingml/fontworkhelpers.hxx
+++ b/oox/inc/drawingml/fontworkhelpers.hxx
@@ -82,7 +82,7 @@ void createCharInteropGrabBagUpdatesFromShapeProps(
 void applyUpdatesToCharInteropGrabBag(const 
std::vector& rUpdatePropVec,
   css::uno::Reference& 
rXText);
 
-// ToDo: This is essentially the same as contained in methode 
DrawingML::WriteOutline. Change it
+// ToDo: This is essentially the same as contained in method 
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


[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/source

2023-01-05 Thread Andrea Gelmini (via logerrit)
 0 files changed

New commits:
commit 22b7f83edd8a4aa4702b63e7183b371175d3810a
Author: Andrea Gelmini 
AuthorDate: Mon Jan 2 14:47:43 2023 +0100
Commit: Julien Nabet 
CommitDate: Thu Jan 5 18:04:59 2023 +

Removed executable bits from source files

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

diff --git a/oox/inc/drawingml/fontworkhelpers.hxx 
b/oox/inc/drawingml/fontworkhelpers.hxx
old mode 100755
new mode 100644
diff --git a/oox/source/drawingml/fontworkhelpers.cxx 
b/oox/source/drawingml/fontworkhelpers.cxx
old mode 100755
new mode 100644


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

2023-01-02 Thread Regina Henschel (via logerrit)
 oox/Library_oox.mk   |1 
 oox/inc/drawingml/fontworkhelpers.hxx|   44 ++
 oox/qa/unit/data/tdf125885_WordArt.docx  |binary
 oox/qa/unit/data/tdf125885_WordArt2.docx |binary
 oox/qa/unit/data/tdf125885_WordArt3.docx |binary
 oox/qa/unit/shape.cxx|  189 +
 oox/source/drawingml/fontworkhelpers.cxx |  172 
 oox/source/drawingml/shape.cxx   |  154 ---
 oox/source/export/drawingml.cxx  |3 
 oox/source/shape/WpsContext.cxx  |  607 ++-
 oox/source/shape/WpsContext.hxx  |1 
 11 files changed, 1013 insertions(+), 158 deletions(-)

New commits:
commit cbf30153a5c776e6d1ee26f2f83c8f77503eceb9
Author: Regina Henschel 
AuthorDate: Sat Dec 3 15:37:49 2022 +0100
Commit: Miklos Vajna 
CommitDate: Mon Jan 2 08:19:37 2023 +

tdf#125885 Conversion WordArt to Fontwork in docx import

docx has the information, that a shape is a WordArt shape, after the
text content. So in import of such file there is already a frame
attached to the shape, which makes it impossible to set it into text
path mode.

The patch detects that it should be a WordArt shape. It transfers the
text from frame to shape, removes the frame and then sets the shape
into text path mode.

WordArt in OOXML has the same closed set of types as we have for MS
binary import. But MS Word can combine them with arbitrary shapes. The
patch does only convert rectangles.

The text is copied from frame to the shape as string. Thus it looses
all styles. But our Fontwork cannot use different styles for
portions of text, so I think that is acceptable.

Fontwork uses not the styles of the text but styles set at the shape.
The patch copies the styles from the first not empty run. That should
give sufficient results in most cases. These text styles are set at
the shape, which will result in a paragraph style referenced by the
draw:text-style-name attribute of the draw:custom-shape element in ODF.

The patch does not yet include export to docx. The current 'restore
old shape' on resave to docx is lost. ToDo: Patch for export.

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

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 6e031a35c5a0..aba27c786f8d 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -165,6 +165,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/drawingml/effectpropertiescontext \
 oox/source/drawingml/embeddedwavaudiofile \
 oox/source/drawingml/fillproperties \
+oox/source/drawingml/fontworkhelpers \
 oox/source/drawingml/misccontexts \
 oox/source/drawingml/graphicshapecontext \
 oox/source/drawingml/guidcontext \
diff --git a/oox/inc/drawingml/fontworkhelpers.hxx 
b/oox/inc/drawingml/fontworkhelpers.hxx
new file mode 100755
index ..2a48f422abbf
--- /dev/null
+++ b/oox/inc/drawingml/fontworkhelpers.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include "customshapeproperties.hxx"
+
+#include 
+#include 
+
+namespace FontworkHelpers
+{
+/** Removes the property specified by rName from the rPropVec vector of 
properties */
+void resetPropertyValueInVec(std::vector& rPropVec,
+ const OUString& rName);
+
+/** Changes the EnhancedCustomShapeGeometry of xShape shape so, that it 
becomes a LO Fontwork
+shape corresponding to the OOXML shape specified by sMSPresetType.
+Precondition: xShape is a custom shape.*/
+void putCustomShapeIntoTextPathMode(
+const css::uno::Reference& xShape,
+const oox::drawingml::CustomShapePropertiesPtr& pCustomShapePropertiesPtr,
+const OUString& sMSPresetType, const bool bFromWordArt);
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
\ No newline at end of 

[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/source sd/qa

2022-10-27 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textparagraph.hxx|3 -
 oox/inc/drawingml/textparagraphproperties.hxx  |1 
 oox/source/drawingml/textbody.cxx  |5 +-
 oox/source/drawingml/textparagraph.cxx |5 +-
 oox/source/drawingml/textparagraphproperties.cxx   |   10 +++-
 sd/qa/unit/data/pptx/tdf149961-autofitIndentation.pptx |binary
 sd/qa/unit/import-tests2.cxx   |   40 +
 7 files changed, 58 insertions(+), 6 deletions(-)

New commits:
commit 08d0c2cd6b6bdf37d6fc5c16359bafc6dddc9d09
Author: Sarper Akdemir 
AuthorDate: Mon Oct 24 01:50:36 2022 +0300
Commit: Miklos Vajna 
CommitDate: Thu Oct 27 15:13:32 2022 +0200

tdf#149961 pptx import: fix indents for autofitted texboxes

For autofitted textboxes, Impress scales the indents with the
text size while PowerPoint doesn't.

Scale the indents inversely propotional to autofit font
scale so that the visual appearance on import is similar to
PowerPoint.

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

diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 1f43249372a5..4920c99da7c5 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -77,7 +77,8 @@ public:
 const TextListStyle& rMasterTextListStyle,
 const TextListStyle& rTextListStyle,
 bool bFirst,
-float nDefaultCharHeight) const;
+float nDefaultCharHeight,
+sal_Int32 nAutofitFontScale) const;
 
 bool HasMathXml() const
 {
diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 8ea56a7b0736..083b61e37da7 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -103,6 +103,7 @@ public:
 const BulletList* 
pMasterBuList,
 bool bApplyBulletList,
 float fFontSize,
+sal_Int32 nAutofitFontScale = 
10,
 bool bPushDefaultValues = 
false ) const;
 
 /** Returns the largest character size of this paragraph. If possible the
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 0f053ab6ad74..1be15c4f885d 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -65,7 +65,7 @@ void TextBody::insertAt(
 for (auto const& paragraph : maParagraphs)
 {
 paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, 
aMasterTextStyle,
-maTextListStyle, (nIndex == 0), nCharHeight);
+maTextListStyle, (nIndex == 0), nCharHeight, 
getTextProperties().mnFontScale);
 ++nIndex;
 }
 }
@@ -148,7 +148,8 @@ void TextBody::ApplyStyleEmpty(
 float nCharHeight = 
xProps->getPropertyValue("CharHeight").get();
 TextParagraphProperties aParaProp;
 aParaProp.apply(*pTextParagraphStyle);
-aParaProp.pushToPropSet(, xProps, aioBulletList, 
>getBulletList(), true, nCharHeight, true);
+aParaProp.pushToPropSet(, xProps, aioBulletList, 
>getBulletList(),
+true, nCharHeight, 
getTextProperties().mnFontScale, true);
 }
 }
 
diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index 23f051cdd5df..f08efdbff3c3 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -87,7 +87,8 @@ void TextParagraph::insertAt(
 const Reference < XTextCursor > ,
 const TextCharacterProperties& rTextStyleProperties,
 const TextListStyle& rMasterTextListStyle,
-const TextListStyle& rTextListStyle, bool bFirst, float 
nDefaultCharHeight) const
+const TextListStyle& rTextListStyle, bool bFirst,
+float nDefaultCharHeight, sal_Int32 nAutofitFontScale) const
 {
 try {
 sal_Int32 nParagraphSize = 0;
@@ -175,7 +176,7 @@ void TextParagraph::insertAt(
 }
 
 float fCharacterSize = nCharHeight > 0 ? GetFontHeight ( 
nCharHeight ) : pTextParagraphStyle->getCharHeightPoints( 12 );
-aParaProp.pushToPropSet( , xProps, aioBulletList, 
>getBulletList(), true, fCharacterSize, true );
+aParaProp.pushToPropSet( , xProps, aioBulletList, 
>getBulletList(), true, fCharacterSize, nAutofitFontScale, 
true );
 }
 
 // empty paragraphs do not have 

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

2022-09-20 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/fillproperties.hxx |1 
 oox/source/drawingml/fillproperties.cxx  |   40 +
 oox/source/drawingml/misccontexts.cxx|4 
 sd/qa/unit/data/pptx/tdf89928-blackWhiteEffectThreshold.pptx |binary
 sd/qa/unit/import-tests2.cxx |   45 +++
 5 files changed, 90 insertions(+)

New commits:
commit 9ecc76988ec46ba0d6c5cb72ac88f65da48867b1
Author: Sarper Akdemir 
AuthorDate: Mon Sep 19 09:56:57 2022 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 20 08:29:29 2022 +0200

tdf#89928 pptx import: implement import of BiLevel threshold

Implement import BiLevel effect's threshold value.
If threshold isn't exactly 50%, we can't map it to the doc model.

Therefore as a workaround apply the BiLevel (Black/White) effect with
specified threshold directly to the graphic.

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

diff --git a/oox/inc/drawingml/fillproperties.hxx 
b/oox/inc/drawingml/fillproperties.hxx
index 9cef3c98f2b1..828c858e12f2 100644
--- a/oox/inc/drawingml/fillproperties.hxx
+++ b/oox/inc/drawingml/fillproperties.hxx
@@ -113,6 +113,7 @@ struct BlipFillProperties
 std::optional< sal_Int32 > moColorEffect;/// XML token for a color 
effect.
 std::optional< sal_Int32 > moBrightness; /// Brightness in the 
range [-10,10].
 std::optional< sal_Int32 > moContrast;   /// Contrast in the range 
[-10,10].
+std::optional< sal_Int32 > moBiLevelThreshold;   /// Bi-Level 
(Black/White) effect threshold (1/1000 percent)
 Color maColorChangeFrom;  /// Start color of color 
transformation.
 Color maColorChangeTo;/// Destination color of 
color transformation.
 Color maDuotoneColors[2]; /// Duotone Colors
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 1ef7579a7725..7933a79f5dba 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -24,6 +24,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -185,6 +187,32 @@ Reference< XGraphic > 
lclGreysScaleGraphic(uno::Reference con
 return aReturnGraphic.GetXGraphic();
 }
 
+/// Applies the graphic Black (Monochrome) effect with the imported 
threshold
+Reference lclApplyBlackWhiteEffect(const BlipFillProperties& 
aBlipProps,
+ const 
uno::Reference& xGraphic)
+{
+const auto& oBiLevelThreshold = aBlipProps.moBiLevelThreshold;
+if (oBiLevelThreshold.has_value())
+{
+sal_uInt8 nThreshold
+= static_cast(oBiLevelThreshold.value() * 255 / 
MAX_PERCENT);
+
+::Graphic aGraphic(xGraphic);
+::Graphic aReturnGraphic;
+
+BitmapEx aBitmapEx(aGraphic.GetBitmapEx());
+AlphaMask aMask(aBitmapEx.GetAlpha());
+
+BitmapEx aTmpBmpEx(aBitmapEx.GetBitmap());
+BitmapFilter::Filter(aTmpBmpEx, BitmapMonochromeFilter{ nThreshold });
+
+aReturnGraphic = ::Graphic(BitmapEx(aTmpBmpEx.GetBitmap(), aMask));
+aReturnGraphic.setOriginURL(aGraphic.getOriginURL());
+return aReturnGraphic.GetXGraphic();
+}
+return xGraphic;
+}
+
 Reference< XGraphic > lclCheckAndApplyChangeColorTransform(const 
BlipFillProperties , uno::Reference const & 
xGraphic,
const 
GraphicHelper& rGraphicHelper, const ::Color nPhClr)
 {
@@ -350,6 +378,7 @@ void BlipFillProperties::assignUsed( const 
BlipFillProperties& rSourceProps )
 assignIfUsed( moColorEffect, rSourceProps.moColorEffect );
 assignIfUsed( moBrightness, rSourceProps.moBrightness );
 assignIfUsed( moContrast, rSourceProps.moContrast );
+assignIfUsed( moBiLevelThreshold, rSourceProps.moBiLevelThreshold );
 maColorChangeFrom.assignIfUsed( rSourceProps.maColorChangeFrom );
 maColorChangeTo.assignIfUsed( rSourceProps.maColorChangeTo );
 maDuotoneColors[0].assignIfUsed( rSourceProps.maDuotoneColors[0] );
@@ -907,6 +936,17 @@ void GraphicProperties::pushToPropMap( PropertyMap& 
rPropMap, const GraphicHelpe
 uno::Reference xGraphic = 
lclCheckAndApplyChangeColorTransform(maBlipProps, maBlipProps.mxFillGraphic, 
rGraphicHelper, API_RGB_TRANSPARENT);
 xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, xGraphic, 
rGraphicHelper, API_RGB_TRANSPARENT);
 
+if( eColorMode == ColorMode_MONO )
+{
+// ColorMode_MONO is the same with MSO's biLevel with 5 (50%) 
threshold,
+// when threshold isn't 5 bake the effect instead.
+if( maBlipProps.moBiLevelThreshold != 5 )
+{
+xGraphic = 

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

2022-06-23 Thread Tibor Nagy (via logerrit)
 oox/inc/ooxresid.hxx   |1 
 oox/inc/strings.hrc|1 
 oox/source/helper/ooxresid.cxx |1 
 oox/source/ppt/presentationfragmenthandler.cxx |7 -
 sd/qa/unit/data/pptx/tdf149314.pptx|binary
 sd/qa/unit/import-tests.cxx|   31 +
 6 files changed, 40 insertions(+), 1 deletion(-)

New commits:
commit 4142d728f003166ebe520bfdaf672505e585b807
Author: Tibor Nagy 
AuthorDate: Wed Jun 1 16:10:42 2022 +0200
Commit: László Németh 
CommitDate: Thu Jun 23 16:20:43 2022 +0200

tdf#149314 PPTX import: fix internal hyperlink in editor

Hyperlinks on text weren't imported correctly if the linked
slides have default slide name, resulting broken links
in the editor (hyperlinks work well in slide shows without
this fix, too).

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

diff --git a/oox/inc/ooxresid.hxx b/oox/inc/ooxresid.hxx
index 473e13407ac3..c374b664525c 100644
--- a/oox/inc/ooxresid.hxx
+++ b/oox/inc/ooxresid.hxx
@@ -14,6 +14,7 @@
 #include 
 
 OUString OoxResId(TranslateId aId);
+OUString URLResId(TranslateId aId);
 
 #endif
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/oox/inc/strings.hrc b/oox/inc/strings.hrc
index c9b4f3cf7230..cd107aa36a02 100644
--- a/oox/inc/strings.hrc
+++ b/oox/inc/strings.hrc
@@ -14,5 +14,6 @@
 
 #define STR_DIAGRAM_TITLENC_("STR_DIAGRAM_TITLE", 
"Chart Title")
 #define STR_DIAGRAM_AXISTITLENC_("STR_DIAGRAM_AXISTITLE", 
"Axis Title")
+#define STR_SLIDE_NAME   NC_("STR_SLIDE_NAME", "Slide" 
)
 #endif
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/oox/source/helper/ooxresid.cxx b/oox/source/helper/ooxresid.cxx
index 58e0e8cb33e0..6ad02a70b056 100644
--- a/oox/source/helper/ooxresid.cxx
+++ b/oox/source/helper/ooxresid.cxx
@@ -12,5 +12,6 @@
 #include 
 
 OUString OoxResId(TranslateId aId) { return Translate::get(aId, 
Translate::Create("oox")); }
+OUString URLResId(TranslateId aId) { return Translate::get(aId, 
Translate::Create("sd")); }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 43b7f105a1c4..ac1e32e533ec 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -60,6 +60,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::oox::core;
@@ -197,7 +199,10 @@ static void ResolveTextFields( XmlFilterBase const & 
rFilter )
 xDrawPage = xPresentationPage->getNotesPage();
 }
 Reference< container::XNamed > xNamed( xDrawPage, 
UNO_QUERY_THROW );
-aURL = "#" + xNamed->getName();
+if (!xNamed->getName().startsWith("page"))
+aURL = "#" + xNamed->getName();
+else
+aURL = "#" + URLResId(STR_SLIDE_NAME) + " " + 
OUString::number(nPageNumber);
 xPropSet->setPropertyValue( sURL, Any( aURL ) );
 Reference< text::XTextContent > xContent( 
rTextField.xTextField);
 Reference< text::XTextRange > xTextRange = 
rTextField.xTextCursor;
diff --git a/sd/qa/unit/data/pptx/tdf149314.pptx 
b/sd/qa/unit/data/pptx/tdf149314.pptx
new file mode 100644
index ..3138c1ddaf78
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149314.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index aa329dfddec6..68161536da93 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -83,6 +83,7 @@ public:
 virtual void setUp() override;
 
 void testDocumentLayout();
+void testTdf149314();
 void testTdf149124();
 void testTdf148965();
 void testTdf89449();
@@ -153,6 +154,7 @@ public:
 CPPUNIT_TEST_SUITE(SdImportTest);
 
 CPPUNIT_TEST(testDocumentLayout);
+CPPUNIT_TEST(testTdf149314);
 CPPUNIT_TEST(testTdf149124);
 CPPUNIT_TEST(testTdf148965);
 CPPUNIT_TEST(testTdf89449);
@@ -301,6 +303,35 @@ void SdImportTest::testDocumentLayout()
 }
 }
 
+void SdImportTest::testTdf149314()
+{
+sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf149314.pptx"), 
PPTX);
+
+OUString aURL;
+uno::Reference xShape(getShapeFromPage(0, 1, 
xDocShRef));
+
+uno::Reference const 
xParagraph1(getParagraphFromShape(0, xShape));
+uno::Reference 

[Libreoffice-commits] core.git: oox/inc oox/source sd/CppunitTest_sd_shape_import_export_tests.mk sd/Module_sd.mk sd/qa

2022-06-08 Thread Tomaž Vajngerl (via logerrit)
 oox/inc/drawingml/textbodyproperties.hxx   |   17 -
 oox/source/drawingml/shape.cxx |9 
 oox/source/drawingml/textbodyproperties.cxx|  129 +++-
 oox/source/export/drawingml.cxx|   48 ++-
 sd/CppunitTest_sd_shape_import_export_tests.mk |   74 
 sd/Module_sd.mk|1 
 sd/qa/unit/ShapeImportExportTest.cxx   |  381 +
 sd/qa/unit/data/TextDistancesInsets1.pptx  |binary
 sd/qa/unit/data/TextDistancesInsets2.pptx  |binary
 sd/qa/unit/data/TextDistancesInsets3.pptx  |binary
 10 files changed, 619 insertions(+), 40 deletions(-)

New commits:
commit e216988657e20a1e52986f742ab60464697bcb41
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 6 22:53:23 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 8 11:36:12 2022 +0200

tdf148321: convert OOXML inset values to text distance values

Inset values for top, bottom are calcualted differently in OOXML
and need to be coverted on import to the text distance LO values,
that place the text relative to the shape correctly.

At export, the values can be converted back to the OOXML inset
compatible values, but the values are not always converted back to
the same values as the conversion is not bijective, however they
do render the same.

This also adds the test for the conversion when importing and
checks that the exported values are expected.

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

diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index 41fbb832a5d8..7cc1b9d8041c 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -21,12 +21,15 @@
 #define INCLUDED_OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
-namespace oox::drawingml {
+class Size;
 
+namespace oox::drawingml {
 
 struct TextBodyProperties
 {
@@ -35,7 +38,7 @@ struct TextBodyProperties
 boolmbAnchorCtr;
 OptValue< sal_Int32 >   moVert;
 boolmoUpright = false;
-std::optional< sal_Int32 >moInsets[4];
+std::array, 4> moInsets;
 std::optional< sal_Int32 >moTextOffUpper;
 std::optional< sal_Int32 >moTextOffLeft;
 std::optional< sal_Int32 >moTextOffLower;
@@ -47,10 +50,14 @@ struct TextBodyProperties
 OUString msHorzOverflow;
 OUString msVertOverflow;
 
-explicitTextBodyProperties();
+std::array, 4> maTextDistanceValues;
+
+explicit TextBodyProperties();
+
+void pushTextDistances(Size const& rShapeSize);
+void readjustTextDistances(css::uno::Reference 
const& xShape);
+void pushVertSimulation();
 
-voidpushRotationAdjustments();
-voidpushVertSimulation();
 };
 
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 8739d4d8989d..8ef86298fd8b 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1237,7 +1237,7 @@ Reference< XShape > const & Shape::createAndInsert(
 // add properties from textbody to shape properties
 if( mpTextBody )
 {
-mpTextBody->getTextProperties().pushRotationAdjustments();
+
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
 if( mpMasterTextListStyle &&  
mpMasterTextListStyle->getListStyle()[0].getTextCharacterProperties().moHeight.has()
 )
@@ -1827,9 +1827,14 @@ Reference< XShape > const & Shape::createAndInsert(
 }
 }
 
-if( mxShape.is() )
+if (mxShape.is())
+{
 finalizeXShape( rFilterBase, rxShapes );
 
+if (mpTextBody)
+mpTextBody->getTextProperties().readjustTextDistances(mxShape);
+}
+
 return mxShape;
 }
 
diff --git a/oox/source/drawingml/textbodyproperties.cxx 
b/oox/source/drawingml/textbodyproperties.cxx
index 2ffa7de1085f..e44a103e3865 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -22,9 +22,17 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
 
 using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::text;
+using namespace css;
 
 namespace oox::drawingml {
 
@@ -57,14 +65,21 @@ void TextBodyProperties::pushVertSimulation()
 maPropertyMap.setProperty( 

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

2022-04-29 Thread Xisco Fauli (via logerrit)
 oox/inc/drawingml/textparagraphproperties.hxx   |1 +
 oox/source/drawingml/textparagraphproperties.cxx|   14 +++---
 oox/source/drawingml/textparagraphpropertiescontext.cxx |2 +-
 3 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 3240820acaa2f87e4917d1fa387255c2101460a2
Author: Xisco Fauli 
AuthorDate: Wed Apr 27 16:59:09 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 29 10:24:08 2022 +0200

oox: make buSzTx and buFontTx behave the same way as buClrTx

I believe this is the right thing to do although this is
a blind fix, since I couldn't find any file affected

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

diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 7bda257d445e..8ea56a7b0736 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -58,6 +58,7 @@ public:
 std::shared_ptr< ::oox::drawingml::Color > maBulletColorPtr;
 css::uno::Any   mbBulletColorFollowText;
 css::uno::Any   mbBulletFontFollowText;
+css::uno::Any   mbBulletSizeFollowText;
 ::oox::drawingml::TextFont  maBulletFont;
 css::uno::Any   msBulletChar;
 css::uno::Any   mnStartAt;
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index ce40f69eb4f6..bcf51d290794 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -59,7 +59,9 @@ namespace oox::drawingml {
 
 BulletList::BulletList( )
 : maBulletColorPtr( std::make_shared() ),
-  mbBulletColorFollowText ( false )
+  mbBulletColorFollowText ( false ),
+  mbBulletFontFollowText ( false ),
+  mbBulletSizeFollowText ( false )
 {
 }
 
@@ -266,6 +268,8 @@ void BulletList::apply( const BulletList& rSource )
 mbBulletColorFollowText = rSource.mbBulletColorFollowText;
 if ( rSource.mbBulletFontFollowText.hasValue() )
 mbBulletFontFollowText = rSource.mbBulletFontFollowText;
+if ( rSource.mbBulletSizeFollowText.hasValue() )
+mbBulletSizeFollowText = rSource.mbBulletSizeFollowText;
 maBulletFont.assignIfUsed( rSource.maBulletFont );
 if ( rSource.msBulletChar.hasValue() )
 msBulletChar = rSource.msBulletChar;
@@ -308,7 +312,9 @@ void BulletList::pushToPropMap( const 
::oox::core::XmlFilterBase* pFilterBase, P
 float nBulletFontWeight = css::awt::FontWeight::NORMAL;
 bool bSymbolFont = false;
 if( pFilterBase) {
-if (maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, 
nBulletFontFamily, *pFilterBase ) )
+bool bFollowTextFont = false;
+mbBulletFontFollowText >>= bFollowTextFont;
+if (!bFollowTextFont && maBulletFont.getFontData( aBulletFontName, 
nBulletFontPitch, nBulletFontFamily, *pFilterBase ) )
 {
 FontDescriptor aFontDesc;
 sal_Int16 nFontSize = 0;
@@ -357,7 +363,9 @@ void BulletList::pushToPropMap( const 
::oox::core::XmlFilterBase* pFilterBase, P
 if (xBitmap.is())
 rPropMap.setProperty(PROP_GraphicBitmap, xBitmap);
 }
-if( mnSize.hasValue() )
+bool bFollowTextSize = false;
+mbBulletSizeFollowText >>= bFollowTextSize;
+if( !bFollowTextSize && mnSize.hasValue() )
 rPropMap.setAnyProperty( PROP_BulletRelSize, mnSize);
 if ( maStyleName.hasValue() )
 rPropMap.setAnyProperty( PROP_CharStyleName, maStyleName);
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 20810ce1b5c8..c1b8763a961a 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -213,7 +213,7 @@ ContextHandlerRef 
TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
 return new ColorContext( *this, *mrBulletList.maBulletColorPtr );
 // EG_TextBulletSize
 case A_TOKEN( buSzTx ): // CT_TextBulletSizeFollowText
-mrBulletList.setBulletSize(100);
+mrBulletList.mbBulletSizeFollowText <<= true;
 break;
 case A_TOKEN( buSzPct ):// CT_TextBulletSizePercent
 mrBulletList.setBulletSize( std::lround( GetPercent( 
rAttribs.getString( XML_val ).get() ) / 1000.f ) );


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

2022-04-18 Thread Tomaž Vajngerl (via logerrit)
 oox/Library_oox.mk|1 
 oox/inc/drawingml/chart/datatableconverter.hxx|   45 +++
 oox/inc/drawingml/chart/plotareaconverter.hxx |   15 --
 oox/source/drawingml/chart/datatablecontext.cxx   |2 
 oox/source/drawingml/chart/datatableconverter.cxx |   50 ++
 oox/source/drawingml/chart/plotareaconverter.cxx  |   22 -
 6 files changed, 99 insertions(+), 36 deletions(-)

New commits:
commit 2e9e057913d5f31490f62ad60d2bae39ae81afee
Author: Tomaž Vajngerl 
AuthorDate: Fri Apr 15 15:53:56 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 18 15:55:12 2022 +0200

oox: move DataTableConverter into own file

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

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 01da0aa4374d..88da558a3f89 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -101,6 +101,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/drawingml/chart/datasourceconverter \
 oox/source/drawingml/chart/datasourcemodel \
 oox/source/drawingml/chart/datatablecontext \
+oox/source/drawingml/chart/datatableconverter \
 oox/source/drawingml/chart/modelbase \
 oox/source/drawingml/chart/objectformatter \
 oox/source/drawingml/chart/plotareacontext \
diff --git a/oox/inc/drawingml/chart/datatableconverter.hxx 
b/oox/inc/drawingml/chart/datatableconverter.hxx
new file mode 100644
index ..f49d908f4aa5
--- /dev/null
+++ b/oox/inc/drawingml/chart/datatableconverter.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+
+namespace com::sun::star::chart2
+{
+class XDiagram;
+}
+
+namespace oox::drawingml::chart
+{
+struct DataTableModel;
+
+class DataTableConverter final : public ConverterBase
+{
+public:
+explicit DataTableConverter(const ConverterRoot& rParent, DataTableModel& 
rModel);
+virtual ~DataTableConverter() override;
+
+/** Converts the OOXML data table model to a chart2 diagram. */
+void convertFromModel(css::uno::Reference const& 
rxDiagram);
+};
+
+} // namespace oox::drawingml::chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/drawingml/chart/plotareaconverter.hxx 
b/oox/inc/drawingml/chart/plotareaconverter.hxx
index 0b389c0fdc78..b520c6b4816c 100644
--- a/oox/inc/drawingml/chart/plotareaconverter.hxx
+++ b/oox/inc/drawingml/chart/plotareaconverter.hxx
@@ -59,21 +59,6 @@ public:
 ObjectType eObjType );
 };
 
-
-struct DataTableModel;
-
-class DataTableConverter final : public ConverterBase< DataTableModel >
-{
-public:
-explicitDataTableConverter( const ConverterRoot& rParent, 
DataTableModel& rModel );
-virtual ~DataTableConverter() override;
-
-/** Converts the OOXML data table model to a chart2 diagram. */
-voidconvertFromModel(
-const css::uno::Reference< css::chart2::XDiagram 
>& rxDiagram);
-};
-
-
 struct PlotAreaModel;
 
 class PlotAreaConverter final : public ConverterBase< PlotAreaModel >
diff --git a/oox/source/drawingml/chart/datatablecontext.cxx 
b/oox/source/drawingml/chart/datatablecontext.cxx
index c40a4f782450..0813a6424312 100644
--- a/oox/source/drawingml/chart/datatablecontext.cxx
+++ b/oox/source/drawingml/chart/datatablecontext.cxx
@@ -55,7 +55,7 @@ ContextHandlerRef DataTableContext::onCreateContext(sal_Int32 
nElement,
 mrModel.mbShowOutline = rAttribs.getBool(XML_val, false);
 break;
 case C_TOKEN(showKeys):
-//mrModel.mbShowKeys = rAttribs.getBool( XML_val, false );
+mrModel.mbShowKeys = rAttribs.getBool(XML_val, false);
 break;
 }
 break;
diff --git a/oox/source/drawingml/chart/datatableconverter.cxx 
b/oox/source/drawingml/chart/datatableconverter.cxx
new file mode 100644

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

2022-03-09 Thread Miklos Vajna (via logerrit)
 oox/inc/drawingml/fillproperties.hxx|1 +
 oox/source/drawingml/fillproperties.cxx |   11 +--
 oox/source/drawingml/shape.cxx  |4 +++-
 oox/source/token/properties.txt |1 +
 svx/qa/unit/styles.cxx  |7 +--
 5 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit f5089e745367e111fb02c493c8c90e96a29e199c
Author: Miklos Vajna 
AuthorDate: Wed Mar 9 20:51:34 2022 +0100
Commit: Miklos Vajna 
CommitDate: Thu Mar 10 08:17:20 2022 +0100

sd theme: add PPTX import for shape fill color

The theme index is typically not a direct property, but comes from style
-> fillref -> theme index, so support that.

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

diff --git a/oox/inc/drawingml/fillproperties.hxx 
b/oox/inc/drawingml/fillproperties.hxx
index f308f6aaec0d..532cb0ec3975 100644
--- a/oox/inc/drawingml/fillproperties.hxx
+++ b/oox/inc/drawingml/fillproperties.hxx
@@ -145,6 +145,7 @@ struct FillProperties
 const GraphicHelper& rGraphicHelper,
 sal_Int32 nShapeRotation = 0,
 ::Color nPhClr = API_RGB_TRANSPARENT,
+sal_Int16 nPhClrTheme = -1,
 bool bFlipH = false,
 bool bFlipV = false,
 bool bIsCustomShape = false ) const;
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 49906cc9b10f..9589a7388bd5 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -371,7 +371,7 @@ Color FillProperties::getBestSolidColor() const
 }
 
 void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
-const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation, ::Color 
nPhClr,
+const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation, ::Color 
nPhClr, sal_Int16 nPhClrTheme,
 bool bFlipH, bool bFlipV, bool bIsCustomShape) const
 {
 if( !moFillType.has() )
@@ -388,9 +388,16 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 case XML_solidFill:
 if( maFillColor.isUsed() )
 {
-rPropMap.setProperty( ShapeProperty::FillColor, 
maFillColor.getColor( rGraphicHelper, nPhClr ) );
+::Color aFillColor = maFillColor.getColor(rGraphicHelper, 
nPhClr);
+rPropMap.setProperty(ShapeProperty::FillColor, aFillColor);
 if( maFillColor.hasTransparency() )
 rPropMap.setProperty( ShapeProperty::FillTransparency, 
maFillColor.getTransparency() );
+
+if (aFillColor == nPhClr)
+{
+rPropMap.setProperty(PROP_FillColorTheme, nPhClrTheme);
+}
+
 eFillStyle = FillStyle_SOLID;
 }
 break;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 98401179d84d..7a01ebddb09e 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1161,6 +1161,7 @@ Reference< XShape > const & Shape::createAndInsert(
 
 ::Color nLinePhClr(ColorTransparency, 0x);
 ::Color nFillPhClr(ColorTransparency, 0x);
+sal_Int16 nFillPhClrTheme = -1;
 // TODO: use ph color when applying effect properties
 //sal_Int32 nEffectPhClr = -1;
 
@@ -1197,6 +1198,7 @@ Reference< XShape > const & Shape::createAndInsert(
 if (!mbUseBgFill)
 {
 nFillPhClr = pFillRef->maPhClr.getColor(rGraphicHelper);
+nFillPhClrTheme = pFillRef->maPhClr.getSchemeColorIndex();
 }
 
 OUString sColorScheme = pFillRef->maPhClr.getSchemeColorName();
@@ -1259,7 +1261,7 @@ Reference< XShape > const & Shape::createAndInsert(
 if (getFillProperties().moFillType.has() && 
getFillProperties().moFillType.get() == XML_grpFill)
 getFillProperties().assignUsed(aFillProperties);
 if(!bIsCroppedGraphic)
-aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, 
mnRotation, nFillPhClr, mbFlipH, mbFlipV, bIsCustomShape );
+aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, 
mnRotation, nFillPhClr, nFillPhClrTheme, mbFlipH, mbFlipV, bIsCustomShape );
 LineProperties aLineProperties = getActualLineProperties(pTheme);
 aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr 
);
 EffectProperties aEffectProperties = getActualEffectProperties(pTheme);
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 87a6700bd35a..e318e0038ecb 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -176,6 

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

2022-03-02 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/table/tablecell.hxx  |2 
 oox/source/drawingml/table/tablecell.cxx   |  112 +++--
 oox/source/drawingml/table/tableproperties.cxx |   16 ++-
 sd/qa/unit/data/pptx/bnc480256-2.pptx  |binary
 sd/qa/unit/data/pptx/tdf135843_insideH.pptx|binary
 sd/qa/unit/import-tests.cxx|2 
 sd/qa/unit/layout-tests.cxx|   38 
 7 files changed, 158 insertions(+), 12 deletions(-)

New commits:
commit 3faf005a367cbd28077403bf93810bbaf4805851
Author: Gülşah Köse 
AuthorDate: Tue Feb 1 16:03:14 2022 +0300
Commit: Gülşah Köse 
CommitDate: Wed Mar 2 11:57:25 2022 +0100

tdf#135843 Implement inside horizontal vertical borders.

wholeTbl as TableStylePart should be handled in different way. Before
left border of the whole table was handling like all cells left
border but it should be left border of the first column.

insideV and and insideH properties are imported but never handled. I
added the inside vertical and horizontal borders handling.

Change-Id: I5aea5cbefc746db637eac6c1438fa70a7d741bc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128971
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/table/tablecell.hxx 
b/oox/inc/drawingml/table/tablecell.hxx
index d6e91da042f7..988b0d057a13 100644
--- a/oox/inc/drawingml/table/tablecell.hxx
+++ b/oox/inc/drawingml/table/tablecell.hxx
@@ -82,6 +82,8 @@ private:
 oox::drawingml::LineProperties  maLinePropertiesRight;
 oox::drawingml::LineProperties  maLinePropertiesTop;
 oox::drawingml::LineProperties  maLinePropertiesBottom;
+oox::drawingml::LineProperties  maLinePropertiesInsideH;
+oox::drawingml::LineProperties  maLinePropertiesInsideV;
 oox::drawingml::LineProperties  maLinePropertiesTopLeftToBottomRight;
 oox::drawingml::LineProperties  maLinePropertiesBottomLeftToTopRight;
 
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index e5ab3372d42e..15ab06303e3b 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -81,6 +81,14 @@ static void applyLineAttributes( const 
::oox::core::XmlFilterBase& rFilterBase,
 aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
+else
+{
+aBorderLine.Color = sal_Int32( COL_AUTO );
+aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.LineWidth = 12700;
+aBorderLine.LineDistance = 0;
+}
 
 if ( rLineProperties.moPresetDash.has() )
 {
@@ -150,9 +158,16 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
   oox::drawingml::LineProperties& rRightBorder,
   oox::drawingml::LineProperties& rTopBorder,
   oox::drawingml::LineProperties& rBottomBorder,
+  oox::drawingml::LineProperties& rInsideHBorder,
+  oox::drawingml::LineProperties& rInsideVBorder,
   oox::drawingml::LineProperties& 
rTopLeftToBottomRightBorder,
   oox::drawingml::LineProperties& 
rBottomLeftToTopRightBorder,
-  TableStylePart& rTableStylePart )
+  TableStylePart& rTableStylePart,
+  bool bIsWholeTable = false,
+  sal_Int32 nCol = 0,
+  sal_Int32 nMaxCol = 0,
+  sal_Int32 nRow = 0,
+  sal_Int32 nMaxRow = 0)
 {
 ::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( 
rTableStylePart.getFillProperties() );
 if ( rPartFillPropertiesPtr )
@@ -169,12 +184,35 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
 }
 }
 
-applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tl2br, 
rTopLeftToBottomRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, 
rBottomLeftToTopRightBorder );
+// Left, right, top and bottom side of the whole table should be mean 
outer frame of the whole table.
+// Without this check it means left top right and bottom of whole cells of 
whole table.
+if (bIsWholeTable)
+{
+if (nCol == 0)
+applyBorder( rFilterBase, 

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

2022-02-28 Thread Tünde Tóth (via logerrit)
 oox/inc/drawingml/textparagraph.hxx|2 ++
 oox/source/drawingml/textbody.cxx  |   18 +-
 oox/source/drawingml/textparagraph.cxx |   15 ---
 sd/qa/unit/data/pptx/tdf103800.pptx|binary
 sd/qa/unit/import-tests.cxx|   17 +
 5 files changed, 40 insertions(+), 12 deletions(-)

New commits:
commit 7d6212e218d4d5c76c8bc60983b548a6893fc6a5
Author: Tünde Tóth 
AuthorDate: Fri Feb 18 10:30:54 2022 +0100
Commit: László Németh 
CommitDate: Mon Feb 28 15:39:07 2022 +0100

tdf#103800 PPTX shape import: fix regression of text color

defined by list styles. Properties in a:lstStyle of p:txBody
should take precedence over the same properties defined in
a:fontRef of style elements.

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

diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 021434d6a5fb..1f43249372a5 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -63,6 +63,7 @@ public:
 
 TextCharacterProperties  getCharacterStyle(
 const TextCharacterProperties& rTextStyleProperties,
+const TextListStyle& rMasterTextListStyle,
 const TextListStyle& rTextListStyle) const;
 
 TextParagraphProperties*  getParagraphStyle(
@@ -73,6 +74,7 @@ public:
 const css::uno::Reference < 
css::text::XText > & xText,
 const css::uno::Reference < 
css::text::XTextCursor > ,
 const TextCharacterProperties& 
rTextStyleProperties,
+const TextListStyle& rMasterTextListStyle,
 const TextListStyle& rTextListStyle,
 bool bFirst,
 float nDefaultCharHeight) const;
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index f4da6886a69c..41a237e97cee 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -57,16 +57,15 @@ void TextBody::insertAt(
 const TextCharacterProperties& rTextStyleProperties,
 const TextListStylePtr& pMasterTextListStylePtr ) const
 {
-TextListStyle aCombinedTextStyle;
-aCombinedTextStyle.apply( *pMasterTextListStylePtr );
-aCombinedTextStyle.apply( maTextListStyle );
+TextListStyle aMasterTextStyle(*pMasterTextListStylePtr);
 
 Reference xPropertySet(xAt, UNO_QUERY);
 float nCharHeight = 
xPropertySet->getPropertyValue("CharHeight").get();
 size_t nIndex = 0;
 for (auto const& paragraph : maParagraphs)
 {
-paragraph->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, 
aCombinedTextStyle, (nIndex == 0), nCharHeight );
+paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, 
aMasterTextStyle,
+maTextListStyle, (nIndex == 0), nCharHeight);
 ++nIndex;
 }
 }
@@ -127,15 +126,16 @@ void TextBody::ApplyStyleEmpty(
 return;
 
 // Apply character properties
-TextListStyle aCombinedTextStyle;
-aCombinedTextStyle.apply( *pMasterTextListStylePtr );
-aCombinedTextStyle.apply( maTextListStyle );
-
 PropertySet aPropSet(xText);
-TextCharacterProperties 
aTextCharacterProps(maParagraphs[0]->getCharacterStyle(rTextStyleProperties, 
aCombinedTextStyle));
+TextCharacterProperties 
aTextCharacterProps(maParagraphs[0]->getCharacterStyle(
+rTextStyleProperties, *pMasterTextListStylePtr, maTextListStyle));
 aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
 
 // Apply paragraph properties
+TextListStyle aCombinedTextStyle;
+aCombinedTextStyle.apply(*pMasterTextListStylePtr);
+aCombinedTextStyle.apply(maTextListStyle);
+
 TextParagraphProperties* pTextParagraphStyle = 
maParagraphs[0]->getParagraphStyle(aCombinedTextStyle);
 if (pTextParagraphStyle)
 {
diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index 9e4f309e9391..f91ee279bb3b 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -48,14 +48,18 @@ TextParagraph::~TextParagraph()
 
 TextCharacterProperties TextParagraph::getCharacterStyle (
 const TextCharacterProperties& rTextStyleProperties,
+const TextListStyle& rMasterTextListStyle,
 const TextListStyle& rTextListStyle) const
 {
+const TextParagraphProperties* pMasterTextParagraphStyle = 
getParagraphStyle(rMasterTextListStyle);
 const TextParagraphProperties* pTextParagraphStyle = 
getParagraphStyle(rTextListStyle);
 
 TextCharacterProperties aTextCharacterStyle;
+if (pMasterTextParagraphStyle)
+

[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/source sd/qa

2021-11-19 Thread Justin Luth (via logerrit)
 oox/inc/drawingml/textcharacterproperties.hxx   |3 +++
 oox/source/drawingml/textcharacterproperties.cxx|   12 
 oox/source/drawingml/textcharacterpropertiescontext.cxx |7 ---
 sd/qa/unit/export-tests-ooxml3.cxx  |   13 +
 sd/qa/unit/import-tests2.cxx|4 ++--
 5 files changed, 34 insertions(+), 5 deletions(-)

New commits:
commit 894a01640a838c9affed7cc7378a452139b5
Author: Justin Luth 
AuthorDate: Sat Nov 13 09:40:09 2021 +0200
Commit: Miklos Vajna 
CommitDate: Fri Nov 19 13:49:01 2021 +0100

tdf#137438 drawingml: separate outline from text import

By ignoring the a:ln group, the contents in that group
(like transparency) were being applied to the text.
Well, it should only apply to a line around the text,
which LO isn't doing.
[Well, LO can do this as Fontwork, but perhaps that
doesn't match so well with text in shapes generally?]

At any rate, don't allow one group's settings
to override the others. Keep them separate and then apply
a bit of merging logic to try to achieve the best look.

So emulate a little bit. If the outline is not very
transparent (less transparent than the main text)
then it may (if thick or opaque enough) dominate
the text.

For simplicity (and because there is no right answer overall)
I just compared transparency and used the more opaque colour.

Unit tests potentially affected:
-export-tests-ooxml1.cxx: tdf100348_FontworkBitmapFill.odp -> PPTX
   -now imports black instead of yellow (MSO sees gradient colors)
   -so previously completely wrong, and now perhaps even more wrong?
-export-tests-ooxml3.cxx: tdf114848.pptx
   -shows blue text regardless - defined by area.
   -can't see where this is set in MSO2016. Perhaps illegal?
-  : tdf125573_FontWorkScaleX.pptx
   -no visual difference. Same as tdf100348, but with black outline.
-  : tdf119087.pptx
   -should be green, not purple. [Added test for that.]
-  : tdf143315-WordartWithoutBullet.ppt
   -no visual difference (COL_AUTO outline?)
-import-tests2.cxx: tdf129686.pptx
   -poor test usage (but also weird transparent default).
   -no visual change.
-ooxmlimport2.cx: tdf143476_lockedCanvas_position.docx
   -no visual difference. Irrelevant since we can't RT

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

diff --git a/oox/inc/drawingml/textcharacterproperties.hxx 
b/oox/inc/drawingml/textcharacterproperties.hxx
index 2724af43051b..49d4125698a4 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -26,6 +26,7 @@
 #include 
 
 #include 
+#include 
 
 namespace oox { class PropertySet; }
 
@@ -57,6 +58,8 @@ struct TextCharacterProperties
 OptValue< bool >moItalic;
 OptValue< bool >moUnderlineLineFollowText;
 OptValue< bool >moUnderlineFillFollowText;
+OptValue moTextOutlineProperties;
+
 FillProperties  maFillProperties;
 /// Set if there was a property set that alters run visually during import
 bool mbHasVisualRunProperties;
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index bd4d051a490b..9200e9666cbf 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -65,6 +65,7 @@ void TextCharacterProperties::assignUsed( const 
TextCharacterProperties& rSource
 moItalic.assignIfUsed( rSourceProps.moItalic );
 moUnderlineLineFollowText.assignIfUsed( 
rSourceProps.moUnderlineLineFollowText );
 moUnderlineFillFollowText.assignIfUsed( 
rSourceProps.moUnderlineFillFollowText );
+moTextOutlineProperties.assignIfUsed(rSourceProps.moTextOutlineProperties);
 
 maTextEffectsProperties = rSourceProps.maTextEffectsProperties;
 maFillProperties.assignUsed( rSourceProps.maFillProperties );
@@ -110,6 +111,17 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 if ( maFillProperties.moFillType.has() )
 {
 Color aColor = maFillProperties.getBestSolidColor();
+// tdf#137438 Emulate text outline color/transparency.
+// If the outline color dominates, then use it as the text color.
+if (moTextOutlineProperties.has()
+&& moTextOutlineProperties.get().maLineFill.moFillType.has()
+&& moTextOutlineProperties.get().maLineFill.moFillType.get() != 
XML_noFill)
+{
+Color aLineColor = 
moTextOutlineProperties.get().maLineFill.getBestSolidColor();
+sal_Int16 nLineTransparency = aLineColor.getTransparency();
+if (nLineTransparency < 

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

2021-06-17 Thread Andrea Gelmini (via logerrit)
 oox/inc/drawingml/textliststyle.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2fad86dea0075a98d2d34bf43780611dd986dc68
Author: Andrea Gelmini 
AuthorDate: Thu Jun 17 09:17:56 2021 +0200
Commit: Andrea Gelmini 
CommitDate: Thu Jun 17 20:58:31 2021 +0200

Fix typo

Change-Id: Ia84c47ea309734f27fd492ba791d88200408f105
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117361
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/oox/inc/drawingml/textliststyle.hxx 
b/oox/inc/drawingml/textliststyle.hxx
index 7fe071af669b..5f986ff45afa 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -54,7 +54,7 @@ public:
 void setHasListStyleOnImport() { mbHasListStyleOnImport = true; }
 /** Returns whether the lstStyle tag was non-empty on import
  *
- *  @return true if list style has it's own noninherited properties.
+ *  @return true if list style has its own noninherited properties.
  */
 bool hasListStyleOnImport() const { return mbHasListStyleOnImport; }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-15 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textbody.hxx|3 +++
 oox/inc/drawingml/textliststyle.hxx   |   10 ++
 oox/source/drawingml/textliststyle.cxx|1 +
 oox/source/drawingml/textliststylecontext.cxx |1 +
 4 files changed, 15 insertions(+)

New commits:
commit 2cfccfba09faa5c3bb973136ffe99d534d09c881
Author: Sarper Akdemir 
AuthorDate: Sun May 9 20:56:41 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Jun 15 09:54:31 2021 +0200

tdf#59323: ooxml import: hasListStyleOnImport

Introduces hasListStyleOnImport to determine whether or not the textbody 
had a
non-empty lstStyle tag in it on import.

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

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index f89e069d5ffe..2ac96011f3c8 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -80,6 +80,9 @@ public:
 /// Flags textbody as having a non-empty bodyPr tag
 void setHasNoninheritedBodyProperties() { mbHasNoninheritedBodyProperties 
= true; }
 
+/// Returns whether the textbody had a non-empty lstStyle tag in it
+bool hasListStyleOnImport() const { return 
maTextListStyle.hasListStyleOnImport(); }
+
 voidApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
 const css::uno::Reference < css::text::XText > & 
xText,
diff --git a/oox/inc/drawingml/textliststyle.hxx 
b/oox/inc/drawingml/textliststyle.hxx
index cd770457575f..7fe071af669b 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -50,6 +50,14 @@ public:
 };
 TextParagraphPropertiesArray& getAggregationListStyle() { return 
maAggregationListStyle; };
 
+/// Flags ListStyle as having a non-empty lstStyle tag on import
+void setHasListStyleOnImport() { mbHasListStyleOnImport = true; }
+/** Returns whether the lstStyle tag was non-empty on import
+ *
+ *  @return true if list style has it's own noninherited properties.
+ */
+bool hasListStyleOnImport() const { return mbHasListStyleOnImport; }
+
 #ifdef DBG_UTIL
 void dump() const;
 #endif
@@ -57,6 +65,8 @@ public:
 private:
 TextParagraphPropertiesArray maListStyle;
 TextParagraphPropertiesArray maAggregationListStyle;
+/// Set if ListStyle has a non-empty lstStyle tag on import
+bool mbHasListStyleOnImport;
 };
 }
 
diff --git a/oox/source/drawingml/textliststyle.cxx 
b/oox/source/drawingml/textliststyle.cxx
index 0b757159e5bc..175b6caf879b 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -23,6 +23,7 @@
 namespace oox::drawingml {
 
 TextListStyle::TextListStyle()
+: mbHasListStyleOnImport(false)
 {
 }
 
diff --git a/oox/source/drawingml/textliststylecontext.cxx 
b/oox/source/drawingml/textliststylecontext.cxx
index f2abd9b91c21..62d81f9c7f4a 100644
--- a/oox/source/drawingml/textliststylecontext.cxx
+++ b/oox/source/drawingml/textliststylecontext.cxx
@@ -41,6 +41,7 @@ TextListStyleContext::~TextListStyleContext()
 
 ContextHandlerRef TextListStyleContext::onCreateContext( sal_Int32 
aElementToken, const AttributeList& rAttribs )
 {
+mrTextListStyle.setHasListStyleOnImport();
 switch( aElementToken )
 {
 case A_TOKEN( defPPr ): // CT_TextParagraphProperties
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-15 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textbody.hxx   |7 +++
 oox/source/drawingml/textbody.cxx|1 +
 oox/source/drawingml/textbodycontext.cxx |4 
 3 files changed, 12 insertions(+)

New commits:
commit 7882f2425499e6d12894a74696f30b718468c4a4
Author: Sarper Akdemir 
AuthorDate: Sun May 9 20:55:17 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Jun 15 09:53:31 2021 +0200

tdf#59323: ooxml import: hasNoninheritedBodyProperties

Introduces hasNoninheritedBodyProperties.

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

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index 25a6ab194089..f89e069d5ffe 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -75,6 +75,11 @@ public:
 /// Returns whether the textbody had a pPr tag in it
 bool hasParagraphProperties() const;
 
+/// Returns whether the textbody had a non-empty bodyPr tag in it
+bool hasNoninheritedBodyProperties() const { return 
mbHasNoninheritedBodyProperties; }
+/// Flags textbody as having a non-empty bodyPr tag
+void setHasNoninheritedBodyProperties() { mbHasNoninheritedBodyProperties 
= true; }
+
 voidApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
 const css::uno::Reference < css::text::XText > & 
xText,
@@ -83,6 +88,8 @@ public:
 protected:
 TextParagraphVector maParagraphs;
 TextBodyProperties  maTextProperties;
+/// Set if bodyPr tag in this textbody is non-empty during import
+boolmbHasNoninheritedBodyProperties;
 TextListStyle   maTextListStyle;
 Text3DPropertiesma3DProperties;
 };
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 5924728430a8..b665e7b355a0 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -30,6 +30,7 @@ using namespace ::com::sun::star::beans;
 namespace oox::drawingml {
 
 TextBody::TextBody()
+: mbHasNoninheritedBodyProperties( false )
 {
 }
 
diff --git a/oox/source/drawingml/textbodycontext.cxx 
b/oox/source/drawingml/textbodycontext.cxx
index a10ba58a0499..0492ac22e44a 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -27,6 +27,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -177,6 +179,8 @@ ContextHandlerRef TextBodyContext::onCreateContext( 
sal_Int32 aElementToken, con
 switch( aElementToken )
 {
 case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag
+if 
(sax_fastparser::castToFastAttributeList(rAttribs.getFastAttributeList()).getFastAttributeTokens().size()
 > 0)
+mrTextBody.setHasNoninheritedBodyProperties();
 if ( mpShapePtr )
 return new TextBodyPropertiesContext( *this, rAttribs, 
mpShapePtr );
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-15 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textbody.hxx   |3 +++
 oox/inc/drawingml/textparagraph.hxx  |5 +
 oox/source/drawingml/textbody.cxx|   10 ++
 oox/source/drawingml/textbodycontext.cxx |1 +
 oox/source/drawingml/textparagraph.cxx   |1 +
 5 files changed, 20 insertions(+)

New commits:
commit b187c36e019f773a71687c819c3cf6a2c3fd2b89
Author: Sarper Akdemir 
AuthorDate: Sun May 9 20:47:35 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Jun 15 09:29:52 2021 +0200

tdf#59323: ooxml import: hasParagraphProperties

Introduces hasParagraphProperties to determine whether or not there was a 
pPr
tag in the textbody on import.

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

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index 8d0ce417f6b9..25a6ab194089 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -72,6 +72,9 @@ public:
  */
 bool hasVisualRunProperties() const;
 
+/// Returns whether the textbody had a pPr tag in it
+bool hasParagraphProperties() const;
+
 voidApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
 const css::uno::Reference < css::text::XText > & 
xText,
diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 4424eadf2cab..021434d6a5fb 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -53,6 +53,10 @@ public:
 
 TextParagraphProperties& getProperties() { return maProperties; }
 const TextParagraphProperties&   getProperties() const { return 
maProperties; }
+/// Flags the textparagraph as having a pPr tag in it
+void setHasProperties() { mbHasProperties = 
true; }
+/// Returns whether the textparagraph had an pPr tag in it during import
+bool hasProperties() const { return 
mbHasProperties; }
 
 TextCharacterProperties& getEndProperties() { return 
maEndProperties; }
 const TextCharacterProperties&   getEndProperties() const { return 
maEndProperties; }
@@ -87,6 +91,7 @@ public:
 
 private:
 TextParagraphProperties maProperties;
+boolmbHasProperties;
 TextCharacterProperties maEndProperties;
 TextRunVector   maRuns;
 // temporarily store this here
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 9839f755dc39..5924728430a8 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -103,6 +103,16 @@ bool TextBody::hasVisualRunProperties() const
 return false;
 }
 
+bool TextBody::hasParagraphProperties() const
+{
+for ( auto& pTextParagraph : getParagraphs() )
+{
+if ( pTextParagraph->hasProperties() )
+return true;
+}
+return false;
+}
+
 void TextBody::ApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
 const Reference < XText > & xText,
diff --git a/oox/source/drawingml/textbodycontext.cxx 
b/oox/source/drawingml/textbodycontext.cxx
index 49b50309f597..a10ba58a0499 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -89,6 +89,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( 
sal_Int32 aElementToken
 }
 case A_TOKEN( pPr ):
 case W_TOKEN( pPr ):
+mrParagraph.setHasProperties();
 return new TextParagraphPropertiesContext( *this, rAttribs, 
mrParagraph.getProperties() );
 case A_TOKEN( endParaRPr ):
 return new TextCharacterPropertiesContext( *this, rAttribs, 
mrParagraph.getEndProperties() );
diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index b1c57205dc26..9e4f309e9391 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -38,6 +38,7 @@ using namespace ::com::sun::star::beans;
 namespace oox::drawingml {
 
 TextParagraph::TextParagraph()
+: mbHasProperties( false )
 {
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-15 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textbody.hxx  |6 +++
 oox/inc/drawingml/textcharacterproperties.hxx   |4 ++
 oox/inc/drawingml/textparagraph.hxx |6 +++
 oox/inc/drawingml/textrun.hxx   |6 +++
 oox/source/drawingml/textbody.cxx   |   10 ++
 oox/source/drawingml/textcharacterpropertiescontext.cxx |   26 +++-
 oox/source/drawingml/textparagraph.cxx  |   10 ++
 7 files changed, 67 insertions(+), 1 deletion(-)

New commits:
commit 4a3b9d2092ff5ce8336cc87cacbdc421f3d26ea7
Author: Sarper Akdemir 
AuthorDate: Sun May 9 20:17:20 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Jun 15 09:28:55 2021 +0200

tdf#59323: ooxml import: hasVisualRunProperties

Introduces helper functions to determine whether a shape has non inherited 
run
properties that change it visually.

mbHasVisualRunProperties is set on import if there was a run property that
alters visual appearance.

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

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index ac6c66b49515..8d0ce417f6b9 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -66,6 +66,12 @@ public:
 bool isEmpty() const;
 OUString toString() const;
 
+/** Returns whether the textbody had a rPr tag in it that alters it 
visually
+ *
+ *  For instance _lang_ doesn't have a visual effect.
+ */
+bool hasVisualRunProperties() const;
+
 voidApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
 const css::uno::Reference < css::text::XText > & 
xText,
diff --git a/oox/inc/drawingml/textcharacterproperties.hxx 
b/oox/inc/drawingml/textcharacterproperties.hxx
index 90d01ec9cde1..2724af43051b 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -58,6 +58,8 @@ struct TextCharacterProperties
 OptValue< bool >moUnderlineLineFollowText;
 OptValue< bool >moUnderlineFillFollowText;
 FillProperties  maFillProperties;
+/// Set if there was a property set that alters run visually during import
+bool mbHasVisualRunProperties;
 
 std::vector maTextEffectsProperties;
 
@@ -78,6 +80,8 @@ struct TextCharacterProperties
 voidpushToPropSet(
 PropertySet& rPropSet,
 const ::oox::core::XmlFilterBase& rFilter ) const;
+
+TextCharacterProperties() : mbHasVisualRunProperties(false) {}
 };
 
 
diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index df39f8841c76..4424eadf2cab 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -79,6 +79,12 @@ public:
 }
 formulaimport::XmlStreamBuilder & GetMathXml();
 
+/** Returns whether textparagraph had a rPr tag in it that alters it 
visually
+ *
+ *  For instance _lang_ doesn't have a visual effect.
+ */
+bool hasVisualRunProperties() const;
+
 private:
 TextParagraphProperties maProperties;
 TextCharacterProperties maEndProperties;
diff --git a/oox/inc/drawingml/textrun.hxx b/oox/inc/drawingml/textrun.hxx
index 355b8a684cc1..b3d1fe041ff8 100644
--- a/oox/inc/drawingml/textrun.hxx
+++ b/oox/inc/drawingml/textrun.hxx
@@ -43,6 +43,12 @@ public:
 void setLineBreak() { mbIsLineBreak = true; }
 bool isLineBreak() const { return mbIsLineBreak; }
 
+/** Returns whether the textrun had properties that alter it visually in 
its rPr tag
+ *
+ *  For instance _lang_ doesn't have a visual effect.
+ */
+bool hasVisualRunProperties() const { return 
maTextCharacterProperties.mbHasVisualRunProperties; }
+
 virtual sal_Int32   insertAt(
 const ::oox::core::XmlFilterBase& 
rFilterBase,
 const css::uno::Reference < 
css::text::XText >& xText,
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 1326c790328f..9839f755dc39 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -93,6 +93,16 @@ OUString TextBody::toString() const
 return OUString();
 }
 
+bool TextBody::hasVisualRunProperties() const
+{
+for ( auto& pTextParagraph : getParagraphs() )
+{
+if ( pTextParagraph->hasVisualRunProperties() )
+return true;
+}
+return false;
+}
+
 void TextBody::ApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
 const Reference < XText > & xText,
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx 

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

2021-06-14 Thread Sarper Akdemir (via logerrit)
 oox/inc/drawingml/textfield.hxx|   13 +++
 oox/source/drawingml/textfield.cxx |  141 +
 2 files changed, 94 insertions(+), 60 deletions(-)

New commits:
commit b2869ca51c2e30128456cbdee7e526bacd9cc905
Author: Sarper Akdemir 
AuthorDate: Sun May 9 19:46:21 2021 +0300
Commit: Miklos Vajna 
CommitDate: Mon Jun 14 12:06:10 2021 +0200

tdf#59323: ooxml import: add OOXML to LO datetime helper

Added static helper functions getLOTimeFormat and getLODateFormat to
TextField class for mapping datetime field types to SvxDateFomat and
SvxTimeFormat.

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

diff --git a/oox/inc/drawingml/textfield.hxx b/oox/inc/drawingml/textfield.hxx
index f365238bd54b..c26a8518c509 100644
--- a/oox/inc/drawingml/textfield.hxx
+++ b/oox/inc/drawingml/textfield.hxx
@@ -23,6 +23,9 @@
 #include 
 #include 
 
+enum class SvxTimeFormat;
+enum class SvxDateFormat;
+
 namespace oox::drawingml {
 
 struct TextCharacterProperties;
@@ -48,6 +51,16 @@ public:
 const TextCharacterProperties& rTextCharacterStyle,
 float nDefaultCharHeight) const override;
 
+/** Gets the corresponding LO Date format for given OOXML datetime field 
type
+ *
+ * @param rDateTimeType PPTX datetime field type e.g. datetime3
+ */
+static SvxDateFormat getLODateFormat( std::u16string_view rDateTimeType );
+/** Gets the corresponding LO Time format for given OOXML datetime field 
type
+ *
+ * @param rDateTimeType PPTX datetime field type e.g. datetime3
+ */
+static SvxTimeFormat getLOTimeFormat( std::u16string_view rDateTimeType );
 private:
 TextParagraphProperties  maTextParagraphProperties;
 OUString msType;
diff --git a/oox/source/drawingml/textfield.cxx 
b/oox/source/drawingml/textfield.cxx
index 7425e0416fec..e590c5c7a2cb 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -71,68 +72,28 @@ void lclCreateTextFields( std::vector< Reference< 
XTextField > > & aFields,
 aFields.emplace_back( xIface, UNO_QUERY );
 return;
 }
-bool bIsDate = true;
-int idx = p.toInt32();
-sal_uInt16 nNumFmt;
-xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.DateTime" );
-aFields.emplace_back( xIface, UNO_QUERY );
-Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW );
-
-// here we should format the field properly. waiting after #i81091.
-switch( idx )
+
+SvxDateFormat eDateFormat = TextField::getLODateFormat(sType);
+if (eDateFormat != SvxDateFormat::AppDefault)
 {
-case 1: // Date dd/mm/
-// this is the default format...
-nNumFmt = 5;
-xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
-break;
-case 2: // Date Day, Month dd, 
-break;
-case 3: // Date dd Month 
-nNumFmt = 3;
-xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
-break;
-case 4: // Date Month dd, 
-break;
-case 5: // Date dd-Mon-yy
-break;
-case 6: // Date Month yy
-break;
-case 7: // Date Mon-yy
-break;
-case 8: // DateTime dd/mm/ H:MM PM
-lclCreateTextFields( aFields, xModel, "datetime12" );
-break;
-case 9: // DateTime dd/mm/yy H:MM:SS PM
-lclCreateTextFields( aFields, xModel, "datetime13" );
-break;
-case 10: // Time H:MM
-bIsDate = false;
-nNumFmt = 3;
-xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
-break;
-case 11: // Time H:MM:SS
-bIsDate = false;
-// this is the default format
-nNumFmt = 2;
-xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
-break;
-case 12: // Time H:MM PM
-bIsDate = false;
-nNumFmt = 6;
-xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
-break;
-case 13: // Time H:MM:SS PM
-bIsDate = false;
-nNumFmt = 7;
-xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
-break;
-default:
-nNumFmt = 2;
-

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

2021-04-14 Thread Noel Grandin (via logerrit)
 oox/inc/drawingml/textliststyle.hxx |2 +-
 oox/inc/drawingml/textparagraph.hxx |2 +-
 oox/inc/drawingml/textparagraphproperties.hxx   |4 
 oox/source/drawingml/shape.cxx  |4 ++--
 oox/source/drawingml/textbody.cxx   |2 +-
 oox/source/drawingml/textliststyle.cxx  |   17 ++---
 oox/source/drawingml/textliststylecontext.cxx   |   24 
 oox/source/drawingml/textparagraph.cxx  |   12 ++--
 oox/source/ppt/presentationfragmenthandler.cxx  |4 ++--
 oox/source/ppt/slidemastertextstylescontext.cxx |2 +-
 oox/source/ppt/slidepersist.cxx |2 +-
 11 files changed, 33 insertions(+), 42 deletions(-)

New commits:
commit 94afb3663b1618b66daa7cc7199cbd5c9f387e0f
Author: Noel Grandin 
AuthorDate: Wed Apr 14 13:11:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 14 18:32:26 2021 +0200

reduce allocation in TextListStyle some more

These child objects do not need to use shared_ptr, since no-one
else holds a pointer to them, and we always allocate them, so
just allocate them inline the parent object.

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

diff --git a/oox/inc/drawingml/textliststyle.hxx 
b/oox/inc/drawingml/textliststyle.hxx
index ac84cc9d903d..cd770457575f 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -27,7 +27,7 @@
 namespace oox::drawingml
 {
 constexpr int NUM_TEXT_LIST_STYLE_ENTRIES = 9;
-typedef std::array, 
NUM_TEXT_LIST_STYLE_ENTRIES>
+typedef std::array
 TextParagraphPropertiesArray;
 
 class TextListStyle
diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 5139c51b9b26..df39f8841c76 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -61,7 +61,7 @@ public:
 const TextCharacterProperties& rTextStyleProperties,
 const TextListStyle& rTextListStyle) const;
 
-TextParagraphPropertiesPtr  getParagraphStyle(
+TextParagraphProperties*  getParagraphStyle(
 const TextListStyle& rTextListStyle) const;
 
 voidinsertAt(
diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 7dd41610024b..dd508179c13d 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -33,10 +33,6 @@ namespace com::sun::star {
 
 namespace oox::drawingml {
 
-class TextParagraphProperties;
-
-typedef std::shared_ptr< TextParagraphProperties > TextParagraphPropertiesPtr;
-
 class BulletList
 {
 public:
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 819d117d4fa9..729fb3c3712f 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1050,8 +1050,8 @@ Reference< XShape > const & Shape::createAndInsert(
 mpTextBody->getTextProperties().pushRotationAdjustments();
 aShapeProps.assignUsed( 
mpTextBody->getTextProperties().maPropertyMap );
 // Push char properties as well - specifically useful when this is 
a placeholder
-if( mpMasterTextListStyle &&  
mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.has()
 )
-aShapeProps.setProperty(PROP_CharHeight, GetFontHeight( 
mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.get()
 ));
+if( mpMasterTextListStyle &&  
mpMasterTextListStyle->getListStyle()[0].getTextCharacterProperties().moHeight.has()
 )
+aShapeProps.setProperty(PROP_CharHeight, GetFontHeight( 
mpMasterTextListStyle->getListStyle()[0].getTextCharacterProperties().moHeight.get()
 ));
 }
 
 // applying properties
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 4c5495e6c040..c6abacf7d485 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -119,7 +119,7 @@ void TextBody::ApplyStyleEmpty(
 aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
 
 // Apply paragraph properties
-TextParagraphPropertiesPtr pTextParagraphStyle = 
maParagraphs[0]->getParagraphStyle(aCombinedTextStyle);
+TextParagraphProperties* pTextParagraphStyle = 
maParagraphs[0]->getParagraphStyle(aCombinedTextStyle);
 if (pTextParagraphStyle)
 {
 Reference< XPropertySet > xProps(xText, UNO_QUERY);
diff --git a/oox/source/drawingml/textliststyle.cxx 
b/oox/source/drawingml/textliststyle.cxx
index da170cae03eb..0b757159e5bc 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -24,11 +24,6 @@ namespace oox::drawingml {
 
 TextListStyle::TextListStyle()
 {
-for ( 

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

2021-04-14 Thread Noel Grandin (via logerrit)
 oox/inc/drawingml/textbody.hxx |1 
 oox/inc/drawingml/textliststyle.hxx|   19 +++-
 oox/inc/drawingml/textparagraph.hxx|1 
 oox/source/drawingml/textliststyle.cxx |   37 +++--
 oox/source/drawingml/textparagraph.cxx |2 -
 oox/source/ppt/presentationfragmenthandler.cxx |2 -
 6 files changed, 26 insertions(+), 36 deletions(-)

New commits:
commit 306f6934ac6f0b012eaecd05bb4abb7c9d341993
Author: Noel Grandin 
AuthorDate: Wed Apr 14 12:51:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 14 17:04:52 2021 +0200

reduce allocation in TextListStyle

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

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index 5e6d156e7ce4..093642f30d97 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::text {
 class XText;
diff --git a/oox/inc/drawingml/textliststyle.hxx 
b/oox/inc/drawingml/textliststyle.hxx
index 52cb29330877..ac84cc9d903d 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -21,11 +21,14 @@
 #define INCLUDED_OOX_DRAWINGML_TEXTLISTSTYLE_HXX
 
 #include 
-#include 
+#include 
+#include 
 
 namespace oox::drawingml
 {
-typedef RefVector TextParagraphPropertiesVector;
+constexpr int NUM_TEXT_LIST_STYLE_ENTRIES = 9;
+typedef std::array, 
NUM_TEXT_LIST_STYLE_ENTRIES>
+TextParagraphPropertiesArray;
 
 class TextListStyle
 {
@@ -38,22 +41,22 @@ public:
 
 void apply(const TextListStyle& rTextListStyle);
 
-const TextParagraphPropertiesVector& getListStyle() const { return 
maListStyle; };
-TextParagraphPropertiesVector& getListStyle() { return maListStyle; };
+const TextParagraphPropertiesArray& getListStyle() const { return 
maListStyle; };
+TextParagraphPropertiesArray& getListStyle() { return maListStyle; };
 
-const TextParagraphPropertiesVector& getAggregationListStyle() const
+const TextParagraphPropertiesArray& getAggregationListStyle() const
 {
 return maAggregationListStyle;
 };
-TextParagraphPropertiesVector& getAggregationListStyle() { return 
maAggregationListStyle; };
+TextParagraphPropertiesArray& getAggregationListStyle() { return 
maAggregationListStyle; };
 
 #ifdef DBG_UTIL
 void dump() const;
 #endif
 
 private:
-TextParagraphPropertiesVector maListStyle;
-TextParagraphPropertiesVector maAggregationListStyle;
+TextParagraphPropertiesArray maListStyle;
+TextParagraphPropertiesArray maAggregationListStyle;
 };
 }
 
diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 22465355142c..5139c51b9b26 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -25,6 +25,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/oox/source/drawingml/textliststyle.cxx 
b/oox/source/drawingml/textliststyle.cxx
index d900e3cef338..da170cae03eb 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -24,10 +24,10 @@ namespace oox::drawingml {
 
 TextListStyle::TextListStyle()
 {
-for ( int i = 0; i < 9; i++ )
+for ( int i = 0; i < NUM_TEXT_LIST_STYLE_ENTRIES; i++ )
 {
-maListStyle.push_back( std::make_shared( ) );
-maAggregationListStyle.push_back( 
std::make_shared( ) );
+maListStyle[i] = std::make_shared( );
+maAggregationListStyle[i] = std::make_shared( 
);
 }
 }
 
@@ -37,12 +37,10 @@ TextListStyle::~TextListStyle()
 
 TextListStyle::TextListStyle(const TextListStyle& rStyle)
 {
-assert(rStyle.maListStyle.size() == 9);
-assert(rStyle.maAggregationListStyle.size() == 9);
-for ( size_t i = 0; i < 9; i++ )
+for ( size_t i = 0; i < NUM_TEXT_LIST_STYLE_ENTRIES; i++ )
 {
-maListStyle.push_back( std::make_shared( 
*rStyle.maListStyle[i] ) );
-maAggregationListStyle.push_back( 
std::make_shared( *rStyle.maAggregationListStyle[i] ) 
);
+maListStyle[i] = std::make_shared( 
*rStyle.maListStyle[i] );
+maAggregationListStyle[i] = std::make_shared( 
*rStyle.maAggregationListStyle[i] );
 }
 }
 
@@ -50,11 +48,7 @@ TextListStyle& TextListStyle::operator=(const TextListStyle& 
rStyle)
 {
 if(this != )
 {
-assert(rStyle.maListStyle.size() == 9);
-assert(rStyle.maAggregationListStyle.size() == 9);
-assert(maListStyle.size() == 9);
-assert(maAggregationListStyle.size() == 9);
-for ( size_t i = 0; i < 9; i++ )
+for ( size_t i = 0; i < NUM_TEXT_LIST_STYLE_ENTRIES; i++ )
 {
 *maListStyle[i] = *rStyle.maListStyle[i];
 *maAggregationListStyle[i] = 

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

2021-01-28 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/graphicproperties.hxx|4 +++-
 oox/source/drawingml/fillproperties.cxx|   29 -
 oox/source/drawingml/shape.cxx |9 +++--
 sd/qa/unit/data/pptx/mirrored-graphic.pptx |binary
 sd/qa/unit/import-tests.cxx|   16 
 5 files changed, 54 insertions(+), 4 deletions(-)

New commits:
commit 62ee7fdce30d8e1deb6df80b73577ef6164a5a90
Author: Gülşah Köse 
AuthorDate: Thu Jan 28 09:37:58 2021 +0300
Commit: Gülşah Köse 
CommitDate: Thu Jan 28 15:46:14 2021 +0100

tdf#134210 Apply mirror property to custom cropped graphic.

Change-Id: I5bf2ba8fa432af8b6a560cc60c18bef799834fd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110039
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/graphicproperties.hxx 
b/oox/inc/drawingml/graphicproperties.hxx
index 85b47dbff593..48d1acf61931 100644
--- a/oox/inc/drawingml/graphicproperties.hxx
+++ b/oox/inc/drawingml/graphicproperties.hxx
@@ -43,7 +43,9 @@ struct GraphicProperties
 /** Writes the properties to the passed property map. */
 voidpushToPropMap(
 PropertyMap& rPropMap,
-const GraphicHelper& rGraphicHelper) const;
+const GraphicHelper& rGraphicHelper,
+bool bFlipH = false,
+bool bFlipV = false) const;
 };
 
 } // namespace oox::drawingml
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index c8946c15f9a8..6d537097a206 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -112,6 +112,28 @@ Reference< XGraphic > 
lclCropGraphic(uno::Reference const & x
 return aReturnGraphic.GetXGraphic();
 }
 
+Reference< XGraphic > lclMirrorGraphic(uno::Reference const 
& xGraphic, bool bFlipH, bool bFlipV)
+{
+::Graphic aGraphic(xGraphic);
+::Graphic aReturnGraphic;
+
+assert (aGraphic.GetType() == GraphicType::Bitmap);
+
+BitmapEx aBitmapEx(aGraphic.GetBitmapEx());
+BmpMirrorFlags nMirrorFlags = BmpMirrorFlags::NONE;
+
+if(bFlipH)
+nMirrorFlags |= BmpMirrorFlags::Horizontal;
+if(bFlipV)
+nMirrorFlags |= BmpMirrorFlags::Vertical;
+
+aBitmapEx.Mirror(nMirrorFlags);
+
+aReturnGraphic = ::Graphic(aBitmapEx);
+aReturnGraphic.setOriginURL(aGraphic.getOriginURL());
+
+return aReturnGraphic.GetXGraphic();
+}
 
 Reference< XGraphic > lclCheckAndApplyChangeColorTransform(const 
BlipFillProperties , uno::Reference const & 
xGraphic,
const 
GraphicHelper& rGraphicHelper, const ::Color nPhClr)
@@ -761,7 +783,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 rPropMap.setProperty( ShapeProperty::FillStyle, eFillStyle );
 }
 
-void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const 
GraphicHelper& rGraphicHelper) const
+void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const 
GraphicHelper& rGraphicHelper, bool bFlipH, bool bFlipV) const
 {
 sal_Int16 nBrightness = getLimitedValue< sal_Int16, sal_Int32 >( 
maBlipProps.moBrightness.get( 0 ) / PER_PERCENT, -100, 100 );
 sal_Int16 nContrast = getLimitedValue< sal_Int16, sal_Int32 >( 
maBlipProps.moContrast.get( 0 ) / PER_PERCENT, -100, 100 );
@@ -811,6 +833,11 @@ void GraphicProperties::pushToPropMap( PropertyMap& 
rPropMap, const GraphicHelpe
 xGraphic = lclRotateGraphic(xGraphic, Degree10(nAngle/10) );
 }
 
+// We have not core feature that flips graphic in the shape.
+// Here we are applying flip property to bitmap directly.
+if(bFlipH || bFlipV)
+xGraphic = lclMirrorGraphic(xGraphic, bFlipH, bFlipV );
+
 rPropMap.setProperty(PROP_FillBitmap, xGraphic);
 }
 else
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 37633abb8b87..38c5ddfa689f 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1049,8 +1049,13 @@ Reference< XShape > const & Shape::createAndInsert(
 aShapeProps.assignUsed( maDefaultShapeProperties );
 if(mnRotation != 0 && bIsCustomShape)
 aShapeProps.setProperty( PROP_RotateAngle, sal_Int32( 
NormAngle36000( Degree100(mnRotation / -600) ) ));
-if ( bIsEmbMedia || aServiceName == 
"com.sun.star.drawing.GraphicObjectShape" || aServiceName == 
"com.sun.star.drawing.OLE2Shape" || bIsCustomShape )
-mpGraphicPropertiesPtr->pushToPropMap( aShapeProps, rGraphicHelper 
);
+if( bIsEmbMedia ||
+bIsCustomShape ||
+aServiceName == "com.sun.star.drawing.GraphicObjectShape" ||
+aServiceName == "com.sun.star.drawing.OLE2Shape")
+{
+mpGraphicPropertiesPtr->pushToPropMap( aShapeProps, 

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

2021-01-21 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/fillproperties.hxx|3 +-
 oox/source/drawingml/fillproperties.cxx |   34 +++-
 oox/source/drawingml/shape.cxx  |2 -
 sd/qa/unit/data/pptx/tdf134210.pptx |binary
 sd/qa/unit/import-tests.cxx |   19 +
 5 files changed, 55 insertions(+), 3 deletions(-)

New commits:
commit 2c96bd26ec488d865370fe9d394e7c4e228e05ab
Author: Gülşah Köse 
AuthorDate: Wed Jan 20 00:52:56 2021 +0300
Commit: Miklos Vajna 
CommitDate: Thu Jan 21 10:52:46 2021 +0100

tdf#134210 Import support for custom stretch values.

Change-Id: I33ced8d667e37b7fb79f4c87b689f45966ac0097
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109658
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/fillproperties.hxx 
b/oox/inc/drawingml/fillproperties.hxx
index cf26acfc17d6..f308f6aaec0d 100644
--- a/oox/inc/drawingml/fillproperties.hxx
+++ b/oox/inc/drawingml/fillproperties.hxx
@@ -146,7 +146,8 @@ struct FillProperties
 sal_Int32 nShapeRotation = 0,
 ::Color nPhClr = API_RGB_TRANSPARENT,
 bool bFlipH = false,
-bool bFlipV = false ) const;
+bool bFlipV = false,
+bool bIsCustomShape = false ) const;
 };
 
 } // namespace oox::drawingml
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 3efd64878326..837578ebc807 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -87,6 +87,32 @@ Reference< XGraphic > 
lclRotateGraphic(uno::Reference const &
 return aReturnGraphic.GetXGraphic();
 }
 
+Reference< XGraphic > lclCropGraphic(uno::Reference const & 
xGraphic, geometry::IntegerRectangle2D aFillRect)
+{
+::Graphic aGraphic(xGraphic);
+::Graphic aReturnGraphic;
+
+assert (aGraphic.GetType() == GraphicType::Bitmap);
+
+BitmapEx aBitmapEx(aGraphic.GetBitmapEx());
+
+sal_Int32 nOrigHeight = aBitmapEx.GetSizePixel().Height();
+sal_Int32 nHeight = nOrigHeight;
+sal_Int32 nTopCorr  = nOrigHeight * -1 * static_cast(aFillRect.Y1) 
/ 10;
+nHeight += nTopCorr;
+sal_Int32 nBottomCorr = nOrigHeight * -1 * 
static_cast(aFillRect.Y2) / 10;
+nHeight += nBottomCorr;
+
+aBitmapEx.Scale(Size(aBitmapEx.GetSizePixel().Width(), nHeight));
+aBitmapEx.Crop(tools::Rectangle(Point(0, nTopCorr), 
Size(aBitmapEx.GetSizePixel().Width(), nOrigHeight)));
+
+aReturnGraphic = ::Graphic(aBitmapEx);
+aReturnGraphic.setOriginURL(aGraphic.getOriginURL());
+
+return aReturnGraphic.GetXGraphic();
+}
+
+
 Reference< XGraphic > lclCheckAndApplyChangeColorTransform(const 
BlipFillProperties , uno::Reference const & 
xGraphic,
const 
GraphicHelper& rGraphicHelper, const ::Color nPhClr)
 {
@@ -272,7 +298,7 @@ Color FillProperties::getBestSolidColor() const
 
 void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
 const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation, ::Color 
nPhClr,
-bool bFlipH, bool bFlipV ) const
+bool bFlipH, bool bFlipV, bool bIsCustomShape) const
 {
 if( !moFillType.has() )
 return;
@@ -675,6 +701,12 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 if ( aFillRect.Y2 )
 aGraphCrop.Bottom = static_cast< sal_Int32 >( 
( static_cast< double >( aOriginalSize.Height ) * aFillRect.Y2 ) / 10 );
 rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
+
+if(bIsCustomShape)
+{
+xGraphic = lclCropGraphic(xGraphic, aFillRect);
+
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
+}
 }
 }
 }
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index f5aa1c2cd9f2..37633abb8b87 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1058,7 +1058,7 @@ Reference< XShape > const & Shape::createAndInsert(
 if (getFillProperties().moFillType.has() && 
getFillProperties().moFillType.get() == XML_grpFill)
 getFillProperties().assignUsed(aFillProperties);
 if(!bIsCroppedGraphic)
-aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, 
mnRotation, nFillPhClr, mbFlipH, mbFlipV );
+aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, 
mnRotation, nFillPhClr, mbFlipH, mbFlipV, bIsCustomShape );
 LineProperties aLineProperties = getActualLineProperties(pTheme);
 aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr 
);
 

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

2020-11-27 Thread Miklos Vajna (via logerrit)
 oox/inc/drawingml/effectpropertiescontext.hxx|5 +
 oox/source/drawingml/effectpropertiescontext.cxx |2 +-
 oox/source/drawingml/shapepropertiescontext.cxx  |2 +-
 oox/source/drawingml/themeelementscontext.cxx|2 +-
 solenv/clang-format/excludelist  |2 +-
 5 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit f2e1685e489c054ea10afc0df52451c74da10cc0
Author: Miklos Vajna 
AuthorDate: Fri Nov 27 16:58:38 2020 +0100
Commit: Miklos Vajna 
CommitDate: Fri Nov 27 21:33:33 2020 +0100

oox: make effectpropertiescontext available to everyone in oox/

I plan to use this from oox/source/drawingml/table/tablecontext.cxx for
tdf#129961.

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

diff --git a/oox/source/drawingml/effectpropertiescontext.hxx 
b/oox/inc/drawingml/effectpropertiescontext.hxx
similarity index 85%
rename from oox/source/drawingml/effectpropertiescontext.hxx
rename to oox/inc/drawingml/effectpropertiescontext.hxx
index ce7b5b3ef363..09ec2f02ec80 100644
--- a/oox/source/drawingml/effectpropertiescontext.hxx
+++ b/oox/inc/drawingml/effectpropertiescontext.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
-#define INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
+#pragma once
 
 #include 
 
@@ -35,6 +34,4 @@ private:
 
 }
 
-#endif // INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIESCONTEXT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/effectpropertiescontext.cxx 
b/oox/source/drawingml/effectpropertiescontext.cxx
index f287c897d891..b7cb03bc08b6 100644
--- a/oox/source/drawingml/effectpropertiescontext.cxx
+++ b/oox/source/drawingml/effectpropertiescontext.cxx
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include "effectpropertiescontext.hxx"
+#include 
 #include "effectproperties.hxx"
 #include 
 #include 
diff --git a/oox/source/drawingml/shapepropertiescontext.cxx 
b/oox/source/drawingml/shapepropertiescontext.cxx
index 4591cb834489..574e0793c89a 100644
--- a/oox/source/drawingml/shapepropertiescontext.cxx
+++ b/oox/source/drawingml/shapepropertiescontext.cxx
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include "effectpropertiescontext.hxx"
+#include 
 #include 
 #include 
 #include 
diff --git a/oox/source/drawingml/themeelementscontext.cxx 
b/oox/source/drawingml/themeelementscontext.cxx
index e5f84e5a02a0..6fbd62e91d18 100644
--- a/oox/source/drawingml/themeelementscontext.cxx
+++ b/oox/source/drawingml/themeelementscontext.cxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include "effectproperties.hxx"
-#include "effectpropertiescontext.hxx"
+#include 
 #include 
 #include 
 
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index c7eee25f0f8c..5249848a75d8 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -7185,6 +7185,7 @@ oox/inc/drawingml/clrschemecontext.hxx
 oox/inc/drawingml/colorchoicecontext.hxx
 oox/inc/drawingml/customshapegeometry.hxx
 oox/inc/drawingml/customshapeproperties.hxx
+oox/inc/drawingml/effectpropertiescontext.hxx
 oox/inc/drawingml/embeddedwavaudiofile.hxx
 oox/inc/drawingml/fillproperties.hxx
 oox/inc/drawingml/graphicproperties.hxx
@@ -7303,7 +7304,6 @@ oox/source/drawingml/drawingmltypes.cxx
 oox/source/drawingml/effectproperties.cxx
 oox/source/drawingml/effectproperties.hxx
 oox/source/drawingml/effectpropertiescontext.cxx
-oox/source/drawingml/effectpropertiescontext.hxx
 oox/source/drawingml/fillproperties.cxx
 oox/source/drawingml/graphicshapecontext.cxx
 oox/source/drawingml/guidcontext.cxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[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 

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

2020-11-18 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/scene3dcontext.hxx   |   13 +++-
 oox/inc/drawingml/shape3dproperties.hxx|7 +++-
 oox/inc/drawingml/textbody.hxx |5 +++
 oox/source/drawingml/scene3dcontext.cxx|   33 +
 oox/source/drawingml/shape.cxx |   20 
 oox/source/drawingml/shape3dproperties.cxx |   30 +--
 oox/source/drawingml/textbodypropertiescontext.cxx |2 -
 oox/source/export/drawingml.cxx|   28 +++--
 oox/source/export/shapes.cxx   |   12 +++
 9 files changed, 126 insertions(+), 24 deletions(-)

New commits:
commit 72998fc859a83f063698c287d035f3fdc8b4481c
Author: Gülşah Köse 
AuthorDate: Tue Nov 17 12:43:12 2020 +0300
Commit: Gülşah Köse 
CommitDate: Wed Nov 18 10:36:07 2020 +0100

tdf#128213 Fix text camera z rotation import and export.

Text3DProperties is added to distinguish shape and text 3D effects.
Before there was implementation error about text camera z rotation
support. We were using shape effects for text. We already have not
support shape 3D rotation but we have text camera z rotation. This
patch includes import and export filter changes about text camera z
rotation.

Change-Id: I623392b82edf4585888d2f15ad91ffb2109d8f96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106033
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/scene3dcontext.hxx 
b/oox/inc/drawingml/scene3dcontext.hxx
index efc9e694f659..400cfff98063 100644
--- a/oox/inc/drawingml/scene3dcontext.hxx
+++ b/oox/inc/drawingml/scene3dcontext.hxx
@@ -41,14 +41,23 @@ private:
 class Scene3DPropertiesContext final : public ::oox::core::ContextHandler2
 {
 public:
-Scene3DPropertiesContext( ::oox::core::ContextHandler2Helper const & 
rParent, Shape3DProperties& r3DProperties ) throw();
-
+Scene3DPropertiesContext( ::oox::core::ContextHandler2Helper const & 
rParent, Shape3DProperties& rShape3DProperties ) throw();
 ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const 
::oox::AttributeList& rAttribs ) override;
 
 private:
 Shape3DProperties& mr3DProperties;
 };
 
+class SceneText3DPropertiesContext final : public ::oox::core::ContextHandler2
+{
+public:
+SceneText3DPropertiesContext( ::oox::core::ContextHandler2Helper const & 
rParent, Text3DProperties& rText3DProperties ) throw();
+::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const 
::oox::AttributeList& rAttribs ) override;
+
+private:
+Text3DProperties& mr3DProperties;
+};
+
 class Shape3DPropertiesContext final : public ::oox::core::ContextHandler2
 {
 public:
diff --git a/oox/inc/drawingml/shape3dproperties.hxx 
b/oox/inc/drawingml/shape3dproperties.hxx
index 683a771b8bdc..c43e643aae5c 100644
--- a/oox/inc/drawingml/shape3dproperties.hxx
+++ b/oox/inc/drawingml/shape3dproperties.hxx
@@ -44,7 +44,7 @@ struct BevelProperties
 OptValue< sal_Int32 > mnHeight;
 };
 
-struct Shape3DProperties
+struct Generic3DProperties
 {
 OptValue< sal_Int32 > mnPreset;
 OptValue< float > mfFieldOfVision;
@@ -79,6 +79,11 @@ struct Shape3DProperties
 const Color& rColor, const GraphicHelper& rGraphicHelper, ::Color 
rPhClr );
 };
 
+struct Shape3DProperties : Generic3DProperties
+{};
+
+struct Text3DProperties : Generic3DProperties
+{};
 
 } // namespace oox::drawingml
 
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index db4c03c6f702..5e6d156e7ce4 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::text {
 class XText;
@@ -53,6 +54,9 @@ public:
 const TextBodyProperties&   getTextProperties() const { return 
maTextProperties; }
 TextBodyProperties& getTextProperties() { return 
maTextProperties; }
 
+Text3DProperties&   get3DProperties() { return 
ma3DProperties; }
+const Text3DProperties& get3DProperties() const { return 
ma3DProperties; }
+
 /** insert the text body at the text cursor */
 voidinsertAt(
 const ::oox::core::XmlFilterBase& rFilterBase,
@@ -72,6 +76,7 @@ protected:
 TextParagraphVector maParagraphs;
 TextBodyProperties  maTextProperties;
 TextListStyle   maTextListStyle;
+Text3DPropertiesma3DProperties;
 };
 
 }
diff --git a/oox/source/drawingml/scene3dcontext.cxx 
b/oox/source/drawingml/scene3dcontext.cxx
index 262d2dfe61ea..91b73f0bbd95 100644
--- a/oox/source/drawingml/scene3dcontext.cxx
+++ b/oox/source/drawingml/scene3dcontext.cxx
@@ -63,6 +63,39 @@ ContextHandlerRef Scene3DPropertiesContext::onCreateContext( 
sal_Int32 aElementT
 return nullptr;
 }
 
+SceneText3DPropertiesContext::SceneText3DPropertiesContext( 

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

2020-11-14 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/textparagraphproperties.hxx   |2 +
 oox/source/drawingml/textparagraph.cxx  |   14 ++-
 oox/source/drawingml/textparagraphproperties.cxx|7 +++
 oox/source/drawingml/textparagraphpropertiescontext.cxx |   32 +++-
 4 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit c9619a5f6c351ede0dbfb3cf07df0ac9b74c2992
Author: Gülşah Köse 
AuthorDate: Thu Nov 12 01:52:15 2020 +0300
Commit: Gülşah Köse 
CommitDate: Sat Nov 14 22:06:22 2020 +0100

tdf#138148 Protect aspect ratio of graphic bullets.

Change-Id: I166d547cdc01853fd81436c6cdc8d64b0fe817be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105618
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index 23a177d289f5..7dd41610024b 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -54,6 +54,7 @@ public:
 void setSuffixNone();
 void setSuffixMinusRight();
 void setBulletSize(sal_Int16 nSize);
+void setBulletAspectRatio(double nAspectRatio);
 void setFontSize(sal_Int16 nSize);
 void setStyleName( const OUString& rStyleName ) { maStyleName <<= 
rStyleName; }
 void setGraphic( css::uno::Reference< css::graphic::XGraphic > const & 
rXGraphic );
@@ -68,6 +69,7 @@ public:
 css::uno::Any   msNumberingPrefix;
 css::uno::Any   msNumberingSuffix;
 css::uno::Any   mnSize;
+css::uno::Any   mnAspectRatio; // Width/Height
 css::uno::Any   mnFontSize;
 css::uno::Any   maStyleName;
 css::uno::Any   maGraphic;
diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index 21c8d44c0079..8aa4d8895040 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -144,11 +144,23 @@ void TextParagraph::insertAt(
 {
 tools::Long nFirstCharHeightMm = 
TransformMetric(nCharHeightFirst > 0 ? nCharHeightFirst : 1200, 
FieldUnit::POINT, FieldUnit::MM);
 float fBulletSizeRel = 1.f;
+double fBulletAspectRatio = 1.0;
+
 if( aParaProp.getBulletList().mnSize.hasValue() )
 fBulletSizeRel = 
aParaProp.getBulletList().mnSize.get() / 100.f;
 
+if( aParaProp.getBulletList().mnAspectRatio.hasValue() )
+fBulletAspectRatio = 
aParaProp.getBulletList().mnAspectRatio.get();
+
 css::awt::Size aBulletSize;
-aBulletSize.Width = aBulletSize.Height = 
std::lround(fBulletSizeRel * nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR);
+if( fBulletAspectRatio != 1.0 )
+{
+aBulletSize.Height = std::lround(fBulletSizeRel * 
nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR);
+aBulletSize.Width = aBulletSize.Height * 
fBulletAspectRatio;
+}
+else
+aBulletSize.Width = aBulletSize.Height = 
std::lround(fBulletSizeRel * nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR);
+
 aioBulletList.setProperty( PROP_GraphicSize, aBulletSize);
 }
 
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 8121edb156ff..197f0e51f28a 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -246,6 +246,11 @@ void BulletList::setBulletSize(sal_Int16 nSize)
 mnSize <<= nSize;
 }
 
+void BulletList::setBulletAspectRatio(double nAspectRatio)
+{
+mnAspectRatio <<= nAspectRatio;
+}
+
 void BulletList::setFontSize(sal_Int16 nSize)
 {
 mnFontSize <<= nSize;
@@ -272,6 +277,8 @@ void BulletList::apply( const BulletList& rSource )
 msNumberingSuffix = rSource.msNumberingSuffix;
 if ( rSource.mnSize.hasValue() )
 mnSize = rSource.mnSize;
+if ( rSource.mnAspectRatio.hasValue() )
+mnAspectRatio = rSource.mnAspectRatio;
 if ( rSource.mnFontSize.hasValue() )
 mnFontSize = rSource.mnFontSize;
 if ( rSource.maStyleName.hasValue() )
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index b58d8952ca76..e81101f85ec2 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -22,6 +22,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -43,8 +46,32 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::xml::sax;
 using namespace ::com::sun::star::style;
 using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::graphic;
 
 namespace 

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

2020-09-29 Thread Regényi Balázs (via logerrit)
 oox/inc/drawingml/textbodyproperties.hxx|2 +
 oox/source/drawingml/shape.cxx  |7 
 oox/source/drawingml/textbodypropertiescontext.cxx  |4 +-
 oox/source/export/drawingml.cxx |   19 +-
 sc/qa/unit/data/xlsx/tdf91251_missingOverflowRoundtrip.xlsx |binary
 sc/qa/unit/subsequent_export-test.cxx   |   21 
 6 files changed, 49 insertions(+), 4 deletions(-)

New commits:
commit 79737c8b0d84d4967c5f1c41b740a8a52db8b551
Author: Regényi Balázs 
AuthorDate: Tue Sep 22 17:12:59 2020 +0200
Commit: László Németh 
CommitDate: Tue Sep 29 12:26:25 2020 +0200

tdf#91251 XLSX textbox export: fix missing overflow properties

by grab-bagging them.

Co-authored-by: Szabolcs Toth

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

diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index 26e34ac6a5f7..8a51c2bb906e 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -46,6 +46,8 @@ struct TextBodyProperties
 sal_Int32 mnNumCol = 1;
 /// Normal autofit: font scale (default: 100%).
 sal_Int32 mnFontScale = 10;
+OUString msHorzOverflow;
+OUString msVertOverflow;
 
 explicitTextBodyProperties();
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index ddc5a96b8018..5af4d51cbfd4 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1429,6 +1429,13 @@ Reference< XShape > const & Shape::createAndInsert(
degrees anticlockwise. */
 mpCustomShapePropertiesPtr->setTextRotateAngle(-1 * 
nTextRotateAngle / 6);
 }
+
+auto sHorzOverflow = 
getTextBody()->getTextProperties().msHorzOverflow;
+if (!sHorzOverflow.isEmpty())
+putPropertyToGrabBag("horzOverflow", 
uno::makeAny(getTextBody()->getTextProperties().msHorzOverflow));
+auto nVertOverflow = 
getTextBody()->getTextProperties().msVertOverflow;
+if (!nVertOverflow.isEmpty())
+putPropertyToGrabBag("vertOverflow", 
uno::makeAny(getTextBody()->getTextProperties().msVertOverflow));
 }
 
 // Note that the script 
oox/source/drawingml/customshapes/generatePresetsData.pl looks
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx 
b/oox/source/drawingml/textbodypropertiescontext.cxx
index d3add310097f..6a6d9e90ef63 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -80,9 +80,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( 
ContextHandler2Helper cons
 mrTextBodyProp.maPropertyMap.setProperty(PROP_FromWordArt, bFromWordArt);
 
   // ST_TextHorzOverflowType
-//   sal_Int32 nHorzOverflow = rAttribs.getToken( XML_horzOverflow, 
XML_overflow );
+mrTextBodyProp.msHorzOverflow = rAttribs.getString(XML_horzOverflow, "");
 // ST_TextVertOverflowType
-//   sal_Int32 nVertOverflow =  rAttribs.getToken( XML_vertOverflow, 
XML_overflow );
+mrTextBodyProp.msVertOverflow = rAttribs.getString(XML_vertOverflow, "");
 
 // ST_TextColumnCount
 mrTextBodyProp.mnNumCol = rAttribs.getInteger( XML_numCol, 1 );
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8ea8035ea39a..0612fe56ed43 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2955,18 +2955,31 @@ void DrawingML::WriteText(const Reference& 
rXIface, bool bBodyPr, bo
 }
 
 bool isUpright = false;
+std::optional sHorzOverflow;
+std::optional sVertOverflow;
 if (GetProperty(rXPropSet, "InteropGrabBag"))
 {
 if 
(rXPropSet->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
 {
 uno::Sequence aGrabBag;
 rXPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
-for (auto& aProp : aGrabBag)
+for (const auto& aProp : std::as_const(aGrabBag))
 {
 if (aProp.Name == "Upright")
 {
 aProp.Value >>= isUpright;
-break;
+}
+else if (aProp.Name == "horzOverflow")
+{
+OUString sValue;
+aProp.Value >>= sValue;
+sHorzOverflow = sValue;
+}
+else if (aProp.Name == "vertOverflow")
+{
+OUString sValue;
+aProp.Value >>= sValue;
+  

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

2020-09-24 Thread Szabolcs Toth (via logerrit)
 oox/inc/drawingml/textbodyproperties.hxx   |1 
 oox/source/drawingml/shape.cxx |   24 +--
 oox/source/drawingml/textbodypropertiescontext.cxx |5 +-
 oox/source/export/drawingml.cxx|   37 -
 sc/qa/unit/data/xlsx/tdf106197_import_upright.xlsx |binary
 sc/qa/unit/subsequent_filters-test.cxx |   45 +
 6 files changed, 89 insertions(+), 23 deletions(-)

New commits:
commit 8c23be49fb5a9044989532e6e20feb1e3ff64f2b
Author: Szabolcs Toth 
AuthorDate: Wed Sep 16 14:41:24 2020 +0200
Commit: László Németh 
CommitDate: Thu Sep 24 12:54:14 2020 +0200

tdf#106197 XLSX shape import: keep text upright

Handle and grab-bag attribute upright to keep
text upright regardless of shape rotation, fixing
the text direction after import and after a round-trip.

Co-authored-by: Balázs Regényi

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

diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index 6e5e97fb94ba..26e34ac6a5f7 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -34,6 +34,7 @@ struct TextBodyProperties
 OptValue< sal_Int32 >   moRotation;
 boolmbAnchorCtr;
 OptValue< sal_Int32 >   moVert;
+boolmoUpright = false;
 std::optional< sal_Int32 >moInsets[4];
 std::optional< sal_Int32 >moTextOffUpper;
 std::optional< sal_Int32 >moTextOffLeft;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 02b89312d200..326d90be3ffd 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1409,10 +1409,26 @@ Reference< XShape > const & Shape::createAndInsert(
 sal_Int32 nTextRotateAngle = static_cast< sal_Int32 >( 
getTextBody()->getTextProperties().moRotation.get( 0 ) );
 
 nTextRotateAngle -= mnDiagramRotation;
-/* OOX measures text rotation clockwise in 1/6th degrees,
-   relative to the containing shape. setTextRotateAngle wants
-   degrees anticlockwise. */
-mpCustomShapePropertiesPtr->setTextRotateAngle( -1 * 
nTextRotateAngle / 6 );
+
+bool isUpright = getTextBody()->getTextProperties().moUpright;
+if (isUpright)
+{
+// When upright is set, we want the text without any 
rotation.
+// But if we set 0 here, the text is still rotated if the
+// shape containing it is rotated.
+// Hence, we rotate the text into the the opposite 
direction of
+// the rotation of the shape, by as much as the shape was 
rotated.
+mpCustomShapePropertiesPtr->setTextRotateAngle(mnRotation 
/ 6);
+// Also put this away in a Gabbag.
+putPropertyToGrabBag("Upright", Any(isUpright));
+}
+else
+{
+/* OOX measures text rotation clockwise in 1/6th 
degrees,
+   relative to the containing shape. setTextRotateAngle 
wants
+   degrees anticlockwise. */
+mpCustomShapePropertiesPtr->setTextRotateAngle(-1 * 
nTextRotateAngle / 6);
+}
 }
 
 // Note that the script 
oox/source/drawingml/customshapes/generatePresetsData.pl looks
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx 
b/oox/source/drawingml/textbodypropertiescontext.cxx
index b72fa194401a..d3add310097f 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -94,7 +94,10 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( 
ContextHandler2Helper cons
 // ST_PositiveCoordinate
 //   sal_Int32 nSpcCol = rAttribs.getInteger( XML_spcCol, 0 );
 //   bool bSpcFirstLastPara = rAttribs.getBool( XML_spcFirstLastPara, 0 );
-//   bool bUpRight = rAttribs.getBool( XML_upright, 0 );
+
+bool bUpright = rAttribs.getBool(XML_upright, false);
+if (bUpright)
+mrTextBodyProp.moUpright = true;
 
 // ST_TextVerticalType
 if( rAttribs.hasAttribute( XML_vert ) ) {
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8d3cbd23a6a7..8ea8035ea39a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2932,24 +2932,6 @@ void DrawingML::WriteText(const Reference& 
rXIface, bool bBodyPr, bo
 else if( bVertical && 

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

2020-08-09 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/table/tableproperties.hxx|2 +-
 oox/source/drawingml/table/tableproperties.cxx |5 -
 oox/source/ppt/pptshape.cxx|2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 7b64bd90637a6722438bf873b1ded74ab3424c46
Author: Gülşah Köse 
AuthorDate: Fri Aug 7 14:53:13 2020 +0300
Commit: Gülşah Köse 
CommitDate: Mon Aug 10 06:18:12 2020 +0200

tdf#133015 Do not import multicol table text on master.

Change-Id: I0a1b1dc2f9b314858ed90347065407bcd1dbbb73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100311
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/table/tableproperties.hxx 
b/oox/inc/drawingml/table/tableproperties.hxx
index dcdf41b17ed0..ec8b3c4c5b60 100644
--- a/oox/inc/drawingml/table/tableproperties.hxx
+++ b/oox/inc/drawingml/table/tableproperties.hxx
@@ -59,7 +59,7 @@ public:
 const ::oox::drawingml::TextListStylePtr& pMasterTextListStyle );
 
 /// Distributes text body with multiple columns in table cells.
-void pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, sal_Int32 
nShapeWidth, bool bhasSameSubTypeIndex);
+void pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, sal_Int32 
nShapeWidth, bool bhasSameSubTypeIndex, bool bMaster);
 
 private:
 
diff --git a/oox/source/drawingml/table/tableproperties.cxx 
b/oox/source/drawingml/table/tableproperties.cxx
index 1ecea1363659..bf7d0dcfe7a2 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -207,7 +207,7 @@ void TableProperties::pushToPropSet(const 
::oox::core::XmlFilterBase& rFilterBas
 xTableStyleToDelete.reset();
 }
 
-void TableProperties::pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, 
sal_Int32 nShapeWidth, bool bhasSameSubTypeIndex)
+void TableProperties::pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, 
sal_Int32 nShapeWidth, bool bhasSameSubTypeIndex, bool bMaster)
 {
 // Create table grid and a single row.
 sal_Int32 nNumCol = pTextBody->getTextProperties().mnNumCol;
@@ -245,6 +245,9 @@ void 
TableProperties::pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, sa
 // Copy properties provided by .
 pCellTextBody->getTextListStyle() = pTextBody->getTextListStyle();
 
+if (bMaster)
+continue;
+
 for (sal_Int32 nParaInCol = 0; nParaInCol < nParaPerCol; ++nParaInCol)
 {
 if (nPara < pTextBody->getParagraphs().size())
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index d4d251d2ceb0..647435888fe3 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -236,7 +236,7 @@ void PPTShape::addShape(
 // represent that as a table.
 sServiceName = "com.sun.star.drawing.TableShape";
 oox::drawingml::table::TablePropertiesPtr pTableProperties 
= getTableProperties();
-pTableProperties->pullFromTextBody(pTextBody, 
maSize.Width, bhasSameSubTypeIndex);
+pTableProperties->pullFromTextBody(pTextBody, 
maSize.Width, bhasSameSubTypeIndex, meShapeLocation == Layout);
 setTextBody(nullptr);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-22 Thread Miklos Vajna (via logerrit)
 oox/inc/drawingml/colorchoicecontext.hxx|   15 +
 oox/source/drawingml/colorchoicecontext.cxx |   25 
 oox/source/drawingml/diagram/diagram.cxx|   17 +-
 oox/source/drawingml/diagram/diagram.hxx|   16 ++
 oox/source/drawingml/diagram/diagramfragmenthandler.cxx |   15 +++--
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |   20 +++-
 oox/source/drawingml/diagram/diagramlayoutatoms.hxx |3 +
 oox/source/drawingml/diagram/layoutatomvisitors.cxx |4 +-
 sd/qa/unit/data/pptx/fill-color-list.pptx   |binary
 sd/qa/unit/import-tests-smartart.cxx|   19 
 10 files changed, 105 insertions(+), 29 deletions(-)

New commits:
commit 12bea6c897822964ad4705418da54411cb15749e
Author: Miklos Vajna 
AuthorDate: Fri May 22 17:58:22 2020 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 22 18:46:16 2020 +0200

smartart import: handle multiple  in 

The TODO in the ColorFragmentHandler ctor was right: we only handled the
last  child, but there can be multiple one.

Use them based on the index of a shape in a  loop.

Move the TODO to the only place which still assumes a single color in
the color list.

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

diff --git a/oox/inc/drawingml/colorchoicecontext.hxx 
b/oox/inc/drawingml/colorchoicecontext.hxx
index 433c94b3addb..093c832cb1e6 100644
--- a/oox/inc/drawingml/colorchoicecontext.hxx
+++ b/oox/inc/drawingml/colorchoicecontext.hxx
@@ -22,6 +22,8 @@
 
 #include 
 
+#include 
+
 namespace oox {
 namespace drawingml {
 
@@ -65,6 +67,19 @@ private:
 Color&  mrColor;
 };
 
+/// Same as ColorContext, but handles multiple colors.
+class ColorsContext : public ::oox::core::ContextHandler2
+{
+public:
+explicit ColorsContext(::oox::core::ContextHandler2Helper const& rParent,
+   std::vector& rColors);
+
+virtual ::oox::core::ContextHandlerRef
+onCreateContext(sal_Int32 nElement, const ::oox::AttributeList& rAttribs) 
override;
+
+private:
+std::vector& mrColors;
+};
 
 } // namespace drawingml
 } // namespace oox
diff --git a/oox/source/drawingml/colorchoicecontext.cxx 
b/oox/source/drawingml/colorchoicecontext.cxx
index 0a4c627833ee..fc93b460a8de 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -148,6 +148,31 @@ ColorContext::ColorContext( ContextHandler2Helper const & 
rParent, Color& rColor
 return nullptr;
 }
 
+ColorsContext::ColorsContext(ContextHandler2Helper const& rParent, 
std::vector& rColors)
+: ContextHandler2(rParent)
+, mrColors(rColors)
+{
+}
+
+::oox::core::ContextHandlerRef ColorsContext::onCreateContext(sal_Int32 
nElement,
+  const 
AttributeList&)
+{
+switch (nElement)
+{
+case A_TOKEN(scrgbClr):
+case A_TOKEN(srgbClr):
+case A_TOKEN(hslClr):
+case A_TOKEN(sysClr):
+case A_TOKEN(schemeClr):
+case A_TOKEN(prstClr):
+{
+mrColors.emplace_back();
+return new ColorValueContext(*this, mrColors.back());
+}
+}
+return nullptr;
+}
+
 } // namespace oox::drawingml
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/diagram/diagram.cxx 
b/oox/source/drawingml/diagram/diagram.cxx
index efe03fd6ff2f..5a4fef99cfcb 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -321,9 +321,11 @@ void loadDiagram( ShapePtr const & pShape,
 if( !pData->getExtDrawings().empty() )
 {
 const DiagramColorMap::const_iterator aColor = 
pDiagram->getColors().find("node0");
-if( aColor != pDiagram->getColors().end() )
+if( aColor != pDiagram->getColors().end() && 
!aColor->second.maTextFillColors.empty())
 {
-pShape->setFontRefColorForNodes(aColor->second.maTextFillColor);
+// TODO(F1): well, actually, there might be *several* color
+// definitions in it, after all it's called list.
+
pShape->setFontRefColorForNodes(DiagramColor::getColorByIndex(aColor->second.maTextFillColors,
 -1));
 }
 }
 
@@ -425,6 +427,17 @@ void reloadDiagram(SdrObject* pObj, core::XmlFilterBase& 
rFilter)
 child->addShape(rFilter, rFilter.getCurrentTheme(), xShapes, 
aTransformation, pShape->getFillProperties());
 }
 
+const oox::drawingml::Color&
+DiagramColor::getColorByIndex(const std::vector& 
rColors, sal_Int32 nIndex)
+{
+assert(!rColors.empty());
+if (nIndex == -1)
+{
+return rColors[rColors.size() - 1];
+}
+
+return rColors[nIndex % rColors.size()];
+}
 }
 
 /* vim:set 

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

2020-03-09 Thread Gabor Kelemen (via logerrit)
 oox/IwyuFilter_oox.yaml   |6 ++
 oox/inc/drawingml/chart/axismodel.hxx |1 -
 oox/inc/drawingml/chart/converterbase.hxx |1 -
 oox/inc/drawingml/customshapegeometry.hxx |2 --
 oox/inc/drawingml/embeddedwavaudiofile.hxx|2 +-
 oox/inc/drawingml/fillproperties.hxx  |1 -
 oox/inc/drawingml/graphicproperties.hxx   |2 --
 oox/inc/drawingml/lineproperties.hxx  |1 -
 oox/inc/drawingml/presetgeometrynames.hxx |1 -
 oox/inc/drawingml/shape3dproperties.hxx   |4 
 oox/inc/drawingml/table/tablecell.hxx |7 +--
 oox/inc/drawingml/table/tablecellcontext.hxx  |2 +-
 oox/inc/drawingml/table/tableproperties.hxx   |2 --
 oox/inc/drawingml/table/tablestylepart.hxx|4 
 oox/inc/drawingml/textbodycontext.hxx |2 --
 oox/inc/drawingml/textfield.hxx   |1 -
 oox/inc/drawingml/textparagraphproperties.hxx |2 --
 oox/inc/drawingml/textparagraphpropertiescontext.hxx  |2 --
 oox/inc/drawingml/textspacing.hxx |2 --
 oox/inc/ooxresid.hxx  |3 +--
 oox/source/docprop/docprophandler.hxx |1 -
 oox/source/docprop/ooxmldocpropimport.cxx |1 +
 oox/source/docprop/ooxmldocpropimport.hxx |1 -
 oox/source/drawingml/chart/axismodel.cxx  |1 +
 oox/source/drawingml/chart/objectformatter.cxx|1 +
 oox/source/drawingml/diagram/constraintlistcontext.hxx|1 -
 oox/source/drawingml/diagram/datamodel.cxx|1 +
 oox/source/drawingml/diagram/datamodel.hxx|3 +--
 oox/source/drawingml/diagram/diagramfragmenthandler.hxx   |3 ++-
 oox/source/drawingml/diagram/diagramlayoutatoms.hxx   |1 -
 oox/source/drawingml/diagram/layoutatomvisitorbase.hxx|3 ---
 oox/source/drawingml/diagram/layoutatomvisitors.hxx   |4 +---
 oox/source/drawingml/diagram/layoutnodecontext.hxx|1 -
 oox/source/drawingml/hyperlinkcontext.hxx |1 -
 oox/source/drawingml/table/tablecontext.cxx   |1 +
 oox/source/drawingml/table/tablestylecellstylecontext.cxx |1 +
 oox/source/drawingml/textcharacterpropertiescontext.cxx   |1 +
 oox/source/drawingml/textparagraphproperties.cxx  |1 +
 oox/source/drawingml/textparagraphpropertiescontext.cxx   |1 +
 oox/source/ppt/animationtypes.hxx |1 -
 oox/source/ppt/commonbehaviorcontext.cxx  |1 +
 oox/source/ppt/commonbehaviorcontext.hxx  |6 +++---
 oox/source/ppt/commontimenodecontext.cxx  |1 +
 oox/source/ppt/commontimenodecontext.hxx  |1 -
 oox/source/ppt/conditioncontext.hxx   |1 -
 oox/source/ppt/extdrawingfragmenthandler.cxx  |1 +
 oox/source/ppt/extdrawingfragmenthandler.hxx  |3 ---
 oox/source/shape/ShapeContextHandler.cxx  |2 ++
 oox/source/shape/ShapeContextHandler.hxx  |3 ---
 oox/source/shape/ShapeDrawingFragmentHandler.cxx  |1 +
 oox/source/shape/ShapeDrawingFragmentHandler.hxx  |2 +-
 51 files changed, 33 insertions(+), 66 deletions(-)

New commits:
commit b114e5659b94c0cc4bf9fe11c7d9e8d41223406d
Author: Gabor Kelemen 
AuthorDate: Sat Mar 7 09:15:39 2020 +0100
Commit: Miklos Vajna 
CommitDate: Mon Mar 9 11:54:45 2020 +0100

tdf#42949 Fix IWYU warnings in oox/*/*hxx

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

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

diff --git a/oox/IwyuFilter_oox.yaml b/oox/IwyuFilter_oox.yaml
new file mode 100644
index ..8b3931312af3
--- /dev/null
+++ b/oox/IwyuFilter_oox.yaml
@@ -0,0 +1,6 @@
+---
+assumeFilename: oox/source/export/drawingml.cxx
+blacklist:
+oox/source/docprop/docprophandler.hxx:
+# Needed for macro defines
+- oox/token/namespaces.hxx
diff --git a/oox/inc/drawingml/chart/axismodel.hxx 
b/oox/inc/drawingml/chart/axismodel.hxx
index 11cf8dfd910e..8f1f9046aed8 100644
--- a/oox/inc/drawingml/chart/axismodel.hxx
+++ b/oox/inc/drawingml/chart/axismodel.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_OOX_DRAWINGML_CHART_AXISMODEL_HXX
 
 #include 
-#include 
 #include 
 
 namespace oox {
diff --git a/oox/inc/drawingml/chart/converterbase.hxx 
b/oox/inc/drawingml/chart/converterbase.hxx
index 183bb16dfc59..9a29783ec027 100644
--- a/oox/inc/drawingml/chart/converterbase.hxx
+++ 

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

2020-01-14 Thread Noel Grandin (via logerrit)
 oox/inc/drawingml/ThemeOverrideFragmentHandler.hxx|2 
 oox/inc/drawingml/chart/axiscontext.hxx   |   10 ++--
 oox/inc/drawingml/chart/axisconverter.hxx |4 -
 oox/inc/drawingml/chart/chartcontextbase.hxx  |4 -
 oox/inc/drawingml/chart/chartdrawingfragment.hxx  |2 
 oox/inc/drawingml/chart/chartspaceconverter.hxx   |2 
 oox/inc/drawingml/chart/chartspacefragment.hxx|2 
 oox/inc/drawingml/chart/converterbase.hxx |2 
 oox/inc/drawingml/chart/datasourcecontext.hxx |6 +-
 oox/inc/drawingml/chart/datasourceconverter.hxx   |4 -
 oox/inc/drawingml/chart/plotareacontext.hxx   |8 +--
 oox/inc/drawingml/chart/plotareaconverter.hxx |8 +--
 oox/inc/drawingml/chart/seriescontext.hxx |   30 +++---
 oox/inc/drawingml/chart/seriesconverter.hxx   |   14 +++---
 oox/inc/drawingml/chart/titlecontext.hxx  |8 +--
 oox/inc/drawingml/chart/titleconverter.hxx|6 +-
 oox/inc/drawingml/chart/typegroupcontext.hxx  |   18 
 oox/inc/drawingml/chart/typegroupconverter.hxx|4 -
 oox/inc/drawingml/clrschemecontext.hxx|6 +-
 oox/inc/drawingml/colorchoicecontext.hxx  |2 
 oox/inc/drawingml/customshapegeometry.hxx |6 +-
 oox/inc/drawingml/guidcontext.hxx |2 
 oox/inc/drawingml/misccontexts.hxx|   18 
 oox/inc/drawingml/scene3dcontext.hxx  |6 +-
 oox/inc/drawingml/table/tablebackgroundstylecontext.hxx   |2 
 oox/inc/drawingml/table/tablecontext.hxx  |2 
 oox/inc/drawingml/table/tablepartstylecontext.hxx |2 
 oox/inc/drawingml/table/tablerowcontext.hxx   |2 
 oox/inc/drawingml/table/tablestylecellstylecontext.hxx|2 
 oox/inc/drawingml/table/tablestylecontext.hxx |2 
 oox/inc/drawingml/table/tablestylelistfragmenthandler.hxx |2 
 oox/inc/drawingml/table/tablestyletextstylecontext.hxx|2 
 oox/inc/drawingml/textfield.hxx   |2 
 oox/inc/drawingml/textfieldcontext.hxx|2 
 oox/inc/drawingml/themeelementscontext.hxx|2 
 35 files changed, 98 insertions(+), 98 deletions(-)

New commits:
commit f076e09e7222ade29e73b839579178ac5f134778
Author: Noel Grandin 
AuthorDate: Tue Jan 14 10:44:05 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 14 13:38:15 2020 +0100

loplugin:finalclasses in oox

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

diff --git a/oox/inc/drawingml/ThemeOverrideFragmentHandler.hxx 
b/oox/inc/drawingml/ThemeOverrideFragmentHandler.hxx
index 266a88c2ad6a..dc5ce5a61366 100644
--- a/oox/inc/drawingml/ThemeOverrideFragmentHandler.hxx
+++ b/oox/inc/drawingml/ThemeOverrideFragmentHandler.hxx
@@ -17,7 +17,7 @@ namespace drawingml {
 
 class Theme;
 
-class ThemeOverrideFragmentHandler : public ::oox::core::FragmentHandler2
+class ThemeOverrideFragmentHandler final : public ::oox::core::FragmentHandler2
 {
 public:
 explicitThemeOverrideFragmentHandler(
diff --git a/oox/inc/drawingml/chart/axiscontext.hxx 
b/oox/inc/drawingml/chart/axiscontext.hxx
index 4544bedf45e3..5db36b914131 100644
--- a/oox/inc/drawingml/chart/axiscontext.hxx
+++ b/oox/inc/drawingml/chart/axiscontext.hxx
@@ -31,7 +31,7 @@ struct AxisDispUnitsModel;
 
 /** Handler for a value axis display units context (c:dispUnits element).
  */
-class AxisDispUnitsContext : public ContextBase< AxisDispUnitsModel >
+class AxisDispUnitsContext final : public ContextBase< AxisDispUnitsModel >
 {
 public:
 explicitAxisDispUnitsContext( 
::oox::core::ContextHandler2Helper& rParent, AxisDispUnitsModel& rModel );
@@ -58,7 +58,7 @@ public:
 
 /** Handler for a category axis context (c:catAx element).
  */
-class CatAxisContext : public AxisContextBase
+class CatAxisContext final : public AxisContextBase
 {
 public:
 explicitCatAxisContext( ::oox::core::ContextHandler2Helper& 
rParent, AxisModel& rModel );
@@ -70,7 +70,7 @@ public:
 
 /** Handler for a date axis context (c:dateAx element).
  */
-class DateAxisContext : public AxisContextBase
+class DateAxisContext final : public AxisContextBase
 {
 public:
 explicitDateAxisContext( ::oox::core::ContextHandler2Helper& 
rParent, AxisModel& rModel );
@@ -82,7 +82,7 @@ public:
 
 /** Handler for a series axis context (c:serAx element).
  */
-class SerAxisContext : public AxisContextBase
+class SerAxisContext final : public AxisContextBase
 {
 public:
 explicitSerAxisContext( ::oox::core::ContextHandler2Helper& 
rParent, AxisModel& 

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

2019-12-06 Thread nd101 (via logerrit)
 oox/inc/drawingml/table/tableproperties.hxx|2 ++
 oox/source/drawingml/table/tablecell.cxx   |6 ++
 oox/source/drawingml/table/tablecontext.cxx|2 ++
 oox/source/drawingml/table/tableproperties.cxx |1 +
 sd/qa/unit/data/pptx/tdf127237.pptx|binary
 sd/qa/unit/export-tests-ooxml1.cxx |   22 ++
 6 files changed, 33 insertions(+)

New commits:
commit 4c2254cbebca53c34fa48a1dd90cebe434f24274
Author: nd101 
AuthorDate: Mon Sep 2 10:29:12 2019 +0800
Commit: Miklos Vajna 
CommitDate: Fri Dec 6 15:01:48 2019 +0100

tdf#127237 fix table background color in Impress import

When the background color is set at the table level in PPTX,
instead of at cell level, the background color fails to
show up in Impress.

Change-Id: I2838e5b56e4a2414494ee99c0f8975b7256ac6dc
Reviewed-on: https://gerrit.libreoffice.org/78377
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/inc/drawingml/table/tableproperties.hxx 
b/oox/inc/drawingml/table/tableproperties.hxx
index dd50cd7a694d..010fc67df416 100644
--- a/oox/inc/drawingml/table/tableproperties.hxx
+++ b/oox/inc/drawingml/table/tableproperties.hxx
@@ -54,6 +54,7 @@ public:
 voidsetBandRow(bool b)  { mbBandRow = b; };
 boolisBandCol() const   { return 
mbBandCol; };
 voidsetBandCol(bool b)  { mbBandCol = b; };
+Color&  getBgColor(){ return maBgColor; };
 
 void pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBase,
 const css::uno::Reference < css::beans::XPropertySet > & xPropSet,
@@ -70,6 +71,7 @@ private:
 std::shared_ptr< TableStyle >   mpTableStyle;   // or the 
complete TableStyle
 std::vector< sal_Int32 >mvTableGrid;
 std::vector< TableRow > mvTableRows;
+Color   maBgColor;
 
 boolmbFirstRow;
 boolmbFirstCol;
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 48f73b269e6a..24e1a5f89c1c 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -424,6 +424,12 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase& rFilterBase, cons
 applyLineAttributes( rFilterBase, xPropSet, 
aLinePropertiesTopLeftToBottomRight, PROP_DiagonalTLBR );
 applyLineAttributes( rFilterBase, xPropSet, 
aLinePropertiesBottomLeftToTopRight, PROP_DiagonalBLTR );
 
+if (rProperties.getBgColor().isUsed() && 
!maFillProperties.maFillColor.isUsed() && maFillProperties.moFillType.get() == 
XML_noFill)
+{
+maFillProperties.moFillType = XML_solidFill;
+maFillProperties.maFillColor = rProperties.getBgColor();
+}
+
 aFillProperties.assignUsed( maFillProperties );
 ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper() );
 
diff --git a/oox/source/drawingml/table/tablecontext.cxx 
b/oox/source/drawingml/table/tablecontext.cxx
index 3371e105f691..90191f615d4d 100644
--- a/oox/source/drawingml/table/tablecontext.cxx
+++ b/oox/source/drawingml/table/tablecontext.cxx
@@ -57,6 +57,8 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, 
const AttributeList& r
 mrTableProperties.setBandCol( rAttribs.getBool( XML_bandCol, false 
) );
 }
 break;
+case A_TOKEN(solidFill):
+return new ColorContext(*this, mrTableProperties.getBgColor());
 case A_TOKEN( tableStyle ): // CT_TableStyle
 {
 std::shared_ptr< TableStyle >& rTableStyle = 
mrTableProperties.getTableStyle();
diff --git a/oox/source/drawingml/table/tableproperties.cxx 
b/oox/source/drawingml/table/tableproperties.cxx
index b6d8bf378127..b58439e5d714 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -49,6 +49,7 @@ TableProperties::TableProperties()
 , mbBandRow( false )
 , mbBandCol( false )
 {
+maBgColor.setUnused();
 }
 
 static void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, 
const std::vector< TableRow >& rvTableRows )
diff --git a/sd/qa/unit/data/pptx/tdf127237.pptx 
b/sd/qa/unit/data/pptx/tdf127237.pptx
new file mode 100644
index ..f63423cd47e8
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf127237.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 79b18b7cb914..769bf6e52456 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -55,6 +55,7 @@ class SdOOXMLExportTest1 : public SdModelTestBaseXML
 {
 public:
 void testFdo90607();
+void testTdf127237();
 void testBnc870233_1();
 void testBnc870233_2();
 void testN828390_4();
@@ -93,6 +94,7 @@ public:
 

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

2019-10-01 Thread Grzegorz Araminowicz (via logerrit)
 oox/inc/drawingml/textbody.hxx |1 +
 oox/source/drawingml/diagram/datamodel.cxx |9 -
 oox/source/drawingml/textbody.cxx  |8 
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit a8356ceb0f9345ebd5171439e3b882642f5fbad5
Author: Grzegorz Araminowicz 
AuthorDate: Mon Sep 30 13:09:13 2019 +0200
Commit: Grzegorz Araminowicz 
CommitDate: Tue Oct 1 21:25:02 2019 +0200

SmartArt edit UI: fix crash on empty node text

Change-Id: Idacbbb50cbdd8ae4c78f3159bc362c7ee2137149
Reviewed-on: https://gerrit.libreoffice.org/79848
Tested-by: Jenkins
Reviewed-by: Grzegorz Araminowicz 

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index 835f1c34b792..38996abe03ea 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -62,6 +62,7 @@ public:
 const TextCharacterProperties& 
rTextStyleProperties,
 const TextListStylePtr& pMasterTextListStyle ) 
const;
 bool isEmpty() const;
+OUString toString() const;
 
 voidApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
diff --git a/oox/source/drawingml/diagram/datamodel.cxx 
b/oox/source/drawingml/diagram/datamodel.cxx
index bfbd67537171..fcad85bd3d6a 100644
--- a/oox/source/drawingml/diagram/datamodel.cxx
+++ b/oox/source/drawingml/diagram/datamodel.cxx
@@ -96,7 +96,7 @@ void DiagramData::getChildrenString(OUStringBuffer& rBuf, 
const dgm::Point* pPoi
 rBuf.append('\t');
 rBuf.append('+');
 rBuf.append(' ');
-
rBuf.append(pPoint->mpShape->getTextBody()->getParagraphs().front()->getRuns().front()->getText());
+rBuf.append(pPoint->mpShape->getTextBody()->toString());
 rBuf.append('\n');
 }
 
@@ -136,7 +136,7 @@ std::vector> 
DiagramData::getChildren(const OUStri
 if (pChild != maPointNameMap.end())
 aChildren[rCxn.mnSourceOrder] = std::make_pair(
 pChild->second->msModelId,
-
pChild->second->mpShape->getTextBody()->getParagraphs().front()->getRuns().front()->getText());
+pChild->second->mpShape->getTextBody()->toString());
 }
 
 // HACK: empty items shouldn't appear there
@@ -361,8 +361,7 @@ void DiagramData::build()
 // does currpoint have any text set?
 if( point.mpShape &&
 point.mpShape->getTextBody() &&
-!point.mpShape->getTextBody()->getParagraphs().empty() &&
-
!point.mpShape->getTextBody()->getParagraphs().front()->getRuns().empty() )
+!point.mpShape->getTextBody()->isEmpty() )
 {
 #ifdef DEBUG_OOX_DIAGRAM
 static sal_Int32 nCount=0;
@@ -371,7 +370,7 @@ void DiagramData::build()
<< " ["
<< "label=\""
<< OUStringToOString(
-   
point.mpShape->getTextBody()->getParagraphs().front()->getRuns().front()->getText(),
+   point.mpShape->getTextBody()->toString(),
RTL_TEXTENCODING_UTF8).getStr()
<< "\"" << "];" << std::endl;
 output << "\t"
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 55989a470a3f..80ebb4d2287d 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -96,6 +96,14 @@ bool TextBody::isEmpty() const
 return aRuns[0]->getText().getLength() <= 0;
 }
 
+OUString TextBody::toString() const
+{
+if (!isEmpty())
+return maParagraphs.front()->getRuns().front()->getText();
+else
+return OUString();
+}
+
 void TextBody::ApplyStyleEmpty(
 const ::oox::core::XmlFilterBase& rFilterBase,
 const Reference < XText > & xText,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-13 Thread Gabor Kelemen (via logerrit)
 oox/inc/strings.hrc  |2 +-
 oox/source/drawingml/chart/axisconverter.cxx |4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit e3b70f23edd28531bae357386e90fd44a18ae24e
Author: Gabor Kelemen 
AuthorDate: Fri Jul 5 08:53:18 2019 +0200
Commit: Andras Timar 
CommitDate: Sun Jul 14 00:11:32 2019 +0200

tdf#126192 Translate automatic axis labels

Change-Id: I7f5e765536198a7ac216e1ff9df55102e23cb1d7
Reviewed-on: https://gerrit.libreoffice.org/75294
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/oox/inc/strings.hrc b/oox/inc/strings.hrc
index dcb0744d593f..89a6d9a115a6 100644
--- a/oox/inc/strings.hrc
+++ b/oox/inc/strings.hrc
@@ -13,6 +13,6 @@
 #define NC_(Context, String) reinterpret_cast(Context "\004" 
u8##String)
 
 #define STR_DIAGRAM_TITLENC_("STR_DIAGRAM_TITLE", 
"Chart Title")
-
+#define STR_DIAGRAM_AXISTITLENC_("STR_DIAGRAM_AXISTITLE", 
"Axis Title")
 #endif
 /* 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/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index f35cd5333e70..a98e1b51223e 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -18,6 +18,8 @@
  */
 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -360,7 +362,7 @@ void AxisConverter::convertFromModel(
 {
 Reference< XTitled > xTitled( xAxis, UNO_QUERY_THROW );
 TitleConverter aTitleConv( *this, *mrModel.mxTitle );
-aTitleConv.convertFromModel( xTitled, "Axis Title", 
OBJECTTYPE_AXISTITLE, nAxesSetIdx, nAxisIdx );
+aTitleConv.convertFromModel( xTitled, 
OoxResId(STR_DIAGRAM_AXISTITLE), OBJECTTYPE_AXISTITLE, nAxesSetIdx, nAxisIdx );
 }
 
 // axis data unit label ---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-17 Thread Regina Henschel (via logerrit)
 oox/inc/drawingml/presetgeometrynames.hxx|1 
 oox/source/drawingml/presetgeometrynames.cxx |   21 +++
 oox/source/export/drawingml.cxx  |   62 +-
 oox/source/export/shapes.cxx |   73 +--
 4 files changed, 139 insertions(+), 18 deletions(-)

New commits:
commit 2be2c914ed48823304c2e95a836ee93a08853628
Author: Regina Henschel 
AuthorDate: Fri Jun 14 19:10:36 2019 +0200
Commit: Regina Henschel 
CommitDate: Mon Jun 17 18:48:14 2019 +0200

tdf#51195, tdf#100348 Convert Fontwork to TextWarp on export

LibreOffice has Fontwork as property text-path in enhanced-custom-
geometry. OOXML has the similar TextWarp as property of a textbox. The
patch converts the custom shape to a textbox and sets the attribute
prstTxWarp. Fill and outline of the Fontwork is lost. The import and
export of fill and outline is tracked in tdf#119221 and still needs
to be fixed.

Change-Id: I8ea7b305d7d0a8367d61c1789f22b56d274a311d
Reviewed-on: https://gerrit.libreoffice.org/74057
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-by: Regina Henschel 

diff --git a/oox/inc/drawingml/presetgeometrynames.hxx 
b/oox/inc/drawingml/presetgeometrynames.hxx
index 51721e41febd..358fc9acefb6 100644
--- a/oox/inc/drawingml/presetgeometrynames.hxx
+++ b/oox/inc/drawingml/presetgeometrynames.hxx
@@ -16,6 +16,7 @@
 namespace PresetGeometryTypeNames
 {
 OOX_DLLPUBLIC OUString GetFontworkType(const OUString& rMsoType);
+OOX_DLLPUBLIC OUString GetMsoName(const OUString& rFontworkType);
 }
 
 #endif
diff --git a/oox/source/drawingml/presetgeometrynames.cxx 
b/oox/source/drawingml/presetgeometrynames.cxx
index 272094dd7ef6..dea972dc1476 100644
--- a/oox/source/drawingml/presetgeometrynames.cxx
+++ b/oox/source/drawingml/presetgeometrynames.cxx
@@ -91,4 +91,25 @@ OUString PresetGeometryTypeNames::GetFontworkType(const 
OUString& rMsoType)
 return OUString(pRetValue, strlen(pRetValue), RTL_TEXTENCODING_ASCII_US);
 }
 
+OUString PresetGeometryTypeNames::GetMsoName(const OUString& rFontworkType)
+{
+static const PresetGeometryHashMap s_HashMapInv = []() {
+PresetGeometryHashMap aHInv;
+for (const auto& item : pPresetGeometryNameArray)
+aHInv[item.pFontworkType] = item.pMsoName;
+return aHInv;
+}();
+const char* pRetValue = "";
+int i, nLen = rFontworkType.getLength();
+std::unique_ptr pBuf(new char[nLen + 1]);
+for (i = 0; i < nLen; i++)
+pBuf[i] = static_cast(rFontworkType[i]);
+pBuf[i] = 0;
+PresetGeometryHashMap::const_iterator 
aHashIter(s_HashMapInv.find(pBuf.get()));
+if (aHashIter != s_HashMapInv.end())
+pRetValue = (*aHashIter).second;
+
+return OUString(pRetValue, strlen(pRetValue), RTL_TEXTENCODING_ASCII_US);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index c87cb3a1f617..575878a11171 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2544,6 +2544,7 @@ void DrawingML::WriteText( const Reference< XInterface >& 
rXIface, const OUStrin
 return;
 
 sal_Int32 nTextRotateAngle = 0;
+bool bIsFontworkShape(presetWarp.startsWith("text") && (presetWarp != 
"textNoShape"));
 
 #define DEFLRINS 254
 #define DEFTBINS 127
@@ -2582,6 +2583,8 @@ void DrawingML::WriteText( const Reference< XInterface >& 
rXIface, const OUStrin
 }
 }
 
+SequenceaAdjustmentSeq;
+
 if (GetProperty(rXPropSet, "CustomShapeGeometry"))
 {
 Sequence< PropertyValue > aProps;
@@ -2601,8 +2604,11 @@ void DrawingML::WriteText( const Reference< XInterface 
>& rXIface, const OUStrin
 sWritingMode = "vert270";
 bVertical = true;
 }
-break;
+if (!bIsFontworkShape)
+break;
 }
+else if (aProps[i].Name == "AdjustmentValues")
+aProps[i].Value >>= aAdjustmentSeq;
 }
 }
 }
@@ -2647,10 +2653,60 @@ void DrawingML::WriteText( const Reference< XInterface 
>& rXIface, const OUStrin
XML_anchorCtr, bHorizontalCenter ? "1" : 
nullptr,
XML_vert, sWritingMode,
XML_rot, (nTextRotateAngle != 0) ? 
oox::drawingml::calcRotationValue( nTextRotateAngle * 100 ).getStr() : nullptr 
);
-if( !presetWarp.isEmpty())
+if (bIsFontworkShape)
 {
-mpFS->singleElementNS(XML_a, XML_prstTxWarp, XML_prst, 
presetWarp.toUtf8());
+if (aAdjustmentSeq.getLength() > 0)
+{
+mpFS->startElementNS(XML_a, XML_prstTxWarp, XML_prst, 
presetWarp.toUtf8());
+mpFS->startElementNS(XML_a, XML_avLst);
+

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

2019-05-13 Thread Tamas Bunth (via logerrit)
 oox/inc/drawingml/graphicproperties.hxx |3 ++-
 oox/source/drawingml/fillproperties.cxx |   12 ++--
 oox/source/drawingml/shape.cxx  |   17 ++---
 3 files changed, 26 insertions(+), 6 deletions(-)

New commits:
commit f4ba484183a1e7b9824f10580d633466c266828f
Author: Tamas Bunth 
AuthorDate: Mon May 13 01:02:07 2019 +0200
Commit: Tamás Bunth 
CommitDate: Mon May 13 18:14:26 2019 +0200

ooxml import: supprt cropping to shape

Change-Id: I7bdc959921ecb0cbf19037a78b63eaeb8fc52814
Reviewed-on: https://gerrit.libreoffice.org/72206
Tested-by: Jenkins
Reviewed-by: Tamás Bunth 

diff --git a/oox/inc/drawingml/graphicproperties.hxx 
b/oox/inc/drawingml/graphicproperties.hxx
index 01dd96cf8f2d..7a227f8cc949 100644
--- a/oox/inc/drawingml/graphicproperties.hxx
+++ b/oox/inc/drawingml/graphicproperties.hxx
@@ -40,12 +40,13 @@ struct GraphicProperties
 {
 BlipFillProperties  maBlipProps;///< Properties for the 
graphic.
 OUStringm_sMediaPackageURL; ///< Audio/Video URL.
+boolmbIsCustomShape = false;
 css::uno::Reference m_xMediaStream; ///< 
Audio/Video input stream.
 
 /** Writes the properties to the passed property map. */
 voidpushToPropMap(
 PropertyMap& rPropMap,
-const GraphicHelper& rGraphicHelper ) const;
+const GraphicHelper& rGraphicHelper) const;
 };
 
 } // namespace drawingml
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 0b99d83733f3..9c5338ce8975 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -739,7 +739,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 }
 }
 
-void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const 
GraphicHelper& rGraphicHelper ) const
+void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const 
GraphicHelper& rGraphicHelper) const
 {
 sal_Int16 nBrightness = getLimitedValue< sal_Int16, sal_Int32 >( 
maBlipProps.moBrightness.get( 0 ) / PER_PERCENT, -100, 100 );
 sal_Int16 nContrast = getLimitedValue< sal_Int16, sal_Int32 >( 
maBlipProps.moContrast.get( 0 ) / PER_PERCENT, -100, 100 );
@@ -770,7 +770,15 @@ void GraphicProperties::pushToPropMap( PropertyMap& 
rPropMap, const GraphicHelpe
 nBrightness = 0;
 nContrast = 0;
 }
-rPropMap.setProperty(PROP_Graphic, xGraphic);
+if(mbIsCustomShape)
+{
+// it is a cropped graphic.
+rPropMap.setProperty(PROP_FillStyle, FillStyle_BITMAP);
+rPropMap.setProperty(PROP_FillBitmapMode, BitmapMode_STRETCH);
+rPropMap.setProperty(PROP_FillBitmap, xGraphic);
+}
+else
+rPropMap.setProperty(PROP_Graphic, xGraphic);
 
 // cropping
 if ( maBlipProps.moClipRect.has() )
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 64c80568f7a8..1003b66e386c 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -658,8 +658,18 @@ Reference< XShape > const & Shape::createAndInsert(
 {
 aServiceName = finalizeServiceName( rFilterBase, rServiceName, 
aShapeRectHmm );
 }
+// Use custom shape instead of GraphicObjectShape if the image is cropped 
to
+// shape. Except rectangle, which does not require further cropping
+bool bIsCroppedGraphic = (aServiceName == 
"com.sun.star.drawing.GraphicObjectShape" && 
mpCustomShapePropertiesPtr->getShapePresetType() >= 0
+&& mpCustomShapePropertiesPtr->getShapePresetType() != XML_Rect && 
mpCustomShapePropertiesPtr->getShapePresetType() != XML_rect);
 bool bIsCustomShape = ( aServiceName == "com.sun.star.drawing.CustomShape" 
||
-aServiceName == 
"com.sun.star.drawing.ConnectorShape" );
+aServiceName == 
"com.sun.star.drawing.ConnectorShape" ||
+bIsCroppedGraphic);
+if(bIsCroppedGraphic)
+{
+aServiceName = "com.sun.star.drawing.CustomShape";
+mpGraphicPropertiesPtr->mbIsCustomShape = true;
+}
 bool bUseRotationTransform = ( !mbWps ||
 aServiceName == "com.sun.star.drawing.LineShape" ||
 aServiceName == "com.sun.star.drawing.GroupShape" ||
@@ -971,13 +981,14 @@ Reference< XShape > const & Shape::createAndInsert(
 // applying properties
 aShapeProps.assignUsed( getShapeProperties() );
 aShapeProps.assignUsed( maDefaultShapeProperties );
-if ( bIsEmbMedia || aServiceName == 
"com.sun.star.drawing.GraphicObjectShape" || aServiceName == 
"com.sun.star.drawing.OLE2Shape" )
+if ( bIsEmbMedia || aServiceName == 
"com.sun.star.drawing.GraphicObjectShape" || aServiceName == 
"com.sun.star.drawing.OLE2Shape" || bIsCustomShape 

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

2018-10-18 Thread Libreoffice Gerrit user
 oox/inc/drawingml/diagram/diagram.hxx   |3 
 oox/source/drawingml/diagram/diagram.cxx|   67 +++-
 oox/source/drawingml/graphicshapecontext.cxx|3 
 oox/source/ppt/dgmimport.cxx|4 -
 sd/qa/unit/data/pptx/smartart-vertial-box-list.pptx |binary
 sd/qa/unit/import-tests-smartart.cxx|   15 
 6 files changed, 86 insertions(+), 6 deletions(-)

New commits:
commit a7e86beb00e9635ea4556ef4f8f8e24ff9965391
Author: Miklos Vajna 
AuthorDate: Thu Oct 18 14:43:23 2018 +0200
Commit: Miklos Vajna 
CommitDate: Thu Oct 18 17:51:00 2018 +0200

oox: ignore SmartArt "fallback" with empty shape list

This way at least something shows up in the import result. Far from
perfect, though.

Change-Id: Iae5a073d458598e7b5059ebdf435d50ce7c7df80
Reviewed-on: https://gerrit.libreoffice.org/61925
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/oox/inc/drawingml/diagram/diagram.hxx 
b/oox/inc/drawingml/diagram/diagram.hxx
index 5277d98d2dee..a528668c08b4 100644
--- a/oox/inc/drawingml/diagram/diagram.hxx
+++ b/oox/inc/drawingml/diagram/diagram.hxx
@@ -39,7 +39,8 @@ void loadDiagram( ShapePtr const & pShape,
   const OUString& rDataModelPath,
   const OUString& rLayoutPath,
   const OUString& rQStylePath,
-  const OUString& rColorStylePath );
+  const OUString& rColorStylePath,
+  const oox::core::Relations& rRelations );
 
 void loadDiagram( const ShapePtr& pShape,
   core::XmlFilterBase& rFilter,
diff --git a/oox/source/drawingml/diagram/diagram.cxx 
b/oox/source/drawingml/diagram/diagram.cxx
index 901995bc2039..edbb6b4ebf59 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "diagramlayoutatoms.hxx"
 #include "layoutatomvisitors.hxx"
@@ -376,12 +377,57 @@ static void importFragment( core::XmlFilterBase& rFilter,
 rFilter.importFragment( rxHandler, xSerializer );
 }
 
+namespace
+{
+/**
+ * A fragment handler that just counts the number of  elements in a
+ * fragment.
+ */
+class DiagramShapeCounter : public oox::core::FragmentHandler2
+{
+public:
+DiagramShapeCounter(oox::core::XmlFilterBase& rFilter, const OUString& 
rFragmentPath,
+sal_Int32& nCounter);
+oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement,
+ const AttributeList& 
rAttribs) override;
+
+private:
+sal_Int32& m_nCounter;
+};
+
+DiagramShapeCounter::DiagramShapeCounter(oox::core::XmlFilterBase& rFilter,
+ const OUString& rFragmentPath, 
sal_Int32& nCounter)
+: FragmentHandler2(rFilter, rFragmentPath)
+, m_nCounter(nCounter)
+{
+}
+
+oox::core::ContextHandlerRef DiagramShapeCounter::onCreateContext(sal_Int32 
nElement,
+  const 
AttributeList& /*rAttribs*/)
+{
+switch (nElement)
+{
+case DSP_TOKEN(drawing):
+case DSP_TOKEN(spTree):
+return this;
+case DSP_TOKEN(sp):
+++m_nCounter;
+break;
+default:
+break;
+}
+
+return nullptr;
+}
+}
+
 void loadDiagram( ShapePtr const & pShape,
   core::XmlFilterBase& rFilter,
   const OUString& rDataModelPath,
   const OUString& rLayoutPath,
   const OUString& rQStylePath,
-  const OUString& rColorStylePath )
+  const OUString& rColorStylePath,
+  const oox::core::Relations& rRelations )
 {
 DiagramPtr pDiagram( new Diagram );
 
@@ -408,11 +454,26 @@ void loadDiagram( ShapePtr const & pShape,
 
 // Pass the info to pShape
 for (auto const& extDrawing : pData->getExtDrawings())
-pShape->addExtDrawingRelId(extDrawing);
+{
+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( pData->getExtDrawings().empty() )
+if( pShape->getExtDrawings().empty() )
 {
 // layout
 if( !rLayoutPath.isEmpty() )
diff --git 

[Libreoffice-commits] core.git: oox/inc oox/Library_oox.mk oox/source oox/util solenv/bin

2018-09-28 Thread Libreoffice Gerrit user
 oox/Library_oox.mk|1 
 oox/inc/pch/precompiled_oox.hxx   |1 
 oox/inc/services.hxx  |   37 -
 oox/source/core/fasttokenhandler.cxx  |2 -
 oox/source/core/filterdetect.cxx  |2 -
 oox/source/core/services.cxx  |   51 --
 oox/source/docprop/ooxmldocpropimport.cxx |1 
 oox/source/ppt/dgmimport.cxx  |2 -
 oox/source/ppt/dgmlayout.cxx  |2 -
 oox/source/ppt/pptimport.cxx  |2 -
 oox/source/shape/ShapeContextHandler.cxx  |   35 +++-
 oox/util/oox.component|5 +-
 solenv/bin/native-code.py |2 -
 13 files changed, 16 insertions(+), 127 deletions(-)

New commits:
commit ff4a319f51fc0ea4eb2baafa22d59f51b6e46a6f
Author: Miklos Vajna 
AuthorDate: Fri Sep 28 12:09:58 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 28 15:10:45 2018 +0200

oox: create ShapeContextHandler instances with an uno constructor

Change-Id: Ie780ff9f3a8c61d13ad10cc2dbe24d3ec165470e
Reviewed-on: https://gerrit.libreoffice.org/61063
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index e917a9b866d3..941b3a1d270a 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -96,7 +96,6 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/core/recordparser \
 oox/source/core/relations \
 oox/source/core/relationshandler \
-oox/source/core/services \
 oox/source/core/xmlfilterbase \
 oox/source/crypto/AgileEngine \
 oox/source/crypto/CryptTools \
diff --git a/oox/inc/pch/precompiled_oox.hxx b/oox/inc/pch/precompiled_oox.hxx
index 2bfc8539945a..222e9663fca5 100644
--- a/oox/inc/pch/precompiled_oox.hxx
+++ b/oox/inc/pch/precompiled_oox.hxx
@@ -187,7 +187,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
deleted file mode 100644
index f790ce525a6b..
--- a/oox/inc/services.hxx
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_OOX_INC_SERVICES_HXX
-#define INCLUDED_OOX_INC_SERVICES_HXX
-
-#include 
-
-namespace oox {
-namespace shape {
-extern OUString ShapeContextHandler_getImplementationName();
-extern css::uno::Sequence< OUString > 
ShapeContextHandler_getSupportedServiceNames();
-/// @throws css::uno::Exception
-extern css::uno::Reference< css::uno::XInterface > 
ShapeContextHandler_createInstance(
-const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
-}
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/fasttokenhandler.cxx 
b/oox/source/core/fasttokenhandler.cxx
index 9925204fef46..489044bbbd97 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -24,8 +24,6 @@
 #include 
 #include 
 
-#include 
-
 using namespace ::com::sun::star;
 
 namespace oox {
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index cbbaae3ed333..a2e34ecd7168 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -36,8 +36,6 @@
 
 #include 
 
-#include 
-
 using namespace ::com::sun::star;
 
 namespace oox {
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
deleted file mode 100644
index 5c18b9544767..
--- a/oox/source/core/services.cxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or 

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

2018-09-21 Thread Libreoffice Gerrit user
 oox/inc/drawingml/textbodyproperties.hxx   |2 ++
 oox/inc/drawingml/textcharacterproperties.hxx  |2 ++
 oox/source/drawingml/table/tableproperties.cxx |   14 +-
 oox/source/drawingml/textbodypropertiescontext.cxx |3 +++
 oox/source/drawingml/textcharacterproperties.cxx   |3 +++
 sd/qa/unit/import-tests.cxx|   12 
 6 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit c8b2849d140677f7b35523096eb2bc715b3dc507
Author: Miklos Vajna 
AuthorDate: Fri Sep 21 16:28:58 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 21 19:57:02 2018 +0200

Related: tdf#120028 PPTX import: fix font size of multi-col shape text

Normal shapes have a TextFitToSize property for this, but table cell
content has to be scaled manually, as the rendering has no automatic
support for them. Luckily the file format has the info we need to scale
at import time.

Change-Id: Ibbcc4b8685995261536cce88b8c0774e148f708e
Reviewed-on: https://gerrit.libreoffice.org/60880
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index 247851ef6cc8..785f117568a9 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -44,6 +44,8 @@ struct TextBodyProperties
 OUStringmsPrst;
 /// Number of requested columns.
 sal_Int32 mnNumCol = 1;
+/// Normal autofit: font scale (default: 100%).
+sal_Int32 mnFontScale = 10;
 
 explicitTextBodyProperties();
 
diff --git a/oox/inc/drawingml/textcharacterproperties.hxx 
b/oox/inc/drawingml/textcharacterproperties.hxx
index 4dfab74e3c1f..a034121e47d0 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -47,6 +47,8 @@ struct TextCharacterProperties
 Color   maHighlightColor;
 OptValue< OUString > moLang;
 OptValue< sal_Int32 > moHeight;
+/// If a font scale has to be applied manually to moHeight.
+OptValue< double > moFontScale;
 OptValue< sal_Int32 > moSpacing;
 OptValue< sal_Int32 > moUnderline;
 OptValue< sal_Int32 > moBaseline;
diff --git a/oox/source/drawingml/table/tableproperties.cxx 
b/oox/source/drawingml/table/tableproperties.cxx
index 8a59bae15738..39ab4cd19eac 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -321,6 +322,8 @@ void 
TableProperties::pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, sa
 // Create the cells and distribute the paragraphs from pTextBody.
 sal_Int32 nNumPara = pTextBody->getParagraphs().size();
 sal_Int32 nParaPerCol = std::ceil(double(nNumPara) / nNumCol);
+// Font scale of text body will be applied at a text run level.
+sal_Int32 nFontScale = pTextBody->getTextProperties().mnFontScale;
 size_t nPara = 0;
 for (sal_Int32 nCol = 0; nCol < nNumCol; ++nCol)
 {
@@ -331,7 +334,16 @@ void 
TableProperties::pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, sa
 for (sal_Int32 nParaInCol = 0; nParaInCol < nParaPerCol; ++nParaInCol)
 {
 if (nPara < pTextBody->getParagraphs().size())
-
pCellTextBody->appendParagraph(pTextBody->getParagraphs()[nPara]);
+{
+std::shared_ptr pParagraph
+= pTextBody->getParagraphs()[nPara];
+if (nFontScale != 10)
+{
+for (auto& pRun : pParagraph->getRuns())
+pRun->getTextCharacterProperties().moFontScale = 
nFontScale;
+}
+pCellTextBody->appendParagraph(pParagraph);
+}
 ++nPara;
 }
 }
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx 
b/oox/source/drawingml/textbodypropertiescontext.cxx
index 0684de52a7c8..9c18536a4a86 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -155,9 +155,12 @@ ContextHandlerRef 
TextBodyPropertiesContext::onCreateContext( sal_Int32 aElement
 mrTextBodyProp.maPropertyMap.setProperty( 
PROP_TextAutoGrowHeight, false);   // CT_TextNoAutofit
 break;
 case A_TOKEN( normAutofit ):// CT_TextNormalAutofit
+{
 mrTextBodyProp.maPropertyMap.setProperty( PROP_TextFitToSize, 
TextFitToSizeType_AUTOFIT);
 mrTextBodyProp.maPropertyMap.setProperty( 
PROP_TextAutoGrowHeight, false);
+mrTextBodyProp.mnFontScale = 
rAttribs.getInteger(XML_fontScale, 10);
 break;
+}
 case A_TOKEN( spAutoFit ):
 {

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

2018-09-21 Thread Libreoffice Gerrit user
 oox/inc/drawingml/table/tableproperties.hxx|3 +
 oox/inc/drawingml/textbody.hxx |2 +
 oox/inc/drawingml/textbodyproperties.hxx   |2 +
 oox/source/drawingml/table/tableproperties.cxx |   32 +
 oox/source/drawingml/textbody.cxx  |5 +++
 oox/source/drawingml/textbodypropertiescontext.cxx |2 -
 oox/source/ppt/pptshape.cxx|   18 +++
 sd/qa/unit/data/pptx/tdf120028.pptx|binary
 sd/qa/unit/import-tests.cxx|   26 +
 9 files changed, 89 insertions(+), 1 deletion(-)

New commits:
commit aef569ed83a3ccc02639e5b2a1c7cc131ba262fc
Author: Miklos Vajna 
AuthorDate: Fri Sep 21 11:50:57 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 21 13:30:20 2018 +0200

tdf#120028 PPTX import: map shapes with multiple columns to table shapes

Longer term the core Impress shape has to be improved so that it can have
text in multiple columns.

Shorter term, map text with multiple columns to table shapes, that gives
correct layout in many cases and requires changes to the import filter
only.

Change-Id: Id7942b16882ab1f083ded2f0e577e8c9e128697c
Reviewed-on: https://gerrit.libreoffice.org/60859
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/oox/inc/drawingml/table/tableproperties.hxx 
b/oox/inc/drawingml/table/tableproperties.hxx
index af6671a81f23..dd50cd7a694d 100644
--- a/oox/inc/drawingml/table/tableproperties.hxx
+++ b/oox/inc/drawingml/table/tableproperties.hxx
@@ -59,6 +59,9 @@ public:
 const css::uno::Reference < css::beans::XPropertySet > & xPropSet,
 const ::oox::drawingml::TextListStylePtr& pMasterTextListStyle );
 
+/// Distributes text body with multiple columns in table cells.
+void pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, sal_Int32 
nShapeWidth);
+
 private:
 
 const TableStyle&   getUsedTableStyle(const 
::oox::core::XmlFilterBase& rFilterBase, std::unique_ptr& 
rTableStyleToDelete);
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index c2b0c5acc762..835f1c34b792 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -45,6 +45,8 @@ public:
 
 const TextParagraphVector&  getParagraphs() const { return 
maParagraphs; }
 TextParagraph&  addParagraph();
+/// Appends an existing paragraph to this text body.
+void appendParagraph(std::shared_ptr pTextParagraph);
 
 const TextListStyle&getTextListStyle() const { return 
maTextListStyle; }
 TextListStyle&  getTextListStyle() { return 
maTextListStyle; }
diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index 62ee3190ae58..247851ef6cc8 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -42,6 +42,8 @@ struct TextBodyProperties
 boost::optional< sal_Int32 >moTextOffRight;
 css::drawing::TextVerticalAdjustmeVA;
 OUStringmsPrst;
+/// Number of requested columns.
+sal_Int32 mnNumCol = 1;
 
 explicitTextBodyProperties();
 
diff --git a/oox/source/drawingml/table/tableproperties.cxx 
b/oox/source/drawingml/table/tableproperties.cxx
index 3701e1ecac9b..8a59bae15738 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -304,6 +305,37 @@ void TableProperties::pushToPropSet( const 
::oox::core::XmlFilterBase& rFilterBa
 xTableStyleToDelete.reset();
 }
 
+void TableProperties::pullFromTextBody(oox::drawingml::TextBodyPtr pTextBody, 
sal_Int32 nShapeWidth)
+{
+// Create table grid and a single row.
+sal_Int32 nNumCol = pTextBody->getTextProperties().mnNumCol;
+std::vector& rTableGrid(getTableGrid());
+sal_Int32 nColWidth = nShapeWidth / nNumCol;
+for (sal_Int32 nCol = 0; nCol < nNumCol; ++nCol)
+rTableGrid.push_back(nColWidth);
+std::vector& rTableRows(getTableRows());
+rTableRows.emplace_back();
+oox::drawingml::table::TableRow& rTableRow = rTableRows.back();
+std::vector& rTableCells = 
rTableRow.getTableCells();
+
+// Create the cells and distribute the paragraphs from pTextBody.
+sal_Int32 nNumPara = pTextBody->getParagraphs().size();
+sal_Int32 nParaPerCol = std::ceil(double(nNumPara) / nNumCol);
+size_t nPara = 0;
+for (sal_Int32 nCol = 0; nCol < nNumCol; ++nCol)
+{
+rTableCells.emplace_back();
+oox::drawingml::table::TableCell& rTableCell = rTableCells.back();
+TextBodyPtr pCellTextBody(new TextBody);
+rTableCell.setTextBody(pCellTextBody);
+for (sal_Int32 

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

2018-09-21 Thread Libreoffice Gerrit user
 oox/inc/services.hxx |7 ---
 oox/source/core/services.cxx |1 -
 oox/source/ppt/dgmlayout.cxx |   26 --
 3 files changed, 8 insertions(+), 26 deletions(-)

New commits:
commit ec3c4775a52bc2bb498f67c5937545fc40c65daa
Author: Miklos Vajna 
AuthorDate: Thu Sep 20 21:58:27 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 21 09:28:36 2018 +0200

oox: create QuickDiagrammingLayout instances with an uno constructor

This is effectively dead code as commit
547217ecf2348cf511b1f058ecbab6f15f2bceff (Document seemingly dead
QuickDiagrammingImport, QuickDiagrammingLayout, 2013-06-03) found, so
the primary motivation is to just get this out of
oox_component_getFactory().

Change-Id: Ibfee57202f0a3b02847b1298ce8895c8cf312322
Reviewed-on: https://gerrit.libreoffice.org/60840
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
index e4becd9f6d4f..f790ce525a6b 100644
--- a/oox/inc/services.hxx
+++ b/oox/inc/services.hxx
@@ -23,13 +23,6 @@
 #include 
 
 namespace oox {
-namespace ppt {
-extern OUString QuickDiagrammingLayout_getImplementationName();
-extern css::uno::Sequence< OUString > 
QuickDiagrammingLayout_getSupportedServiceNames();
-/// @throws css::uno::Exception
-extern css::uno::Reference< css::uno::XInterface > 
QuickDiagrammingLayout_createInstance(
-const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
-}
 namespace shape {
 extern OUString ShapeContextHandler_getImplementationName();
 extern css::uno::Sequence< OUString > 
ShapeContextHandler_getSupportedServiceNames();
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index 4f4f4b76528e..5c18b9544767 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -35,7 +35,6 @@ namespace {
 // Impress" would actually want to make use of them:
 static ::cppu::ImplementationEntry const spServices[] =
 {
-IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingLayout ),
 IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ),
 { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
 };
diff --git a/oox/source/ppt/dgmlayout.cxx b/oox/source/ppt/dgmlayout.cxx
index c4ff54bcf492..6d941dee0f4d 100644
--- a/oox/source/ppt/dgmlayout.cxx
+++ b/oox/source/ppt/dgmlayout.cxx
@@ -43,23 +43,6 @@ using namespace ::oox::drawingml;
 
 namespace oox { namespace ppt {
 
-OUString QuickDiagrammingLayout_getImplementationName()
-{
-return OUString( "com.sun.star.comp.Impress.oox.QuickDiagrammingLayout" );
-}
-
-uno::Sequence< OUString > QuickDiagrammingLayout_getSupportedServiceNames()
-{
-const OUString aServiceName = "com.sun.star.comp.ooxpptx.dgm.layout";
-const Sequence< OUString > aSeq( , 1 );
-return aSeq;
-}
-
-uno::Reference< uno::XInterface > QuickDiagrammingLayout_createInstance( const 
Reference< XComponentContext >& rxContext )
-{
-return static_cast(new QuickDiagrammingLayout( 
rxContext ));
-}
-
 QuickDiagrammingLayout::QuickDiagrammingLayout( const Reference< 
XComponentContext >& rxContext )
 : XmlFilterBase( rxContext ),
 mpThemePtr(new drawingml::Theme())
@@ -159,7 +142,7 @@ const oox::drawingml::table::TableStyleListPtr 
QuickDiagrammingLayout::getTableS
 
 OUString QuickDiagrammingLayout::getImplementationName()
 {
-return QuickDiagrammingLayout_getImplementationName();
+return OUString( "com.sun.star.comp.Impress.oox.QuickDiagrammingLayout" );
 }
 
 ::oox::ole::VbaProject* QuickDiagrammingLayout::implCreateVbaProject() const
@@ -169,4 +152,11 @@ OUString QuickDiagrammingLayout::getImplementationName()
 
 }}
 
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_oox_ppt_QuickDiagrammingLayout_get_implementation(
+uno::XComponentContext* pCtx, uno::Sequence const& /*rSeq*/)
+{
+return cppu::acquire(new oox::ppt::QuickDiagrammingLayout(pCtx));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-14 Thread Libreoffice Gerrit user
 oox/inc/services.hxx |7 ---
 oox/source/core/services.cxx |1 -
 oox/source/ppt/dgmimport.cxx |   26 --
 3 files changed, 8 insertions(+), 26 deletions(-)

New commits:
commit 515f97e3dd279ca8487f6f6038045511f0e1db51
Author: Miklos Vajna 
AuthorDate: Thu Sep 13 22:38:57 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 14 09:05:07 2018 +0200

oox: create QuickDiagrammingImport instances with an uno constructor

This is effectively dead code as commit
547217ecf2348cf511b1f058ecbab6f15f2bceff (Document seemingly dead
QuickDiagrammingImport, QuickDiagrammingLayout, 2013-06-03) found, so
the primary motivation is to just get this out of
oox_component_getFactory().

Change-Id: If0a585c2fc4b87ceb00e6f772fef2ac65d10dc67
Reviewed-on: https://gerrit.libreoffice.org/60470
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
index 7140a5b87d80..e4becd9f6d4f 100644
--- a/oox/inc/services.hxx
+++ b/oox/inc/services.hxx
@@ -24,13 +24,6 @@
 
 namespace oox {
 namespace ppt {
-extern OUString QuickDiagrammingImport_getImplementationName();
-extern css::uno::Sequence< OUString > 
QuickDiagrammingImport_getSupportedServiceNames();
-/// @throws css::uno::Exception
-extern css::uno::Reference< css::uno::XInterface > 
QuickDiagrammingImport_createInstance(
-const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
-}
-namespace ppt {
 extern OUString QuickDiagrammingLayout_getImplementationName();
 extern css::uno::Sequence< OUString > 
QuickDiagrammingLayout_getSupportedServiceNames();
 /// @throws css::uno::Exception
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index c336022110a2..4f4f4b76528e 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -35,7 +35,6 @@ namespace {
 // Impress" would actually want to make use of them:
 static ::cppu::ImplementationEntry const spServices[] =
 {
-IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingLayout ),
 IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ),
 { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
diff --git a/oox/source/ppt/dgmimport.cxx b/oox/source/ppt/dgmimport.cxx
index c10dc48a72ef..2439ca6daa72 100644
--- a/oox/source/ppt/dgmimport.cxx
+++ b/oox/source/ppt/dgmimport.cxx
@@ -36,23 +36,6 @@ using namespace oox::core;
 
 namespace oox { namespace ppt {
 
-OUString QuickDiagrammingImport_getImplementationName()
-{
-return OUString( "com.sun.star.comp.Impress.oox.QuickDiagrammingImport" );
-}
-
-uno::Sequence< OUString > QuickDiagrammingImport_getSupportedServiceNames()
-{
-const OUString aServiceName = "com.sun.star.comp.ooxpptx.dgm.import";
-const Sequence< OUString > aSeq( , 1 );
-return aSeq;
-}
-
-uno::Reference< uno::XInterface > QuickDiagrammingImport_createInstance( const 
Reference< XComponentContext >& rxContext )
-{
-return static_cast(new QuickDiagrammingImport( 
rxContext ));
-}
-
 QuickDiagrammingImport::QuickDiagrammingImport( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext )
 : XmlFilterBase( rxContext )
 {}
@@ -115,7 +98,7 @@ oox::drawingml::chart::ChartConverter* 
QuickDiagrammingImport::getChartConverter
 
 OUString QuickDiagrammingImport::getImplementationName()
 {
-return QuickDiagrammingImport_getImplementationName();
+return OUString( "com.sun.star.comp.Impress.oox.QuickDiagrammingImport" );
 }
 
 ::oox::ole::VbaProject* QuickDiagrammingImport::implCreateVbaProject() const
@@ -125,4 +108,11 @@ OUString QuickDiagrammingImport::getImplementationName()
 
 }}
 
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_oox_ppt_QuickDiagrammingImport_get_implementation(
+uno::XComponentContext* pCtx, uno::Sequence const& /*rSeq*/)
+{
+return cppu::acquire(new oox::ppt::QuickDiagrammingImport(pCtx));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: oox/inc oox/source oox/util solenv/bin

2018-09-07 Thread Libreoffice Gerrit user
 oox/inc/services.hxx |7 ---
 oox/source/core/services.cxx |1 -
 oox/source/ppt/pptimport.cxx |   27 ---
 oox/util/oox.component   |3 ++-
 solenv/bin/native-code.py|1 +
 5 files changed, 11 insertions(+), 28 deletions(-)

New commits:
commit c3c43c7966e0f4c7a3b76361559d29c9335487d9
Author: Miklos Vajna 
AuthorDate: Fri Sep 7 08:41:44 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 7 11:58:02 2018 +0200

oox: create PowerPointImport instances with an uno constructor

PowerPointImport_getSupportedServiceNames() was copy from
oox::core::FilterBase::getSupportedServiceNames(), so it can go away 
entirely.

Change-Id: Ia6352cea1c2d65ba94cae66b500de951d82f455a
Reviewed-on: https://gerrit.libreoffice.org/60124
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
index 849c28a279bc..7140a5b87d80 100644
--- a/oox/inc/services.hxx
+++ b/oox/inc/services.hxx
@@ -24,13 +24,6 @@
 
 namespace oox {
 namespace ppt {
-extern OUString PowerPointImport_getImplementationName();
-extern css::uno::Sequence< OUString > 
PowerPointImport_getSupportedServiceNames();
-/// @throws css::uno::Exception
-extern css::uno::Reference< css::uno::XInterface > 
PowerPointImport_createInstance(
-const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
-}
-namespace ppt {
 extern OUString QuickDiagrammingImport_getImplementationName();
 extern css::uno::Sequence< OUString > 
QuickDiagrammingImport_getSupportedServiceNames();
 /// @throws css::uno::Exception
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index 9bf8e57466bf..c336022110a2 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -35,7 +35,6 @@ namespace {
 // Impress" would actually want to make use of them:
 static ::cppu::ImplementationEntry const spServices[] =
 {
-IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingLayout ),
 IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ),
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 634cd877f66f..8d5a6aa03f67 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -54,24 +54,6 @@ using ::com::sun::star::lang::XComponent;
 
 namespace oox { namespace ppt {
 
-OUString PowerPointImport_getImplementationName()
-{
-return OUString( "com.sun.star.comp.oox.ppt.PowerPointImport" );
-}
-
-uno::Sequence< OUString > PowerPointImport_getSupportedServiceNames()
-{
-Sequence< OUString > aSeq( 2 );
-aSeq[ 0 ] = "com.sun.star.document.ImportFilter";
-aSeq[ 1 ] = "com.sun.star.document.ExportFilter";
-return aSeq;
-}
-
-uno::Reference< uno::XInterface > PowerPointImport_createInstance( const 
Reference< XComponentContext >& rxContext )
-{
-return static_cast< ::cppu::OWeakObject* >( new PowerPointImport( 
rxContext ) );
-}
-
 #if OSL_DEBUG_LEVEL > 0
 XmlFilterBase* PowerPointImport::mpDebugFilterBase = nullptr;
 #endif
@@ -321,9 +303,16 @@ GraphicHelper* PowerPointImport::implCreateGraphicHelper() 
const
 
 OUString PowerPointImport::getImplementationName()
 {
-return PowerPointImport_getImplementationName();
+return OUString( "com.sun.star.comp.oox.ppt.PowerPointImport" );
 }
 
 }}
 
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_oox_ppt_PowerPointImport_get_implementation(
+uno::XComponentContext* pCtx, uno::Sequence const& /*rSeq*/)
+{
+return cppu::acquire(new oox::ppt::PowerPointImport(pCtx));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/util/oox.component b/oox/util/oox.component
index 399348db905c..09952c7abdf4 100644
--- a/oox/util/oox.component
+++ b/oox/util/oox.component
@@ -31,7 +31,8 @@
 
constructor="com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation">
 
   
-  
+  
 
 
   
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index d297f93bba05..75d3afbcbbac 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -256,6 +256,7 @@ core_constructor_list = [
 "com_sun_star_comp_oox_core_FastTokenHandler_get_implementation",
 "com_sun_star_comp_oox_FormatDetector_get_implementation",
 
"com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation",
+"com_sun_star_comp_oox_ppt_PowerPointImport_get_implementation",
 ]
 
 # edit group for apps, where you can edit documents
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: oox/inc oox/source oox/util solenv/bin

2018-08-31 Thread Libreoffice Gerrit user
 oox/inc/services.hxx  |7 ---
 oox/source/core/services.cxx  |1 -
 oox/source/docprop/ooxmldocpropimport.cxx |   30 --
 oox/util/oox.component|3 ++-
 solenv/bin/native-code.py |1 +
 5 files changed, 15 insertions(+), 27 deletions(-)

New commits:
commit 4ccac77652d61b823160cac073e3c1bf725352f1
Author: Miklos Vajna 
AuthorDate: Thu Aug 30 21:58:14 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 31 09:08:47 2018 +0200

oox: create DocumentPropertiesImporter instances with an uno constructor

Change-Id: I2600a59e4eac7375882aff0491ecf16bad449520
Reviewed-on: https://gerrit.libreoffice.org/59841
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
index 9fd9ddd46b70..849c28a279bc 100644
--- a/oox/inc/services.hxx
+++ b/oox/inc/services.hxx
@@ -23,13 +23,6 @@
 #include 
 
 namespace oox {
-namespace docprop {
-extern OUString DocumentPropertiesImport_getImplementationName();
-extern css::uno::Sequence< OUString > 
DocumentPropertiesImport_getSupportedServiceNames();
-/// @throws css::uno::Exception
-extern css::uno::Reference< css::uno::XInterface > 
DocumentPropertiesImport_createInstance(
-const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
-}
 namespace ppt {
 extern OUString PowerPointImport_getImplementationName();
 extern css::uno::Sequence< OUString > 
PowerPointImport_getSupportedServiceNames();
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index 2c9412ea2640..9bf8e57466bf 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -35,7 +35,6 @@ namespace {
 // Impress" would actually want to make use of them:
 static ::cppu::ImplementationEntry const spServices[] =
 {
-IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingLayout ),
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx 
b/oox/source/docprop/ooxmldocpropimport.cxx
index a15518b2eb75..6129030f7c4e 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -33,6 +33,8 @@
 
 #include 
 
+using namespace ::com::sun::star;
+
 namespace oox {
 namespace docprop {
 
@@ -44,22 +46,6 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::xml::sax;
 
-OUString DocumentPropertiesImport_getImplementationName()
-{
-return OUString( 
"com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" );
-}
-
-Sequence< OUString > DocumentPropertiesImport_getSupportedServiceNames()
-{
-Sequence aServices { 
"com.sun.star.document.OOXMLDocumentPropertiesImporter" };
-return aServices;
-}
-
-Reference< XInterface > DocumentPropertiesImport_createInstance( const 
Reference< XComponentContext >& rxContext )
-{
-return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( 
rxContext ) );
-}
-
 namespace {
 
 /// @throws RuntimeException
@@ -113,7 +99,7 @@ DocumentPropertiesImport::DocumentPropertiesImport( const 
Reference< XComponentC
 // XServiceInfo
 OUString SAL_CALL DocumentPropertiesImport::getImplementationName()
 {
-return DocumentPropertiesImport_getImplementationName();
+return OUString( 
"com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" );
 }
 
 sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& 
rServiceName )
@@ -123,7 +109,8 @@ sal_Bool SAL_CALL 
DocumentPropertiesImport::supportsService( const OUString& rSe
 
 Sequence< OUString > SAL_CALL 
DocumentPropertiesImport::getSupportedServiceNames()
 {
-return DocumentPropertiesImport_getSupportedServiceNames();
+Sequence aServices { 
"com.sun.star.document.OOXMLDocumentPropertiesImporter" };
+return aServices;
 }
 
 // XOOXMLDocumentPropertiesImporter
@@ -179,4 +166,11 @@ void SAL_CALL DocumentPropertiesImport::importProperties(
 } // namespace docprop
 } // namespace oox
 
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation(
+uno::XComponentContext* pCtx, uno::Sequence const& /*rSeq*/)
+{
+return cppu::acquire(new oox::docprop::DocumentPropertiesImport(pCtx));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/util/oox.component b/oox/util/oox.component
index 5d235e1485cf..399348db905c 100644
--- a/oox/util/oox.component
+++ b/oox/util/oox.component
@@ -27,7 +27,8 @@
 constructor="com_sun_star_comp_oox_FormatDetector_get_implementation">
 
   
-  
+  
 
   
   
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 0056fb1a6dc3..d297f93bba05 100755
--- 

[Libreoffice-commits] core.git: oox/inc oox/source oox/util solenv/bin

2018-08-10 Thread Libreoffice Gerrit user
 oox/inc/services.hxx |7 ---
 oox/source/core/filterdetect.cxx |   33 -
 oox/source/core/services.cxx |1 -
 oox/util/oox.component   |3 ++-
 solenv/bin/native-code.py|1 +
 5 files changed, 15 insertions(+), 30 deletions(-)

New commits:
commit 2963e0c69949c2c5d0c57a1960ac0406edfc2311
Author: Miklos Vajna 
AuthorDate: Thu Aug 9 21:27:45 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 10 09:03:50 2018 +0200

oox: create FilterDetect instances with an uno constructor

Change-Id: Ic9baba6a4ca37af18c5f5175aadcc59bf47c7b64
Reviewed-on: https://gerrit.libreoffice.org/58798
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
index 5b77f4b1d9a4..9fd9ddd46b70 100644
--- a/oox/inc/services.hxx
+++ b/oox/inc/services.hxx
@@ -23,13 +23,6 @@
 #include 
 
 namespace oox {
-namespace core {
-extern OUString FilterDetect_getImplementationName();
-extern css::uno::Sequence< OUString > 
FilterDetect_getSupportedServiceNames();
-/// @throws css::uno::Exception
-extern css::uno::Reference< css::uno::XInterface > 
FilterDetect_createInstance(
-const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
-}
 namespace docprop {
 extern OUString DocumentPropertiesImport_getImplementationName();
 extern css::uno::Sequence< OUString > 
DocumentPropertiesImport_getSupportedServiceNames();
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 0f1fe8625b7c..cbbaae3ed333 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -38,6 +38,8 @@
 
 #include 
 
+using namespace ::com::sun::star;
+
 namespace oox {
 namespace core {
 
@@ -228,25 +230,6 @@ void FilterDetectDocHandler::parseContentTypesOverride( 
const AttributeList& rAt
 mrFilterName = getFilterNameFromContentType( rAttribs.getString( 
XML_ContentType, OUString() ), maFileName );
 }
 
-/* Helper for XServiceInfo */
-Sequence< OUString > FilterDetect_getSupportedServiceNames()
-{
-Sequence aServiceNames { 
"com.sun.star.frame.ExtendedTypeDetection" };
-return aServiceNames;
-}
-
-/* Helper for XServiceInfo */
-OUString FilterDetect_getImplementationName()
-{
-return OUString( "com.sun.star.comp.oox.FormatDetector" );
-}
-
-/* Helper for registry */
-Reference< XInterface > FilterDetect_createInstance( const Reference< 
XComponentContext >& rxContext )
-{
-return static_cast< ::cppu::OWeakObject* >( new FilterDetect( rxContext ) 
);
-}
-
 FilterDetect::FilterDetect( const Reference< XComponentContext >& rxContext ) :
 mxContext( rxContext, UNO_SET_THROW )
 {
@@ -377,7 +360,7 @@ Reference< XInputStream > 
FilterDetect::extractUnencryptedPackage( MediaDescript
 
 OUString SAL_CALL FilterDetect::getImplementationName()
 {
-return FilterDetect_getImplementationName();
+return OUString( "com.sun.star.comp.oox.FormatDetector" );
 }
 
 sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName )
@@ -387,7 +370,8 @@ sal_Bool SAL_CALL FilterDetect::supportsService( const 
OUString& rServiceName )
 
 Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames()
 {
-return FilterDetect_getSupportedServiceNames();
+Sequence aServiceNames { 
"com.sun.star.frame.ExtendedTypeDetection" };
+return aServiceNames;
 }
 
 // com.sun.star.document.XExtendedFilterDetection interface ---
@@ -452,4 +436,11 @@ OUString SAL_CALL FilterDetect::detect( Sequence< 
PropertyValue >& rMediaDescSeq
 } // namespace core
 } // namespace oox
 
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_oox_FormatDetector_get_implementation(uno::XComponentContext*
 pCtx,
+
uno::Sequence const& /*rSeq*/)
+{
+return cppu::acquire(new oox::core::FilterDetect(pCtx));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index 354501e79e2c..2c9412ea2640 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -35,7 +35,6 @@ namespace {
 // Impress" would actually want to make use of them:
 static ::cppu::ImplementationEntry const spServices[] =
 {
-IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
 IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::QuickDiagrammingImport ),
diff --git a/oox/util/oox.component b/oox/util/oox.component
index ccbba4d28759..5d235e1485cf 100644
--- a/oox/util/oox.component
+++ b/oox/util/oox.component
@@ -23,7 +23,8 @@
 
constructor="com_sun_star_comp_oox_core_FastTokenHandler_get_implementation">
 
   
-  
+  
 
   
   
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py

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

2018-08-07 Thread Libreoffice Gerrit user
 oox/inc/drawingml/table/tableproperties.hxx|2 +-
 oox/source/drawingml/table/tableproperties.cxx |   12 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit fe5afeda8c0a99bc97e1b2009b554d3a2ef4da70
Author: Caolán McNamara 
AuthorDate: Tue Aug 7 08:53:10 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 7 10:57:16 2018 +0200

ofz#9747 Indirect-leak

Change-Id: I1063fbe9f41833c70e28343dd8d2392acd579d6d
Reviewed-on: https://gerrit.libreoffice.org/58665
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/oox/inc/drawingml/table/tableproperties.hxx 
b/oox/inc/drawingml/table/tableproperties.hxx
index 0cd500279974..af6671a81f23 100644
--- a/oox/inc/drawingml/table/tableproperties.hxx
+++ b/oox/inc/drawingml/table/tableproperties.hxx
@@ -61,7 +61,7 @@ public:
 
 private:
 
-const TableStyle&   getUsedTableStyle(const 
::oox::core::XmlFilterBase& rFilterBase, TableStyle*& rTableStyleToDelete);
+const TableStyle&   getUsedTableStyle(const 
::oox::core::XmlFilterBase& rFilterBase, std::unique_ptr& 
rTableStyleToDelete);
 
 OUStringmaStyleId;  // either 
StyleId is available
 std::shared_ptr< TableStyle >   mpTableStyle;   // or the 
complete TableStyle
diff --git a/oox/source/drawingml/table/tableproperties.cxx 
b/oox/source/drawingml/table/tableproperties.cxx
index 3be685a954d3..00c5b765cfca 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -234,7 +234,7 @@ TableStyle* CreateTableStyle(const OUString& styleId)
 return pTableStyle;
 }
 
-const TableStyle& TableProperties::getUsedTableStyle( const 
::oox::core::XmlFilterBase& rFilterBase, TableStyle*& rTableStyleToDelete )
+const TableStyle& TableProperties::getUsedTableStyle( const 
::oox::core::XmlFilterBase& rFilterBase, std::unique_ptr& 
rTableStyleToDelete )
 {
 ::oox::core::XmlFilterBase& rBase( const_cast< ::oox::core::XmlFilterBase& 
>( rFilterBase ) );
 
@@ -257,8 +257,8 @@ const TableStyle& TableProperties::getUsedTableStyle( const 
::oox::core::XmlFilt
 //if the pptx just has table style id, but no table style content, we 
will create the table style ourselves
 if (!pTableStyle)
 {
-rTableStyleToDelete = CreateTableStyle(aStyleId);
-pTableStyle = rTableStyleToDelete;
+rTableStyleToDelete.reset(CreateTableStyle(aStyleId));
+pTableStyle = rTableStyleToDelete.get();
 }
 }
 
@@ -277,8 +277,8 @@ void TableProperties::pushToPropSet( const 
::oox::core::XmlFilterBase& rFilterBa
 CreateTableColumns( xColumnRowRange->getColumns(), mvTableGrid );
 CreateTableRows( xColumnRowRange->getRows(), mvTableRows );
 
-TableStyle* pTableStyleToDelete = nullptr;
-const TableStyle& rTableStyle( getUsedTableStyle( rFilterBase, 
pTableStyleToDelete ) );
+std::unique_ptr xTableStyleToDelete;
+const TableStyle& rTableStyle( getUsedTableStyle( rFilterBase, 
xTableStyleToDelete ) );
 sal_Int32 nRow = 0;
 for (auto & tableRow : mvTableRows)
 {
@@ -301,7 +301,7 @@ void TableProperties::pushToPropSet( const 
::oox::core::XmlFilterBase& rFilterBa
 ++nRow;
 }
 
-delete pTableStyleToDelete;
+xTableStyleToDelete.reset();
 }
 
 } } }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-03 Thread Libreoffice Gerrit user
 oox/inc/services.hxx |7 ---
 oox/source/core/fasttokenhandler.cxx |   30 --
 oox/source/core/services.cxx |1 -
 oox/util/oox.component   |3 ++-
 4 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit 28dc7c3c5efe78d8e43abec89fb904100ace5d41
Author: Miklos Vajna 
AuthorDate: Thu Aug 2 21:25:35 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 3 09:04:31 2018 +0200

oox: create FastTokenHandler instances with an uno constructor

Change-Id: I1d7bca67c493d31a2a833a8254a9c01c76f1d286
Reviewed-on: https://gerrit.libreoffice.org/58495
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
index 59e490ad5f43..5b77f4b1d9a4 100644
--- a/oox/inc/services.hxx
+++ b/oox/inc/services.hxx
@@ -24,13 +24,6 @@
 
 namespace oox {
 namespace core {
-extern OUString FastTokenHandler_getImplementationName();
-extern css::uno::Sequence< OUString > 
FastTokenHandler_getSupportedServiceNames();
-/// @throws css::uno::Exception
-extern css::uno::Reference< css::uno::XInterface > 
FastTokenHandler_createInstance(
-const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
-}
-namespace core {
 extern OUString FilterDetect_getImplementationName();
 extern css::uno::Sequence< OUString > 
FilterDetect_getSupportedServiceNames();
 /// @throws css::uno::Exception
diff --git a/oox/source/core/fasttokenhandler.cxx 
b/oox/source/core/fasttokenhandler.cxx
index 7709c6c5a25a..9925204fef46 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -26,27 +26,13 @@
 
 #include 
 
+using namespace ::com::sun::star;
+
 namespace oox {
 namespace core {
 
 using namespace ::com::sun::star::uno;
 
-OUString FastTokenHandler_getImplementationName()
-{
-return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" );
-}
-
-Sequence< OUString > FastTokenHandler_getSupportedServiceNames()
-{
-Sequence aServiceNames { "com.sun.star.xml.sax.FastTokenHandler" 
};
-return aServiceNames;
-}
-
-Reference< XInterface > FastTokenHandler_createInstance( const Reference< 
XComponentContext >& /*rxContext*/ )
-{
-return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler );
-}
-
 FastTokenHandler::FastTokenHandler() :
 mrTokenMap( StaticTokenMap::get() )
 {
@@ -59,7 +45,7 @@ FastTokenHandler::~FastTokenHandler()
 // XServiceInfo
 OUString SAL_CALL FastTokenHandler::getImplementationName()
 {
-return FastTokenHandler_getImplementationName();
+return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" );
 }
 
 sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& 
rServiceName )
@@ -69,7 +55,8 @@ sal_Bool SAL_CALL FastTokenHandler::supportsService( const 
OUString& rServiceNam
 
 Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames()
 {
-return FastTokenHandler_getSupportedServiceNames();
+Sequence aServiceNames { "com.sun.star.xml.sax.FastTokenHandler" 
};
+return aServiceNames;
 }
 
 Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken )
@@ -90,4 +77,11 @@ sal_Int32 FastTokenHandler::getTokenDirect( const char 
*pToken, sal_Int32 nLengt
 } // namespace core
 } // namespace oox
 
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_oox_core_FastTokenHandler_get_implementation(
+uno::XComponentContext* /*pCtx*/, uno::Sequence const& /*rSeq*/)
+{
+return cppu::acquire(new oox::core::FastTokenHandler());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index 85489f2bca6a..354501e79e2c 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -35,7 +35,6 @@ namespace {
 // Impress" would actually want to make use of them:
 static ::cppu::ImplementationEntry const spServices[] =
 {
-IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ),
 IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
 IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
 IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
diff --git a/oox/util/oox.component b/oox/util/oox.component
index 06b2eafb8d22..ccbba4d28759 100644
--- a/oox/util/oox.component
+++ b/oox/util/oox.component
@@ -19,7 +19,8 @@
 
 http://openoffice.org/2010/uno-components;>
-  
+  
 
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-02 Thread Libreoffice Gerrit user
 oox/Library_oox.mk |1 
 oox/inc/drawingml/presetgeometrynames.hxx  |   23 ++
 oox/inc/drawingml/textbodycontext.hxx  |2 
 oox/inc/drawingml/textbodyproperties.hxx   |1 
 oox/inc/drawingml/textbodypropertiescontext.hxx|5 
 oox/source/drawingml/presetgeometrynames.cxx   |  108 
 oox/source/drawingml/shape.cxx |  184 +
 oox/source/drawingml/shapecontext.cxx  |4 
 oox/source/drawingml/textbodycontext.cxx   |   12 +
 oox/source/drawingml/textbodyproperties.cxx|1 
 oox/source/drawingml/textbodypropertiescontext.cxx |   32 +++
 oox/source/ppt/pptshapecontext.cxx |2 
 sd/qa/unit/data/pptx/tdf116350-texteffects.pptx|binary
 sd/qa/unit/export-tests-ooxml2.cxx |   50 +
 14 files changed, 420 insertions(+), 5 deletions(-)

New commits:
commit bf3420110cdd21490bc8d49a471340e747585159
Author: Szymon Kłos 
AuthorDate: Fri Jul 20 17:21:43 2018 +0200
Commit: Szymon Kłos 
CommitDate: Thu Aug 2 17:16:08 2018 +0200

tdf#116350 Import preset text geometry (text effects)

"Font effect" implementation, instead of normal
text, content is converted to "fontwork".

Change-Id: I5d02c7faedb66a4b919e64ae1b830bffb69984c1
Reviewed-on: https://gerrit.libreoffice.org/58358
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index a21157be131f..e917a9b866d3 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -159,6 +159,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/drawingml/linepropertiescontext \
 oox/source/drawingml/lineproperties \
 oox/source/drawingml/objectdefaultcontext \
+oox/source/drawingml/presetgeometrynames \
 oox/source/drawingml/scene3dcontext \
 oox/source/drawingml/shapecontext \
 oox/source/drawingml/shape \
diff --git a/oox/inc/drawingml/presetgeometrynames.hxx 
b/oox/inc/drawingml/presetgeometrynames.hxx
new file mode 100644
index ..51721e41febd
--- /dev/null
+++ b/oox/inc/drawingml/presetgeometrynames.hxx
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_OOX_DRAWINGML_PRESETGEOMETRYNAMES_HXX
+#define INCLUDED_OOX_DRAWINGML_PRESETGEOMETRYNAMES_HXX
+
+#include 
+#include 
+
+namespace PresetGeometryTypeNames
+{
+OOX_DLLPUBLIC OUString GetFontworkType(const OUString& rMsoType);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/oox/inc/drawingml/textbodycontext.hxx 
b/oox/inc/drawingml/textbodycontext.hxx
index a3439105493a..39ae7b8a1b59 100644
--- a/oox/inc/drawingml/textbodycontext.hxx
+++ b/oox/inc/drawingml/textbodycontext.hxx
@@ -32,11 +32,13 @@ class TextBodyContext final : public 
::oox::core::ContextHandler2
 {
 public:
 TextBodyContext( ::oox::core::ContextHandler2Helper const & rParent, 
TextBody& rTextBody );
+TextBodyContext( ::oox::core::ContextHandler2Helper const & rParent, 
ShapePtr pShapePtr );
 
 virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const ::oox::AttributeList& rAttribs ) override;
 
 private:
 TextBody&   mrTextBody;
+ShapePtrmpShapePtr;
 };
 
 // CT_RegularTextRun
diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index bcb75546a688..62ee3190ae58 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -41,6 +41,7 @@ struct TextBodyProperties
 boost::optional< sal_Int32 >moTextOffLower;
 boost::optional< sal_Int32 >moTextOffRight;
 css::drawing::TextVerticalAdjustmeVA;
+OUStringmsPrst;
 
 explicitTextBodyProperties();
 
diff --git a/oox/inc/drawingml/textbodypropertiescontext.hxx 
b/oox/inc/drawingml/textbodypropertiescontext.hxx
index 0ec5fe455185..b6305866e014 100644
--- a/oox/inc/drawingml/textbodypropertiescontext.hxx
+++ b/oox/inc/drawingml/textbodypropertiescontext.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_OOX_DRAWINGML_TEXTBODYPROPERTIESCONTEXT_HXX
 
 #include 
+#include 
 
 namespace oox { namespace drawingml {
 
@@ -33,10 +34,14 @@ public:
  const ::oox::AttributeList& rAttributes,
  TextBodyProperties& rTextBodyProp );
 
+TextBodyPropertiesContext( ::oox::core::ContextHandler2Helper const & 
rParent,
+ const ::oox::AttributeList& rAttributes, ShapePtr pShapePtr );
+
  

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

2018-03-07 Thread Tomaž Vajngerl
 oox/inc/drawingml/fillproperties.hxx|3 --
 oox/source/drawingml/fillproperties.cxx |   19 +++-
 oox/source/drawingml/misccontexts.cxx   |6 ++---
 oox/source/drawingml/textparagraphpropertiescontext.cxx |4 +--
 oox/source/vml/vmlformatting.cxx|4 +--
 5 files changed, 17 insertions(+), 19 deletions(-)

New commits:
commit 584454cedc57efc98a386dffa2ebae30c0625b8a
Author: Tomaž Vajngerl 
Date:   Wed Mar 7 16:37:26 2018 +0900

oox: BlipFillProperties rename mxGraphic to mxFillGraphic

Change-Id: Iea4b48e79c7c727bbd7dafd816538f6c1dd25bf8
Reviewed-on: https://gerrit.libreoffice.org/50868
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/oox/inc/drawingml/fillproperties.hxx 
b/oox/inc/drawingml/fillproperties.hxx
index 7fe1a3f6033d..45f5c4b40272 100644
--- a/oox/inc/drawingml/fillproperties.hxx
+++ b/oox/inc/drawingml/fillproperties.hxx
@@ -98,8 +98,7 @@ struct ArtisticEffectProperties
 
 struct BlipFillProperties
 {
-css::uno::Reference< css::graphic::XGraphic >
-  mxGraphic;  /// The fill graphic.
+css::uno::Reference mxFillGraphic; /// The fill 
graphic.
 OptValue< sal_Int32 > moBitmapMode; /// Bitmap tile or stretch.
 OptValue< css::geometry::IntegerRectangle2D >
   moFillRect; /// Stretch fill offsets.
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 9ba7e46ac215..e7b16553c622 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -68,7 +68,7 @@ Reference< XGraphic > lclCheckAndApplyDuotoneTransform( const 
BlipFillProperties
 ::Color nColor2 = aBlipProps.maDuotoneColors[1].getColor( 
rGraphicHelper, nPhClr );
 try
 {
-Reference< XGraphicTransformer > xTransformer( 
aBlipProps.mxGraphic, UNO_QUERY_THROW );
+Reference< XGraphicTransformer > xTransformer( 
aBlipProps.mxFillGraphic, UNO_QUERY_THROW );
 return xTransformer->applyDuotone( xGraphic, sal_Int32(nColor1), 
sal_Int32(nColor2) );
 }
 catch( Exception& )
@@ -89,7 +89,7 @@ Reference< XGraphic > lclCheckAndApplyChangeColorTransform( 
const BlipFillProper
 {
 sal_Int16 nToTransparence = 
aBlipProps.maColorChangeTo.getTransparency();
 sal_Int8 nToAlpha = static_cast< sal_Int8 >( (100 - 
nToTransparence) * 2.55 );
-Reference< XGraphicTransformer > xTransformer( 
aBlipProps.mxGraphic, UNO_QUERY_THROW );
+Reference< XGraphicTransformer > xTransformer( 
aBlipProps.mxFillGraphic, UNO_QUERY_THROW );
 return xTransformer->colorChange( xGraphic, sal_Int32(nFromColor), 
9, sal_Int32(nToColor), nToAlpha );
 }
 catch( Exception& )
@@ -187,8 +187,8 @@ void PatternFillProperties::assignUsed( const 
PatternFillProperties& rSourceProp
 
 void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps )
 {
-if( rSourceProps.mxGraphic.is() )
-mxGraphic = rSourceProps.mxGraphic;
+if(rSourceProps.mxFillGraphic.is())
+mxFillGraphic = rSourceProps.mxFillGraphic;
 moBitmapMode.assignIfUsed( rSourceProps.moBitmapMode );
 moFillRect.assignIfUsed( rSourceProps.moFillRect );
 moTileOffsetX.assignIfUsed( rSourceProps.moTileOffsetX );
@@ -598,10 +598,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 
 case XML_blipFill:
 // do not start complex graphic transformation if property is 
not supported...
-if (maBlipProps.mxGraphic.is() && 
rPropMap.supportsProperty(ShapeProperty::FillBitmap))
+if (maBlipProps.mxFillGraphic.is() && 
rPropMap.supportsProperty(ShapeProperty::FillBitmap))
 {
-Reference< XGraphic > xGraphic = 
lclCheckAndApplyDuotoneTransform( maBlipProps, maBlipProps.mxGraphic, 
rGraphicHelper, nPhClr );
-uno::Reference xBitmap(xGraphic, 
uno::UNO_QUERY);
+uno::Reference xGraphic = 
lclCheckAndApplyDuotoneTransform(maBlipProps, maBlipProps.mxFillGraphic, 
rGraphicHelper, nPhClr);
 // TODO: "rotate with shape" is not possible with our 
current core
 
 if (xGraphic.is())
@@ -631,7 +630,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 RectanglePoint eRectPoint = lclGetRectanglePoint( 
maBlipProps.moTileAlign.get( XML_tl ) );
 rPropMap.setProperty( 
ShapeProperty::FillBitmapRectanglePoint, eRectPoint );
 
-awt::Size aOriginalSize = lclGetOriginalSize( 
rGraphicHelper, maBlipProps.mxGraphic );
+awt::Size aOriginalSize = 

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

2018-02-13 Thread Tamás Zolnai
 oox/inc/drawingml/textparagraphproperties.hxx   |4 +
 oox/inc/drawingml/textparagraphpropertiescontext.hxx|1 
 oox/source/drawingml/textparagraphproperties.cxx|   11 
 oox/source/drawingml/textparagraphpropertiescontext.cxx |   17 +++---
 sd/qa/unit/data/pptx/tdf51340.pptx  |binary
 sd/qa/unit/import-tests.cxx |   42 
 6 files changed, 66 insertions(+), 9 deletions(-)

New commits:
commit 53551d49d3be2301985f2cf2d8bb23ff374ecfd1
Author: Tamás Zolnai 
Date:   Wed Feb 14 02:15:54 2018 +0100

tdf#51340: Line spacing is imported incorrectly from PPTX

Move the line spacing member to the TextParagraphProperties class
which is used to do the inheritance from master / layout slides.

Change-Id: I0bf92420963163eae78e06ebc7fdfa1f2c72fdf8
Reviewed-on: https://gerrit.libreoffice.org/49692
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

diff --git a/oox/inc/drawingml/textparagraphproperties.hxx 
b/oox/inc/drawingml/textparagraphproperties.hxx
index cac6d64f0447..2710dcb484b2 100644
--- a/oox/inc/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/drawingml/textparagraphproperties.hxx
@@ -97,6 +97,9 @@ public:
 boost::optional< css::style::ParagraphAdjust >&   getParaAdjust() { 
return moParaAdjust; }
 voidsetParaAdjust( 
css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; }
 
+TextSpacing&getLineSpacing() { return 
maLineSpacing; }
+voidsetLineSpacing( const TextSpacing& 
rLineSpacing ) { maLineSpacing = rLineSpacing; }
+
 voidapply( const TextParagraphProperties& 
rSourceProps );
 voidpushToPropSet( const 
::oox::core::XmlFilterBase* pFilterBase,
 const css::uno::Reference < 
css::beans::XPropertySet > & xPropSet,
@@ -126,6 +129,7 @@ protected:
 boost::optional< sal_Int32 >moFirstLineIndentation;
 boost::optional< css::style::ParagraphAdjust >moParaAdjust;
 sal_Int16   mnLevel;
+TextSpacing maLineSpacing;
 };
 
 } }
diff --git a/oox/inc/drawingml/textparagraphpropertiescontext.hxx 
b/oox/inc/drawingml/textparagraphpropertiescontext.hxx
index 2de92b5b05ab..3cd2d0d375b4 100644
--- a/oox/inc/drawingml/textparagraphpropertiescontext.hxx
+++ b/oox/inc/drawingml/textparagraphpropertiescontext.hxx
@@ -42,7 +42,6 @@ public:
 
 private:
 TextParagraphProperties& mrTextParagraphProperties;
-TextSpacing maLineSpacing;
 BulletList& mrBulletList;
 std::vector< css::style::TabStop >  maTabList;
 std::shared_ptr< BlipFillProperties > mxBlipProps;
diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index c36912bb9dca..8f4e635db48c 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -388,6 +388,8 @@ void TextParagraphProperties::apply( const 
TextParagraphProperties& rSourceProps
 mnLevel = rSourceProps.mnLevel;
 if( rSourceProps.moParaAdjust )
 moParaAdjust = rSourceProps.moParaAdjust;
+if( rSourceProps.maLineSpacing.bHasValue )
+maLineSpacing = rSourceProps.maLineSpacing;
 }
 
 void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* 
pFilterBase,
@@ -486,6 +488,15 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 {
 aPropSet.setProperty( PROP_ParaAdjust, 
css::style::ParagraphAdjust_LEFT);
 }
+
+if ( maLineSpacing.bHasValue )
+{
+aPropSet.setProperty( PROP_ParaLineSpacing, 
maLineSpacing.toLineSpacing());
+}
+else
+{
+aPropSet.setProperty( PROP_ParaLineSpacing, css::style::LineSpacing( 
css::style::LineSpacingMode::PROP, 100 ));
+}
 }
 
 float TextParagraphProperties::getCharHeightPoints( float fDefault ) const
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index fdc9c3f210a9..5cf1750dec4e 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -133,8 +133,8 @@ 
TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H
 TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
 {
 PropertyMap& rPropertyMap( 
mrTextParagraphProperties.getTextParagraphPropertyMap() );
-if ( maLineSpacing.bHasValue )
-rPropertyMap.setProperty( PROP_ParaLineSpacing, 
maLineSpacing.toLineSpacing());
+if ( mrTextParagraphProperties.getLineSpacing().bHasValue )
+rPropertyMap.setProperty( PROP_ParaLineSpacing, 

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

2017-09-18 Thread Szymon Kłos
 oox/inc/drawingml/fillproperties.hxx|2 +-
 oox/source/drawingml/fillproperties.cxx |   17 -
 oox/source/drawingml/misccontexts.cxx   |3 ++-
 oox/source/drawingml/shape.cxx  |2 +-
 oox/source/vml/vmlformatting.cxx|   23 +--
 sd/qa/unit/data/pptx/tdf112088.pptx |binary
 sd/qa/unit/export-tests-ooxml2.cxx  |   14 ++
 7 files changed, 47 insertions(+), 14 deletions(-)

New commits:
commit 89879b0051529cb8d16da6c8b4b1203679f8f734
Author: Szymon Kłos 
Date:   Tue Sep 12 13:26:35 2017 +0200

tdf#112088 gradient stop map -> multimap

When two gradientstops were set to position 50%
only one was stored and the exported file was
detected as broken by MSO.

Change-Id: I5fd1acde6051f734a5f3e4cff9bde01b675e1984
Reviewed-on: https://gerrit.libreoffice.org/42210
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 

diff --git a/oox/inc/drawingml/fillproperties.hxx 
b/oox/inc/drawingml/fillproperties.hxx
index 15b503161440..affd8e1602eb 100644
--- a/oox/inc/drawingml/fillproperties.hxx
+++ b/oox/inc/drawingml/fillproperties.hxx
@@ -48,7 +48,7 @@ class ShapePropertyMap;
 
 struct GradientFillProperties
 {
-typedef ::std::map< double, Color > GradientStopMap;
+typedef ::std::multimap< double, Color > GradientStopMap;
 
 GradientStopMap maGradientStops;/// Gradient stops 
(colors/transparence).
 OptValue< css::geometry::IntegerRectangle2D > moFillToRect;
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 925db22fb5f9..d18f6249b0fc 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -379,18 +379,20 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 
 // Add a fake gradient stop at 0% and 100% if 
necessary, so that the gradient always starts
 // at 0% and ends at 100%, to make following logic 
clearer (?).
-if( aGradientStops.find(0.0) == aGradientStops.end() )
+auto a0 = aGradientStops.find( 0.0 );
+if( a0 == aGradientStops.end() )
 {
 // temp variable required
 Color aFirstColor(aGradientStops.begin()->second);
-aGradientStops[0.0] = aFirstColor;
+aGradientStops.emplace( 0.0, aFirstColor );
 }
 
-if( aGradientStops.find(1.0) == aGradientStops.end() )
+auto a1 = aGradientStops.find( 1.0 );
+if( a1 == aGradientStops.end() )
 {
 // ditto
 Color aLastColor(aGradientStops.rbegin()->second);
-aGradientStops[1.0] = aLastColor;
+aGradientStops.emplace( 1.0, aLastColor );
 }
 
 // Check if the gradient is symmetric, which we will 
emulate with an "axial" gradient.
@@ -421,7 +423,12 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 if( aItA->first != aItZ->first )
 {
 Color aMiddleColor = aItZ->second;
-aGradientStops[0.5] = aMiddleColor;
+auto a05 = aGradientStops.find( 0.5 );
+
+if( a05 != aGradientStops.end() )
+a05->second = aMiddleColor;
+else
+aGradientStops.emplace( 0.5, 
aMiddleColor );
 }
 // Drop the rest of the stops
 while( aGradientStops.rbegin()->first > 0.5 )
diff --git a/oox/source/drawingml/misccontexts.cxx 
b/oox/source/drawingml/misccontexts.cxx
index 499d5137b8b2..6e0d7651bcc5 100644
--- a/oox/source/drawingml/misccontexts.cxx
+++ b/oox/source/drawingml/misccontexts.cxx
@@ -63,7 +63,8 @@ ContextHandlerRef GradientFillContext::onCreateContext(
 if( rAttribs.hasAttribute( XML_pos ) )
 {
 double fPosition = getLimitedValue< double >( 
rAttribs.getDouble( XML_pos, 0.0 ) / 10.0, 0.0, 1.0 );
-return new ColorContext( *this, 
mrGradientProps.maGradientStops[ fPosition ] );
+auto aElement = mrGradientProps.maGradientStops.emplace( 
fPosition, Color() );
+return new ColorContext( *this, aElement->second );
 }
 break;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 

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

2017-05-04 Thread Jochen Nitschke
 oox/inc/drawingml/customshapeproperties.hxx|   12 
 oox/source/drawingml/customshapegeometry.cxx   |3 ++-
 oox/source/drawingml/customshapepresetdata.cxx |3 +++
 oox/source/drawingml/customshapeproperties.cxx |   13 -
 oox/source/shape/WpsContext.cxx|1 +
 5 files changed, 10 insertions(+), 22 deletions(-)

New commits:
commit dd2a4069e50ec0a114173ffb811e736155614f9a
Author: Jochen Nitschke 
Date:   Tue May 2 23:43:11 2017 +0200

cleanup includes

Change-Id: I9615a1da8224b0112acf5b811f7de566945c02c9
Reviewed-on: https://gerrit.libreoffice.org/37185
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/oox/inc/drawingml/customshapeproperties.hxx 
b/oox/inc/drawingml/customshapeproperties.hxx
index 0a4a338e8db6..2e47b64bb013 100644
--- a/oox/inc/drawingml/customshapeproperties.hxx
+++ b/oox/inc/drawingml/customshapeproperties.hxx
@@ -23,21 +23,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/oox/source/drawingml/customshapegeometry.cxx 
b/oox/source/drawingml/customshapegeometry.cxx
index d15337dd7cbd..43de3ddebc19 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -20,6 +20,8 @@
 #include "drawingml/customshapegeometry.hxx"
 #include 
 
+#include 
+#include 
 #include 
 #include 
 #include "oox/helper/helper.hxx"
@@ -31,7 +33,6 @@
 
 using namespace ::oox::core;
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::xml::sax;
 
diff --git a/oox/source/drawingml/customshapepresetdata.cxx 
b/oox/source/drawingml/customshapepresetdata.cxx
index ca931eb199b4..e2b0a5816236 100644
--- a/oox/source/drawingml/customshapepresetdata.cxx
+++ b/oox/source/drawingml/customshapepresetdata.cxx
@@ -16,6 +16,9 @@
 #include 
 #include "oox/token/tokenmap.hxx"
 #include 
+#include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index a043dabb359a..5cf9cd235b93 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -18,28 +18,23 @@
  */
 
 #include "drawingml/customshapeproperties.hxx"
-#include "oox/helper/helper.hxx"
 #include "oox/helper/propertymap.hxx"
 #include "oox/helper/propertyset.hxx"
 #include 
 #include "oox/token/tokenmap.hxx"
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
-#include 
+#include 
+#include 
 #include 
 
-using namespace ::oox::core;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::graphic;
 using namespace ::com::sun::star::drawing;
 
 namespace oox { namespace drawingml {
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 0ed5f9024ccc..b26ce06562b0 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-22 Thread Tor Lillqvist
 oox/inc/drawingml/chart/chartdrawingfragment.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 65c43905c3396412b08eb09c58830d0acd9ad72c
Author: Tor Lillqvist 
Date:   Tue Feb 21 16:06:48 2017 +0200

Bin pointless once used typedef

Change-Id: I12f51748dd190f6d50ed7ae738d7eedeb32f0af8

diff --git a/oox/inc/drawingml/chart/chartdrawingfragment.hxx 
b/oox/inc/drawingml/chart/chartdrawingfragment.hxx
index 3d7ce5c..cb52046 100644
--- a/oox/inc/drawingml/chart/chartdrawingfragment.hxx
+++ b/oox/inc/drawingml/chart/chartdrawingfragment.hxx
@@ -70,9 +70,6 @@ private:
 boolmbRelSize;  /// True = relative size, false = 
absolute size.
 };
 
-typedef std::shared_ptr< ShapeAnchor > ShapeAnchorRef;
-
-
 /** Handler for a chart drawing fragment (c:userShapes root element).
  */
 class ChartDrawingFragment : public ::oox::core::FragmentHandler2
@@ -95,7 +92,7 @@ private:
 css::uno::Reference< css::drawing::XShapes >
 mxDrawPage; /// Drawing page of this sheet.
 ::oox::drawingml::ShapePtr mxShape; /// Current top-level shape.
-ShapeAnchorRef  mxAnchor;   /// Current anchor of 
top-level shape.
+std::shared_ptr< ShapeAnchor > mxAnchor;/// Current anchor of 
top-level shape.
 EmuRectanglemaChartRectEmu; /// Position and size of the 
chart object for embedded shapes (in EMUs).
 boolmbOleSupport;   /// True = allow to insert OLE 
objects into the drawing page.
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-17 Thread Tamás Zolnai
 oox/inc/drawingml/textbody.hxx |8 -
 oox/inc/drawingml/textparagraph.hxx|7 
 oox/source/drawingml/textbody.cxx  |   34 +-
 oox/source/drawingml/textparagraph.cxx |   51 ++---
 oox/source/ppt/pptshape.cxx|   11 +++
 sd/qa/unit/data/pptx/tdf103876.pptx|binary
 sd/qa/unit/import-tests.cxx|   21 +
 7 files changed, 113 insertions(+), 19 deletions(-)

New commits:
commit 5c7f3e4a7190bf9821bed102f96a926c9a894e59
Author: Tamás Zolnai 
Date:   Tue Nov 15 23:18:03 2016 +0100

tdf#103876: PPTX import: Title shape's character properties are wrong

Text properties are applied on a shape during text insertion,
but if a placeholder shape has no text, then it has a placehodler
text which should have the right text properties.

Change-Id: I54175d52dd25915ee4d7153298e01ec07c6be1f6
Reviewed-on: https://gerrit.libreoffice.org/30881
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 

diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index 5f8b053..0435297 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -59,7 +59,13 @@ public:
 const css::uno::Reference < css::text::XTextCursor 
> & xAt,
 const TextCharacterProperties& 
rTextStyleProperties,
 const TextListStylePtr& pMasterTextListStyle ) 
const;
-bool isEmpty();
+bool isEmpty() const;
+
+voidApplyStyleEmpty(
+const ::oox::core::XmlFilterBase& rFilterBase,
+const css::uno::Reference < css::text::XText > & 
xText,
+const TextCharacterProperties& 
rTextStyleProperties,
+const TextListStylePtr& pMasterTextListStylePtr) 
const;
 protected:
 TextParagraphVector maParagraphs;
 TextBodyProperties  maTextProperties;
diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 8a02a67..337d507 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -53,6 +53,13 @@ public:
 TextCharacterProperties& getEndProperties() { return 
maEndProperties; }
 const TextCharacterProperties&   getEndProperties() const { return 
maEndProperties; }
 
+TextCharacterProperties  getCharacterStyle(
+const TextCharacterProperties& rTextStyleProperties,
+const TextListStyle& rTextListStyle) const;
+
+TextParagraphPropertiesPtr  getParagraphStyle(
+const TextListStyle& rTextListStyle) const;
+
 voidinsertAt(
 const ::oox::core::XmlFilterBase& 
rFilterBase,
 const css::uno::Reference < 
css::text::XText > & xText,
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index 3aa835e..662a52f 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -22,9 +22,11 @@
 #include 
 #include 
 #include "drawingml/textparagraph.hxx"
+#include "oox/helper/propertyset.hxx"
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::frame;
 
 namespace oox { namespace drawingml {
@@ -69,7 +71,7 @@ void TextBody::insertAt(
 (*aIt)->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, 
aCombinedTextStyle, aIt == aBeg, nCharHeight );
 }
 
-bool TextBody::isEmpty()
+bool TextBody::isEmpty() const
 {
 if ( maParagraphs.size() <= 0 )
 return true;
@@ -85,6 +87,36 @@ bool TextBody::isEmpty()
 return aRuns[0]->getText().getLength() <= 0;
 }
 
+void TextBody::ApplyStyleEmpty(
+const ::oox::core::XmlFilterBase& rFilterBase,
+const Reference < XText > & xText,
+const TextCharacterProperties& rTextStyleProperties,
+const TextListStylePtr& pMasterTextListStylePtr) const
+{
+assert(isEmpty());
+
+// Apply character properties
+TextListStyle aCombinedTextStyle;
+aCombinedTextStyle.apply( *pMasterTextListStylePtr );
+aCombinedTextStyle.apply( maTextListStyle );
+
+PropertySet aPropSet(xText);
+TextCharacterProperties 
aTextCharacterProps(maParagraphs[0]->getCharacterStyle(rTextStyleProperties, 
aCombinedTextStyle));
+aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
+
+// Apply paragraph properties
+TextParagraphPropertiesPtr pTextParagraphStyle = 
maParagraphs[0]->getParagraphStyle(aCombinedTextStyle);
+if (pTextParagraphStyle.get())
+{
+Reference< XPropertySet > xProps(xText, UNO_QUERY);
+PropertyMap aioBulletList;
+float nCharHeight = 
xProps->getPropertyValue("CharHeight").get();
+

[Libreoffice-commits] core.git: oox/inc oox/source opencl/inc package/source registry/source reportdesign/source sal/osl sal/qa sax/source scaddins/source scripting/source sd/inc sd/qa sd/source

2016-08-05 Thread Noel Grandin
 oox/inc/drawingml/chart/converterbase.hxx|2 -
 oox/inc/drawingml/chart/objectformatter.hxx  |2 -
 oox/inc/drawingml/shape3dproperties.hxx  |2 -
 oox/inc/drawingml/textparagraph.hxx  |4 +--
 oox/source/helper/propertymap.cxx|2 -
 opencl/inc/opencl_device.hxx |2 -
 package/source/xstor/ohierarchyholder.hxx|2 -
 registry/source/reflwrit.hxx |2 -
 registry/source/regimpl.hxx  |   14 +--
 reportdesign/source/core/inc/Section.hxx |2 -
 reportdesign/source/ui/inc/ReportWindow.hxx  |4 +--
 reportdesign/source/ui/inc/ScrollHelper.hxx  |4 +--
 reportdesign/source/ui/inc/ViewsWindow.hxx   |6 ++---
 sal/osl/unx/file_stat.cxx|2 -
 sal/qa/rtl/process/rtl_Process.cxx   |2 -
 sax/source/tools/fastserializer.hxx  |4 +--
 scaddins/source/analysis/analysishelper.cxx  |2 -
 scaddins/source/analysis/analysishelper.hxx  |8 +++---
 scripting/source/vbaevents/eventhelper.cxx   |4 +--
 sd/inc/OutlinerIterator.hxx  |4 +--
 sd/qa/unit/sdmodeltestbase.hxx   |2 -
 sd/source/filter/eppt/eppt.hxx   |2 -
 sd/source/ui/inc/OutlineView.hxx |4 +--
 sd/source/ui/inc/View.hxx|4 +--
 sd/source/ui/inc/optsitem.hxx|   18 +++
 sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx |4 +--
 26 files changed, 54 insertions(+), 54 deletions(-)

New commits:
commit f12476f0f61824f6bf5120d3176731b17a43b817
Author: Noel Grandin 
Date:   Fri Aug 5 11:59:19 2016 +0200

loplugin:countusersofdefaultparams in oox..sd

Change-Id: I4504939a3957606979c6ac36af6611e1fe072d01
Reviewed-on: https://gerrit.libreoffice.org/27902
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/oox/inc/drawingml/chart/converterbase.hxx 
b/oox/inc/drawingml/chart/converterbase.hxx
index 6b53e5a..7723891 100644
--- a/oox/inc/drawingml/chart/converterbase.hxx
+++ b/oox/inc/drawingml/chart/converterbase.hxx
@@ -88,7 +88,7 @@ protected:
 voidregisterTitleLayout(
 const css::uno::Reference< css::chart2::XTitle >& 
rxTitle,
 const ModelRef< LayoutModel >& rxLayout, 
ObjectType eObjType,
-sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 );
+sal_Int32 nMainIdx, sal_Int32 nSubIdx );
 /** Converts the positions of the main title and all axis titles. */
 voidconvertTitlePositions();
 
diff --git a/oox/inc/drawingml/chart/objectformatter.hxx 
b/oox/inc/drawingml/chart/objectformatter.hxx
index 3b632ef..446c3d8 100644
--- a/oox/inc/drawingml/chart/objectformatter.hxx
+++ b/oox/inc/drawingml/chart/objectformatter.hxx
@@ -139,7 +139,7 @@ public:
 voidconvertAutomaticFill(
 PropertySet& rPropSet,
 ObjectType eObjType,
-sal_Int32 nSeriesIdx = -1 );
+sal_Int32 nSeriesIdx );
 
 /** Returns true, if the passed shape properties have automatic fill mode. 
*/
 static bool isAutomaticFill( const ModelRef< Shape >& rxShapeProp 
);
diff --git a/oox/inc/drawingml/shape3dproperties.hxx 
b/oox/inc/drawingml/shape3dproperties.hxx
index 8c19509..e0fe9a9 100644
--- a/oox/inc/drawingml/shape3dproperties.hxx
+++ b/oox/inc/drawingml/shape3dproperties.hxx
@@ -78,7 +78,7 @@ struct Shape3DProperties
 css::uno::Sequence< css::beans::PropertyValue > getCameraAttributes();
 css::uno::Sequence< css::beans::PropertyValue > getLightRigAttributes();
 css::uno::Sequence< css::beans::PropertyValue > getShape3DAttributes(
-const GraphicHelper& rGraphicHelper, sal_Int32 rPhClr = 
API_RGB_TRANSPARENT );
+const GraphicHelper& rGraphicHelper, sal_Int32 rPhClr );
 static css::uno::Sequence< css::beans::PropertyValue > getBevelAttributes( 
BevelProperties rProps );
 static css::uno::Sequence< css::beans::PropertyValue > getColorAttributes(
 const Color& rColor, const GraphicHelper& rGraphicHelper, 
sal_Int32 rPhClr );
diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 43bf51a..8a02a67 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -59,8 +59,8 @@ public:
 const css::uno::Reference < 
css::text::XTextCursor > ,
 const 

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

2016-04-12 Thread Rohan Kumar
 oox/inc/drawingml/textliststyle.hxx  |2 +-
 oox/source/drawingml/diagram/diagram.cxx |   18 --
 oox/source/drawingml/textliststyle.cxx   |4 ++--
 3 files changed, 11 insertions(+), 13 deletions(-)

New commits:
commit aba0c20fb059e5cc484af5feae29e6f51e584fa8
Author: Rohan Kumar 
Date:   Fri Apr 8 11:42:42 2016 +0530

tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals

I disentangled my previous patch to make one patch per module. I also
modified the patch according to new directions given by Sweet5hark

Change-Id: Id690f7c1e87230e4d10e1c9fe472f35d1d1caa8b
Reviewed-on: https://gerrit.libreoffice.org/22924
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/oox/inc/drawingml/textliststyle.hxx 
b/oox/inc/drawingml/textliststyle.hxx
index 1f3c6a0..d4cc455 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -45,7 +45,7 @@ public:
 const TextParagraphPropertiesVector& getAggregationListStyle() const { 
return maAggregationListStyle; };
 TextParagraphPropertiesVector&   getAggregationListStyle() { return 
maAggregationListStyle; };
 
-#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 1
+#ifdef DBG_UTIL
 void dump() const;
 #endif
 
diff --git a/oox/source/drawingml/diagram/diagram.cxx 
b/oox/source/drawingml/diagram/diagram.cxx
index 04bda5b..7749d5e 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -91,7 +91,7 @@ void Diagram::setLayout( const DiagramLayoutPtr & pLayout)
 mpLayout = pLayout;
 }
 
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_OOX_DIAGRAM
 OString normalizeDotName( const OUString& rStr )
 {
 OUStringBuffer aBuf;
@@ -139,19 +139,17 @@ static sal_Int32 calcDepth( const OUString& rNodeName,
 void Diagram::build(  )
 {
 // build name-object maps
-
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_OOX_DIAGRAM
 std::ofstream output("/tmp/tree.dot");
 
 output << "digraph datatree {" << std::endl;
 #endif
-
 dgm::Points& rPoints = getData()->getPoints();
 dgm::Points::iterator aCurrPoint(rPoints.begin());
 dgm::Points::iterator aEndPoint(rPoints.end());
 while( aCurrPoint != aEndPoint )
 {
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_OOX_DIAGRAM
 output << "\t"
<< normalizeDotName(aCurrPoint->msModelId).getStr()
<< "[";
@@ -179,6 +177,7 @@ void Diagram::build(  )
 }
 
 output << "];" << std::endl;
+#endif
 
 // does currpoint have any text set?
 if( aCurrPoint->mpShape &&
@@ -186,8 +185,8 @@ void Diagram::build(  )
 !aCurrPoint->mpShape->getTextBody()->getParagraphs().empty() &&
 
!aCurrPoint->mpShape->getTextBody()->getParagraphs().front()->getRuns().empty() 
)
 {
+#ifdef DEBUG_OOX_DIAGRAM
 static sal_Int32 nCount=0;
-
 output << "\t"
<< "textNode" << nCount
<< " ["
@@ -201,8 +200,8 @@ void Diagram::build(  )
<< " -> "
<< "textNode" << nCount++
<< ";" << std::endl;
-}
 #endif
+}
 
 const bool bInserted1=getData()->getPointNameMap().insert(
 std::make_pair(aCurrPoint->msModelId,&(*aCurrPoint))).second;
@@ -224,7 +223,7 @@ void Diagram::build(  )
 const dgm::Connections::const_iterator aEndCxn(rConnections.end());
 while( aCurrCxn != aEndCxn )
 {
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_OOX_DIAGRAM
 if( !aCurrCxn->msParTransId.isEmpty() ||
 !aCurrCxn->msSibTransId.isEmpty() )
 {
@@ -308,8 +307,7 @@ void Diagram::build(  )
 
 ++aPresOfIter;
 }
-
-#if OSL_DEBUG_LEVEL > 1
+#ifdef DEBUG_OOX_DIAGRAM
 output << "}" << std::endl;
 #endif
 }
diff --git a/oox/source/drawingml/textliststyle.cxx 
b/oox/source/drawingml/textliststyle.cxx
index 5ea7a04..44b0f41 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -86,12 +86,12 @@ void TextListStyle::apply( const TextListStyle& 
rTextListStyle )
 applyStyleList( rTextListStyle.getListStyle(), getListStyle() );
 }
 
-#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 1
+#ifdef DBG_UTIL
 void TextListStyle::dump() const
 {
 for ( int i = 0; i < 9; i++ )
 {
-OSL_TRACE("text list style level: %d", i);
+SAL_INFO("oox.drawingml", "text list style level: " << i);
 maListStyle[i]->dump();
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-10 Thread Matus Uzak
 oox/inc/drawingml/textcharacterproperties.hxx   |3 --
 oox/source/drawingml/chart/objectformatter.cxx  |6 +++--
 oox/source/drawingml/shape.cxx  |6 -
 oox/source/drawingml/table/tablecell.cxx|7 --
 oox/source/drawingml/textcharacterproperties.cxx|   11 ++
 oox/source/drawingml/textcharacterpropertiescontext.cxx |   17 +++-
 oox/source/drawingml/textparagraph.cxx  |8 +++
 oox/source/drawingml/textparagraphproperties.cxx|2 -
 oox/source/drawingml/textrun.cxx|3 +-
 sd/qa/unit/data/pptx/tdf89927.pptx  |binary
 sd/qa/unit/import-tests.cxx |   17 
 11 files changed, 50 insertions(+), 30 deletions(-)

New commits:
commit 6802f760a69f3b1f203d70399f0d73764f9159d5
Author: Matus Uzak 
Date:   Mon Mar 7 12:04:01 2016 +0100

tdf#89927: PPTX import: Incorrect inheritance of text run fill properties

Make use of FillProperties in TextCharacterProperties.  DrawingML:
Fill related elements in Text Run Properties are in sync with Table
Cell Properties and all of Line Properties.

Change-Id: I7c513ecfc5f94cf49e98a657384b5c0f5dddc1c7
Reviewed-on: https://gerrit.libreoffice.org/22979
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/oox/inc/drawingml/textcharacterproperties.hxx 
b/oox/inc/drawingml/textcharacterproperties.hxx
index 6d7229a..055e58f 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -42,7 +42,6 @@ struct TextCharacterProperties
 TextFontmaComplexFont;
 TextFontmaComplexThemeFont;
 TextFontmaSymbolFont;
-Color   maCharColor;
 Color   maUnderlineColor;
 Color   maHighlightColor;
 OptValue< OUString > moLang;
@@ -56,7 +55,7 @@ struct TextCharacterProperties
 OptValue< bool >moItalic;
 OptValue< bool >moUnderlineLineFollowText;
 OptValue< bool >moUnderlineFillFollowText;
-GradientFillProperties  maGradientProps; /// Properties for gradient 
text colors
+FillProperties  maFillProperties;
 
 std::vector maTextEffectsProperties;
 
diff --git a/oox/source/drawingml/chart/objectformatter.cxx 
b/oox/source/drawingml/chart/objectformatter.cxx
index 9da925d..b2ac6e5 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -881,8 +881,10 @@ TextFormatter::TextFormatter( ObjectFormatterData& rData, 
const AutoTextEntry* p
 if( const TextCharacterProperties* pTextProps = 
pTheme->getFontStyle( pAutoTextEntry->mnThemedFont ) )
 *mxAutoText = *pTextProps;
 sal_Int32 nTextColor = getPhColor( -1 );
-if( nTextColor >= 0 )
-mxAutoText->maCharColor.setSrgbClr( nTextColor );
+if( nTextColor >= 0 ) {
+mxAutoText->maFillProperties.maFillColor.setSrgbClr( nTextColor );
+mxAutoText->maFillProperties.moFillType.set(XML_solidFill);
+}
 mxAutoText->moHeight = pAutoTextEntry->mnDefFontSize;
 mxAutoText->moBold = pAutoTextEntry->mbBold;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 71b2f46..63d8c5a 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1133,7 +1133,11 @@ Reference< XShape > Shape::createAndInsert(
 if( const TextCharacterProperties* pCharProps = 
pTheme->getFontStyle( pFontRef->mnThemedIdx ) )
 aCharStyleProperties.assignUsed( *pCharProps );
 SAL_INFO("oox.drawingml", OSL_THIS_FUNC << "use font 
color");
-aCharStyleProperties.maCharColor.assignIfUsed( 
pFontRef->maPhClr );
+if ( pFontRef->maPhClr.isUsed() )
+{
+aCharStyleProperties.maFillProperties.maFillColor 
= pFontRef->maPhClr;
+
aCharStyleProperties.maFillProperties.moFillType.set(XML_solidFill);;
+}
 }
 }
 
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 45efa77..47f4103 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -148,8 +148,11 @@ void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
 aTextCharProps.maAsianFont = rTableStylePart.getAsianFont();
 aTextCharProps.maComplexFont = rTableStylePart.getComplexFont();
 aTextCharProps.maSymbolFont = rTableStylePart.getSymbolFont();
-if (rTableStylePart.getTextColor().isUsed())
-aTextCharProps.maCharColor = 

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

2015-04-30 Thread Caolán McNamara
 oox/inc/drawingml/table/tableproperties.hxx|2 +-
 oox/source/drawingml/table/tableproperties.cxx |   16 ++--
 2 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 2bb444ecb10436b640c1dc35e85cdcb512c8dff6
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Apr 30 16:00:41 2015 +0100

see if a re-org will silence coverity#1272392 Resource leak

Change-Id: I65c20f75c4086dc5167c6fa41b0171f07c1419bb

diff --git a/oox/inc/drawingml/table/tableproperties.hxx 
b/oox/inc/drawingml/table/tableproperties.hxx
index ea03f75..eb3ba78 100644
--- a/oox/inc/drawingml/table/tableproperties.hxx
+++ b/oox/inc/drawingml/table/tableproperties.hxx
@@ -57,7 +57,7 @@ public:
 
 private:
 
-const TableStyle   getUsedTableStyle( const 
::oox::core::XmlFilterBase rFilterBase, bool isCreateTabStyle);
+const TableStyle   getUsedTableStyle(const 
::oox::core::XmlFilterBase rFilterBase, TableStyle* rTableStyleToDelete);
 
 OUStringmaStyleId;  // either 
StyleId is available
 boost::shared_ptr TableStyle  mpTableStyle;   // or the 
complete TableStyle
diff --git a/oox/source/drawingml/table/tableproperties.cxx 
b/oox/source/drawingml/table/tableproperties.cxx
index 393095b..380fcfb 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -221,7 +221,7 @@ TableStyle* CreateTableStyle(const OUString styleId)
 return pTableStyle;
 }
 
-const TableStyle TableProperties::getUsedTableStyle( const 
::oox::core::XmlFilterBase rFilterBase, bool isCreateTabStyle )
+const TableStyle TableProperties::getUsedTableStyle( const 
::oox::core::XmlFilterBase rFilterBase, TableStyle* rTableStyleToDelete )
 {
 ::oox::core::XmlFilterBase rBase( const_cast ::oox::core::XmlFilterBase 
( rFilterBase ) );
 
@@ -245,8 +245,8 @@ const TableStyle TableProperties::getUsedTableStyle( const 
::oox::core::XmlFilt
 //if the pptx just has table style id, but no table style content, we 
will create the table style ourselves
 if (!pTableStyle)
 {
-pTableStyle = CreateTableStyle(aStyleId);
-isCreateTabStyle = (pTableStyle != NULL);
+rTableStyleToDelete = CreateTableStyle(aStyleId);
+pTableStyle = rTableStyleToDelete;
 }
 }
 
@@ -265,8 +265,8 @@ void TableProperties::pushToPropSet( const 
::oox::core::XmlFilterBase rFilterBa
 CreateTableColumns( xColumnRowRange-getColumns(), mvTableGrid );
 CreateTableRows( xColumnRowRange-getRows(), mvTableRows );
 
-bool bOwnTblStyle = false;
-const TableStyle rTableStyle( getUsedTableStyle( rFilterBase, 
bOwnTblStyle ) );
+TableStyle* pTableStyleToDelete = NULL;
+const TableStyle rTableStyle( getUsedTableStyle( rFilterBase, 
pTableStyleToDelete ) );
 sal_Int32 nRow = 0;
 const std::vector TableRow ::const_iterator aTableRowEnd( 
mvTableRows.end() );
 for (std::vector TableRow ::iterator aTableRowIter( mvTableRows.begin() 
);
@@ -291,11 +291,7 @@ void TableProperties::pushToPropSet( const 
::oox::core::XmlFilterBase rFilterBa
 }
 }
 
-if(bOwnTblStyle)
-{
-TableStyle* pTableStyle = const_castTableStyle*(rTableStyle);
-delete pTableStyle;
-}
+delete pTableStyleToDelete;
 }
 
 } } }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-03-30 Thread Andras Timar
 oox/inc/drawingml/textbodyproperties.hxx|2 
 oox/source/drawingml/shape.cxx  |2 
 oox/source/drawingml/textbodyproperties.cxx |8 
 sd/qa/unit/data/n902652.pptx|binary
 sd/qa/unit/data/xml/n902652_0.xml   |  309 
 sd/qa/unit/import-tests.cxx |1 
 6 files changed, 316 insertions(+), 6 deletions(-)

New commits:
commit af686aa8694903bde5952656cd69993c8c8393d7
Author: Andras Timar andras.ti...@collabora.com
Date:   Mon Mar 30 21:37:47 2015 +0200

bnc#902652 OOXML: fix import of insets when shape and/or shape text is 
rotated

5ac575ee3e109 did not get it right, the vert attribute (i.e. the
rotation of text) is relevant, not the rotation of the shape. In
that case both text and shape rotation were 270 degrees. I checked
that the bugdoc of bnc#773048 looked good after this.

Change-Id: I6e0401cd138a82040df82d7da1a47311db7771e4
Reviewed-on: https://gerrit.libreoffice.org/15076
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/inc/drawingml/textbodyproperties.hxx 
b/oox/inc/drawingml/textbodyproperties.hxx
index e6ed0fc..c7a98cb 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -45,7 +45,7 @@ struct TextBodyProperties
 
 explicitTextBodyProperties();
 
-voidpushRotationAdjustments( sal_Int32 nRotation );
+voidpushRotationAdjustments();
 voidpushVertSimulation();
 };
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index bea5cd2..d46476a 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -652,7 +652,7 @@ Reference XShape  Shape::createAndInsert(
 // add properties from textbody to shape properties
 if( mpTextBody.get() )
 {
-mpTextBody-getTextProperties().pushRotationAdjustments( 
mnRotation );
+mpTextBody-getTextProperties().pushRotationAdjustments();
 aShapeProps.assignUsed( 
mpTextBody-getTextProperties().maPropertyMap );
 // Push char properties as well - specifically useful when this is 
a placeholder
 if( mpMasterTextListStyle   
mpMasterTextListStyle-getListStyle()[0]-getTextCharacterProperties().moHeight.has()
 )
diff --git a/oox/source/drawingml/textbodyproperties.cxx 
b/oox/source/drawingml/textbodyproperties.cxx
index 9f146c6..f61330a 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -58,17 +58,17 @@ void TextBodyProperties::pushVertSimulation()
 }
 
 /* Push adjusted values, taking into consideration Shape Rotation */
-void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation )
+void TextBodyProperties::pushRotationAdjustments()
 {
 sal_Int32 nOff  = 0;
 sal_Int32 aProps[]  = { PROP_TextLeftDistance, PROP_TextUpperDistance, 
PROP_TextRightDistance, PROP_TextLowerDistance };
 sal_Int32 n = ( sal_Int32 )( sizeof( aProps ) / sizeof( sal_Int32 
) );
 
-switch( nRotation ) // TODO: What happens for part rotations ?
+switch( moRotation.get(0) )
 {
-case (90*1*6): nOff = 1; break;
+case (90*1*6): nOff = 3; break;
 case (90*2*6): nOff = 2; break;
-case (90*3*6): nOff = 3; break;
+case (90*3*6): nOff = 1; break;
 default: break;
 }
 
diff --git a/sd/qa/unit/data/n902652.pptx b/sd/qa/unit/data/n902652.pptx
new file mode 100644
index 000..8726600
Binary files /dev/null and b/sd/qa/unit/data/n902652.pptx differ
diff --git a/sd/qa/unit/data/xml/n902652_0.xml 
b/sd/qa/unit/data/xml/n902652_0.xml
new file mode 100644
index 000..de8ed91
--- /dev/null
+++ b/sd/qa/unit/data/xml/n902652_0.xml
@@ -0,0 +1,309 @@
+?xml version=1.0?
+XShapes
+ XShape positionX=899 positionY=9525 sizeX=9000 sizeY=4800 
type=com.sun.star.drawing.CustomShape name=Rounded Rectangle 3 text= 
LibreOffice fontHeight=18.00 fontColor= 
textAutoGrowHeight=false textAutoGrowWidth=false textContourFrame=false 
textFitToSize=NONE textHorizontalAdjust=BLOCK textVerticalAdjust=TOP 
textLeftDistance=3000 textRightDistance=500 textUpperDistance=300 
textLowerDistance=3000 textMaximumFrameHeight=0 textMaximumFrameWidth=0 
textMinimumFrameHeight=0 textMinimumFrameWidth=0 textAnimationAmount=0 
textAnimationCount=0 textAnimationDelay=0 textAnimationDirection=LEFT 
textAnimationKind=NONE textAnimationStartInside=false 
textAnimationStopInside=false textWritingMode=LR_TB fillStyle=SOLID 
fillColor=9bbb59 fillTransparence=0 fillTransparenceGradientName=
+  FillTransparenceGradient style=LINEAR startColor=00 
endColor=ff angle=0 border=0 xOffset=50 yOffset=50 
startIntensity=100 endIntensity=100 stepCount=0/
+  FillGradient style=LINEAR startColor=3465a4 endColor=ff angle=0 
border=0 

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

2014-04-14 Thread Stephan Bergmann
 oox/inc/services.hxx  |   45 +++
 oox/source/core/contexthandler2.cxx   |1 
 oox/source/core/fasttokenhandler.cxx  |2 
 oox/source/core/filterbase.cxx|8 +--
 oox/source/core/filterdetect.cxx  |2 
 oox/source/core/services.cxx  |   24 --
 oox/source/docprop/ooxmldocpropimport.cxx |3 -
 oox/source/export/chartexport.cxx |2 
 oox/source/ole/vbamodule.cxx  |   68 --
 oox/source/ppt/dgmimport.cxx  |6 +-
 oox/source/ppt/dgmlayout.cxx  |6 +-
 oox/source/ppt/pptimport.cxx  |6 +-
 oox/source/shape/ShapeContextHandler.cxx  |3 -
 13 files changed, 71 insertions(+), 105 deletions(-)

New commits:
commit e13022a825917ad9bf1d2b16af6b88a4fa97b1cd
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Apr 14 14:15:12 2014 +0200

Clean up function declarations and some unused functions

Change-Id: I2f5b3144e8d4ce3e497a030aa102985c3bc81645

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
new file mode 100644
index 000..9090a5b
--- /dev/null
+++ b/oox/inc/services.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_OOX_SOURCE_CORE_SERVICES_HXX
+#define INCLUDED_OOX_SOURCE_CORE_SERVICES_HXX
+
+#include sal/config.h
+
+#define DECLARE_FUNCTIONS( className ) 
 \
+extern OUString SAL_CALL className##_getImplementationName();  
 \
+extern css::uno::Sequence OUString  SAL_CALL 
className##_getSupportedServiceNames(); \
+extern css::uno::Reference css::uno::XInterface  SAL_CALL 
className##_createInstance( \
+const css::uno::Reference css::uno::XComponentContext  rxContext ) throw 
(css::uno::Exception)
+
+namespace oox {
+namespace core {DECLARE_FUNCTIONS( FastTokenHandler );  }
+namespace core {DECLARE_FUNCTIONS( FilterDetect );  }
+namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport );  }
+namespace ppt { DECLARE_FUNCTIONS( PowerPointImport );  }
+namespace ppt { DECLARE_FUNCTIONS( QuickDiagrammingImport );}
+namespace ppt { DECLARE_FUNCTIONS( QuickDiagrammingLayout );}
+namespace shape {   DECLARE_FUNCTIONS( ShapeContextHandler );   }
+}
+
+#undef DECLARE_FUNCTIONS
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/contexthandler2.cxx 
b/oox/source/core/contexthandler2.cxx
index 4e5bf80..0d74d66 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -39,7 +39,6 @@ struct ElementInfo
 boolmbTrimSpaces;   /// True = trims leading/trailing 
spaces from text data.
 
 inline explicit ElementInfo() : maChars( 0), mnElement( 
XML_TOKEN_INVALID ), mbTrimSpaces( false ) {}
-ElementInfo( sal_Int32 nElement ) : maChars( 0 ), 
mnElement( nElement ), mbTrimSpaces(false) {}
 };
 
 
diff --git a/oox/source/core/fasttokenhandler.cxx 
b/oox/source/core/fasttokenhandler.cxx
index 5bf6102..9764ff3 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -24,6 +24,8 @@
 #include oox/token/tokenmap.hxx
 #include cppuhelper/supportsservice.hxx
 
+#include services.hxx
+
 namespace oox {
 namespace core {
 
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 1b45ea2..6f2b1ae 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include sal/config.h
+
+#include boost/noncopyable.hpp
 #include com/sun/star/container/XNameAccess.hpp
 #include com/sun/star/drawing/XShape.hpp
 #include com/sun/star/frame/XModel.hpp
@@ -68,7 +71,7 @@ struct UrlPool
 struct StaticUrlPool : public ::rtl::Static UrlPool, StaticUrlPool  {};
 
 /** This guard prevents recursive loading/saving of the same document. */
-class DocumentOpenedGuard
+class 

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

2014-01-21 Thread Alexandre Vicenzi
 oox/inc/pch/precompiled_oox.hxx |1 -
 oox/source/drawingml/shape.cxx  |5 -
 2 files changed, 6 deletions(-)

New commits:
commit 15913f9ae1b8753a1fab894667b7543e08210b04
Author: Alexandre Vicenzi vicenzi.alexan...@gmail.com
Date:   Mon Jan 20 23:03:01 2014 -0200

fdo#63154 Removed unused solar.h reference in oox

Change-Id: I224bc31af9ecb77ad42357550e016b000ebf4837
Reviewed-on: https://gerrit.libreoffice.org/7519
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/oox/inc/pch/precompiled_oox.hxx b/oox/inc/pch/precompiled_oox.hxx
index f997388..d2dae89 100644
--- a/oox/inc/pch/precompiled_oox.hxx
+++ b/oox/inc/pch/precompiled_oox.hxx
@@ -388,7 +388,6 @@
 #include tools/globname.hxx
 #include tools/mapunit.hxx
 #include tools/multisel.hxx
-#include tools/solar.h
 #include tools/stream.hxx
 #include tools/time.hxx
 #include unotools/fltrcfg.hxx
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index c9889db..78b3f35 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -36,7 +36,6 @@
 #include oox/helper/graphichelper.hxx
 #include oox/helper/propertyset.hxx
 
-#include tools/solar.h
 #include tools/gen.hxx
 #include tools/mapunit.hxx
 #include editeng/unoprnms.hxx
@@ -80,8 +79,6 @@ using namespace ::com::sun::star::style;
 
 namespace oox { namespace drawingml {
 
-// 
-
 Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
 : mbIsChild( false )
 , mpLinePropertiesPtr( new LineProperties )
@@ -,8 +1108,6 @@ void Shape::putPropertiesToGrabBag( const Sequence 
PropertyValue  aProperties
 }
 }
 
-// 
-
 } }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-02 Thread Aurimas Fišeras
 oox/inc/pch/precompiled_oox.hxx   |1 +
 sc/inc/pch/precompiled_sc.hxx |1 +
 writerfilter/inc/pch/precompiled_writerfilter.hxx |2 ++
 3 files changed, 4 insertions(+)

New commits:
commit cf685e9299ab9d196b7f90803f03d4fea8d16091
Author: Aurimas Fišeras auri...@members.fsf.org
Date:   Thu May 2 09:52:32 2013 +0300

Update pch

Change-Id: Ia400389ca7c4fbe752e19ca2d38f2fee00f6ee7d
Reviewed-on: https://gerrit.libreoffice.org/3736
Reviewed-by: Tor Lillqvist t...@iki.fi
Tested-by: Tor Lillqvist t...@iki.fi

diff --git a/oox/inc/pch/precompiled_oox.hxx b/oox/inc/pch/precompiled_oox.hxx
index f9ea8b6..1125be4 100644
--- a/oox/inc/pch/precompiled_oox.hxx
+++ b/oox/inc/pch/precompiled_oox.hxx
@@ -283,6 +283,7 @@
 #include com/sun/star/text/SizeType.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
 #include com/sun/star/text/VertOrientation.hpp
+#include com/sun/star/text/WrapTextMode.hpp
 #include com/sun/star/text/WritingMode.hpp
 #include com/sun/star/text/XNumberingRulesSupplier.hpp
 #include com/sun/star/text/XSimpleText.hpp
diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx
index bb42081..a913837 100644
--- a/sc/inc/pch/precompiled_sc.hxx
+++ b/sc/inc/pch/precompiled_sc.hxx
@@ -53,6 +53,7 @@
 #include formula/grammar.hxx
 #include formula/opcode.hxx
 #include formula/token.hxx
+#include formula/vectortoken.hxx
 #include i18nlangtag/lang.h
 #include i18nlangtag/mslangid.hxx
 #include rtl/math.hxx
diff --git a/writerfilter/inc/pch/precompiled_writerfilter.hxx 
b/writerfilter/inc/pch/precompiled_writerfilter.hxx
index 6e840a6..641211a 100644
--- a/writerfilter/inc/pch/precompiled_writerfilter.hxx
+++ b/writerfilter/inc/pch/precompiled_writerfilter.hxx
@@ -71,6 +71,7 @@
 #include com/sun/star/form/XFormComponent.hpp
 #include com/sun/star/form/XFormsSupplier.hpp
 #include com/sun/star/frame/XFrame.hpp
+#include com/sun/star/frame/XModel.hpp
 #include com/sun/star/graphic/GraphicProvider.hpp
 #include com/sun/star/graphic/XGraphic.hpp
 #include com/sun/star/graphic/XGraphicProvider.hpp
@@ -146,6 +147,7 @@
 #include com/sun/star/uri/UriReferenceFactory.hpp
 #include com/sun/star/util/XNumberFormatsSupplier.hpp
 #include com/sun/star/util/XRefreshable.hpp
+#include com/sun/star/view/XFormLayerAccess.hpp
 #include com/sun/star/xml/sax/Parser.hpp
 #include com/sun/star/xml/sax/SAXException.hpp
 #include com/sun/star/xml/sax/XParser.hpp
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-17 Thread Noel Power
 oox/inc/oox/ole/axbinaryreader.hxx |   16 +++--
 oox/inc/oox/ole/axcontrol.hxx  |   50 ++--
 oox/source/ole/axbinaryreader.cxx  |   11 +++
 oox/source/ole/axcontrol.cxx   |  115 +
 oox/source/ole/vbacontrol.cxx  |   63 ++--
 5 files changed, 240 insertions(+), 15 deletions(-)

New commits:
commit a43cc9ec8dde4f311bcf8ff96e6a26d56b2abdcf
Author: Noel Power noel.po...@suse.com
Date:   Wed Apr 17 17:08:59 2013 +0100

implement MultiPage, Page  TabStrip import for oox

Change-Id: I1912c9550c12a971fcc7fdbc8bd623f18ccc40b8

diff --git a/oox/inc/oox/ole/axbinaryreader.hxx 
b/oox/inc/oox/ole/axbinaryreader.hxx
index f734a307..b6a937d 100644
--- a/oox/inc/oox/ole/axbinaryreader.hxx
+++ b/oox/inc/oox/ole/axbinaryreader.hxx
@@ -87,7 +87,7 @@ private:
 typedef ::std::pair sal_Int32, sal_Int32  AxPairData;
 
 /** An array of string values as a property. */
-typedef ::std::vector OUString  AxStringArray;
+typedef ::std::vector OUString  AxArrayString;
 
 // 
 
@@ -112,6 +112,9 @@ public:
 /** Reads the next string property from the stream, if the respective flag
 in the property mask is set. */
 voidreadStringProperty( OUString orValue );
+/** Reads ArrayString, an array of fmString ( compressed or uncompressed )
+is read from the stream and inserted into rStrings */
+voidreadArrayStringProperty( std::vector OUString  
rStrings );
 /** Reads the next GUID property from the stream, if the respective flag
 in the property mask is set. The GUID will be enclosed in braces. */
 voidreadGuidProperty( OUString orGuid );
@@ -135,6 +138,9 @@ public:
 /** Skips the next string property in the stream, if the respective flag in
 the property mask is set. */
 inline void skipStringProperty() { readStringProperty( 
maDummyString ); }
+/** Skips the next ArrayString property in the stream, if the respective 
flag in
+the property mask is set. */
+inline void skipArrayStringProperty() { readArrayStringProperty( 
maDummyArrayString ); }
 /** Skips the next GUID property in the stream, if the respective flag in
 the property mask is set. */
 inline void skipGuidProperty() { readGuidProperty( maDummyString 
); }
@@ -185,11 +191,11 @@ private:
 };
 
 /** Complex property for an array of strings. */
-struct StringArrayProperty : public ComplexProperty
+struct ArrayStringProperty : public ComplexProperty
 {
-AxStringArray  mrArray;
+AxArrayString  mrArray;
 sal_uInt32  mnSize;
-inline explicit StringArrayProperty( AxStringArray rArray, 
sal_uInt32 nSize ) :
+inline explicit ArrayStringProperty( AxArrayString rArray, 
sal_uInt32 nSize ) :
 mrArray( rArray ), mnSize( nSize ) {}
 virtual boolreadProperty( AxAlignedInputStream rInStrm );
 };
@@ -234,7 +240,7 @@ private:
 AxFontData  maDummyFontData;/// Dummy font for unsupported 
properties.
 StreamDataSequence  maDummyPicData; /// Dummy picture for unsupported 
properties.
 OUString maDummyString;  /// Dummy string for unsupported 
properties.
-AxStringArray   maDummyStringArray; /// Dummy string array for 
unsupported properties.
+AxArrayString maDummyArrayString; /// Dummy strings for unsupported 
ArrayString properties.
 sal_Int64   mnPropFlags;/// Flags specifying existing 
properties.
 sal_Int64   mnNextProp; /// Next property to read.
 sal_Int64   mnPropsEnd; /// End position of simple/large 
properties.
diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index 6612ef3..84e3a3e 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -157,13 +157,13 @@ enum ApiControlType
 API_CONTROL_COMBOBOX,
 API_CONTROL_SPINBUTTON,
 API_CONTROL_SCROLLBAR,
-API_CONTROL_TABSTRIP,
+API_CONTROL_TABSTRIP, //11
 API_CONTROL_PROGRESSBAR,
 API_CONTROL_GROUPBOX,
-API_CONTROL_FRAME,
-API_CONTROL_PAGE,
-API_CONTROL_MULTIPAGE,
-API_CONTROL_DIALOG
+API_CONTROL_FRAME, // 14
+API_CONTROL_PAGE,  // 15
+API_CONTROL_MULTIPAGE, // 16
+API_CONTROL_DIALOG // 17
 };
 
 // 
@@ -600,6 +600,24 @@ private:
 boolmbPicTiling;/// True = picture is repeated.
 };
 
+class OOX_DLLPUBLIC AxTabStripModel : public AxFontDataModel
+{
+public:
+explicitAxTabStripModel();
+
+virtual boolimportBinaryModel( BinaryInputStream rInStrm );
+
+virtual ApiControlType getControlType() const;
+
+public:
+sal_uInt32   mnListIndex;
+

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

2013-03-14 Thread Thorsten Behrens
 oox/Library_oox.mk   |1 
 oox/inc/oox/ppt/comments.hxx |   72 ---
 oox/source/ppt/comments.cxx  |   65 ++
 3 files changed, 74 insertions(+), 64 deletions(-)

New commits:
commit 42f9c7f8364818e91c95cf3dae8ab9ae6f1b561e
Author: Thorsten Behrens tbehr...@suse.com
Date:   Thu Mar 14 12:52:03 2013 +0100

More cleanup of pptx comment import code.

- moved non-trivial code out of header file
- replaced all std::string occurences with OUString
- binned boost/atoi string parsing in favour of builtins.

Change-Id: I872e18e33ae9b997e041b4ccc26f80e79b54052b

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 303b21f..e468256 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -253,6 +253,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/ppt/animvariantcontext \
 oox/source/ppt/backgroundproperties \
 oox/source/ppt/buildlistcontext \
+oox/source/ppt/comments \
 oox/source/ppt/commonbehaviorcontext \
 oox/source/ppt/commontimenodecontext \
 oox/source/ppt/conditioncontext \
diff --git a/oox/inc/oox/ppt/comments.hxx b/oox/inc/oox/ppt/comments.hxx
index 81bcb78..fe718db 100644
--- a/oox/inc/oox/ppt/comments.hxx
+++ b/oox/inc/oox/ppt/comments.hxx
@@ -12,10 +12,7 @@
 #define OOX_PPT_COMMENTS_HXX
 
 #include vector
-#include boost/algorithm/string.hpp //split function to tokenize for date 
time
-
 #include com/sun/star/util/DateTime.hpp
-#include com/sun/star/lang/IllegalArgumentException.hpp
 
 namespace oox { namespace ppt {
 
@@ -34,20 +31,7 @@ class CommentAuthorList
 std::vectorCommentAuthor cmAuthorLst;
 
 public:
-void setValues(const CommentAuthorList list)
-{
-std::vectorCommentAuthor::const_iterator it;
-for(it = list.cmAuthorLst.begin(); it != list.cmAuthorLst.end(); 
++it)
-{
-CommentAuthor temp;
-cmAuthorLst.push_back(temp);
-cmAuthorLst.back().clrIdx = it-clrIdx;
-cmAuthorLst.back().id = it-id;
-cmAuthorLst.back().initials = it-initials;
-cmAuthorLst.back().lastIdx = it-lastIdx;
-cmAuthorLst.back().name = it-name;
-}
-}
+void setValues(const CommentAuthorList list);
 
 const std::vectorCommentAuthor getCmAuthorLst() const
 {
@@ -73,20 +57,7 @@ class Comment
 ::rtl::OUString text;
 ::com::sun::star::util::DateTime aDateTime;
 
-//DateTime is saved as : 2013-01-10T15:53:26.000
-void setDateTime (::rtl::OUString datetime)
-{
-std::string _datetime = rtl::OUStringToOString(datetime, 
RTL_TEXTENCODING_UTF8).getStr();
-std::vectorstd::string _dt;
-boost::split( _dt, _datetime, boost::is_any_of( -:T ) );
-aDateTime.Year = atoi(_dt.at(0).c_str());
-aDateTime.Month = atoi(_dt.at(1).c_str());
-aDateTime.Day = atoi(_dt.at(2).c_str());
-aDateTime.Hours = atoi(_dt.at(3).c_str());
-aDateTime.Minutes = atoi(_dt.at(4).c_str());
-aDateTime.HundredthSeconds = atoi(_dt.at(5).c_str());
-std::vectorstd::string::iterator i;
-}
+void setDateTime (::rtl::OUString datetime);
 
 public:
 void setAuthorId(const ::rtl::OUString _aId)
@@ -107,10 +78,6 @@ class Comment
 x=_x;
 y=_y;
 }
-void setText(std::string _text)
-{
-text = rtl::OUString::createFromAscii (  _text.c_str() );
-}
 void setText(const rtl::OUString _text)
 {
 text = _text;
@@ -143,32 +110,15 @@ class Comment
 {
 return aDateTime;
 }
-int getIntX()
-{
-std::string temp = rtl::OUStringToOString(get_X(), 
RTL_TEXTENCODING_UTF8).getStr();
-return atoi(temp.c_str());
-}
-int getIntY()
+sal_Int32 getIntX()
 {
-std::string temp = rtl::OUStringToOString(get_Y(), 
RTL_TEXTENCODING_UTF8).getStr();
-return atoi(temp.c_str());
+return x.toInt32();
 }
-OUString getAuthor ( const CommentAuthorList list )
+sal_Int32 getIntY()
 {
-std::string temp = rtl::OUStringToOString(authorId, 
RTL_TEXTENCODING_UTF8).getStr();
-int aId = atoi(temp.c_str());
-std::vectorCommentAuthor::const_iterator it;
-for(it = list.cmAuthorLst.begin(); it != list.cmAuthorLst.end(); 
++it)
-{
-temp = rtl::OUStringToOString(it-id, 
RTL_TEXTENCODING_UTF8).getStr();
-
-int list_aId = atoi(temp.c_str());
-std::string temp_a =rtl::OUStringToOString(it-name, 
RTL_TEXTENCODING_UTF8).getStr();
-if(list_aId == aId)
-return it-name;
-

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

2013-03-13 Thread Vinaya
 oox/inc/oox/ppt/comments.hxx|  195 
 oox/inc/oox/ppt/presentationfragmenthandler.hxx |5 
 oox/inc/oox/ppt/slidefragmenthandler.hxx|7 
 oox/inc/oox/ppt/slidepersist.hxx|   11 +
 oox/source/ppt/presentationfragmenthandler.cxx  |   46 +
 oox/source/ppt/slidefragmenthandler.cxx |   34 
 6 files changed, 295 insertions(+), 3 deletions(-)

New commits:
commit 856756ec77ac64d1caee6c1b80c3641d4e487b2d
Author: Vinaya vinaya.man...@synerzip.com
Date:   Fri Feb 8 19:19:38 2013 +0530

Changes to enable display of comments annotations in pptx files

Change-Id: Ibf7dc0c61dc46d1568abe47285662810f79410e7
Change-Id: I965798cd3a539ab8deffcdf4a8e2c52c9e8e8fc1
Reviewed-on: https://gerrit.libreoffice.org/2048
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/oox/inc/oox/ppt/comments.hxx b/oox/inc/oox/ppt/comments.hxx
new file mode 100644
index 000..44ea442
--- /dev/null
+++ b/oox/inc/oox/ppt/comments.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+
+#ifndef OOX_PPT_COMMENTS_HXX
+#define OOX_PPT_COMMENTS_HXX
+
+#define ELEMENT_NOT_FOUND 0
+
+using rtl::OUString;
+#include vector
+#include boost/algorithm/string.hpp //split function to tokenize for date 
time
+
+#include com/sun/star/util/DateTime.hpp
+
+
+struct commentAuthor
+{
+::rtl::OUString clrIdx;
+::rtl::OUString id;
+::rtl::OUString initials;
+::rtl::OUString lastIdx;
+::rtl::OUString name;
+};
+
+class commentAuthorList
+{
+private:
+std::vectorcommentAuthor cmAuthorLst;
+public:
+void setValues( commentAuthorList list)
+{
+std::vectorcommentAuthor::iterator it;
+for(it=list.cmAuthorLst.begin();it!=list.cmAuthorLst.end();it++)
+{
+commentAuthor temp;
+cmAuthorLst.push_back(temp);
+cmAuthorLst.back().clrIdx = it-clrIdx;
+cmAuthorLst.back().id = it-id;
+cmAuthorLst.back().initials = it-initials;
+cmAuthorLst.back().lastIdx = it-lastIdx;
+cmAuthorLst.back().name = it-name;
+}
+}
+
+std::vectorcommentAuthor getCmAuthorLst()
+{
+return cmAuthorLst;
+}
+void addAuthor(commentAuthor _author)
+{
+cmAuthorLst.push_back(_author);
+}
+friend class comment;
+};
+
+class comment
+{
+private:
+::rtl::OUString authorId;
+::rtl::OUString dt;
+::rtl::OUString idx;
+::rtl::OUString x;
+::rtl::OUString y;
+::rtl::OUString text;
+::com::sun::star::util::DateTime aDateTime;
+
+public:
+void setAuthorId(::rtl::OUString _aId)
+{
+authorId = _aId;
+}
+void setdt(::rtl::OUString _dt)
+{
+dt=_dt;
+setDateTime(_dt);
+}
+void setidx(::rtl::OUString _idx)
+{
+idx=_idx;
+}
+void setPoint(::rtl::OUString _x, ::rtl::OUString _y)
+{
+x=_x;
+y=_y;
+}
+void setText(std::string _text)
+{
+text = rtl::OUString::createFromAscii (  _text.c_str() );
+}
+void setText(rtl::OUString _text)
+{
+text = _text;
+}
+
+private:
+//DateTime is saved as : 2013-01-10T15:53:26.000
+void setDateTime (::rtl::OUString datetime)
+{
+std::string _datetime = rtl::OUStringToOString(datetime, 
RTL_TEXTENCODING_UTF8).getStr();
+std::vectorstd::string _dt;
+boost::split( _dt, _datetime, boost::is_any_of( -:T ) );
+aDateTime.Year = atoi(_dt.at(0).c_str());
+aDateTime.Month = atoi(_dt.at(1).c_str());
+aDateTime.Day = atoi(_dt.at(2).c_str());
+aDateTime.Hours = atoi(_dt.at(3).c_str());
+aDateTime.Minutes = atoi(_dt.at(4).c_str());
+aDateTime.HundredthSeconds = atoi(_dt.at(5).c_str());
+std::vectorstd::string::iterator i;
+}
+
+public:
+::rtl::OUString getAuthorId()
+{
+return authorId;
+}
+::rtl::OUString getdt()
+{
+return dt;
+}
+::rtl::OUString getidx()
+{
+return idx;
+}
+::rtl::OUString get_X()
+{
+return x;
+}
+::rtl::OUString get_Y()
+{
+return y;
+}
+::rtl::OUString 

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

2013-03-13 Thread Noel Power
 oox/inc/oox/drawingml/shape.hxx |5 -
 oox/source/drawingml/chart/chartdrawingfragment.cxx |2 +-
 oox/source/drawingml/shape.cxx  |   15 +++
 oox/source/ppt/dgmimport.cxx|2 +-
 oox/source/ppt/pptshape.cxx |2 +-
 oox/source/ppt/slidepersist.cxx |2 +-
 oox/source/shape/ShapeContextHandler.cxx|6 +++---
 sc/source/filter/oox/drawingfragment.cxx|2 +-
 8 files changed, 23 insertions(+), 13 deletions(-)

New commits:
commit 1dbd088e4fb9597b0e2f5e4c4db6ecf047d85da3
Author: Noel Power noel.po...@suse.com
Date:   Tue Mar 12 20:37:15 2013 +

bnc#798309 inherit group style from parent

Change-Id: Ie4f1d244f1c9b4935305742d12cabaee3e38647c

diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 0b82a01..88d37b3 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -149,6 +149,7 @@ public:
 const Theme* pTheme,
 const ::com::sun::star::uno::Reference 
::com::sun::star::drawing::XShapes  rxShapes,
 basegfx::B2DHomMatrix aTransformation,
+FillProperties rShapeOrParentShapeFillProps,
 const ::com::sun::star::awt::Rectangle* pShapeRect 
= 0,
 ShapeIdMap* pShapeMap = 0 );
 
@@ -183,7 +184,9 @@ protected:
 const ::com::sun::star::awt::Rectangle* pShapeRect,
 sal_Bool bClearText,
 sal_Bool bDoNotInsertEmptyTextBody,
-basegfx::B2DHomMatrix aTransformation );
+basegfx::B2DHomMatrix aTransformation,
+FillProperties rShapeOrParentShapeFillProps
+ );
 
 voidaddChildren(
 ::oox::core::XmlFilterBase rFilterBase,
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx 
b/oox/source/drawingml/chart/chartdrawingfragment.cxx
index 707a4ab..4f46603 100644
--- a/oox/source/drawingml/chart/chartdrawingfragment.cxx
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -215,7 +215,7 @@ void ChartDrawingFragment::onEndElement()
 getLimitedValue sal_Int32, sal_Int64 ( 
aShapeRectEmu.Width, 0, SAL_MAX_INT32 ),
 getLimitedValue sal_Int32, sal_Int64 ( 
aShapeRectEmu.Height, 0, SAL_MAX_INT32 ) );
 basegfx::B2DHomMatrix aMatrix;
-mxShape-addShape( getFilter(), getFilter().getCurrentTheme(), 
mxDrawPage, aMatrix, aShapeRectEmu32 );
+mxShape-addShape( getFilter(), getFilter().getCurrentTheme(), 
mxDrawPage, aMatrix, mxShape-getFillProperties(), aShapeRectEmu32 );
 }
 }
 mxShape.reset();
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 45cc868..acb7128 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -193,6 +193,7 @@ void Shape::addShape(
 const Theme* pTheme,
 const Reference XShapes  rxShapes,
 basegfx::B2DHomMatrix aTransformation,
+FillProperties rShapeOrParentShapeFillProps,
 const awt::Rectangle* pShapeRect,
 ShapeIdMap* pShapeMap )
 {
@@ -204,7 +205,7 @@ void Shape::addShape(
 if( !sServiceName.isEmpty() )
 {
 basegfx::B2DHomMatrix aMatrix( aTransformation );
-Reference XShape  xShape( createAndInsert( rFilterBase, 
sServiceName, pTheme, rxShapes, pShapeRect, sal_False, sal_False, aMatrix ) );
+Reference XShape  xShape( createAndInsert( rFilterBase, 
sServiceName, pTheme, rxShapes, pShapeRect, sal_False, sal_False, aMatrix, 
rShapeOrParentShapeFillProps ) );
 
 if( pShapeMap  !msId.isEmpty() )
 {
@@ -309,7 +310,7 @@ void Shape::addChildren(
 std::vector ShapePtr ::iterator aIter( rMaster.maChildren.begin() );
 while( aIter != rMaster.maChildren.end() ) {
 (*aIter)-setMasterTextListStyle( mpMasterTextListStyle );
-(*aIter++)-addShape( rFilterBase, pTheme, rxShapes, 
aChildTransformation, NULL, pShapeMap );
+(*aIter++)-addShape( rFilterBase, pTheme, rxShapes, 
aChildTransformation, getFillProperties(), NULL, pShapeMap );
 }
 }
 
@@ -321,7 +322,8 @@ Reference XShape  Shape::createAndInsert(
 const awt::Rectangle* /* pShapeRect */,
 sal_Bool bClearText,
 sal_Bool bDoNotInsertEmptyTextBody,
-basegfx::B2DHomMatrix aParentTransformation )
+basegfx::B2DHomMatrix aParentTransformation,
+FillProperties rShapeOrParentShapeFillProps )
 {
 bool bIsEmbMedia = false;
 SAL_INFO(oox, OSL_THIS_FUNC   id:   msId);
@@ -516,7 +518,12 @@ Reference XShape  Shape::createAndInsert(
 }
 
 

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

2013-03-13 Thread Thorsten Behrens
 oox/inc/oox/ppt/comments.hxx|  100 +++---
 oox/inc/oox/ppt/presentationfragmenthandler.hxx |6 -
 oox/inc/oox/ppt/slidefragmenthandler.hxx|   11 +-
 oox/inc/oox/ppt/slidepersist.hxx|   15 +--
 oox/source/ppt/presentationfragmenthandler.cxx  |  106 +++-
 oox/source/ppt/slidefragmenthandler.cxx |   41 -
 6 files changed, 154 insertions(+), 125 deletions(-)

New commits:
commit 83e1044d939285f90a3e1adbc67d1c4d08cb5c58
Author: Thorsten Behrens tbehr...@suse.com
Date:   Wed Mar 13 20:54:06 2013 +0100

Cleanup pptx comment import patch a bit.

This cleans up 856756ec77ac64d1caee6c1b80c3641d4e487b2d a bit:
 * add vim footer for new file
 * use UpperCamelCase for class names
 * use const references for parameter / bulk object passing
 * indent properly
 * don't mix private/public class members randomly
 * use customary exception object, actually handle the error
 * stick comment classes into oox namespace
 * use 'ma' class member prefixes where applicable

Change-Id: I98021415331e62a8ee583ecfd27829f7dbfbc498

diff --git a/oox/inc/oox/ppt/comments.hxx b/oox/inc/oox/ppt/comments.hxx
index 44ea442..81bcb78 100644
--- a/oox/inc/oox/ppt/comments.hxx
+++ b/oox/inc/oox/ppt/comments.hxx
@@ -11,16 +11,15 @@
 #ifndef OOX_PPT_COMMENTS_HXX
 #define OOX_PPT_COMMENTS_HXX
 
-#define ELEMENT_NOT_FOUND 0
-
-using rtl::OUString;
 #include vector
 #include boost/algorithm/string.hpp //split function to tokenize for date 
time
 
 #include com/sun/star/util/DateTime.hpp
+#include com/sun/star/lang/IllegalArgumentException.hpp
 
+namespace oox { namespace ppt {
 
-struct commentAuthor
+struct CommentAuthor
 {
 ::rtl::OUString clrIdx;
 ::rtl::OUString id;
@@ -29,17 +28,18 @@ struct commentAuthor
 ::rtl::OUString name;
 };
 
-class commentAuthorList
+class CommentAuthorList
 {
 private:
-std::vectorcommentAuthor cmAuthorLst;
+std::vectorCommentAuthor cmAuthorLst;
+
 public:
-void setValues( commentAuthorList list)
+void setValues(const CommentAuthorList list)
 {
-std::vectorcommentAuthor::iterator it;
-for(it=list.cmAuthorLst.begin();it!=list.cmAuthorLst.end();it++)
+std::vectorCommentAuthor::const_iterator it;
+for(it = list.cmAuthorLst.begin(); it != list.cmAuthorLst.end(); 
++it)
 {
-commentAuthor temp;
+CommentAuthor temp;
 cmAuthorLst.push_back(temp);
 cmAuthorLst.back().clrIdx = it-clrIdx;
 cmAuthorLst.back().id = it-id;
@@ -49,18 +49,20 @@ class commentAuthorList
 }
 }
 
-std::vectorcommentAuthor getCmAuthorLst()
+const std::vectorCommentAuthor getCmAuthorLst() const
 {
 return cmAuthorLst;
 }
-void addAuthor(commentAuthor _author)
+
+void addAuthor(const CommentAuthor _author)
 {
 cmAuthorLst.push_back(_author);
 }
-friend class comment;
+
+friend class Comment;
 };
 
-class comment
+class Comment
 {
 private:
 ::rtl::OUString authorId;
@@ -71,21 +73,36 @@ class comment
 ::rtl::OUString text;
 ::com::sun::star::util::DateTime aDateTime;
 
+//DateTime is saved as : 2013-01-10T15:53:26.000
+void setDateTime (::rtl::OUString datetime)
+{
+std::string _datetime = rtl::OUStringToOString(datetime, 
RTL_TEXTENCODING_UTF8).getStr();
+std::vectorstd::string _dt;
+boost::split( _dt, _datetime, boost::is_any_of( -:T ) );
+aDateTime.Year = atoi(_dt.at(0).c_str());
+aDateTime.Month = atoi(_dt.at(1).c_str());
+aDateTime.Day = atoi(_dt.at(2).c_str());
+aDateTime.Hours = atoi(_dt.at(3).c_str());
+aDateTime.Minutes = atoi(_dt.at(4).c_str());
+aDateTime.HundredthSeconds = atoi(_dt.at(5).c_str());
+std::vectorstd::string::iterator i;
+}
+
 public:
-void setAuthorId(::rtl::OUString _aId)
+void setAuthorId(const ::rtl::OUString _aId)
 {
 authorId = _aId;
 }
-void setdt(::rtl::OUString _dt)
+void setdt(const ::rtl::OUString _dt)
 {
 dt=_dt;
 setDateTime(_dt);
 }
-void setidx(::rtl::OUString _idx)
+void setidx(const ::rtl::OUString _idx)
 {
 idx=_idx;
 }
-void setPoint(::rtl::OUString _x, ::rtl::OUString _y)
+void setPoint(const ::rtl::OUString _x, const ::rtl::OUString _y)
 {
 x=_x;
 y=_y;
@@ -94,28 +111,10 @@ class comment
 {
 text = rtl::OUString::createFromAscii (  _text.c_str() );
 }
-void setText(rtl::OUString _text)
+void setText(const rtl::OUString _text)
 

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

2013-03-11 Thread SJacobi
 oox/inc/oox/core/filterbase.hxx |4 
 oox/inc/oox/ppt/presentationfragmenthandler.hxx |3 
 oox/source/core/filterbase.cxx  |9 
 oox/source/ppt/presentationfragmenthandler.cxx  |  269 ++--
 4 files changed, 174 insertions(+), 111 deletions(-)

New commits:
commit a09e0137c11ce47f7d4fc598b19d18a7d8951bf1
Author: SJacobi sven-jac...@gmx.de
Date:   Mon Mar 11 13:29:47 2013 +0100

pptx import:supporting FilterData properties:PageRange and ImportNotesPages

Change-Id: I9da8455bb10e93f1ae6c4894d4f15ff7fbcdfa07

diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx
index 171ae5f..5f47ea9 100644
--- a/oox/inc/oox/core/filterbase.hxx
+++ b/oox/inc/oox/core/filterbase.hxx
@@ -32,6 +32,7 @@
 #include com/sun/star/lang/XServiceInfo.hpp
 #include cppuhelper/basemutex.hxx
 #include cppuhelper/implbase5.hxx
+#include comphelper/sequenceashashmap.hxx
 #include oox/helper/binarystreambase.hxx
 #include oox/helper/storagebase.hxx
 #include oox/dllapi.h
@@ -140,6 +141,9 @@ public:
 const ::com::sun::star::uno::Reference 
::com::sun::star::task::XStatusIndicator 
 getStatusIndicator() const;
 
+/** Returns the FilterData */
+::comphelper::SequenceAsHashMap getFilterData() const;
+
 /** Returns the media descriptor. */
 ::comphelper::MediaDescriptor getMediaDescriptor() const;
 
diff --git a/oox/inc/oox/ppt/presentationfragmenthandler.hxx 
b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
index 6943368..bb94884 100644
--- a/oox/inc/oox/ppt/presentationfragmenthandler.hxx
+++ b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
@@ -48,6 +48,9 @@ protected:
 const oox::ppt::SlidePersistPtr pPersist );
 
 private:
+
+void importSlide(sal_uInt32 nSlide, sal_Bool bFirstSlide, sal_Bool 
bImportNotes);
+
 std::vector rtl::OUString  maSlideMasterVector;
 std::vector rtl::OUString  maSlidesVector;
 std::vector rtl::OUString  maNotesMasterVector;
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 3c3e8c3..8643d2c 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -132,6 +132,7 @@ struct FilterBaseImpl
 
 FilterDirection meDirection;
 SequenceAsHashMap   maArguments;
+SequenceAsHashMap   maFilterData;
 MediaDescriptor maMediaDesc;
 OUStringmaFileUrl;
 StorageRef  mxStorage;
@@ -202,6 +203,8 @@ void FilterBaseImpl::finalizeFilter()
 {
 try
 {
+// writing back the FilterData to the MediaDescriptor
+maMediaDesc[FilterData] = 
makeAny(maFilterData.getAsConstPropertyValueList());
 // write the descriptor back to the document model (adds the passwords)
 mxModel-attachResource( maFileUrl, 
maMediaDesc.getAsConstPropertyValueList() );
 // unlock the model controllers
@@ -278,6 +281,11 @@ MediaDescriptor FilterBase::getMediaDescriptor() const
 return mxImpl-maMediaDesc;
 }
 
+SequenceAsHashMap FilterBase::getFilterData() const
+{
+return mxImpl-maFilterData;
+}
+
 const OUString FilterBase::getFileUrl() const
 {
 return mxImpl-maFileUrl;
@@ -548,6 +556,7 @@ void FilterBase::setMediaDescriptor( const Sequence 
PropertyValue  rMediaDesc
 mxImpl-mxStatusIndicator = mxImpl-maMediaDesc.getUnpackedValueOrDefault( 
MediaDescriptor::PROP_STATUSINDICATOR(), Reference XStatusIndicator () );
 mxImpl-mxInteractionHandler = 
mxImpl-maMediaDesc.getUnpackedValueOrDefault( 
MediaDescriptor::PROP_INTERACTIONHANDLER(), Reference XInteractionHandler () 
);
 mxImpl-mxParentShape = mxImpl-maMediaDesc.getUnpackedValueOrDefault( 
ParentShape, mxImpl-mxParentShape );
+mxImpl-maFilterData = mxImpl-maMediaDesc.getUnpackedValueOrDefault( 
FilterData, Sequence PropertyValue () );
 
 // Check for ISO OOXML
 OUString sFilterName = mxImpl-maMediaDesc.getUnpackedValueOrDefault( 
FilterName, OUString() );
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 6d077e7..c2fdf53 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -19,6 +19,7 @@
 
 #include comphelper/anytostring.hxx
 #include cppuhelper/exc_hlp.hxx
+#include tools/multisel.hxx
 
 #include com/sun/star/drawing/XMasterPagesSupplier.hpp
 #include com/sun/star/drawing/XDrawPages.hpp
@@ -130,133 +131,123 @@ void ResolveTextFields( XmlFilterBase rFilter )
 }
 }
 
-void PresentationFragmentHandler::finalizeImport()
+void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool 
bFirstPage, sal_Bool bImportNotesPage)
 {
-// todo: localized progress bar text
-const Reference task::XStatusIndicator  rxStatusIndicator( 
getFilter().getStatusIndicator() );
-if ( rxStatusIndicator.is() )
-rxStatusIndicator-start( OUString(), 1 );
+PowerPointImport rFilter = dynamic_cast PowerPointImport 

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

2013-03-06 Thread Pallavi Jadhav
 oox/inc/oox/export/drawingml.hxx |1 +
 oox/source/export/drawingml.cxx  |   24 
 oox/source/export/shapes.cxx |2 ++
 3 files changed, 27 insertions(+)

New commits:
commit 5d10a0180f5e9922ca197cdea00ee84bc4b2d313
Author: Pallavi Jadhav pallavi.jad...@synerzip.com
Date:   Fri Feb 8 10:11:42 2013 +0530

fdo#48735: Save crop information in PPTX.

fdo#48735: Save crop information in PPTX.

Change-Id: I8aee13b11406988ab451034f43ee41c662add5fb

diff --git a/oox/inc/oox/export/drawingml.hxx b/oox/inc/oox/export/drawingml.hxx
index 6198ec6..09da104 100644
--- a/oox/inc/oox/export/drawingml.hxx
+++ b/oox/inc/oox/export/drawingml.hxx
@@ -106,6 +106,7 @@ public:
 void WriteGradientFill( ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  rXPropSet );
 void WriteBlipFill( ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  rXPropSet, OUString sURLPropName, 
sal_Int32 nXmlNamespace );
 void WriteBlipFill( ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  rXPropSet, OUString sURLPropName );
+void WriteSrcRect( ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet , const OUString );
 void WriteOutline( ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  rXPropSet );
 void WriteStretch();
 void WriteLinespacing( ::com::sun::star::style::LineSpacing rLineSpacing 
);
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index d26002a..ead3ed2 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -44,12 +44,14 @@
 #include com/sun/star/drawing/TextVerticalAdjust.hpp
 #include com/sun/star/drawing/XShape.hpp
 #include com/sun/star/drawing/FillStyle.hpp
+#include com/sun/star/geometry/IntegerRectangle2D.hpp
 #include com/sun/star/i18n/ScriptType.hpp
 #include com/sun/star/io/XOutputStream.hpp
 #include com/sun/star/style/LineSpacing.hpp
 #include com/sun/star/style/LineSpacingMode.hpp
 #include com/sun/star/style/ParagraphAdjust.hpp
 #include com/sun/star/text/WritingMode.hpp
+#include com/sun/star/text/GraphicCrop.hpp
 #include com/sun/star/text/XText.hpp
 #include com/sun/star/text/XTextContent.hpp
 #include com/sun/star/text/XTextField.hpp
@@ -83,6 +85,7 @@ using ::com::sun::star::beans::XPropertyState;
 using ::com::sun::star::container::XEnumeration;
 using ::com::sun::star::container::XEnumerationAccess;
 using ::com::sun::star::container::XIndexAccess;
+using ::com::sun::star::geometry::IntegerRectangle2D;
 using ::com::sun::star::io::XOutputStream;
 using ::com::sun::star::style::LineSpacing;
 using ::com::sun::star::text::XText;
@@ -604,6 +607,27 @@ void DrawingML::WriteBlipFill( Reference XPropertySet  
rXPropSet, OUString sUR
 }
 }
 
+void DrawingML::WriteSrcRect( Reference XPropertySet  rXPropSet, const 
OUString rURL )
+{
+Size aOriginalSize( GraphicObject::CreateGraphicObjectFromURL( rURL 
).GetPrefSize() );
+
+if ( GetProperty( rXPropSet, GraphicCrop ) )
+{
+::com::sun::star::text::GraphicCrop aGraphicCropStruct;
+mAny = aGraphicCropStruct;
+
+if ( (0 != aGraphicCropStruct.Left) || (0 != aGraphicCropStruct.Top) 
|| (0 != aGraphicCropStruct.Right) || (0 != aGraphicCropStruct.Bottom) )
+{
+mpFS-singleElementNS( XML_a, XML_srcRect,
+  XML_l, I32S(((aGraphicCropStruct.Left) * 
10)/aOriginalSize.Width()),
+  XML_t, I32S(((aGraphicCropStruct.Top) * 
10)/aOriginalSize.Height()),
+  XML_r, I32S(((aGraphicCropStruct.Right) * 
10)/aOriginalSize.Width()),
+  XML_b, I32S(((aGraphicCropStruct.Bottom) * 
10)/aOriginalSize.Height()),
+  FSEND );
+}
+}
+}
+
 void DrawingML::WriteStretch()
 {
 mpFS-startElementNS( XML_a, XML_stretch, FSEND );
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 89e6440..f26a527 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -872,6 +872,8 @@ void ShapeExport::WriteGraphicObjectShapePart( Reference 
XShape  xShape, const
 
 WriteBlip( xShapeProps, sGraphicURL, pGraphic );
 
+WriteSrcRect( xShapeProps, sGraphicURL );
+
 // now we stretch always when we get pGraphic (when changing that
 // behavior, test n#780830 for regression, where the OLE sheet might get 
tiled
 bool bStretch = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-03 Thread Miklos Vajna
 oox/inc/oox/drawingml/shape.hxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 3f2767ad271714a2b32024c2838c223fdf3eb928
Author: Miklos Vajna vmik...@suse.cz
Date:   Sun Mar 3 19:39:05 2013 +0100

oox: fix doxygen comments in drawingml::shape

Change-Id: I3b2576057db49998b610da3094c3a41f2d214429

diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 4e2b491..0b82a01 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -59,8 +59,8 @@ typedef ::std::map sal_Int32, ShapeStyleRef  
ShapeStyleRefMap;
 /** Additional information for a chart embedded in a drawing shape. */
 struct ChartShapeInfo
 {
-::rtl::OUString maFragmentPath; /// Path to related XML stream, 
e.g. for charts.
-boolmbEmbedShapes;  /// True = load chart shapes into 
chart, false = load into parent drawpage.
+::rtl::OUString maFragmentPath; /// Path to related XML stream, 
e.g. for charts.
+boolmbEmbedShapes;  /// True = load chart shapes into 
chart, false = load into parent drawpage.
 
 inline explicit ChartShapeInfo( bool bEmbedShapes ) : mbEmbedShapes( 
bEmbedShapes ) {}
 };
@@ -238,19 +238,19 @@ protected:
 private:
 enum FrameType
 {
-FRAMETYPE_GENERIC,  /// Generic shape, no special type.
-FRAMETYPE_OLEOBJECT,/// OLE object embedded in a shape.
-FRAMETYPE_CHART,/// Chart embedded in a shape.
-FRAMETYPE_DIAGRAM,  /// Complex diagram drawing shape.
-FRAMETYPE_TABLE /// A table embedded in a shape.
+FRAMETYPE_GENERIC,  /// Generic shape, no special type.
+FRAMETYPE_OLEOBJECT,/// OLE object embedded in a shape.
+FRAMETYPE_CHART,/// Chart embedded in a shape.
+FRAMETYPE_DIAGRAM,  /// Complex diagram drawing shape.
+FRAMETYPE_TABLE /// A table embedded in a shape.
 };
 
 typedef ::boost::shared_ptr ::oox::vml::OleObjectInfo 
OleObjectInfoRef;
 typedef ::boost::shared_ptr ChartShapeInfo
ChartShapeInfoRef;
 
-FrameType   meFrameType;/// Type for graphic frame shapes.
-OleObjectInfoRefmxOleObjectInfo;/// Additional data for OLE 
objects.
-ChartShapeInfoRef   mxChartShapeInfo;   /// Additional data for chart 
shapes.
+FrameType   meFrameType;/// Type for graphic frame shapes.
+OleObjectInfoRefmxOleObjectInfo;/// Additional data for OLE 
objects.
+ChartShapeInfoRef   mxChartShapeInfo;   /// Additional data for chart 
shapes.
 
 sal_Int32   mnRotation;
 sal_BoolmbFlipH;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-22 Thread Norbert Thiebaud
 oox/inc/oox/ole/axbinarywriter.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit c522001687676327b6f04d0d72a1d45fe3f2b110
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Thu Feb 21 20:43:13 2013 -0600

coverity#738777 Uninitialized scalar field = unused member

Change-Id: Id4ddd4d4581aa35abfab0251737607d794a944f3
Reviewed-on: https://gerrit.libreoffice.org/2321
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/oox/inc/oox/ole/axbinarywriter.hxx 
b/oox/inc/oox/ole/axbinarywriter.hxx
index fbd0921..c344285 100644
--- a/oox/inc/oox/ole/axbinarywriter.hxx
+++ b/oox/inc/oox/ole/axbinarywriter.hxx
@@ -181,7 +181,6 @@ private:
 sal_Int64   mnPropFlagsStart; /// pos of Prop flags
 sal_Int64   mnPropFlags;/// Flags specifying existing 
properties.
 sal_Int64   mnNextProp; /// Next property to read.
-sal_Int64   mnPropsEnd; /// End position of simple/large 
properties.
 boolmbValid;/// True = stream still valid.
 boolmb64BitPropFlags;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-21 Thread Cédric Bosdonnat
 oox/inc/oox/vml/vmltextbox.hxx   |1 +
 oox/source/vml/vmltextbox.cxx|8 
 oox/source/vml/vmltextboxcontext.cxx |   11 +++
 3 files changed, 20 insertions(+)

New commits:
commit 3d46b39491af97ba360fb92182501e6b399f4f56
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Thu Feb 21 17:34:16 2013 +0100

n#779642: Import vertical layout mode from VML elements.

diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx
index 1dc30ab..f234b00 100644
--- a/oox/inc/oox/vml/vmltextbox.hxx
+++ b/oox/inc/oox/vml/vmltextbox.hxx
@@ -86,6 +86,7 @@ public:
 /// Text distance from the border (inset attribute of v:textbox), valid 
only if set.
 bool borderDistanceSet;
 int borderDistanceLeft, borderDistanceTop, borderDistanceRight, 
borderDistanceBottom;
+OUString maLayoutFlow;
 
 private:
 typedef ::std::vector TextPortionModel  PortionVector;
diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx
index f3c4102..65b8f34 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -21,7 +21,9 @@
 
 #include rtl/ustrbuf.hxx
 #include com/sun/star/awt/FontWeight.hpp
+#include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/text/XTextAppend.hpp
+#include com/sun/star/text/WritingMode.hpp
 
 namespace oox {
 namespace vml {
@@ -88,6 +90,12 @@ void TextBox::convert(uno::Referencedrawing::XShape 
xShape) const
 *pValues++ = *i;
 xTextAppend-appendTextPortion(aIt-maText, aPropSeq);
 }
+
+if ( maLayoutFlow == vertical )
+{
+uno::Referencebeans::XPropertySet xProperties(xShape, 
uno::UNO_QUERY);
+xProperties-setPropertyValue( TextWritingMode, uno::makeAny( 
text::WritingMode_TB_RL ) );
+}
 }
 
 } // namespace vml
diff --git a/oox/source/vml/vmltextboxcontext.cxx 
b/oox/source/vml/vmltextboxcontext.cxx
index 9d1c4ee..ca124bc 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -178,6 +178,17 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper 
rParent, TextBox rTextBo
 value.isEmpty() ? 0.05in : value, 0, false, false );
 rTextBox.borderDistanceSet = true;
 }
+
+OUString sStyle = rAttribs.getString( XML_style, OUString() );
+sal_Int32 nIndex = 0;
+while( nIndex = 0 )
+{
+OUString aName, aValue;
+if( ConversionHelper::separatePair( aName, aValue, sStyle.getToken( 0, 
';', nIndex ), ':' ) )
+{
+if( aName == layout-flow )  rTextBox.maLayoutFlow = aValue;
+}
+}
 }
 
 ContextHandlerRef TextBoxContext::onCreateContext( sal_Int32 nElement, const 
AttributeList rAttribs )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-13 Thread Katarina Behrens
 oox/inc/oox/export/chartexport.hxx |3 +
 oox/source/export/chartexport.cxx  |   81 -
 2 files changed, 83 insertions(+), 1 deletion(-)

New commits:
commit 32edd34a2056f0eba1a44fd01743908b1a4729b5
Author: Katarina Behrens bu...@bubli.org
Date:   Wed Feb 13 15:44:34 2013 +0100

fdo#59789: xlsx export of data point labels, first cut

Change-Id: I4a9d893ce770a559851ce2faac50b3d01b6e

diff --git a/oox/inc/oox/export/chartexport.hxx 
b/oox/inc/oox/export/chartexport.hxx
index f801fc3..83b2ef1 100644
--- a/oox/inc/oox/export/chartexport.hxx
+++ b/oox/inc/oox/export/chartexport.hxx
@@ -159,6 +159,9 @@ private:
 void exportDataPoints(
 const ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  xSeriesProperties,
 sal_Int32 nSeriesLength );
+void exportDataLabels(
+const ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  xSeriesProperties,
+sal_Int32 nSeriesLength );
 void exportGrouping( sal_Bool isBar = sal_False );
 void exportMarker();
 void exportSmooth();
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 6b53159..df2400d 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -42,6 +42,7 @@
 #include com/sun/star/chart/ChartAxisLabelPosition.hpp
 #include com/sun/star/chart/ChartAxisPosition.hpp
 #include com/sun/star/chart/ChartSolidType.hpp
+#include com/sun/star/chart/DataLabelPlacement.hpp
 
 #include com/sun/star/chart2/XChartDocument.hpp
 #include com/sun/star/chart2/XDiagram.hpp
@@ -51,6 +52,7 @@
 #include com/sun/star/chart2/XChartTypeContainer.hpp
 #include com/sun/star/chart2/XDataSeriesContainer.hpp
 #include com/sun/star/chart2/DataPointGeometry3D.hpp
+#include com/sun/star/chart2/DataPointLabel.hpp
 #include com/sun/star/chart2/data/XDataSource.hpp
 #include com/sun/star/chart2/data/XDataSink.hpp
 #include com/sun/star/chart2/data/XDataReceiver.hpp
@@ -1546,7 +1548,8 @@ void ChartExport::exportSeries( Reference 
chart2::XChartType  xChartType, sal_
 }
 }
 
-// TODO: Data Labels: show data lables
+// export data labels
+exportDataLabels( uno::Reference beans::XPropertySet ( 
aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength );
 
 // export data points
 exportDataPoints( uno::Reference beans::XPropertySet ( 
aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength );
@@ -2284,6 +2287,82 @@ void ChartExport::_exportAxis(
 pFS-endElement( FSNS( XML_c, nAxisType ) );
 }
 
+void ChartExport::exportDataLabels(
+const uno::Reference beans::XPropertySet   xSeriesProperties,
+sal_Int32 nSeriesLength )
+{
+// TODO: export field separators, missing flag vs. showing series name or 
not
+uno::Reference chart2::XDataSeries  xSeries( xSeriesProperties, 
uno::UNO_QUERY );
+Sequence sal_Int32  aDataPointSeq;
+if( xSeriesProperties.is())
+{
+FSHelperPtr pFS = GetFS();
+pFS-startElement( FSNS( XML_c, XML_dLbls ),
+FSEND );
+sal_Int32 nElem;
+for( nElem = 0; nElem  nSeriesLength; ++nElem)
+{
+uno::Reference beans::XPropertySet  xPropSet;
+
+try
+{
+xPropSet = 
SchXMLSeriesHelper::createOldAPIDataPointPropertySet(
+xSeries, nElem, getModel() );
+}
+catch( const uno::Exception  rEx )
+{
+(void)rEx; // avoid warning for pro build
+OSL_TRACE( Exception caught during Export of data label: %s,
+rtl::OUStringToOString( rEx.Message, 
RTL_TEXTENCODING_ASCII_US ).getStr() );
+}
+
+if( xPropSet.is() )
+{
+   namespace cssc2 = ::com::sun::star::chart2;
+   cssc2::DataPointLabel aLabel;
+   if( GetProperty( xPropSet, S( Label ) ) )
+   {
+   mAny = aLabel;
+
+   namespace csscd = 
::com::sun::star::chart::DataLabelPlacement;
+   sal_Int32 nPlacement;
+   const char *aPlacement = NULL;
+
+   if( GetProperty( xPropSet, S( LabelPlacement ) ) )
+   mAny = nPlacement;
+
+   switch( nPlacement )
+   {
+   case csscd::OUTSIDE:   aPlacement = outEnd;  
break;
+   case csscd::INSIDE:aPlacement = inEnd;   
break;
+   case csscd::CENTER:aPlacement = ctr; 
break;
+   case csscd::NEAR_ORIGIN:   aPlacement = inBase;  
break;
+   case csscd::TOP:   aPlacement = t;   
break;
+   case csscd::BOTTOM:aPlacement = b;   
break;
+