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

2023-08-11 Thread Caolán McNamara (via logerrit)
 include/oox/vml/vmlshape.hxx|4 ++--
 oox/source/vml/vmlshape.cxx |   10 --
 sc/source/filter/oox/commentsbuffer.cxx |7 ++-
 3 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 5aeb15e95d26ce6de28eb5f5933324828d553f41
Author: Caolán McNamara 
AuthorDate: Fri Aug 11 10:46:53 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 11 18:12:47 2023 +0200

refactor to return the position to be set by the caller instead

no change in behavior intended

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

diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx
index d46c23282324..8c63d8cbd26c 100644
--- a/include/oox/vml/vmlshape.hxx
+++ b/include/oox/vml/vmlshape.hxx
@@ -267,8 +267,8 @@ public:
 const css::uno::Reference< css::drawing::XShapes 
>& rxShapes,
 const ShapeParentAnchor* pParentAnchor = nullptr ) 
const;
 
-/** Converts position and formatting into the passed existing XShape. */
-voidconvertFormatting(
+/** Converts formatting into the passed existing XShape and returns 
position. */
+css::awt::Rectangle convertFormatting(
 const css::uno::Reference< css::drawing::XShape >& 
rxShape ) const;
 
 void setContainer(ShapeContainer* pContainer);
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 607ddf5354b4..328abeba7875 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -484,10 +484,10 @@ Reference< XShape > ShapeBase::convertAndInsert( const 
Reference< XShapes >& rxS
 return xShape;
 }
 
-void ShapeBase::convertFormatting( const Reference< XShape >& rxShape ) const
+awt::Rectangle ShapeBase::convertFormatting( const Reference< XShape >& 
rxShape ) const
 {
 if( !rxShape.is() )
-return;
+return awt::Rectangle();
 
 /*  Calculate shape rectangle. Applications may do something special
 according to some imported shape client data (e.g. Excel cell anchor). 
*/
@@ -495,11 +495,9 @@ void ShapeBase::convertFormatting( const Reference< XShape 
>& rxShape ) const
 
 // convert the shape, if the calculated rectangle is not empty
 if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) )
-{
-rxShape->setPosition( awt::Point( aShapeRect.X, aShapeRect.Y ) );
-rxShape->setSize( awt::Size( aShapeRect.Width, aShapeRect.Height ) );
 convertShapeProperties( rxShape );
-}
+
+return aShapeRect;
 }
 
 void ShapeBase::setContainer(ShapeContainer* pContainer) { mpContainer = 
pContainer; }
diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index 05deae3ee876..555ddad3a924 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -183,7 +183,12 @@ void Comment::finalizeImport()
 if( const ::oox::vml::ShapeBase* pVmlNoteShape = 
getVmlDrawing().getNoteShape( maModel.maRange.aStart ) )
 {
 // position and formatting
-pVmlNoteShape->convertFormatting( xAnnoShape );
+css::awt::Rectangle aShapeRect = 
pVmlNoteShape->convertFormatting(xAnnoShape);
+if (aShapeRect.Width > 0 || aShapeRect.Height > 0)
+{
+xAnnoShape->setPosition(css::awt::Point(aShapeRect.X, 
aShapeRect.Y));
+xAnnoShape->setSize(css::awt::Size(aShapeRect.Width, 
aShapeRect.Height));
+}
 // visibility
 bVisible = pVmlNoteShape->getTypeModel().mbVisible;
 


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

2022-06-22 Thread Noel Grandin (via logerrit)
 include/oox/helper/helper.hxx|4 -
 oox/source/drawingml/chart/axisconverter.cxx |   20 +++---
 oox/source/drawingml/chart/chartspaceconverter.cxx   |2 
 oox/source/drawingml/chart/objectformatter.cxx   |4 -
 oox/source/drawingml/chart/seriesconverter.cxx   |   28 -
 oox/source/drawingml/connectorshapecontext.cxx   |   12 +--
 oox/source/drawingml/customshapegeometry.cxx |   26 
 oox/source/drawingml/customshapeproperties.cxx   |   24 +++
 oox/source/drawingml/diagram/datamodelcontext.cxx|   20 +++---
 oox/source/drawingml/diagram/diagramdefinitioncontext.cxx|   14 ++--
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx  |   12 +--
 oox/source/drawingml/diagram/layoutnodecontext.cxx   |   12 +--
 oox/source/drawingml/embeddedwavaudiofile.cxx|4 -
 oox/source/drawingml/fillproperties.cxx  |   18 ++---
 oox/source/drawingml/graphicshapecontext.cxx |   14 ++--
 oox/source/drawingml/hyperlinkcontext.cxx|8 +-
 oox/source/drawingml/lineproperties.cxx  |   22 +++
 oox/source/drawingml/shape.cxx   |   22 +++
 oox/source/drawingml/shapecontext.cxx|8 +-
 oox/source/drawingml/shapegroupcontext.cxx   |6 -
 oox/source/drawingml/table/tablecell.cxx |6 -
 oox/source/drawingml/table/tablecellcontext.cxx  |4 -
 oox/source/drawingml/table/tablecontext.cxx  |2 
 oox/source/drawingml/table/tablerowcontext.cxx   |2 
 oox/source/drawingml/table/tablestylecontext.cxx |4 -
 oox/source/drawingml/table/tablestylelistfragmenthandler.cxx |2 
 oox/source/drawingml/textbodypropertiescontext.cxx   |4 -
 oox/source/drawingml/textcharacterproperties.cxx |   18 ++---
 oox/source/drawingml/textcharacterpropertiescontext.cxx  |8 +-
 oox/source/drawingml/texteffectscontext.cxx  |2 
 oox/source/drawingml/textfield.cxx   |2 
 oox/source/drawingml/textfieldcontext.cxx|4 -
 oox/source/drawingml/textparagraph.cxx   |2 
 oox/source/drawingml/textparagraphpropertiescontext.cxx  |   30 -
 oox/source/drawingml/textrun.cxx |2 
 oox/source/drawingml/textspacingcontext.cxx  |4 -
 oox/source/drawingml/texttabstoplistcontext.cxx  |2 
 oox/source/drawingml/themeelementscontext.cxx|4 -
 oox/source/drawingml/themefragmenthandler.cxx|2 
 oox/source/drawingml/transform2dcontext.cxx  |   20 +++---
 oox/source/helper/attributelist.cxx  |2 
 oox/source/ppt/layoutfragmenthandler.cxx |2 
 oox/source/ppt/pptgraphicshapecontext.cxx|6 -
 oox/source/ppt/pptshape.cxx  |   10 +--
 oox/source/ppt/pptshapecontext.cxx   |6 -
 oox/source/ppt/pptshapegroupcontext.cxx  |8 +-
 oox/source/ppt/presPropsfragmenthandler.cxx  |4 -
 oox/source/ppt/slidefragmenthandler.cxx  |2 
 oox/source/shape/LockedCanvasContext.cxx |4 -
 oox/source/shape/WpsContext.cxx  |   12 +--
 oox/source/vml/vmlformatting.cxx |   34 +--
 oox/source/vml/vmlshape.cxx  |   16 ++---
 oox/source/vml/vmlshapecontext.cxx   |   26 
 oox/source/vml/vmltextbox.cxx|   22 +++
 oox/source/vml/vmltextboxcontext.cxx |8 +-
 sc/source/filter/oox/SparklineFragment.cxx   |4 -
 sc/source/filter/oox/autofilterbuffer.cxx|2 
 sc/source/filter/oox/drawingfragment.cxx |2 
 58 files changed, 287 insertions(+), 287 deletions(-)

New commits:
commit 0feeb94f97332a8e803e1936d66e0f234bd51973
Author: Noel Grandin 
AuthorDate: Tue Jun 21 13:02:53 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 22 11:48:28 2022 +0200

rename oox::OptValue::get to value

as a step in replacing OptValue with std::optional

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

diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index 0c8aa2e6c358..9d5b7c3e2549 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -180,7 +180,7 @@ public:
 bool has_value() 

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

2022-06-22 Thread Noel Grandin (via logerrit)
 include/oox/helper/helper.hxx  |2 -
 oox/source/drawingml/chart/objectformatter.cxx |4 +--
 oox/source/drawingml/chart/plotareaconverter.cxx   |8 +++---
 oox/source/drawingml/chart/seriesconverter.cxx |   24 +-
 oox/source/drawingml/fillproperties.cxx|   28 ++---
 oox/source/drawingml/lineproperties.cxx|   12 -
 oox/source/drawingml/shape.cxx |8 +++---
 oox/source/drawingml/table/tablecell.cxx   |   12 -
 oox/source/drawingml/textbodyproperties.cxx|4 +--
 oox/source/drawingml/textbodypropertiescontext.cxx |4 +--
 oox/source/drawingml/textcharacterproperties.cxx   |   16 ++--
 oox/source/helper/attributelist.cxx|   18 ++---
 oox/source/vml/vmlformatting.cxx   |   20 +++
 oox/source/vml/vmlshape.cxx|8 +++---
 oox/source/vml/vmlshapecontext.cxx |4 +--
 sc/source/filter/oox/autofilterbuffer.cxx  |2 -
 sc/source/filter/oox/drawingfragment.cxx   |   16 ++--
 17 files changed, 95 insertions(+), 95 deletions(-)

New commits:
commit 813939f8e392feff0b6e1bae023bc9c98849
Author: Noel Grandin 
AuthorDate: Tue Jun 21 12:43:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 22 10:28:41 2022 +0200

rename oox::OptValue::get(Type) to value_or

as a step towards replacing OptValue with std::optional

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

diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index 90890b3ceecb..0c8aa2e6c358 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -181,7 +181,7 @@ public:
 bool operator!() const { return !mbHasValue; }
 
 const Type&  get() const { return maValue; }
-const Type&  get( const Type& rDefValue ) const { return mbHasValue ? 
maValue : rDefValue; }
+const Type&  value_or( const Type& rDefValue ) const { return mbHasValue ? 
maValue : rDefValue; }
 
 Type&operator*() { assert(mbHasValue); return maValue; }
 Type&emplace() { mbHasValue = true; maValue = Type(); return 
maValue; }
diff --git a/oox/source/drawingml/chart/objectformatter.cxx 
b/oox/source/drawingml/chart/objectformatter.cxx
index e04bfe5f0ae6..2ef67ebc683e 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1060,14 +1060,14 @@ void ObjectFormatter::convertTextRotation( PropertySet& 
rPropSet, const ModelRef
 bool bStacked = false;
 if( bSupportsStacked )
 {
-sal_Int32 nVert = rxTextProp->getTextProperties().moVert.get( XML_horz 
);
+sal_Int32 nVert = rxTextProp->getTextProperties().moVert.value_or( 
XML_horz );
 bStacked = (nVert == XML_wordArtVert) || (nVert == XML_wordArtVertRtl);
 rPropSet.setProperty( PROP_StackCharacters, bStacked );
 }
 
 /*  Chart2 expects rotation angle as double value in range of [0,360).
 OOXML counts clockwise, Chart2 counts counterclockwise. */
-double fAngle = static_cast< double >( bStacked ? 0 : 
rxTextProp->getTextProperties().moRotation.get( nDefaultRotation ) );
+double fAngle = static_cast< double >( bStacked ? 0 : 
rxTextProp->getTextProperties().moRotation.value_or( nDefaultRotation ) );
 // MS Office UI allows values only in range of [-90,90].
 if ( fAngle < -540.0 || fAngle > 540.0 )
 {
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx 
b/oox/source/drawingml/chart/plotareaconverter.cxx
index afbb28adee03..a30b3bdc6249 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -217,9 +217,9 @@ void View3DConverter::convertFromModel( const Reference< 
XDiagram >& rxDiagram,
 if( rTypeGroup.getTypeInfo().meTypeCategory == TYPECATEGORY_PIE )
 {
 // Y rotation used as 'first pie slice angle' in 3D pie charts
-rTypeGroup.convertPieRotation( aPropSet, mrModel.monRotationY.get( 0 ) 
);
+rTypeGroup.convertPieRotation( aPropSet, 
mrModel.monRotationY.value_or( 0 ) );
 // X rotation a.k.a. elevation (map OOXML [0..90] to Chart2 [-90,0])
-nRotationX = getLimitedValue< sal_Int32, sal_Int32 >( 
mrModel.monRotationX.get( 15 ), 0, 90 ) - 90;
+nRotationX = getLimitedValue< sal_Int32, sal_Int32 >( 
mrModel.monRotationX.value_or( 15 ), 0, 90 ) - 90;
 // no right-angled axes in pie charts
 bRightAngled = false;
 // ambient color (Gray 30%)
@@ -230,9 +230,9 @@ void View3DConverter::convertFromModel( const Reference< 
XDiagram >& rxDiagram,
 else // 3D bar/area/line charts
 {
 // Y rotation (OOXML [0..359], Chart2 [-179,180])
-  

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

2022-06-22 Thread Noel Grandin (via logerrit)
 include/oox/helper/helper.hxx|8 +++-
 oox/source/drawingml/effectproperties.cxx|   14 +++
 oox/source/drawingml/fillproperties.cxx  |   46 +++
 oox/source/drawingml/lineproperties.cxx  |   16 
 oox/source/drawingml/textcharacterproperties.cxx |   26 ++---
 oox/source/vml/vmlformatting.cxx |   46 +++
 oox/source/vml/vmlshape.cxx  |   10 ++---
 oox/source/vml/vmlshapecontext.cxx   |   20 +-
 sc/source/filter/oox/autofilterbuffer.cxx|2 -
 9 files changed, 97 insertions(+), 91 deletions(-)

New commits:
commit 3ff9582704a024b4a89da9a63322e117157b5857
Author: Noel Grandin 
AuthorDate: Tue Jun 21 12:18:52 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 22 10:08:35 2022 +0200

make oox::OptValue::assignIfUsed a free function

as a step towards making OptValue into std::optional.

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

diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index 9dc43bdc9b34..90890b3ceecb 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -191,13 +191,19 @@ public:
  return ( ( !mbHasValue && rValue.mbHasValue == 
false ) ||
  ( mbHasValue == rValue.mbHasValue && maValue 
== rValue.maValue ) );
  }
-void assignIfUsed( const OptValue& rValue ) { if( 
rValue.mbHasValue ) operator=(rValue.maValue); }
 
 private:
 TypemaValue;
 boolmbHasValue;
 };
 
+template< typename Type >
+void assignIfUsed( OptValue& rDestValue, const OptValue& 
rSourceValue )
+{
+if( rSourceValue.has_value() )
+rDestValue = rSourceValue.get();
+}
+
 
 /** Provides platform independent functions to convert from or to little-endian
 byte order, e.g. for reading data from or writing data to memory or a
diff --git a/oox/source/drawingml/effectproperties.cxx 
b/oox/source/drawingml/effectproperties.cxx
index 88d69a16d177..579f4e1ab0ac 100644
--- a/oox/source/drawingml/effectproperties.cxx
+++ b/oox/source/drawingml/effectproperties.cxx
@@ -21,23 +21,23 @@ namespace oox::drawingml {
 
 void EffectGlowProperties ::assignUsed(const EffectGlowProperties& 
rSourceProps)
 {
-moGlowRad.assignIfUsed( rSourceProps.moGlowRad );
+assignIfUsed( moGlowRad, rSourceProps.moGlowRad );
 moGlowColor.assignIfUsed( rSourceProps.moGlowColor );
 }
 
 void EffectSoftEdgeProperties::assignUsed(const EffectSoftEdgeProperties& 
rSourceProps)
 {
-moRad.assignIfUsed(rSourceProps.moRad);
+assignIfUsed(moRad, rSourceProps.moRad);
 }
 
 void EffectShadowProperties::assignUsed(const EffectShadowProperties& 
rSourceProps)
 {
-moShadowDist.assignIfUsed( rSourceProps.moShadowDist );
-moShadowDir.assignIfUsed( rSourceProps.moShadowDir );
-moShadowSx.assignIfUsed( rSourceProps.moShadowSx );
-moShadowSy.assignIfUsed( rSourceProps.moShadowSy );
+assignIfUsed( moShadowDist, rSourceProps.moShadowDist );
+assignIfUsed( moShadowDir, rSourceProps.moShadowDir );
+assignIfUsed( moShadowSx, rSourceProps.moShadowSx );
+assignIfUsed( moShadowSy, rSourceProps.moShadowSy );
 moShadowColor.assignIfUsed( rSourceProps.moShadowColor );
-moShadowBlur.assignIfUsed( rSourceProps.moShadowBlur );
+assignIfUsed( moShadowBlur, rSourceProps.moShadowBlur );
 
 }
 
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index b26c42b85759..f315f0182245 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -292,51 +292,51 @@ void GradientFillProperties::assignUsed( const 
GradientFillProperties& rSourcePr
 {
 if( !rSourceProps.maGradientStops.empty() )
 maGradientStops = rSourceProps.maGradientStops;
-moFillToRect.assignIfUsed( rSourceProps.moFillToRect );
-moTileRect.assignIfUsed( rSourceProps.moTileRect );
-moGradientPath.assignIfUsed( rSourceProps.moGradientPath );
-moShadeAngle.assignIfUsed( rSourceProps.moShadeAngle );
-moShadeFlip.assignIfUsed( rSourceProps.moShadeFlip );
-moShadeScaled.assignIfUsed( rSourceProps.moShadeScaled );
-moRotateWithShape.assignIfUsed( rSourceProps.moRotateWithShape );
+assignIfUsed( moFillToRect, rSourceProps.moFillToRect );
+assignIfUsed( moTileRect, rSourceProps.moTileRect );
+assignIfUsed( moGradientPath, rSourceProps.moGradientPath );
+assignIfUsed( moShadeAngle, rSourceProps.moShadeAngle );
+assignIfUsed( moShadeFlip, rSourceProps.moShadeFlip );
+assignIfUsed( moShadeScaled, rSourceProps.moShadeScaled );
+assignIfUsed( moRotateWithShape, rSourceProps.moRotateWithShape );
 }
 
 void 

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

2022-06-21 Thread Noel Grandin (via logerrit)
 include/oox/helper/helper.hxx   |2 
 oox/source/drawingml/chart/axisconverter.cxx|   20 
 oox/source/drawingml/chart/chartspaceconverter.cxx  |2 
 oox/source/drawingml/chart/objectformatter.cxx  |6 +-
 oox/source/drawingml/chart/seriesconverter.cxx  |   28 +--
 oox/source/drawingml/colorchoicecontext.cxx |2 
 oox/source/drawingml/customshapeproperties.cxx  |   22 
 oox/source/drawingml/diagram/datamodelcontext.cxx   |2 
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |   14 ++---
 oox/source/drawingml/fillproperties.cxx |   16 +++---
 oox/source/drawingml/lineproperties.cxx |   12 ++--
 oox/source/drawingml/shape.cxx  |   24 -
 oox/source/drawingml/shape3dproperties.cxx  |   40 
 oox/source/drawingml/table/predefined-table-styles.cxx  |2 
 oox/source/drawingml/table/tablecell.cxx|4 -
 oox/source/drawingml/textbodypropertiescontext.cxx  |2 
 oox/source/drawingml/textcharacterproperties.cxx|   18 +++
 oox/source/drawingml/textcharacterpropertiescontext.cxx |6 +-
 oox/source/drawingml/textfield.cxx  |2 
 oox/source/drawingml/textparagraph.cxx  |6 +-
 oox/source/drawingml/textparagraphpropertiescontext.cxx |   14 ++---
 oox/source/drawingml/textrun.cxx|4 -
 oox/source/helper/attributelist.cxx |2 
 oox/source/ppt/layoutfragmenthandler.cxx|2 
 oox/source/ppt/pptshape.cxx |6 +-
 oox/source/ppt/pptshapecontext.cxx  |2 
 oox/source/ppt/slidefragmenthandler.cxx |2 
 oox/source/shape/WpsContext.cxx |8 +--
 oox/source/vml/vmlformatting.cxx|   30 ++--
 oox/source/vml/vmlshape.cxx |   12 ++--
 oox/source/vml/vmlshapecontext.cxx  |   18 +++
 oox/source/vml/vmltextbox.cxx   |   18 +++
 oox/source/vml/vmltextboxcontext.cxx|4 -
 sc/source/filter/oox/drawingfragment.cxx|2 
 writerfilter/source/rtftok/rtfsdrimport.cxx |2 
 35 files changed, 178 insertions(+), 178 deletions(-)

New commits:
commit d8487667e65184aa58520aa907fa747a73a08e34
Author: Noel Grandin 
AuthorDate: Tue Jun 21 11:00:43 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 21 11:58:40 2022 +0200

rename oox::OptValue::has() to has_value

as a step towards converting it to std::optional

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

diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index 63718ca0ebed..1805e0b24c81 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -178,7 +178,7 @@ public:
 explicit OptValue( const Type& rValue ) : maValue( rValue ), 
mbHasValue( true ) {}
 explicit OptValue( bool bHasValue, const Type& rValue ) : maValue( 
rValue ), mbHasValue( bHasValue ) {}
 
-bool has() const { return mbHasValue; }
+bool has_value() const { return mbHasValue; }
 bool operator!() const { return !mbHasValue; }
 bool differsFrom( const Type& rValue ) const { return mbHasValue 
&& (maValue != rValue); }
 
diff --git a/oox/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index a8ccc6cdf164..bb6b278af8ac 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -55,12 +55,12 @@ namespace {
 
 void lclSetValueOrClearAny( Any& orAny, const OptValue< double >& rofValue )
 {
-if( rofValue.has() ) orAny <<= rofValue.get(); else orAny.clear();
+if( rofValue.has_value() ) orAny <<= rofValue.get(); else orAny.clear();
 }
 
 bool lclIsLogarithmicScale( const AxisModel& rAxisModel )
 {
-return rAxisModel.mofLogBase.has() && (2.0 <= rAxisModel.mofLogBase.get()) 
&& (rAxisModel.mofLogBase.get() <= 1000.0);
+return rAxisModel.mofLogBase.has_value() && (2.0 <= 
rAxisModel.mofLogBase.get()) && (rAxisModel.mofLogBase.get() <= 1000.0);
 }
 
 sal_Int32 lclGetApiTimeUnit( sal_Int32 nTimeUnit )
@@ -78,7 +78,7 @@ sal_Int32 lclGetApiTimeUnit( sal_Int32 nTimeUnit )
 
 void lclConvertTimeInterval( Any& orInterval, const OptValue< double >& 
rofUnit, sal_Int32 nTimeUnit )
 {
-if( rofUnit.has() && (1.0 <= rofUnit.get()) && (rofUnit.get() <= 
SAL_MAX_INT32) )
+if( rofUnit.has_value() && (1.0 <= rofUnit.get()) && (rofUnit.get() <= 
SAL_MAX_INT32) )
 orInterval <<= css::chart::TimeInterval( static_cast< sal_Int32 >( 
rofUnit.get() ), 

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

2022-02-05 Thread Tomaž Vajngerl (via logerrit)
 include/oox/ole/vbamodule.hxx   |   11 +--
 oox/source/ole/vbamodule.cxx|2 +-
 sc/source/ui/vba/vbaapplication.cxx |7 ++-
 3 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 6ed0ffe9177ff6851e1b1e338dd92f81e7987f57
Author: Tomaž Vajngerl 
AuthorDate: Wed Feb 2 15:20:13 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Feb 6 06:49:15 2022 +0100

vba: small fixes for GetOpenFilename and documenting structs

Check the XFileDialogSelectedItems is using the expected impl.
after dynamic_casting.

Rename VbaKeyBinding to VbaMacroKeyAndMethodBinding and document
the struct.

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

diff --git a/include/oox/ole/vbamodule.hxx b/include/oox/ole/vbamodule.hxx
index 3028136375bc..4cbb4a41c948 100644
--- a/include/oox/ole/vbamodule.hxx
+++ b/include/oox/ole/vbamodule.hxx
@@ -40,9 +40,14 @@ namespace oox {
 
 namespace oox::ole {
 
-struct VbaKeyBinding
+/** Stores, which key shortcut maps to which VBA macro method. */
+struct VbaMacroKeyAndMethodBinding
 {
+// This describes a key combinaton in "raw" VBA Macro form, that
+// still needs translated to a key event that can be used in
+// LibreOffice.
 OUString msApiKey;
+// The name of the macro method
 OUString msMethodName;
 };
 
@@ -105,7 +110,9 @@ private:
 boolmbReadOnly;
 boolmbPrivate;
 boolmbExecutable;
-std::vector maKeyBindings;
+
+/** Keys and VBA macro method bindings */
+std::vector maKeyBindings;
 };
 
 
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index 0fc9609653f3..d53e525989e6 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -136,7 +136,7 @@ void VbaModule::createAndImportModule( StorageBase& 
rVbaStrg,
 
 void VbaModule::registerShortcutKeys()
 {
-for (VbaKeyBinding const& rKeyBinding : maKeyBindings)
+for (VbaMacroKeyAndMethodBinding const& rKeyBinding : maKeyBindings)
 {
 try
 {
diff --git a/sc/source/ui/vba/vbaapplication.cxx 
b/sc/source/ui/vba/vbaapplication.cxx
index f11ee6f21bbe..7b68047d0b80 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -358,7 +358,7 @@ uno::Any SAL_CALL
 ScVbaApplication::GetOpenFilename(const uno::Any& /*aFileFilter*/, const 
uno::Any& /*aFilterIndex*/, const uno::Any& aTitle, const uno::Any& 
/*aButtonText*/, const uno::Any& aMultiSelect)
 {
 // TODO - take all parameters into account
-auto xDialog = uno::Reference (new ScVbaFileDialog( 
this, mxContext, office::MsoFileDialogType::msoFileDialogFilePicker));
+uno::Reference xDialog(new ScVbaFileDialog(this, 
mxContext, office::MsoFileDialogType::msoFileDialogFilePicker));
 xDialog->setTitle(aTitle);
 xDialog->setAllowMultiSelect(aMultiSelect);
 
@@ -373,6 +373,11 @@ ScVbaApplication::GetOpenFilename(const uno::Any& 
/*aFileFilter*/, const uno::An
 
 uno::Reference xItems = 
xDialog->getSelectedItems();
 auto* pItems = dynamic_cast(xItems.get());
+
+// Check, if the implementation of XFileDialogSelectedItems is what we 
expect
+if (!pItems)
+throw uno::RuntimeException("Unexpected XFileDialogSelectedItems 
implementation");
+
 auto const & rItemVector = pItems->getItems();
 
 if (!bMultiSelect) // only 1 selection allowed - return path


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

2021-07-08 Thread Gülşah Köse (via logerrit)
 include/oox/core/contexthandler2.hxx  |   19 +
 include/oox/core/fragmenthandler2.hxx |   11 ---
 include/oox/drawingml/graphicshapecontext.hxx |1 
 include/oox/ole/oleobjecthelper.hxx   |1 
 oox/source/core/contexthandler2.cxx   |   85 +-
 oox/source/core/fragmenthandler2.cxx  |   70 -
 oox/source/drawingml/graphicshapecontext.cxx  |   11 +++
 sc/source/filter/oox/worksheetfragment.cxx|6 -
 sd/qa/unit/data/pptx/tdf143222.pptx   |binary
 sd/qa/unit/export-tests-ooxml3.cxx|   30 +
 10 files changed, 148 insertions(+), 86 deletions(-)

New commits:
commit 92a407b7f90a98704a238c5ffa3a3491eaf3263a
Author: Gülşah Köse 
AuthorDate: Wed Jul 7 00:27:58 2021 +0300
Commit: Gülşah Köse 
CommitDate: Thu Jul 8 23:12:07 2021 +0200

tdf143222 Handle alternate content of graphicData element.

Handle alternate content and make true choice.

According to ooxml spec ole object requires exactly one pic
element. (ECMA-376 Part 1, Annex A, CT_OleObject). In the
current case first choice has not pic element and we should
allow fallback processing.

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

diff --git a/include/oox/core/contexthandler2.hxx 
b/include/oox/core/contexthandler2.hxx
index 4e256089ac8e..3a75aff5706a 100644
--- a/include/oox/core/contexthandler2.hxx
+++ b/include/oox/core/contexthandler2.hxx
@@ -72,7 +72,7 @@ struct ElementInfo;
 class OOX_DLLPUBLIC ContextHandler2Helper
 {
 public:
-explicitContextHandler2Helper( bool bEnableTrimSpace );
+explicitContextHandler2Helper( bool bEnableTrimSpace, 
XmlFilterBase& rFilter );
 explicitContextHandler2Helper( const ContextHandler2Helper& 
rParent );
 virtual ~ContextHandler2Helper();
 
@@ -201,6 +201,21 @@ protected:
 /** Must be called from endRecord() in derived classes. */
 voidimplEndRecord( sal_Int32 nRecId );
 
+boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
+XmlFilterBase&  getDocFilter() const { return mrFilter; }
+
+enum class MCE_STATE
+{
+Started,
+FoundChoice
+};
+
+MCE_STATE   getMCEState() const { return aMceState.back(); }
+voidsetMCEState( MCE_STATE aState ) { aMceState.back() = 
aState; }
+voidaddMCEState( MCE_STATE aState ) { aMceState.push_back( 
aState ); }
+voidremoveMCEState() { aMceState.pop_back(); }
+boolisMCEStateEmpty() { return aMceState.empty(); }
+
 private:
 ContextHandler2Helper& operator=( const ContextHandler2Helper& ) = delete;
 
@@ -214,9 +229,11 @@ private:
 
 ContextStackRef mxContextStack; ///< Stack of all processed 
elements.
 size_t  mnRootStackSize;///< Stack size on construction 
time.
+std::vector aMceState;
 
 protected:
 boolmbEnableTrimSpace;  ///< True = trim whitespace in 
characters().
+XmlFilterBase&  mrFilter;
 };
 
 class OOX_DLLPUBLIC ContextHandler2 : public ContextHandler, public 
ContextHandler2Helper
diff --git a/include/oox/core/fragmenthandler2.hxx 
b/include/oox/core/fragmenthandler2.hxx
index 86d1453f13a1..598426ee681e 100644
--- a/include/oox/core/fragmenthandler2.hxx
+++ b/include/oox/core/fragmenthandler2.hxx
@@ -47,17 +47,6 @@ class XmlFilterBase;
 
 class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public 
ContextHandler2Helper
 {
-protected:
-enum class MCE_STATE
-{
-Started,
-FoundChoice
-};
-::std::vector   aMceState;
-
-boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
-
-
 public:
 explicitFragmentHandler2(
 XmlFilterBase& rFilter,
diff --git a/include/oox/drawingml/graphicshapecontext.hxx 
b/include/oox/drawingml/graphicshapecontext.hxx
index 4813d5fc9aed..ffd579f00bb1 100644
--- a/include/oox/drawingml/graphicshapecontext.hxx
+++ b/include/oox/drawingml/graphicshapecontext.hxx
@@ -62,6 +62,7 @@ public:
 OleObjectGraphicDataContext( ::oox::core::ContextHandler2Helper const & 
rParent, const ShapePtr& pShapePtr );
 virtual ~OleObjectGraphicDataContext() override;
 virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const ::oox::AttributeList& rAttribs ) override;
+virtual void onEndElement() override;
 
 private:
 ::oox::vml::OleObjectInfo& mrOleObjectInfo;
diff --git a/include/oox/ole/oleobjecthelper.hxx 
b/include/oox/ole/oleobjecthelper.hxx
index d2506f3d4949..5b792f2048b1 100644
--- a/include/oox/ole/oleobjecthelper.hxx
+++ b/include/oox/ole/oleobjecthelper.hxx
@@ -47,6 +47,7 @@ 

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

2019-08-23 Thread Noel Grandin (via logerrit)
 include/oox/core/xmlfilterbase.hxx|2 +-
 include/oox/ole/axcontrol.hxx |2 +-
 include/oox/ppt/pptimport.hxx |2 +-
 include/oox/shape/ShapeFilterBase.hxx |2 +-
 oox/source/drawingml/fillproperties.cxx   |2 +-
 oox/source/ppt/pptimport.cxx  |2 +-
 oox/source/shape/ShapeFilterBase.cxx  |2 +-
 sc/source/filter/excel/xestream.cxx   |2 +-
 sc/source/filter/inc/excelfilter.hxx  |2 +-
 sc/source/filter/inc/xestream.hxx |2 +-
 sc/source/filter/oox/excelfilter.cxx  |2 +-
 sd/source/filter/eppt/epptooxml.hxx   |2 +-
 sw/source/filter/ww8/docxexportfilter.hxx |2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 09cd0e363d6c5b0e7b9cebc598030a7e3d397922
Author: Noel Grandin 
AuthorDate: Fri Aug 23 14:59:48 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 23 19:34:49 2019 +0200

loplugin:returnconstval in oox

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

diff --git a/include/oox/core/xmlfilterbase.hxx 
b/include/oox/core/xmlfilterbase.hxx
index 4f828abf82eb..68bd801eaefd 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -102,7 +102,7 @@ public:
 virtual void useInternalChartDataTable( bool /*bInternal*/ ) { }
 
 /** Has to be implemented by each filter to return the table style list. */
-virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() 
= 0;
+virtual ::oox::drawingml::table::TableStyleListPtr getTableStyles() = 0;
 
 
 OUString getFragmentPathFromFirstTypeFromOfficeDoc( const OUString& rPart 
);
diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx
index 968360a5b39b..d1d47459bdb8 100644
--- a/include/oox/ole/axcontrol.hxx
+++ b/include/oox/ole/axcontrol.hxx
@@ -334,7 +334,7 @@ public:
 PropertySet const & rPropSet,
 sal_Int32& nOrientation );
 
-const css::uno::Reference GetDocModel() const { return 
mxDocModel; }
+const css::uno::Reference & GetDocModel() const { 
return mxDocModel; }
 
 private:
 css::uno::Reference< css::frame::XModel > mxDocModel;
diff --git a/include/oox/ppt/pptimport.hxx b/include/oox/ppt/pptimport.hxx
index c97a6f8c4f57..c5ff1b1e5a0c 100644
--- a/include/oox/ppt/pptimport.hxx
+++ b/include/oox/ppt/pptimport.hxx
@@ -62,7 +62,7 @@ public:
 
 virtual const ::oox::drawingml::Theme* getCurrentTheme() const override;
 virtual ::oox::vml::Drawing* getVmlDrawing() override;
-virtual const oox::drawingml::table::TableStyleListPtr getTableStyles() 
override;
+virtual oox::drawingml::table::TableStyleListPtr getTableStyles() override;
 virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() 
override;
 
 const SlidePersistPtr&  
getActualSlidePersist() const { return mpActualSlidePersist; };
diff --git a/include/oox/shape/ShapeFilterBase.hxx 
b/include/oox/shape/ShapeFilterBase.hxx
index 50d80f39cae9..b0ddbff4e217 100644
--- a/include/oox/shape/ShapeFilterBase.hxx
+++ b/include/oox/shape/ShapeFilterBase.hxx
@@ -56,7 +56,7 @@ public:
 virtual ::oox::vml::Drawing* getVmlDrawing() override;
 
 /** Has to be implemented by each filter to return TableStyles. */
-virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() 
override;
+virtual ::oox::drawingml::table::TableStyleListPtr getTableStyles() 
override;
 
 virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() 
override;
 
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 81d46dae8a23..82c48426d1a2 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -132,7 +132,7 @@ RectanglePoint lclGetRectanglePoint( sal_Int32 nToken )
 return RectanglePoint_LEFT_TOP;
 }
 
-const awt::Size lclGetOriginalSize( const GraphicHelper& rGraphicHelper, const 
Reference< XGraphic >& rxGraphic )
+awt::Size lclGetOriginalSize( const GraphicHelper& rGraphicHelper, const 
Reference< XGraphic >& rxGraphic )
 {
 awt::Size aSizeHmm( 0, 0 );
 try
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index a5ef6c54150d..efc10c69af97 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -254,7 +254,7 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< 
PropertyValue >& rDe
 return mpActualSlidePersist ? mpActualSlidePersist->getDrawing() : nullptr;
 }
 
-const oox::drawingml::table::TableStyleListPtr 
PowerPointImport::getTableStyles()
+oox::drawingml::table::TableStyleListPtr PowerPointImport::getTableStyles()
 {
 if ( !mpTableStyleList && !maTableStyleListPath.isEmpty() )
 {
diff --git a/oox/source/shape/ShapeFilterBase.cxx 

[Libreoffice-commits] core.git: include/oox oox/source sc/source sd/source sfx2/source sw/source

2018-06-28 Thread László Németh
 include/oox/core/xmlfilterbase.hxx   |2 -
 oox/source/core/xmlfilterbase.cxx|   50 +--
 sc/source/filter/excel/excdoc.cxx|2 -
 sd/source/filter/eppt/pptx-epptooxml.cxx |   14 
 sfx2/source/doc/objstor.cxx  |   27 
 sw/source/filter/ww8/docxexport.cxx  |4 +-
 6 files changed, 80 insertions(+), 19 deletions(-)

New commits:
commit 9a5c56a9c4e04589b0a6bb710573922e459d9685
Author: László Németh 
Date:   Wed Jun 20 16:28:13 2018 +0200

tdf#107690 OOXML import/export of setting "Open as read-only"

Import custom document property _MarkAsFinal as LoadReadonly
setting, export LoadReadonly as _MarkAsFinal in DOCX, XLSX
and PPTX documents.

Before this fix, LibreOffice opened read-only OOXML documents
as editable, also saved and exported _MarkAsFinal=true silently,
resulting unintented read-only warning info bar in MSO.

This commit improves interoperability a lot, because this is a
basic document protection of MSO, recommended on its UI.

Note: LoadReadonly (on File->Properties...->Security, property
"Open file read-only") doesn't show "Edit read-only" info bar
from commit 630186ff4e0eba7317e542f8c3eca39ebd068721,
but it's still possible to switch on editing by Edit->Edit Mode.
MSO shows info bar for _MarkAsFinal. (There is an advantage to
hide the info bar in LibreOffice in a mixed environment,
to avoid overwriting of press-ready MSO files by LibreOffice.)

Note 2: Other differences of LoadReadonly in LO and _MarkAsFinal
in MSO: (1) Switching on editing doesn't remove the LoadReadonly
property automatically in LO. (2) Saving with LoadReadonly doesn't
switch off editing of the actual (still opened) document in LO.

Change-Id: Ie279c0670090d075103384cfa44ff1c2a2898216
Reviewed-on: https://gerrit.libreoffice.org/56180
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/include/oox/core/xmlfilterbase.hxx 
b/include/oox/core/xmlfilterbase.hxx
index ffe0c5bc45e3..e2be8d14f9c8 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -224,7 +224,7 @@ public:
 
 @param xProperties  The document properties to export.
  */
-void exportDocumentProperties( const css::uno::Reference< 
css::document::XDocumentProperties >& xProperties );
+void exportDocumentProperties( const css::uno::Reference< 
css::document::XDocumentProperties >& xProperties, bool 
bSecurityOptOpenReadOnly );
 
 /** Write the customXml entries we are preserving (xlsx and pptx only). */
 void exportCustomFragments();
diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 57a752489960..5168d81fb7fb 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -750,13 +750,31 @@ writeAppProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentProperties >
 }
 
 static void
-writeCustomProperties( XmlFilterBase& rSelf, const Reference< 
XDocumentProperties >& xProperties )
+writeCustomProperties( XmlFilterBase& rSelf, const Reference< 
XDocumentProperties >& xProperties, bool bSecurityOptOpenReadOnly )
 {
 uno::Reference xUserDefinedProperties( 
xProperties->getUserDefinedProperties(), uno::UNO_QUERY );
 Sequence< PropertyValue > aprop( 
xUserDefinedProperties->getPropertyValues() );
 sal_Int32 nbCustomProperties = aprop.getLength();
 // tdf#89791 : if no custom properties, no need to add docProps/custom.x
-if (!nbCustomProperties)
+// tdf#107690: except the case of read-only documents, because that
+// is handled by the _MarkAsFinal custom property in MSO.
+if (!nbCustomProperties && !bSecurityOptOpenReadOnly)
+return;
+
+std::vector aprop2;
+for ( sal_Int32 n = 0; n < nbCustomProperties; ++n )
+aprop2.push_back(aprop[n]);
+
+if (bSecurityOptOpenReadOnly)
+{
+PropertyValue aPropertyValue;
+// MSO custom property for read-only documents
+aPropertyValue.Name = "_MarkAsFinal";
+aPropertyValue.Value <<= true;
+aprop2.push_back(aPropertyValue);
+}
+
+if (!aprop2.size())
 return;
 
 rSelf.addRelation(
@@ -770,11 +788,12 @@ writeCustomProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentPropertie
 FSNS( XML_xmlns, XML_vt ),  
OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)), 
RTL_TEXTENCODING_UTF8).getStr(),
 FSEND );
 
-for ( sal_Int32 n = 0; n < nbCustomProperties; ++n )
+auto aIt = aprop2.begin();
+for ( size_t n = 0; n < aprop2.size(); ++n )
 {
-if ( !aprop[n].Name.isEmpty() )
+if ( !aIt->Name.isEmpty() )
 {
-OString aName = OUStringToOString( aprop[n].Name, 
RTL_TEXTENCODING_ASCII_US );
+OString aName = OUStringToOString( aIt->Name, 
RTL_TEXTENCODING_ASCII_US );
 

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

2017-09-23 Thread Szymon Kłos
 include/oox/export/chartexport.hxx  |3 +--
 oox/source/export/chartexport.cxx   |   10 +-
 oox/source/export/shapes.cxx|2 +-
 sc/source/filter/excel/xeescher.cxx |3 ++-
 sd/qa/unit/data/pptx/tdf112089.pptx |binary
 sd/qa/unit/export-tests-ooxml2.cxx  |   16 
 6 files changed, 21 insertions(+), 13 deletions(-)

New commits:
commit c0a61832965aff202d72a2bf51556c5c6b6d594b
Author: Szymon Kłos 
Date:   Wed Sep 20 16:29:54 2017 +0200

tdf#112089 add charts to the ShapeMap

Charts weren't added to the collection what resulted
in missing ids during export (target field).

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

diff --git a/include/oox/export/chartexport.hxx 
b/include/oox/export/chartexport.hxx
index dadad8d6ca34..cebc4f41ca4d 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -211,10 +211,9 @@ public:
  ::oox::core::XmlFilterBase* pFB, DocumentType eDocumentType );
 virtual ~ChartExport() {}
 
-sal_Int32   GetChartID( );
 const css::uno::Reference< css::frame::XModel >& getModel(){ return 
mxChartModel; }
 
-void WriteChartObj( const css::uno::Reference< css::drawing::XShape >& 
xShape, sal_Int32 nChartCount );
+void WriteChartObj( const css::uno::Reference< css::drawing::XShape >& 
xShape, sal_Int32 nID, sal_Int32 nChartCount );
 
 void ExportContent();
 void InitRangeSegmentationProperties(
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 60bdc4d8c6c7..bbf0cf113f14 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -377,12 +377,6 @@ ChartExport::ChartExport( sal_Int32 nXmlNamespace, 
FSHelperPtr pFS, Reference< f
 {
 }
 
-sal_Int32 ChartExport::GetChartID( )
-{
-sal_Int32 nID = GetFB()->GetUniqueId();
-return nID;
-}
-
 sal_Int32 ChartExport::getChartType( )
 {
 OUString sChartType = mxDiagram->getDiagramType();
@@ -434,7 +428,7 @@ OUString ChartExport::parseFormula( const OUString& rRange )
 return aResult;
 }
 
-void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 
nChartCount )
+void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 
nID, sal_Int32 nChartCount )
 {
 FSHelperPtr pFS = GetFS();
 
@@ -448,8 +442,6 @@ void ChartExport::WriteChartObj( const Reference< XShape >& 
xShape, sal_Int32 nC
 if (xNamed.is())
 sName = xNamed->getName();
 
-sal_Int32 nID = GetChartID();
-
 pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
   XML_id, I32S( nID ),
   XML_name,   USS( sName ),
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index b3d42048ec6d..05ea273d2612 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1935,7 +1935,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const 
Reference< XShape >& xShape )
 Reference< XModel > xModel( xChartDoc, UNO_QUERY );
 ChartExport aChartExport( mnXmlNamespace, GetFS(), xModel, GetFB(), 
GetDocumentType() );
 static sal_Int32 nChartCount = 0;
-aChartExport.WriteChartObj( xShape, ++nChartCount );
+aChartExport.WriteChartObj( xShape, GetNewShapeID( xShape ), 
++nChartCount );
 return *this;
 }
 
diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 13a58328fce4..f3da7609ae02 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1140,7 +1140,8 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
 ChartExport aChartExport(XML_xdr, pDrawing, xModel, , 
drawingml::DOCUMENT_XLSX);
 static sal_Int32 nChartCount = 0;
 nChartCount++;
-aChartExport.WriteChartObj( mxShape, nChartCount );
+sal_Int32 nID = rStrm.GetUniqueId();
+aChartExport.WriteChartObj( mxShape, nID, nChartCount );
 // TODO: get the correcto chart number
 }
 
diff --git a/sd/qa/unit/data/pptx/tdf112089.pptx 
b/sd/qa/unit/data/pptx/tdf112089.pptx
new file mode 100755
index ..d0cafcd91c72
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf112089.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 9861726386e0..cd60f8dc95c2 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -112,6 +112,7 @@ public:
 void testTdf112552();
 void testTdf112557();
 void testTdf112334();
+void testTdf112089();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -151,6 +152,7 @@ public:
 CPPUNIT_TEST(testTdf112552);
 CPPUNIT_TEST(testTdf112557);
 CPPUNIT_TEST(testTdf112334);
+

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

2017-08-12 Thread Christian Barth
 include/oox/token/relationship.hxx   |9 +++--
 oox/source/token/relationship.inc|9 +++--
 sc/source/filter/excel/xecontent.cxx |2 +-
 sc/source/filter/excel/xeescher.cxx  |3 ++-
 sc/source/filter/excel/xelink.cxx|3 ++-
 sc/source/filter/excel/xestream.cxx  |5 +++--
 sc/source/filter/excel/xestyle.cxx   |3 ++-
 sc/source/filter/xcl97/xcl97rec.cxx  |7 ---
 8 files changed, 28 insertions(+), 13 deletions(-)

New commits:
commit 6d34c6eed0a35ac5db918baf742692241c2dc5e9
Author: Christian Barth 
Date:   Fri Aug 11 20:30:53 2017 +0200

tdf#107197: Replace relationship URI

Replaced URIs in sc/source

Change-Id: I5227d4d471cf7e579c8c6ec43e0ea3d04b65b331
Signed-off-by: Christian Barth 
Reviewed-on: https://gerrit.libreoffice.org/41062
Reviewed-by: Markus Mohrhard 
Tested-by: Jenkins 

diff --git a/include/oox/token/relationship.hxx 
b/include/oox/token/relationship.hxx
index 08b999a87a29..d00552e02560 100644
--- a/include/oox/token/relationship.hxx
+++ b/include/oox/token/relationship.hxx
@@ -27,7 +27,9 @@ enum class Relationship
 DIAGRAMDRAWING,
 DIAGRAMLAYOUT,
 DIAGRAMQUICKSTYLE,
+DRAWING,
 ENDNOTES,
+EXTERNALLINKPATH,
 FONT,
 FONTTABLE,
 FOOTER,
@@ -37,20 +39,23 @@ enum class Relationship
 HEADER,
 HYPERLINK,
 IMAGE,
-NOTESSLIDE,
 NOTESMASTER,
+NOTESSLIDE,
 NUMBERING,
 OFFICEDOCUMENT,
 OLEOBJECT,
 PACKAGE,
 SETTINGS,
+SHAREDSTRINGS,
 SLIDE,
 SLIDELAYOUT,
 SLIDEMASTER,
 STYLES,
 THEME,
 VBAPROJECT,
-WORDVBADATA
+VMLDRAWING,
+WORDVBADATA,
+WORKSHEET
 };
 
 OUString OOX_DLLPUBLIC getRelationship(Relationship eRelationship);
diff --git a/oox/source/token/relationship.inc 
b/oox/source/token/relationship.inc
index 56b4426dcc9b..85a459d49697 100644
--- a/oox/source/token/relationship.inc
+++ b/oox/source/token/relationship.inc
@@ -10,7 +10,9 @@
 {Relationship::DIAGRAMDRAWING, 
"http://schemas.microsoft.com/office/2007/relationships/diagramDrawing"},
 {Relationship::DIAGRAMLAYOUT, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout"},
 {Relationship::DIAGRAMQUICKSTYLE, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle"},
+{Relationship::DRAWING, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"},
 {Relationship::ENDNOTES, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"},
+{Relationship::EXTERNALLINKPATH, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath"},
 {Relationship::FONT, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font"},
 {Relationship::FONTTABLE, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"},
 {Relationship::FOOTER, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"},
@@ -20,17 +22,20 @@
 {Relationship::HEADER, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"},
 {Relationship::HYPERLINK, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"},
 {Relationship::IMAGE, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"},
-{Relationship::NOTESSLIDE, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"},
 {Relationship::NOTESMASTER, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster"},
+{Relationship::NOTESSLIDE, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"},
 {Relationship::NUMBERING, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"},
 {Relationship::OFFICEDOCUMENT, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"},
 {Relationship::OLEOBJECT, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"},
 {Relationship::PACKAGE, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"},
 {Relationship::SETTINGS, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"},
+{Relationship::SHAREDSTRINGS, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"},
 {Relationship::SLIDE, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"},
 {Relationship::SLIDELAYOUT, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"},
 {Relationship::SLIDEMASTER, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"},
 {Relationship::STYLES, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"},
 {Relationship::THEME, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"},
 {Relationship::VBAPROJECT, 

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

2017-07-07 Thread Caolán McNamara
 include/oox/export/utils.hxx |   21 +++
 oox/source/export/chartexport.cxx|   12 +++---
 oox/source/export/drawingml.cxx  |4 +-
 sc/source/filter/excel/excrecds.cxx  |   49 +--
 sc/source/filter/excel/xecontent.cxx |9 ++--
 sc/source/filter/excel/xedbdata.cxx  |6 +--
 sc/source/filter/excel/xeescher.cxx  |   10 ++---
 sc/source/filter/excel/xeextlst.cxx  |9 ++--
 sc/source/filter/excel/xename.cxx|7 ++-
 sc/source/filter/excel/xepage.cxx|9 ++--
 sc/source/filter/excel/xepivotxml.cxx|   42 +++
 sc/source/filter/excel/xerecord.cxx  |3 +
 sc/source/filter/excel/xestream.cxx  |   22 ++--
 sc/source/filter/excel/xestyle.cxx   |   33 +-
 sc/source/filter/excel/xetable.cxx   |   21 ++-
 sc/source/filter/excel/xeview.cxx|   21 ++-
 sc/source/filter/inc/xestream.hxx|   11 --
 sc/source/filter/xcl97/XclExpChangeTrack.cxx |   11 +++---
 sc/source/filter/xcl97/xcl97rec.cxx  |4 +-
 19 files changed, 155 insertions(+), 149 deletions(-)

New commits:
commit 23978f85533e66b18ee2e9b72ad2fc71a93958a3
Author: Caolán McNamara 
Date:   Fri Jul 7 12:06:32 2017 +0100

merge BS and ToPsz10, etc

Change-Id: I25d4efe816bf6ae4ba456bb42a827b9a70f503c7
Reviewed-on: https://gerrit.libreoffice.org/39689
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index 05ee6a750281..d94d6c4228ae 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -29,7 +29,26 @@ inline OString I64S_(sal_Int64 x) { return 
OString::number(x); }
 #define I32S(x) I32S_(x).getStr()
 #define I64S(x) I64S_(x).getStr()
 #define IS(x) OString::number( x ).getStr()
-inline const char* BS(bool x) { return x ? "1" : "0"; }
+
+/**
+ * @return const char* literal "true" for true value, or literal "false"
+ * for false value.
+ */
+static inline const char* ToPsz(bool b)
+{
+return b ? "true" : "false";
+}
+
+/**
+ * @return literal "1" for true value, or literal "0" for false value.
+ */
+static inline const char* ToPsz10(bool b)
+{
+// xlsx seems to use "1" or "0" for boolean values.  I wonder it ever uses
+// the "true" "false" variant.
+return b ? "1" : "0";
+}
+
 #define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
 
 static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index b1ac3f1b5415..5f488e0b4b75 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -888,7 +888,7 @@ void ChartExport::exportChart( const Reference< 
css::chart::XChartDocument >& xC
 bool bIncludeHiddenCells = false;
 aPlotVisOnly >>= bIncludeHiddenCells;
 pFS->singleElement( FSNS( XML_c, XML_plotVisOnly ),
-XML_val, BS(!bIncludeHiddenCells),
+XML_val, ToPsz10(!bIncludeHiddenCells),
 FSEND );
 
 exportMissingValueTreatment(Reference(mxDiagram, 
uno::UNO_QUERY));
@@ -3030,11 +3030,11 @@ void writeLabelProperties(
 }
 }
 
-pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, 
BS(aLabel.ShowLegendSymbol), FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, 
BS(aLabel.ShowNumber), FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, 
BS(aLabel.ShowCategoryName), FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, BS(false), 
FSEND);
-pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, 
BS(aLabel.ShowNumberInPercent), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, 
ToPsz10(aLabel.ShowLegendSymbol), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, 
ToPsz10(aLabel.ShowNumber), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, 
ToPsz10(aLabel.ShowCategoryName), FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, ToPsz10(false), 
FSEND);
+pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, 
ToPsz10(aLabel.ShowNumberInPercent), FSEND);
 }
 
 }
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index e3615e6bb5de..ddb91babb7c5 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2006,7 +2006,7 @@ void DrawingML::WriteParagraphProperties( const 
Reference< XTextContent >& rPara
XML_marL, nParaLeftMargin > 0 ? I32S( 
oox::drawingml::convertHmmToEmu( nParaLeftMargin ) ) : nullptr,
XML_indent, nParaFirstLineIndent ? I32S( 
oox::drawingml::convertHmmToEmu( nParaFirstLineIndent ) ) : nullptr,
  

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

2017-04-13 Thread Noel Grandin
 include/oox/ole/axfontdata.hxx   |   25 -
 oox/source/ole/axcontrol.cxx |   27 +--
 oox/source/ole/axfontdata.cxx|   18 ++
 sc/source/filter/oox/drawingfragment.cxx |   10 +-
 4 files changed, 48 insertions(+), 32 deletions(-)

New commits:
commit 7bf1e66ac51a582527b35b852586cf7474bc7ba8
Author: Noel Grandin 
Date:   Wed Apr 12 14:03:04 2017 +0200

convert AX_FONTDATA to o3tl::typed_flags

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

diff --git a/include/oox/ole/axfontdata.hxx b/include/oox/ole/axfontdata.hxx
index c255747357fa..fa79aef9d1a9 100644
--- a/include/oox/ole/axfontdata.hxx
+++ b/include/oox/ole/axfontdata.hxx
@@ -23,22 +23,29 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace oox {
 class BinaryInputStream;
 class BinaryOutputStream;
 }
 
+enum class AxFontFlags {
+NONE   = 0x,
+Bold   = 0x0001,
+Italic = 0x0002,
+Underline  = 0x0004,
+Strikeout  = 0x0008,
+Disabled   = 0x2000,
+AutoColor  = 0x4000,
+};
+namespace o3tl {
+template<> struct typed_flags : is_typed_flags {};
+}
+
 namespace oox {
 namespace ole {
 
-const sal_uInt32 AX_FONTDATA_BOLD   = 0x0001;
-const sal_uInt32 AX_FONTDATA_ITALIC = 0x0002;
-const sal_uInt32 AX_FONTDATA_UNDERLINE  = 0x0004;
-const sal_uInt32 AX_FONTDATA_STRIKEOUT  = 0x0008;
-const sal_uInt32 AX_FONTDATA_DISABLED   = 0x2000;
-const sal_uInt32 AX_FONTDATA_AUTOCOLOR  = 0x4000;
-
 enum class AxHorizontalAlign {
 Left = 1, Right = 2, Center = 3
 };
@@ -46,8 +53,8 @@ enum class AxHorizontalAlign {
 /** All entries of a font property. */
 struct OOX_DLLPUBLIC AxFontData
 {
-OUString maFontName; ///< Name of the used font.
-sal_uInt32  mnFontEffects;  ///< Font effect flags.
+OUStringmaFontName; ///< Name of the used font.
+AxFontFlags mnFontEffects;  ///< Font effect flags.
 sal_Int32   mnFontHeight;   ///< Height of the font (not 
really twips, see code).
 sal_Int32   mnFontCharSet;  ///< Windows character set of the 
font.
 AxHorizontalAlign   mnHorAlign; ///< Horizontal text alignment.
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 283c0e48dc61..24b33d842840 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -851,10 +851,14 @@ void AxFontDataModel::importProperty( sal_Int32 nPropId, 
const OUString& rValue
 switch( nPropId )
 {
 case XML_FontName:  maFontData.maFontName = rValue;
 break;
-case XML_FontEffects:   maFontData.mnFontEffects = 
AttributeConversion::decodeUnsigned( rValue );   break;
+case XML_FontEffects:
+maFontData.mnFontEffects = 
static_cast(AttributeConversion::decodeUnsigned( rValue ));
+break;
 case XML_FontHeight:maFontData.mnFontHeight = 
AttributeConversion::decodeInteger( rValue ); break;
 case XML_FontCharSet:   maFontData.mnFontCharSet = 
AttributeConversion::decodeInteger( rValue );break;
-case XML_ParagraphAlign:maFontData.mnHorAlign = 
static_cast(AttributeConversion::decodeInteger( rValue )); 
break;
+case XML_ParagraphAlign:
+maFontData.mnHorAlign = 
static_cast(AttributeConversion::decodeInteger( rValue ));
+break;
 default:AxControlModelBase::importProperty( 
nPropId, rValue );
 }
 }
@@ -875,10 +879,13 @@ void AxFontDataModel::convertProperties( PropertyMap& 
rPropMap, const ControlCon
 rPropMap.setProperty( PROP_FontName, maFontData.maFontName );
 
 // font effects
-rPropMap.setProperty( PROP_FontWeight, getFlagValue( 
maFontData.mnFontEffects, AX_FONTDATA_BOLD, awt::FontWeight::BOLD, 
awt::FontWeight::NORMAL ) );
-rPropMap.setProperty( PROP_FontSlant, getFlagValue( 
maFontData.mnFontEffects, AX_FONTDATA_ITALIC, FontSlant_ITALIC, FontSlant_NONE 
) );
-rPropMap.setProperty( PROP_FontUnderline, getFlagValue( 
maFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, maFontData.mbDblUnderline ? 
awt::FontUnderline::DOUBLE : awt::FontUnderline::SINGLE, 
awt::FontUnderline::NONE ) );
-rPropMap.setProperty( PROP_FontStrikeout, getFlagValue( 
maFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, awt::FontStrikeout::SINGLE, 
awt::FontStrikeout::NONE ) );
+rPropMap.setProperty( PROP_FontWeight, maFontData.mnFontEffects & 
AxFontFlags::Bold ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL );
+rPropMap.setProperty( 

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

2017-04-12 Thread Noel Grandin
 include/oox/ole/axbinarywriter.hxx   |2 +-
 include/oox/ole/axfontdata.hxx   |8 
 oox/source/ole/axcontrol.cxx |   14 +++---
 oox/source/ole/axfontdata.cxx|   10 ++
 sc/source/filter/oox/drawingfragment.cxx |8 
 5 files changed, 22 insertions(+), 20 deletions(-)

New commits:
commit 4f55dfb564e56515b6ebb4d10b089f67ad628fb6
Author: Noel Grandin 
Date:   Wed Apr 12 13:24:09 2017 +0200

convert AX_FONTDATA constants to scoped enum

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

diff --git a/include/oox/ole/axbinarywriter.hxx 
b/include/oox/ole/axbinarywriter.hxx
index d1fe1a23fcea..c8b1bdb29158 100644
--- a/include/oox/ole/axbinarywriter.hxx
+++ b/include/oox/ole/axbinarywriter.hxx
@@ -85,7 +85,7 @@ public:
 /** Write an integer property value to the stream, the
 respective flag in the property mask is set. */
 template< typename StreamType, typename DataType >
-voidwriteIntProperty( DataType& ornValue )
+voidwriteIntProperty( DataType ornValue )
 { if( startNextProperty() ) 
maOutStrm.writeAligned< StreamType >( ornValue ); }
 /** Write a boolean property value to the stream, the
 respective flag in the property mask is set. */
diff --git a/include/oox/ole/axfontdata.hxx b/include/oox/ole/axfontdata.hxx
index 3e01af488da4..c255747357fa 100644
--- a/include/oox/ole/axfontdata.hxx
+++ b/include/oox/ole/axfontdata.hxx
@@ -39,9 +39,9 @@ const sal_uInt32 AX_FONTDATA_STRIKEOUT  = 0x0008;
 const sal_uInt32 AX_FONTDATA_DISABLED   = 0x2000;
 const sal_uInt32 AX_FONTDATA_AUTOCOLOR  = 0x4000;
 
-const sal_Int32 AX_FONTDATA_LEFT= 1;
-const sal_Int32 AX_FONTDATA_RIGHT   = 2;
-const sal_Int32 AX_FONTDATA_CENTER  = 3;
+enum class AxHorizontalAlign {
+Left = 1, Right = 2, Center = 3
+};
 
 /** All entries of a font property. */
 struct OOX_DLLPUBLIC AxFontData
@@ -50,7 +50,7 @@ struct OOX_DLLPUBLIC AxFontData
 sal_uInt32  mnFontEffects;  ///< Font effect flags.
 sal_Int32   mnFontHeight;   ///< Height of the font (not 
really twips, see code).
 sal_Int32   mnFontCharSet;  ///< Windows character set of the 
font.
-sal_Int32   mnHorAlign; ///< Horizontal text alignment.
+AxHorizontalAlign   mnHorAlign; ///< Horizontal text alignment.
 boolmbDblUnderline; ///< True = double underline style 
(legacy VML drawing controls only).
 
 explicitAxFontData();
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 889c7ad7ae05..283c0e48dc61 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -854,7 +854,7 @@ void AxFontDataModel::importProperty( sal_Int32 nPropId, 
const OUString& rValue
 case XML_FontEffects:   maFontData.mnFontEffects = 
AttributeConversion::decodeUnsigned( rValue );   break;
 case XML_FontHeight:maFontData.mnFontHeight = 
AttributeConversion::decodeInteger( rValue ); break;
 case XML_FontCharSet:   maFontData.mnFontCharSet = 
AttributeConversion::decodeInteger( rValue );break;
-case XML_ParagraphAlign:maFontData.mnHorAlign = 
AttributeConversion::decodeInteger( rValue );   break;
+case XML_ParagraphAlign:maFontData.mnHorAlign = 
static_cast(AttributeConversion::decodeInteger( rValue )); 
break;
 default:AxControlModelBase::importProperty( 
nPropId, rValue );
 }
 }
@@ -894,9 +894,9 @@ void AxFontDataModel::convertProperties( PropertyMap& 
rPropMap, const ControlCon
 sal_Int32 nAlign = awt::TextAlign::LEFT;
 switch( maFontData.mnHorAlign )
 {
-case AX_FONTDATA_LEFT:  nAlign = awt::TextAlign::LEFT;   break;
-case AX_FONTDATA_RIGHT: nAlign = awt::TextAlign::RIGHT;  break;
-case AX_FONTDATA_CENTER:nAlign = awt::TextAlign::CENTER; break;
+case AxHorizontalAlign::Left:  nAlign = awt::TextAlign::LEFT;  
 break;
+case AxHorizontalAlign::Right: nAlign = awt::TextAlign::RIGHT; 
 break;
+case AxHorizontalAlign::Center:nAlign = 
awt::TextAlign::CENTER; break;
 default:OSL_FAIL( "AxFontDataModel::convertProperties - 
unknown text alignment" );
 }
 // form controls expect short value
@@ -934,9 +934,9 @@ void AxFontDataModel::convertFromProperties( PropertySet& 
rPropSet, const Contro
 {
 switch ( nAlign )
 {
-case awt::TextAlign::LEFT: maFontData.mnHorAlign = 
AX_FONTDATA_LEFT;   break;
-case awt::TextAlign::RIGHT: 

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

2017-03-11 Thread Tamás Zolnai
 include/oox/drawingml/shape.hxx |2 --
 oox/source/drawingml/chart/chartdrawingfragment.cxx |2 +-
 oox/source/drawingml/shape.cxx  |8 +++-
 oox/source/ppt/pptshape.cxx |2 +-
 oox/source/ppt/slidepersist.cxx |2 +-
 sc/source/filter/oox/drawingfragment.cxx|   10 +-
 6 files changed, 11 insertions(+), 15 deletions(-)

New commits:
commit cdd4a9fa539bcfc11dda35adda4b290ceab9e0b0
Author: Tamás Zolnai 
Date:   Sat Mar 11 16:07:34 2017 +0100

Passing shaperect to addShape function is useless

Shaperect is ignored by createAndInsert() so it has no effect
at all. Also when this parameter is set the size and position
is set using the same shaperect, so don't need to pass it also
as a parameter.

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

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 1bc3fb7b..b908046 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -175,7 +175,6 @@ public:
 const css::uno::Reference< css::drawing::XShapes 
>& rxShapes,
 const basegfx::B2DHomMatrix& aTransformation,
 FillProperties& rShapeOrParentShapeFillProps,
-const css::awt::Rectangle* pShapeRect = nullptr,
 ShapeIdMap* pShapeMap = nullptr );
 
 voidaddChildren(
@@ -220,7 +219,6 @@ protected:
 const OUString& rServiceName,
 const Theme* pTheme,
 const css::uno::Reference< css::drawing::XShapes 
>& rxShapes,
-const css::awt::Rectangle* pShapeRect,
 bool bClearText,
 bool bDoNotInsertEmptyTextBody,
 basegfx::B2DHomMatrix& aTransformation,
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx 
b/oox/source/drawingml/chart/chartdrawingfragment.cxx
index 00bc99f..d5140c1 100644
--- a/oox/source/drawingml/chart/chartdrawingfragment.cxx
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -222,7 +222,7 @@ void ChartDrawingFragment::onEndElement()
 mxShape->setSize(awt::Size(aShapeRectEmu32.Width, 
aShapeRectEmu32.Height));
 
 basegfx::B2DHomMatrix aMatrix;
-mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), 
mxDrawPage, aMatrix, mxShape->getFillProperties(),  );
+mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), 
mxDrawPage, aMatrix, mxShape->getFillProperties() );
 }
 }
 mxShape.reset();
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index e60d487..198986d 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -243,7 +243,6 @@ void Shape::addShape(
 const Reference< XShapes >& rxShapes,
 const basegfx::B2DHomMatrix& aTransformation,
 FillProperties& rShapeOrParentShapeFillProps,
-const awt::Rectangle* pShapeRect,
 ShapeIdMap* pShapeMap )
 {
 SAL_INFO("oox.drawingml", "Shape::addShape: id='" << msId << "'");
@@ -254,7 +253,7 @@ void Shape::addShape(
 if( !sServiceName.isEmpty() )
 {
 basegfx::B2DHomMatrix aMatrix( aTransformation );
-Reference< XShape > xShape( createAndInsert( rFilterBase, 
sServiceName, pTheme, rxShapes, pShapeRect, false, false, aMatrix, 
rShapeOrParentShapeFillProps ) );
+Reference< XShape > xShape( createAndInsert( rFilterBase, 
sServiceName, pTheme, rxShapes, false, false, aMatrix, 
rShapeOrParentShapeFillProps ) );
 
 if( pShapeMap && !msId.isEmpty() )
 {
@@ -264,7 +263,7 @@ void Shape::addShape(
 // if this is a group shape, we have to add also each child shape
 Reference< XShapes > xShapes( xShape, UNO_QUERY );
 if ( xShapes.is() )
-addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? 
*pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, 
maSize.Height ), pShapeMap, aMatrix );
+addChildren( rFilterBase, *this, pTheme, xShapes, 
awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), 
pShapeMap, aMatrix );
 
 if( meFrameType == FRAMETYPE_DIAGRAM )
 {
@@ -393,7 +392,7 @@ void Shape::addChildren(
 std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
 while( aIter != rMaster.maChildren.end() ) {
 (*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
-

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

2017-01-24 Thread Noel Grandin
 include/oox/core/fastparser.hxx   |   17 -
 include/oox/core/xmlfilterbase.hxx|2 +-
 oox/source/core/fastparser.cxx|8 +++-
 oox/source/core/filterdetect.cxx  |2 +-
 oox/source/core/xmlfilterbase.cxx |7 +++
 oox/source/docprop/ooxmldocpropimport.cxx |2 +-
 sc/source/filter/oox/revisionfragment.cxx |2 +-
 sc/source/filter/oox/workbookfragment.cxx |4 ++--
 8 files changed, 20 insertions(+), 24 deletions(-)

New commits:
commit a449e0d2425fdedc02fae793a925dd0702d70319
Author: Noel Grandin 
Date:   Tue Jan 24 10:26:23 2017 +0200

use rtl::Reference in FastParser

instead of storing both a raw pointer and a uno::Reference

Change-Id: I6b67a6098a3ccdce7e29ee8d601c743897032eaf

diff --git a/include/oox/core/fastparser.hxx b/include/oox/core/fastparser.hxx
index 69cc111..d28e724 100644
--- a/include/oox/core/fastparser.hxx
+++ b/include/oox/core/fastparser.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace com { namespace sun { namespace star {
@@ -57,10 +58,12 @@ class FastParser
 {
 public:
 /// @throws css::uno::RuntimeException
-explicitFastParser(
-const css::uno::Reference< 
css::uno::XComponentContext >& rxContext )
+explicitFastParser()
 throw( css::uno::RuntimeException );
 
+FastParser(const FastParser&) = delete;
+FastParser& operator=(const FastParser&) = delete;
+
 virtual ~FastParser();
 
 /** Registers an OOXML namespace at the parser.
@@ -110,13 +113,9 @@ public:
getTokenHandler() const { return mxTokenHandler; }
 
 private:
-css::uno::Reference< css::xml::sax::XFastParser >
-mxParser;
-css::uno::Reference< css::xml::sax::XFastTokenHandler >
-mxTokenHandler;
-const NamespaceMap& mrNamespaceMap;
-
-sax_fastparser::FastSaxParser* mpParser;
+css::uno::Reference   mxTokenHandler;
+const NamespaceMap& mrNamespaceMap;
+rtl::Reference   mxParser;
 };
 
 
diff --git a/include/oox/core/xmlfilterbase.hxx 
b/include/oox/core/xmlfilterbase.hxx
index c9769d7..5149783 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -230,7 +230,7 @@ public:
 
 void importDocumentProperties();
 
-FastParser* createParser() const;
+static FastParser* createParser();
 
 bool isMSO2007Document() const;
 
diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx
index 54b07b1..ce0a6c0 100644
--- a/oox/source/core/fastparser.cxx
+++ b/oox/source/core/fastparser.cxx
@@ -63,13 +63,11 @@ InputStreamCloseGuard::~InputStreamCloseGuard()
 
 } // namespace
 
-FastParser::FastParser( const Reference< XComponentContext >& rxContext ) 
throw( RuntimeException ) :
-mrNamespaceMap( StaticNamespaceMap::get() ),
-mpParser(nullptr)
+FastParser::FastParser() throw( RuntimeException ) :
+mrNamespaceMap( StaticNamespaceMap::get() )
 {
 // create a fast parser instance
-mxParser = css::xml::sax::FastParser::create(rxContext);
-mpParser = dynamic_cast(mxParser.get());
+mxParser = new sax_fastparser::FastSaxParser;
 
 // create the fast tokenhandler
 mxTokenHandler.set( new FastTokenHandler );
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index f7a8f81..c333db3 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -403,7 +403,7 @@ OUString SAL_CALL FilterDetect::detect( Sequence< 
PropertyValue >& rMediaDescSeq
 if( aZipStorage.isStorage() )
 {
 // create the fast parser, register the XML namespaces, set 
document handler
-FastParser aParser( mxContext );
+FastParser aParser;
 aParser.registerNamespace( NMSP_packageRel );
 aParser.registerNamespace( NMSP_officeRel );
 aParser.registerNamespace( NMSP_packageContentTypes );
diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 48da8c7..21f0b50 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -188,7 +188,6 @@ struct XmlFilterBaseImpl
 
 XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& 
rxContext ) throw( RuntimeException ) :
 mxContext(rxContext),
-maFastParser( rxContext ),
 maBinSuffix( ".bin" ),
 mrNamespaceMap(StaticNamespaceMap::get())
 {
@@ -268,9 +267,9 @@ void XmlFilterBase::importDocumentProperties()
 checkDocumentProperties(xDocProps);
 }
 
-FastParser* XmlFilterBase::createParser() const
+FastParser* XmlFilterBase::createParser()
 {
-FastParser* pParser = new FastParser(getComponentContext());
+

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

2016-12-25 Thread Markus Mohrhard
 include/oox/core/xmlfilterbase.hxx   |2 ++
 oox/source/core/xmlfilterbase.cxx|   17 -
 oox/source/token/namespaces.hxx.tail |1 +
 sc/source/filter/excel/xecontent.cxx |3 ++-
 4 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit c61981c19335d6a75bf16e1653a2e8bbae81b14d
Author: Markus Mohrhard 
Date:   Sun Dec 25 23:23:11 2016 +0100

use the existing namespace map for the oox namespace export

Change-Id: I7909b08db556c6c65c1547303f2b899c30feaba4
Reviewed-on: https://gerrit.libreoffice.org/32425
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/include/oox/core/xmlfilterbase.hxx 
b/include/oox/core/xmlfilterbase.hxx
index 1a9be6a..59043ba 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -236,6 +236,8 @@ public:
 void checkDocumentProperties(
 const css::uno::Reference& 
xDocProps);
 
+OUString getNamespaceURL(sal_Int32 nNSID) const;
+
 protected:
 virtual css::uno::Reference< css::io::XInputStream >
 implGetInputStream( utl::MediaDescriptor& rMediaDesc ) const override;
diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 952bf5e..85cfc9f 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using ::com::sun::star::xml::dom::DocumentBuilder;
 using ::com::sun::star::xml::dom::XDocument;
@@ -178,6 +179,7 @@ struct XmlFilterBaseImpl
 const OUString maBinSuffix;
 RelationsMap   maRelationsMap;
 TextFieldStack maTextFieldStack;
+const NamespaceMap& mrNamespaceMap;
 
 explicitXmlFilterBaseImpl( const Reference< XComponentContext 
>& rxContext ) throw( RuntimeException );
 ~XmlFilterBaseImpl();
@@ -186,7 +188,8 @@ struct XmlFilterBaseImpl
 XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& 
rxContext ) throw( RuntimeException ) :
 mxContext(rxContext),
 maFastParser( rxContext ),
-maBinSuffix( ".bin" )
+maBinSuffix( ".bin" ),
+mrNamespaceMap(StaticNamespaceMap::get())
 {
 // register XML namespaces
 registerNamespaces(maFastParser);
@@ -910,6 +913,18 @@ bool XmlFilterBase::isMSO2007Document() const
 return mbMSO2007;
 }
 
+OUString XmlFilterBase::getNamespaceURL(sal_Int32 nNSID) const
+{
+auto itr = mxImpl->mrNamespaceMap.maTransitionalNamespaceMap.find(nNSID);
+if (itr == mxImpl->mrNamespaceMap.maTransitionalNamespaceMap.end())
+{
+SAL_WARN("oox", "missing namespace in the namespace map for : " << 
nNSID);
+return OUString();
+}
+
+return itr->second;
+}
+
 } // namespace core
 } // namespace oox
 
diff --git a/oox/source/token/namespaces.hxx.tail 
b/oox/source/token/namespaces.hxx.tail
index 17770dc..a52eddf 100644
--- a/oox/source/token/namespaces.hxx.tail
+++ b/oox/source/token/namespaces.hxx.tail
@@ -30,6 +30,7 @@ inline sal_Int32 getNamespace( sal_Int32 nToken ) { return 
nToken & NMSP_MASK; }
 
 // defines for tokens with specific namespaces
 #define OOX_TOKEN( namespace, token ) (::oox::NMSP_##namespace | 
::oox::XML_##token)
+#define OOX_NS( namespace ) (::oox::NMSP_##namespace)
 
 #define A_TOKEN( token )OOX_TOKEN( dml, token )
 #define AX_TOKEN( token )   OOX_TOKEN( ax, token )
diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index ee7ec4b..b74eeb1 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -44,6 +44,7 @@
 #include "xestyle.hxx"
 #include "xename.hxx"
 #include 
+#include 
 
 using namespace ::oox;
 
@@ -1396,7 +1397,7 @@ void XclExpDataBar::SaveXml( XclExpXmlStream& rStrm )
 // extLst entries for Excel 2010 and 2013
 rWorksheet->startElement( XML_extLst, FSEND );
 rWorksheet->startElement( XML_ext,
-FSNS( XML_xmlns, XML_x14 ), 
"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main;,
+FSNS( XML_xmlns, XML_x14 ), 
XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls14Lst))).getStr(),
 XML_uri, 
"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}",
 FSEND );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-28 Thread Justin Luth
 include/oox/ole/vbaproject.hxx|6 +++---
 oox/source/ole/vbaproject.cxx |5 ++---
 sc/source/filter/oox/workbookfragment.cxx |3 +++
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit b41e7b817e1e214582505d28d0cc36d741fa9979
Author: Justin Luth 
Date:   Thu Oct 27 19:31:50 2016 +0300

tdf#63846 assign macros after VBA project fully loaded.

fixes regression caused by d4743045a0b320449d07a957463a76bb8b13f939.

see the documentation for VbaMacroAttacherBase, which indicates that
the macros are to be attached after all objects are finished loading.

Made attachMacros() public so it could be called separately since so
many things are inter-dependent in the logic flow.

Change-Id: I11f7f4a1a75d6f77a97e12e3359d6ea8a995f518
Reviewed-on: https://gerrit.libreoffice.org/30337
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Markus Mohrhard 

diff --git a/include/oox/ole/vbaproject.hxx b/include/oox/ole/vbaproject.hxx
index 22e1a12..6949834 100644
--- a/include/oox/ole/vbaproject.hxx
+++ b/include/oox/ole/vbaproject.hxx
@@ -139,6 +139,9 @@ public:
 VbaMacroAttacherBase class. */
 voidregisterMacroAttacher( const VbaMacroAttacherRef& 
rxAttacher );
 
+/** Attaches VBA macros to objects registered via registerMacroAttacher(). 
*/
+voidattachMacros();
+
 /** Returns true, if the document contains at least one code module. */
 boolhasModules() const;
 
@@ -177,9 +180,6 @@ private:
 StorageBase& rVbaPrjStrg,
 const GraphicHelper& rGraphicHelper );
 
-/** Attaches VBA macros to objects registered via registerMacroAttacher(). 
*/
-voidattachMacros();
-
 /** Copies the entire VBA project storage to the passed document model. */
 voidcopyStorage( StorageBase& rVbaPrjStrg );
 
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index 5471117..e716696 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -253,6 +253,8 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const 
GraphicHelper& rGrap
 {
 readVbaModules( rVbaPrjStrg );
 importModulesAndForms(rVbaPrjStrg, rGraphicHelper );
+// attach macros to registered objects
+attachMacros();
 }
 
 void VbaProject::readVbaModules( StorageBase& rVbaPrjStrg )
@@ -502,9 +504,6 @@ void VbaProject::importModulesAndForms( StorageBase& 
rVbaPrjStrg, const GraphicH
 }
 }
 }
-
-// attach macros to registered objects
-attachMacros();
 }
 
 void VbaProject::attachMacros()
diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index 77317fe..18d2075 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -508,6 +508,9 @@ void WorkbookFragment::finalizeImport()
 rtl::Reference xFragment(new 
RevisionHeadersFragment(*this, aRevHeadersPath));
 importOoxFragment(xFragment, *xParser);
 }
+
+// attach macros to registered objects now that all objects have been 
created.
+getBaseFilter().getVbaProject().attachMacros();
 }
 
 namespace {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-13 Thread Jorenz Paragas
 include/oox/ole/axbinaryreader.hxx   |9 +++-
 include/oox/ole/axbinarywriter.hxx   |5 
 include/oox/ole/axcontrol.hxx|   12 +-
 include/oox/ole/axcontrolfragment.hxx|7 ++
 include/oox/ole/axfontdata.hxx   |   10 ++---
 include/oox/ole/olehelper.hxx|   34 ++-
 include/oox/ole/oleobjecthelper.hxx  |3 ++
 include/oox/ole/olestorage.hxx   |9 
 include/oox/ole/vbacontrol.hxx   |   18 ++--
 include/oox/ole/vbaexport.hxx|5 +++-
 include/oox/ole/vbahelper.hxx|2 +
 include/oox/ole/vbainputstream.hxx   |4 +++
 include/oox/ole/vbamodule.hxx|2 +
 include/oox/ole/vbaproject.hxx   |   19 +++--
 oox/source/ole/axbinaryreader.cxx|1 
 oox/source/ole/olehelper.cxx |5 
 sc/source/filter/inc/excelhandlers.hxx   |1 
 sc/source/filter/oox/drawingfragment.cxx |1 
 sw/source/filter/ww8/wrtw8nds.cxx|1 
 19 files changed, 115 insertions(+), 33 deletions(-)

New commits:
commit 96d5516429bc1846fc6cf7119590f7b05a65eef8
Author: Jorenz Paragas 
Date:   Wed May 11 22:02:58 2016 -0700

tdf#42949: clean up includes in include/oox/ole with iwyu

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

diff --git a/include/oox/ole/axbinaryreader.hxx 
b/include/oox/ole/axbinaryreader.hxx
index 5823fbb..81b1053 100644
--- a/include/oox/ole/axbinaryreader.hxx
+++ b/include/oox/ole/axbinaryreader.hxx
@@ -20,10 +20,17 @@
 #ifndef INCLUDED_OOX_OLE_AXBINARYREADER_HXX
 #define INCLUDED_OOX_OLE_AXBINARYREADER_HXX
 
+#include 
 #include 
+#include 
+
 #include 
+#include 
 #include 
-#include 
+#include 
+#include 
+
+namespace oox { namespace ole { struct AxFontData; } }
 
 namespace oox {
 namespace ole {
diff --git a/include/oox/ole/axbinarywriter.hxx 
b/include/oox/ole/axbinarywriter.hxx
index 66dc500..d1fe1a2 100644
--- a/include/oox/ole/axbinarywriter.hxx
+++ b/include/oox/ole/axbinarywriter.hxx
@@ -10,9 +10,14 @@
 #ifndef INCLUDED_OOX_OLE_AXBINARYWRITER_HXX
 #define INCLUDED_OOX_OLE_AXBINARYWRITER_HXX
 
+#include 
 #include 
+
 #include 
+#include 
 #include 
+#include 
+#include 
 
 namespace oox {
 namespace ole {
diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx
index e8c879a..4d91f97 100644
--- a/include/oox/ole/axcontrol.hxx
+++ b/include/oox/ole/axcontrol.hxx
@@ -20,12 +20,19 @@
 #ifndef INCLUDED_OOX_OLE_AXCONTROL_HXX
 #define INCLUDED_OOX_OLE_AXCONTROL_HXX
 
+#include 
+#include 
+
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 namespace com { namespace sun { namespace star {
 namespace awt { class XControlModel; }
@@ -38,6 +45,7 @@ namespace com { namespace sun { namespace star {
 
 namespace oox {
 class BinaryInputStream;
+class BinaryOutputStream;
 class GraphicHelper;
 class PropertyMap;
 }
diff --git a/include/oox/ole/axcontrolfragment.hxx 
b/include/oox/ole/axcontrolfragment.hxx
index b4284cf..a741aed 100644
--- a/include/oox/ole/axcontrolfragment.hxx
+++ b/include/oox/ole/axcontrolfragment.hxx
@@ -20,7 +20,14 @@
 #ifndef INCLUDED_OOX_OLE_AXCONTROLFRAGMENT_HXX
 #define INCLUDED_OOX_OLE_AXCONTROLFRAGMENT_HXX
 
+#include 
+#include 
 #include 
+#include 
+#include 
+
+namespace oox { class AttributeList; }
+namespace oox { namespace core { class XmlFilterBase; } }
 
 namespace oox {
 namespace ole {
diff --git a/include/oox/ole/axfontdata.hxx b/include/oox/ole/axfontdata.hxx
index 05694fb..b6bcf9e 100644
--- a/include/oox/ole/axfontdata.hxx
+++ b/include/oox/ole/axfontdata.hxx
@@ -20,10 +20,14 @@
 #ifndef INCLUDED_OOX_OLE_AXFONTDATA_HXX
 #define INCLUDED_OOX_OLE_AXFONTDATA_HXX
 
-#include 
-#include 
-#include 
 #include 
+#include 
+#include 
+
+namespace oox {
+class BinaryInputStream;
+class BinaryOutputStream;
+}
 
 namespace oox {
 namespace ole {
diff --git a/include/oox/ole/olehelper.hxx b/include/oox/ole/olehelper.hxx
index 0a6ba4a..d848cc4 100644
--- a/include/oox/ole/olehelper.hxx
+++ b/include/oox/ole/olehelper.hxx
@@ -20,24 +20,24 @@
 #ifndef INCLUDED_OOX_OLE_OLEHELPER_HXX
 #define INCLUDED_OOX_OLE_OLEHELPER_HXX
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace com { namespace sun { namespace star {
+namespace awt { class XControlModel; }
+namespace awt { struct Size; }
+namespace form { class XFormComponent; }
+namespace frame { class XModel; }
+namespace io { 

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

2016-05-03 Thread Jorenz Paragas
 include/oox/drawingml/chart/chartconverter.hxx  |1 
 include/oox/drawingml/chart/datasourcemodel.hxx |4 +
 include/oox/drawingml/chart/modelbase.hxx   |5 +-
 include/oox/drawingml/clrscheme.hxx |5 +-
 include/oox/drawingml/color.hxx |9 +---
 include/oox/drawingml/connectorshapecontext.hxx |9 +++-
 include/oox/drawingml/drawingmltypes.hxx|   20 +
 include/oox/drawingml/fillproperties.hxx|   12 +
 include/oox/drawingml/graphicshapecontext.hxx   |   13 --
 include/oox/drawingml/lineproperties.hxx|   10 
 include/oox/drawingml/shape.hxx |   42 +++-
 include/oox/drawingml/shapecontext.hxx  |8 ++-
 include/oox/drawingml/shapegroupcontext.hxx |8 ++-
 include/oox/drawingml/shapepropertymap.hxx  |   10 +++-
 include/oox/drawingml/theme.hxx |   17 +++-
 include/oox/drawingml/themefragmenthandler.hxx  |6 ++
 oox/source/drawingml/chart/axiscontext.cxx  |1 
 oox/source/drawingml/chart/chartdrawingfragment.cxx |2 
 oox/source/drawingml/chart/chartspacefragment.cxx   |1 
 oox/source/drawingml/chart/plotareacontext.cxx  |1 
 oox/source/drawingml/chart/plotareaconverter.cxx|1 
 oox/source/drawingml/chart/seriescontext.cxx|1 
 oox/source/drawingml/chart/seriesconverter.cxx  |1 
 oox/source/drawingml/chart/titlecontext.cxx |1 
 oox/source/drawingml/chart/typegroupcontext.cxx |1 
 oox/source/drawingml/chart/typegroupconverter.cxx   |1 
 oox/source/drawingml/clrscheme.cxx  |2 
 oox/source/drawingml/drawingmltypes.cxx |2 
 oox/source/ppt/dgmimport.cxx|1 
 oox/source/ppt/dgmlayout.cxx|1 
 oox/source/ppt/pptshapegroupcontext.cxx |1 
 oox/source/ppt/slidepersist.cxx |1 
 oox/source/shape/LockedCanvasContext.cxx|1 
 oox/source/shape/ShapeContextHandler.cxx|2 
 oox/source/shape/WpsContext.cxx |1 
 sc/source/filter/oox/condformatbuffer.cxx   |1 
 sc/source/filter/oox/drawingfragment.cxx|2 
 sc/source/filter/oox/workbookfragment.cxx   |1 
 38 files changed, 165 insertions(+), 41 deletions(-)

New commits:
commit af1174b2dea72359e8eb0e15297c61cf82571250
Author: Jorenz Paragas 
Date:   Sat Apr 30 00:06:53 2016 -0700

tdf#42949: clean up includes in include/oox/drawingml with iwyu

Add includes in other files to fix compiler errors.

Change-Id: I566e2e081094cb074d20afbe7ceee49f759c725b
Reviewed-on: https://gerrit.libreoffice.org/24510
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/include/oox/drawingml/chart/chartconverter.hxx 
b/include/oox/drawingml/chart/chartconverter.hxx
index f8ee8d0..d4371c6 100644
--- a/include/oox/drawingml/chart/chartconverter.hxx
+++ b/include/oox/drawingml/chart/chartconverter.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 
 namespace com { namespace sun { namespace star {
 namespace awt { struct Point; }
diff --git a/include/oox/drawingml/chart/datasourcemodel.hxx 
b/include/oox/drawingml/chart/datasourcemodel.hxx
index b09558f..097bfd1 100644
--- a/include/oox/drawingml/chart/datasourcemodel.hxx
+++ b/include/oox/drawingml/chart/datasourcemodel.hxx
@@ -20,8 +20,12 @@
 #ifndef INCLUDED_OOX_DRAWINGML_CHART_DATASOURCEMODEL_HXX
 #define INCLUDED_OOX_DRAWINGML_CHART_DATASOURCEMODEL_HXX
 
+#include 
+
 #include 
 #include 
+#include 
+#include 
 
 namespace oox {
 namespace drawingml {
diff --git a/include/oox/drawingml/chart/modelbase.hxx 
b/include/oox/drawingml/chart/modelbase.hxx
index 5dc25fb..d27d139 100644
--- a/include/oox/drawingml/chart/modelbase.hxx
+++ b/include/oox/drawingml/chart/modelbase.hxx
@@ -20,9 +20,12 @@
 #ifndef INCLUDED_OOX_DRAWINGML_CHART_MODELBASE_HXX
 #define INCLUDED_OOX_DRAWINGML_CHART_MODELBASE_HXX
 
-#include 
+#include 
+
 #include 
 #include 
+#include 
+#include 
 
 namespace oox { class AttributeList; }
 
diff --git a/include/oox/drawingml/clrscheme.hxx 
b/include/oox/drawingml/clrscheme.hxx
index 00bf149..ccb1517 100644
--- a/include/oox/drawingml/clrscheme.hxx
+++ b/include/oox/drawingml/clrscheme.hxx
@@ -20,11 +20,14 @@
 #ifndef INCLUDED_OOX_DRAWINGML_CLRSCHEME_HXX
 #define INCLUDED_OOX_DRAWINGML_CLRSCHEME_HXX
 
+#include 
 #include 
 #include 
+#include 
 #include 
-#include 
+
 #include 
+#include 
 
 namespace oox { namespace drawingml {
 
diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
index 9f94c4d..cde7bf1 100644
--- a/include/oox/drawingml/color.hxx
+++ b/include/oox/drawingml/color.hxx
@@ -20,15 +20,14 @@
 #ifndef INCLUDED_OOX_DRAWINGML_COLOR_HXX
 #define 

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

2016-04-25 Thread Jorenz Paragas
 include/oox/core/binarycodec.hxx |   11 ++--
 include/oox/core/contexthandler.hxx  |   17 --
 include/oox/core/contexthandler2.hxx |   20 +++
 include/oox/core/fastparser.hxx  |   18 ++-
 include/oox/core/fasttokenhandler.hxx|9 +++
 include/oox/core/filterbase.hxx  |   28 ++-
 include/oox/core/filterdetect.hxx|   13 +
 include/oox/core/fragmenthandler.hxx |   14 +
 include/oox/core/fragmenthandler2.hxx|   22 
 include/oox/core/recordparser.hxx|   13 +++--
 include/oox/core/relations.hxx   |6 +-
 include/oox/core/relationshandler.hxx|   13 +
 include/oox/core/xmlfilterbase.hxx   |   28 +++
 include/oox/vml/vmlshapecontext.hxx  |1 
 include/oox/vml/vmltextboxcontext.hxx|1 
 oox/source/core/contexthandler2.cxx  |2 
 oox/source/core/filterbase.cxx   |1 
 oox/source/core/fragmenthandler2.cxx |1 
 oox/source/core/xmlfilterbase.cxx|2 
 oox/source/drawingml/ThemeOverrideFragmentHandler.cxx|2 
 oox/source/drawingml/chart/axiscontext.cxx   |1 
 oox/source/drawingml/chart/axisconverter.cxx |2 
 oox/source/drawingml/chart/chartcontextbase.cxx  |3 +
 oox/source/drawingml/chart/chartdrawingfragment.cxx  |3 +
 oox/source/drawingml/chart/chartspaceconverter.cxx   |2 
 oox/source/drawingml/chart/chartspacefragment.cxx|2 
 oox/source/drawingml/chart/converterbase.cxx |1 
 oox/source/drawingml/chart/datasourcecontext.cxx |3 +
 oox/source/drawingml/chart/plotareacontext.cxx   |3 +
 oox/source/drawingml/chart/plotareaconverter.cxx |2 
 oox/source/drawingml/chart/seriescontext.cxx |3 +
 oox/source/drawingml/chart/seriesconverter.cxx   |3 +
 oox/source/drawingml/chart/titlecontext.cxx  |3 +
 oox/source/drawingml/chart/titleconverter.cxx|1 
 oox/source/drawingml/chart/typegroupcontext.cxx  |2 
 oox/source/drawingml/chart/typegroupconverter.cxx|2 
 oox/source/drawingml/clrschemecontext.cxx|3 +
 oox/source/drawingml/connectorshapecontext.cxx   |2 
 oox/source/drawingml/diagram/diagramdefinitioncontext.cxx|2 
 oox/source/drawingml/diagram/diagramfragmenthandler.cxx  |2 
 oox/source/drawingml/fillproperties.cxx  |3 -
 oox/source/drawingml/objectdefaultcontext.cxx|2 
 oox/source/drawingml/shapepropertiescontext.cxx  |3 +
 oox/source/drawingml/spdefcontext.cxx|2 
 oox/source/drawingml/table/tablecell.cxx |2 
 oox/source/drawingml/table/tablepartstylecontext.cxx |2 
 oox/source/drawingml/table/tableproperties.cxx   |1 
 oox/source/drawingml/table/tablerowcontext.cxx   |3 +
 oox/source/drawingml/table/tablestylecontext.cxx |3 +
 oox/source/drawingml/table/tablestylelistfragmenthandler.cxx |3 +
 oox/source/drawingml/textbodycontext.cxx |2 
 oox/source/drawingml/texteffectscontext.cxx  |3 +
 oox/source/drawingml/textfieldcontext.cxx|3 +
 oox/source/drawingml/textparagraphproperties.cxx |1 
 oox/source/drawingml/textspacingcontext.cxx  |3 +
 oox/source/drawingml/texttabstoplistcontext.cxx  |3 +
 oox/source/drawingml/themefragmenthandler.cxx|2 
 oox/source/mathml/import.cxx |2 
 oox/source/ole/axcontrolfragment.cxx |3 +
 oox/source/ppt/animationspersist.cxx |3 +
 oox/source/ppt/backgroundproperties.cxx  |2 
 oox/source/ppt/commonbehaviorcontext.cxx |3 +
 oox/source/ppt/customshowlistcontext.cxx |4 +
 oox/source/ppt/extdrawingfragmenthandler.cxx |3 +
 oox/source/ppt/layoutfragmenthandler.cxx |3 +
 oox/source/ppt/pptgraphicshapecontext.cxx|3 -
 oox/source/ppt/pptimport.cxx |1 
 oox/source/ppt/pptshape.cxx  |1 
 oox/source/ppt/pptshapepropertiescontext.cxx |2 
 oox/source/ppt/presentationfragmenthandler.cxx   |   

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

2015-03-17 Thread Stephan Bergmann
 include/oox/core/filterbase.hxx   |6 --
 include/oox/ppt/dgmimport.hxx |2 +-
 include/oox/ppt/dgmlayout.hxx |2 +-
 include/oox/ppt/pptimport.hxx |2 +-
 oox/source/core/filterbase.cxx|5 -
 oox/source/ppt/dgmimport.cxx  |2 +-
 oox/source/ppt/dgmlayout.cxx  |2 +-
 oox/source/ppt/pptimport.cxx  |2 +-
 oox/source/shape/ShapeFilterBase.cxx  |2 +-
 oox/source/shape/ShapeFilterBase.hxx  |2 +-
 sc/source/filter/excel/xestream.cxx   |2 +-
 sc/source/filter/inc/excelfilter.hxx  |2 +-
 sc/source/filter/inc/xestream.hxx |2 +-
 sc/source/filter/oox/excelfilter.cxx  |2 +-
 sd/source/filter/eppt/epptooxml.hxx   |2 +-
 sd/source/filter/eppt/pptx-epptooxml.cxx  |2 +-
 sw/source/filter/ww8/docxexportfilter.cxx |2 +-
 sw/source/filter/ww8/docxexportfilter.hxx |4 +---
 18 files changed, 16 insertions(+), 29 deletions(-)

New commits:
commit 413f7c3642a6a237848e2c6d3b279bdf4d808c31
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Mar 17 21:45:30 2015 +0100

Remove oox::core::FilterBase::implGetImplementationName indirection

Change-Id: Ib275192452c6836cbaac2e517942ec5356dfd9ab

diff --git a/include/oox/core/filterbase.hxx b/include/oox/core/filterbase.hxx
index 3d10c08..0273716 100644
--- a/include/oox/core/filterbase.hxx
+++ b/include/oox/core/filterbase.hxx
@@ -199,10 +199,6 @@ public:
 
 // com.sun.star.lang.XServiceInfo interface ---
 
-virtual OUString SAL_CALL
-getImplementationName()
-throw( ::com::sun::star::uno::RuntimeException, 
std::exception ) SAL_OVERRIDE;
-
 virtual sal_Bool SAL_CALL
 supportsService( const OUString rServiceName )
 throw( ::com::sun::star::uno::RuntimeException, 
std::exception ) SAL_OVERRIDE;
@@ -274,8 +270,6 @@ private:
 /** Derived classes create a VBA project manager object. */
 virtual ::oox::ole::VbaProject* implCreateVbaProject() const = 0;
 
-virtual OUString implGetImplementationName() const = 0;
-
 virtual StorageRef  implCreateStorage(
 const ::com::sun::star::uno::Reference 
::com::sun::star::io::XInputStream  rxInStream ) const = 0;
 virtual StorageRef  implCreateStorage(
diff --git a/include/oox/ppt/dgmimport.hxx b/include/oox/ppt/dgmimport.hxx
index 83ec960..3fd88b5 100644
--- a/include/oox/ppt/dgmimport.hxx
+++ b/include/oox/ppt/dgmimport.hxx
@@ -50,7 +50,7 @@ public:
 virtual oox::drawingml::chart::ChartConverter* getChartConverter() 
SAL_OVERRIDE;
 
 private:
-virtual OUString implGetImplementationName() const SAL_OVERRIDE;
+virtual OUString SAL_CALL getImplementationName() throw 
(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 virtual ::oox::ole::VbaProject* implCreateVbaProject() const SAL_OVERRIDE;
 };
 
diff --git a/include/oox/ppt/dgmlayout.hxx b/include/oox/ppt/dgmlayout.hxx
index 8cc4802..d0ec057 100644
--- a/include/oox/ppt/dgmlayout.hxx
+++ b/include/oox/ppt/dgmlayout.hxx
@@ -50,7 +50,7 @@ public:
 virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() 
SAL_OVERRIDE;
 
 private:
-virtual OUString implGetImplementationName() const SAL_OVERRIDE;
+virtual OUString SAL_CALL getImplementationName() throw 
(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 virtual ::oox::ole::VbaProject* implCreateVbaProject() const SAL_OVERRIDE;
 drawingml::ThemePtr mpThemePtr;
 };
diff --git a/include/oox/ppt/pptimport.hxx b/include/oox/ppt/pptimport.hxx
index 02f0f4b..860da2a 100644
--- a/include/oox/ppt/pptimport.hxx
+++ b/include/oox/ppt/pptimport.hxx
@@ -69,7 +69,7 @@ public:
 private:
 virtual GraphicHelper* implCreateGraphicHelper() const SAL_OVERRIDE;
 virtual ::oox::ole::VbaProject* implCreateVbaProject() const SAL_OVERRIDE;
-virtual OUString implGetImplementationName() const SAL_OVERRIDE;
+virtual OUString SAL_CALL getImplementationName() throw 
(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
 private:
 OUString   maTableStyleListPath;
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index bef0434..cfa2796 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -392,11 +392,6 @@ bool FilterBase::importBinaryData( StreamDataSequence 
orDataSeq, const OUString
 
 // com.sun.star.lang.XServiceInfo interface
 
-OUString SAL_CALL FilterBase::getImplementationName() throw( RuntimeException, 
std::exception )
-{
-return implGetImplementationName();
-}
-
 sal_Bool SAL_CALL FilterBase::supportsService( const OUString rServiceName ) 
throw( RuntimeException, std::exception )
 {
 return cppu::supportsService(this, rServiceName);
diff --git a/oox/source/ppt/dgmimport.cxx 

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

2015-02-02 Thread Juan Picca
 include/oox/export/utils.hxx|5 -
 oox/source/export/drawingml.cxx |   14 +++---
 oox/source/export/shapes.cxx|4 ++--
 sc/source/filter/excel/xeescher.cxx |4 ++--
 sc/source/filter/xcl97/xcl97rec.cxx |8 
 5 files changed, 15 insertions(+), 20 deletions(-)

New commits:
commit c32aa53a7df7af4ef23b8d235483eabb51463183
Author: Juan Picca jumap...@gmail.com
Date:   Sat Jan 31 21:24:42 2015 -0200

fdo#88826: replace MM100toEMU() by convertHmmToEmu()

Change-Id: I9ca79dfa0c214e3f58b7f45a78ad0877d4c7d10a
Reviewed-on: https://gerrit.libreoffice.org/14266
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index 2c4fcec..417e552 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -39,11 +39,6 @@ static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT )
 return (sal_Int64)( (double)nPPT * 1587.5 );
 }
 
-static inline sal_Int64 MM100toEMU( sal_Int32 nMM100 )
-{
-return (sal_Int64)nMM100 * 360;
-}
-
 static inline sal_Int64 TwipsToEMU( sal_Int32 nTwips )
 {
 return sal_Int64( nTwips ) * 635;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3c5c3f3..fcacb7a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -636,7 +636,7 @@ void DrawingML::WriteOutline( ReferenceXPropertySet 
rXPropSet )
 mpFS-startElementNS( XML_a, XML_ln,
   XML_cap, cap,
   XML_w, nLineWidth  1  nStyleLineWidth != 
nLineWidth ?
-  I64S( MM100toEMU( nLineWidth ) ) :NULL,
+  I64S( oox::drawingml::convertHmmToEmu( 
nLineWidth ) ) :NULL,
   FSEND );
 
 if( bColorSet )
@@ -1120,8 +1120,8 @@ void DrawingML::WriteTransformation( const Rectangle 
rRect,
 nTop = 0;
 }
 
-mpFS-singleElementNS( XML_a, XML_off, XML_x, IS( MM100toEMU( nLeft ) ), 
XML_y, IS( MM100toEMU( nTop ) ), FSEND );
-mpFS-singleElementNS( XML_a, XML_ext, XML_cx, IS( MM100toEMU( 
rRect.GetWidth() ) ), XML_cy, IS( MM100toEMU( rRect.GetHeight() ) ), FSEND );
+mpFS-singleElementNS( XML_a, XML_off, XML_x, IS( 
oox::drawingml::convertHmmToEmu( nLeft ) ), XML_y, IS( 
oox::drawingml::convertHmmToEmu( nTop ) ), FSEND );
+mpFS-singleElementNS( XML_a, XML_ext, XML_cx, IS( 
oox::drawingml::convertHmmToEmu( rRect.GetWidth() ) ), XML_cy, IS( 
oox::drawingml::convertHmmToEmu( rRect.GetHeight() ) ), FSEND );
 
 mpFS-endElementNS( nXmlNamespace, XML_xfrm );
 }
@@ -1924,10 +1924,10 @@ void DrawingML::WriteText( Reference XInterface  
rXIface, const OUString pres
 }
 mpFS-startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), 
XML_bodyPr,
XML_wrap, pWrap,
-   XML_lIns, (nLeft != DEFLRINS) ? IS( MM100toEMU( 
nLeft ) ) : NULL,
-   XML_rIns, (nRight != DEFLRINS) ? IS( 
MM100toEMU( nRight ) ) : NULL,
-   XML_tIns, (nTop != DEFTBINS) ? IS( MM100toEMU( 
nTop ) ) : NULL,
-   XML_bIns, (nBottom != DEFTBINS) ? IS( 
MM100toEMU( nBottom ) ) : NULL,
+   XML_lIns, (nLeft != DEFLRINS) ? IS( 
oox::drawingml::convertHmmToEmu( nLeft ) ) : NULL,
+   XML_rIns, (nRight != DEFLRINS) ? IS( 
oox::drawingml::convertHmmToEmu( nRight ) ) : NULL,
+   XML_tIns, (nTop != DEFTBINS) ? IS( 
oox::drawingml::convertHmmToEmu( nTop ) ) : NULL,
+   XML_bIns, (nBottom != DEFTBINS) ? IS( 
oox::drawingml::convertHmmToEmu( nBottom ) ) : NULL,
XML_anchor, sVerticalAlignment,
XML_anchorCtr, bHorizontalCenter ? 1 : NULL,
XML_vert, sWritingMode,
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 71968b9..a41ea2b 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -867,7 +867,7 @@ void ShapeExport::WriteTable( Reference XShape  rXShape  )
 sal_Int32 nWidth(0);
 xColPropSet-getPropertyValue( Width ) = nWidth;
 
-mpFS-singleElementNS( XML_a, XML_gridCol, XML_w, 
I64S(MM100toEMU(nWidth)), FSEND );
+mpFS-singleElementNS( XML_a, XML_gridCol, XML_w, 
I64S(oox::drawingml::convertHmmToEmu(nWidth)), FSEND );
 }
 
 mpFS-endElementNS( XML_a, XML_tblGrid );
@@ -879,7 +879,7 @@ void ShapeExport::WriteTable( Reference XShape  rXShape  )
 
 xRowPropSet-getPropertyValue( Height ) = nRowHeight;
 
-mpFS-startElementNS( XML_a, XML_tr, XML_h, I64S( MM100toEMU( 
nRowHeight ) ), FSEND );
+mpFS-startElementNS( XML_a, XML_tr, XML_h, I64S( 
oox::drawingml::convertHmmToEmu( nRowHeight ) ), 

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

2014-12-12 Thread Noel Grandin
 include/oox/dump/dumperbase.hxx   |   21 --
 include/oox/helper/binaryinputstream.hxx  |   43 --
 include/oox/helper/binaryoutputstream.hxx |   23 ++--
 include/oox/ole/axbinaryreader.hxx|4 ++
 include/oox/ole/axbinarywriter.hxx|5 +++
 oox/source/crypto/DocumentDecryption.cxx  |   25 -
 oox/source/crypto/DocumentEncryption.cxx  |4 +-
 oox/source/crypto/Standard2007Engine.cxx  |4 +-
 oox/source/dump/dffdumper.cxx |6 ++--
 oox/source/dump/dumperbase.cxx|   17 ++-
 oox/source/dump/oledumper.cxx |   12 
 oox/source/helper/binaryinputstream.cxx   |8 -
 oox/source/ole/axbinaryreader.cxx |4 +-
 oox/source/ole/axcontrol.cxx  |   37 -
 oox/source/ole/olehelper.cxx  |   16 +++
 oox/source/ole/vbacontrol.cxx |3 +-
 oox/source/ole/vbahelper.cxx  |3 +-
 oox/source/ole/vbainputstream.cxx |2 -
 sc/source/filter/inc/biffinputstream.hxx  |2 -
 sc/source/filter/oox/biffinputstream.cxx  |8 ++---
 sc/source/filter/oox/stylesbuffer.cxx |5 ++-
 21 files changed, 139 insertions(+), 113 deletions(-)

New commits:
commit aa2f02a4dc8a05f49e679a26f2beebb9d66b2325
Author: Noel Grandin n...@peralex.com
Date:   Fri Dec 12 10:45:32 2014 +0200

remove operator and operator methods

in favour of ReadXXX/WriteXXX methods

Change-Id: I69eebee3a8ce5b40301db7940a1d85915c0bf6f4

diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx
index a747de5..9a89f0a 100644
--- a/include/oox/dump/dumperbase.hxx
+++ b/include/oox/dump/dumperbase.hxx
@@ -1557,8 +1557,7 @@ typedef ::boost::shared_ptr InputObjectBase  
InputObjectRef;
 template typename Type 
 Type InputObjectBase::dumpName( const String rName, const NameListWrapper 
rListWrp )
 {
-Type nData;
-*mxStrm  nData;
+Type nData = mxStrm-readValueType();
 writeNameItem( rName, nData, rListWrp );
 return nData;
 }
@@ -1566,8 +1565,7 @@ Type InputObjectBase::dumpName( const String rName, 
const NameListWrapper rLis
 template typename Type 
 Type InputObjectBase::dumpDec( const String rName, const NameListWrapper 
rListWrp )
 {
-Type nData;
-*mxStrm  nData;
+Type nData = mxStrm-readValueType();
 writeDecItem( rName, nData, rListWrp );
 return nData;
 }
@@ -1575,8 +1573,7 @@ Type InputObjectBase::dumpDec( const String rName, const 
NameListWrapper rList
 template typename Type 
 Type InputObjectBase::dumpHex( const String rName, const NameListWrapper 
rListWrp )
 {
-Type nData;
-*mxStrm  nData;
+Type nData = mxStrm-readValueType();
 writeHexItem( rName, nData, rListWrp );
 return nData;
 }
@@ -1584,8 +1581,7 @@ Type InputObjectBase::dumpHex( const String rName, const 
NameListWrapper rList
 template typename Type 
 Type InputObjectBase::dumpBin( const String rName, const NameListWrapper 
rListWrp )
 {
-Type nData;
-*mxStrm  nData;
+Type nData = mxStrm-readValueType();
 writeBinItem( rName, nData, rListWrp );
 return nData;
 }
@@ -1593,8 +1589,7 @@ Type InputObjectBase::dumpBin( const String rName, const 
NameListWrapper rList
 template typename Type 
 Type InputObjectBase::dumpFix( const String rName, const NameListWrapper 
rListWrp )
 {
-Type nData;
-*mxStrm  nData;
+Type nData = mxStrm-readValueType();
 writeFixItem( rName, nData, rListWrp );
 return nData;
 }
@@ -1602,8 +1597,7 @@ Type InputObjectBase::dumpFix( const String rName, const 
NameListWrapper rList
 template typename Type 
 Type InputObjectBase::dumpBool( const String rName, const NameListWrapper 
rListWrp )
 {
-Type nData;
-*mxStrm  nData;
+Type nData = mxStrm-readValueType();
 writeDecBoolItem( rName, nData, rListWrp );
 return nData;
 }
@@ -1611,8 +1605,7 @@ Type InputObjectBase::dumpBool( const String rName, 
const NameListWrapper rLis
 template typename Type 
 Type InputObjectBase::dumpValue( const ItemFormat rItemFmt )
 {
-Type nData;
-*mxStrm  nData;
+Type nData = mxStrm-readValueType();
 writeValueItem( rItemFmt, nData );
 return nData;
 }
diff --git a/include/oox/helper/binaryinputstream.hxx 
b/include/oox/helper/binaryinputstream.hxx
index 0ddc1ab..4918605 100644
--- a/include/oox/helper/binaryinputstream.hxx
+++ b/include/oox/helper/binaryinputstream.hxx
@@ -78,28 +78,19 @@ public:
 All data types supported by the ByteOrderConverter class can be used.
  */
 template typename Type 
-voidreadValue( Type ornValue );
-
-/** Reads a value from the stream and converts it to platform byte order.
-All data types supported by the ByteOrderConverter class can be used.
- */
-template typename Type 
-Type readValue() { Type nValue; readValue( nValue ); return 
nValue; }
-
-/** Stream operator 

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

2014-10-11 Thread Takeshi Abe
 include/oox/core/relations.hxx |   18 +-
 oox/source/core/relations.cxx  |   15 ---
 oox/source/core/relationshandler.cxx   |2 +-
 sc/source/filter/oox/worksheetfragment.cxx |6 +++---
 4 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit c51f77b1c02d03a4932d1b20ba6440465d265d48
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Fri Oct 10 14:08:49 2014 +0900

fdo#75757: remove inheritance to std::map

from oox::core::Relations.

Change-Id: If2e0109a2ad6598436177b7638cb6d568fb2d3d6
Reviewed-on: https://gerrit.libreoffice.org/11899
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/include/oox/core/relations.hxx b/include/oox/core/relations.hxx
index 38a99c8..e33cb93 100644
--- a/include/oox/core/relations.hxx
+++ b/include/oox/core/relations.hxx
@@ -68,11 +68,26 @@ struct Relation
 class Relations;
 typedef ::boost::shared_ptr Relations  RelationsRef;
 
-class OOX_DLLPUBLIC Relations : public ::std::map OUString, Relation 
+class OOX_DLLPUBLIC Relations
 {
 public:
 explicitRelations( const OUString rFragmentPath );
 
+size_t size() const { return maMap.size(); }
+size_t count( const OUString rId ) const { return maMap.count( rId ); }
+::std::map OUString, Relation ::const_iterator begin() const
+{
+return maMap.begin();
+}
+::std::map OUString, Relation ::const_iterator end() const
+{
+return maMap.end();
+}
+void insert( const ::std::map OUString, Relation ::value_type rVal )
+{
+maMap.insert( rVal );
+}
+
 /** Returns the path of the fragment this relations collection is related 
to. */
 const OUString getFragmentPath() const { return maFragmentPath; }
 
@@ -99,6 +114,7 @@ public:
 OUString getFragmentPathFromFirstTypeFromOfficeDoc( const OUString 
rType ) const;
 
 private:
+::std::map OUString, Relation  maMap;
 OUString maFragmentPath;
 };
 
diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx
index 4122678..5c75b33 100644
--- a/oox/source/core/relations.cxx
+++ b/oox/source/core/relations.cxx
@@ -52,20 +52,21 @@ OUString createOfficeDocRelationTypeStrict(const OUString 
rType)
 
 }
 
-Relations::Relations( const OUString rFragmentPath ) :
-maFragmentPath( rFragmentPath )
+Relations::Relations( const OUString rFragmentPath )
+: maMap()
+, maFragmentPath( rFragmentPath )
 {
 }
 
 const Relation* Relations::getRelationFromRelId( const OUString rId ) const
 {
-const_iterator aIt = find( rId );
-return (aIt == end()) ? 0 : aIt-second;
+::std::map OUString, Relation ::const_iterator aIt = maMap.find( rId );
+return (aIt == maMap.end()) ? 0 : aIt-second;
 }
 
 const Relation* Relations::getRelationFromFirstType( const OUString rType ) 
const
 {
-for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
+for( ::std::map OUString, Relation ::const_iterator aIt = maMap.begin(), 
aEnd = maMap.end(); aIt != aEnd; ++aIt )
 if( aIt-second.maType.equalsIgnoreAsciiCase( rType ) )
 return aIt-second;
 return 0;
@@ -74,10 +75,10 @@ const Relation* Relations::getRelationFromFirstType( const 
OUString rType ) con
 RelationsRef Relations::getRelationsFromTypeFromOfficeDoc( const OUString 
rType ) const
 {
 RelationsRef xRelations( new Relations( maFragmentPath ) );
-for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
+for( ::std::map OUString, Relation ::const_iterator aIt = maMap.begin(), 
aEnd = maMap.end(); aIt != aEnd; ++aIt )
 if( aIt-second.maType.equalsIgnoreAsciiCase( 
createOfficeDocRelationTypeTransitional(rType) ) ||
 aIt-second.maType.equalsIgnoreAsciiCase( 
createOfficeDocRelationTypeStrict(rType) ))
-(*xRelations)[ aIt-first ] = aIt-second;
+xRelations-maMap[ aIt-first ] = aIt-second;
 return xRelations;
 }
 
diff --git a/oox/source/core/relationshandler.cxx 
b/oox/source/core/relationshandler.cxx
index 20adc05..4802b8f 100644
--- a/oox/source/core/relationshandler.cxx
+++ b/oox/source/core/relationshandler.cxx
@@ -76,7 +76,7 @@ Reference XFastContextHandler  
RelationsFragment::createFastChildContext(
 
 OSL_ENSURE( mxRelations-count( aRelation.maId ) == 0,
 RelationsFragment::createFastChildContext - relation 
identifier exists already );
-mxRelations-insert( Relations::value_type( aRelation.maId, 
aRelation ) );
+mxRelations-insert( ::std::map OUString, Relation 
::value_type( aRelation.maId, aRelation ) );
 }
 }
 break;
diff --git a/sc/source/filter/oox/worksheetfragment.cxx 
b/sc/source/filter/oox/worksheetfragment.cxx
index f93d56ee..9f2ff39 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -194,7 

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

2013-07-09 Thread Muthu Subramanian
 include/oox/core/xmlfilterbase.hxx  |3 +++
 oox/source/drawingml/shape.cxx  |   15 +++
 sc/source/filter/inc/excelfilter.hxx|1 +
 sc/source/filter/inc/workbookhelper.hxx |4 +++-
 sc/source/filter/oox/excelfilter.cxx|5 +
 sc/source/filter/oox/workbookhelper.cxx |   21 ++---
 6 files changed, 45 insertions(+), 4 deletions(-)

New commits:
commit 7da06efd74be6500895bab6e5e8ed485914ff45e
Author: Muthu Subramanian sumu...@suse.com
Date:   Tue Jul 9 13:31:16 2013 +0530

n#819822: XLSX Chart import with internal data table.

When the import with xlsx ranges fail - try with
internal data table.

diff --git a/include/oox/core/xmlfilterbase.hxx 
b/include/oox/core/xmlfilterbase.hxx
index 4b5c1e0..5bddea4 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -90,6 +90,9 @@ public:
 converter object, that should be global per imported document. */
 virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() = 0;
 
+/** Helper to switch chart data table - specifically for xlsx imports */
+ virtual void useInternalChartDataTable( bool /*bInternal*/ ) { }
+
 /** Has to be implemented by each filter to return the table style list. */
 virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() 
= 0;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 0d3a286..96a67d6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -52,6 +52,7 @@
 #include basegfx/polygon/b2dpolygon.hxx
 #include basegfx/matrix/b2dhommatrix.hxx
 #include com/sun/star/document/XActionLockable.hpp
+#include com/sun/star/chart2/data/XDataReceiver.hpp
 
 using namespace ::oox::core;
 using namespace ::com::sun::star;
@@ -711,7 +712,21 @@ void Shape::finalizeXShape( XmlFilterBase rFilter, const 
Reference XShapes 
 if( !mxChartShapeInfo-mbEmbedShapes )
 xExternalPage = rxShapes;
 if( rFilter.getChartConverter() )
+{
 rFilter.getChartConverter()-convertFromModel( rFilter, 
aModel, xChartDoc, xExternalPage, mxShape-getPosition(), mxShape-getSize() );
+if( !xChartDoc-hasInternalDataProvider() )
+{
+Reference chart2::data::XDataReceiver  xDataRec( 
xChartDoc, UNO_QUERY );
+Reference chart2::data::XDataSource  xData( 
xDataRec-getUsedData(), UNO_QUERY );
+if( 
xData-getDataSequences()[0]-getValues()-getData().getLength() = 0 )
+{
+rFilter.useInternalChartDataTable( true );
+rFilter.getChartConverter()-convertFromModel( 
rFilter, aModel, xChartDoc, xExternalPage, mxShape-getPosition(), 
mxShape-getSize() );
+rFilter.useInternalChartDataTable( false );
+}
+}
+
+}
 }
 catch( Exception )
 {
diff --git a/sc/source/filter/inc/excelfilter.hxx 
b/sc/source/filter/inc/excelfilter.hxx
index 5aa3310..c368792 100644
--- a/sc/source/filter/inc/excelfilter.hxx
+++ b/sc/source/filter/inc/excelfilter.hxx
@@ -48,6 +48,7 @@ public:
 virtual ::oox::vml::Drawing* getVmlDrawing();
 virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles();
 virtual ::oox::drawingml::chart::ChartConverter* getChartConverter();
+virtual void useInternalChartDataTable( bool bInternal );
 
 virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence 
::com::sun::star::beans::PropertyValue  rDescriptor ) throw( 
::com::sun::star::uno::RuntimeException );
 
diff --git a/sc/source/filter/inc/workbookhelper.hxx 
b/sc/source/filter/inc/workbookhelper.hxx
index fa1ce19..f4ce1cc 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -23,6 +23,7 @@
 #include boost/shared_ptr.hpp
 #include rtl/ref.hxx
 #include oox/helper/storagebase.hxx
+#include oox/drawingml/chart/chartconverter.hxx
 #include biffhelper.hxx
 #include rangenam.hxx
 
@@ -144,6 +145,7 @@ public:
 voidsetCurrentSheetIndex( sal_Int16 nSheet );
 /** Final conversion after importing the workbook. */
 voidfinalizeWorkbookImport();
+voiduseInternalChartDataTable( bool bInternal );
 
 // document model -
 ScDocument getScDocument() const;
@@ -248,7 +250,7 @@ public:
 /** Returns the converter for string to cell address/range conversion. */
 AddressConverter   getAddressConverter() const;
 /** Returns the chart object converter. */
-ExcelChartConverter* getChartConverter() const;
+oox::drawingml::chart::ChartConverter* getChartConverter() const;
 /** Returns the page and print 

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

2013-06-28 Thread Tor Lillqvist
 include/oox/drawingml/connectorshapecontext.hxx   |2 
 include/oox/drawingml/graphicshapecontext.hxx |   10 +-
 include/oox/drawingml/shapecontext.hxx|6 -
 include/oox/drawingml/shapegroupcontext.hxx   |4 
 include/oox/drawingml/table/tablecontext.hxx  |2 
 include/oox/ppt/pptgraphicshapecontext.hxx|2 
 include/oox/ppt/pptshapecontext.hxx   |2 
 include/oox/ppt/pptshapegroupcontext.hxx  |2 
 oox/source/drawingml/connectorshapecontext.cxx|2 
 oox/source/drawingml/diagram/constraintlistcontext.cxx|6 -
 oox/source/drawingml/diagram/constraintlistcontext.hxx|6 -
 oox/source/drawingml/diagram/diagramdefinitioncontext.cxx |   14 +--
 oox/source/drawingml/diagram/diagramdefinitioncontext.hxx |6 -
 oox/source/drawingml/diagram/diagramfragmenthandler.cxx   |4 
 oox/source/drawingml/diagram/diagramfragmenthandler.hxx   |2 
 oox/source/drawingml/diagram/layoutnodecontext.cxx|   61 ++
 oox/source/drawingml/diagram/layoutnodecontext.hxx|6 -
 oox/source/drawingml/graphicshapecontext.cxx  |   10 +-
 oox/source/drawingml/shapecontext.cxx |4 
 oox/source/drawingml/shapegroupcontext.cxx|4 
 oox/source/drawingml/table/tablecontext.cxx   |2 
 oox/source/ppt/extdrawingfragmenthandler.cxx  |2 
 oox/source/ppt/extdrawingfragmenthandler.hxx  |3 
 oox/source/ppt/pptgraphicshapecontext.cxx |2 
 oox/source/ppt/pptshapecontext.cxx|2 
 oox/source/ppt/pptshapegroupcontext.cxx   |2 
 oox/source/shape/ShapeContextHandler.cxx  |4 
 oox/source/shape/ShapeContextHandler.hxx  |6 -
 oox/source/shape/ShapeDrawingFragmentHandler.cxx  |2 
 oox/source/shape/ShapeDrawingFragmentHandler.hxx  |4 
 sc/source/filter/inc/drawingfragment.hxx  |4 
 sc/source/filter/oox/drawingfragment.cxx  |4 
 32 files changed, 95 insertions(+), 97 deletions(-)

New commits:
commit 32ce3c6b0a945078868fb2ae35c9260e4e4c3649
Author: Tor Lillqvist t...@iki.fi
Date:   Thu Jun 13 22:44:43 2013 +0300

More OOXML Markup Compatibility and Extensibility (MCE) support

Change many classes in oox to be based on ContextHandler2 instead of
ContextHandler. That supposedly adds MCE support.

This is a minimal initial effort. It compiles and links but doesn't work
(CppunitTest_chart2_export fails). Follow-up coming...

Change-Id: If89117abd48cfead468633fd7fce1ea785f6f420
Reviewed-on: https://gerrit.libreoffice.org/4577
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/include/oox/drawingml/connectorshapecontext.hxx 
b/include/oox/drawingml/connectorshapecontext.hxx
index 48a03ae..e320147 100644
--- a/include/oox/drawingml/connectorshapecontext.hxx
+++ b/include/oox/drawingml/connectorshapecontext.hxx
@@ -29,7 +29,7 @@ namespace oox { namespace drawingml {
 class OOX_DLLPUBLIC ConnectorShapeContext : public ShapeContext
 {
 public:
-ConnectorShapeContext( ::oox::core::ContextHandler rParent, ShapePtr 
pMasterShapePtr, ShapePtr pGroupShapePtr );
+ConnectorShapeContext( ::oox::core::ContextHandler2Helper rParent, 
ShapePtr pMasterShapePtr, ShapePtr pGroupShapePtr );
 virtual ~ConnectorShapeContext();
 virtual ::com::sun::star::uno::Reference 
::com::sun::star::xml::sax::XFastContextHandler  SAL_CALL 
createFastChildContext( ::sal_Int32 Element, const 
::com::sun::star::uno::Reference 
::com::sun::star::xml::sax::XFastAttributeList  Attribs ) throw 
(::com::sun::star::xml::sax::SAXException, 
::com::sun::star::uno::RuntimeException);
 };
diff --git a/include/oox/drawingml/graphicshapecontext.hxx 
b/include/oox/drawingml/graphicshapecontext.hxx
index c5984d5..8d85fd0 100644
--- a/include/oox/drawingml/graphicshapecontext.hxx
+++ b/include/oox/drawingml/graphicshapecontext.hxx
@@ -31,7 +31,7 @@ namespace oox { namespace drawingml {
 class OOX_DLLPUBLIC GraphicShapeContext : public ShapeContext
 {
 public:
-GraphicShapeContext( ::oox::core::ContextHandler rParent, ShapePtr 
pMasterShapePtr, ShapePtr pShapePtr );
+GraphicShapeContext( ::oox::core::ContextHandler2Helper rParent, ShapePtr 
pMasterShapePtr, ShapePtr pShapePtr );
 
 virtual ::com::sun::star::uno::Reference 
::com::sun::star::xml::sax::XFastContextHandler  SAL_CALL 
createFastChildContext( ::sal_Int32 Element, const 
::com::sun::star::uno::Reference 
::com::sun::star::xml::sax::XFastAttributeList  Attribs ) throw 
(::com::sun::star::xml::sax::SAXException, 
::com::sun::star::uno::RuntimeException);
 
@@ -42,7 +42,7 @@ public:
 class OOX_DLLPUBLIC GraphicalObjectFrameContext : public 

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

2013-06-12 Thread Noel Power
 include/oox/ole/axcontrol.hxx|6 +++---
 oox/source/ole/axcontrol.cxx |   10 +-
 sc/source/filter/oox/drawingfragment.cxx |8 
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit fecd316a966f08d095c1514f8de0924749a5b8da
Author: Noel Power noel.po...@suse.com
Date:   Wed Jun 12 18:50:22 2013 +0100

typo correction AX_SELCTION_xxx - AX_SELECTION_xxx

petty correct of AX_SELCTION_xxx - AX_SELECTION_xxx but it
was irritating me

Change-Id: Iae7a0151a63502aa89f04ae54fe7348548ffd32c

diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx
index 84e3a3e..d2bf3e5 100644
--- a/include/oox/ole/axcontrol.hxx
+++ b/include/oox/ole/axcontrol.hxx
@@ -129,9 +129,9 @@ const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON   = 5;
 const sal_Int32 AX_DISPLAYSTYLE_TOGGLE  = 6;
 const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN= 7;
 
-const sal_Int32 AX_SELCTION_SINGLE  = 0;
-const sal_Int32 AX_SELCTION_MULTI   = 1;
-const sal_Int32 AX_SELCTION_EXTENDED= 2;
+const sal_Int32 AX_SELECTION_SINGLE = 0;
+const sal_Int32 AX_SELECTION_MULTI  = 1;
+const sal_Int32 AX_SELECTION_EXTENDED   = 2;
 
 const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0;
 const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1;
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 47d21d5..eca6d70 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -541,7 +541,7 @@ void ControlConverter::convertAxState( PropertyMap 
rPropMap,
 
 // tristate
 if( bSupportsTriState )
-rPropMap.setProperty( PROP_TriState, nMultiSelect == AX_SELCTION_MULTI 
);
+rPropMap.setProperty( PROP_TriState, nMultiSelect == 
AX_SELECTION_MULTI );
 }
 
 void ControlConverter::convertToAxState( PropertySet rPropSet,
@@ -564,7 +564,7 @@ void ControlConverter::convertToAxState( PropertySet 
rPropSet,
 
 // tristate
 if( bSupportsTriState  rPropSet.getProperty( bTmp, PROP_TriState ) )
-nMultiSelect = AX_SELCTION_MULTI;
+nMultiSelect = AX_SELECTION_MULTI;
 }
 
 void ControlConverter::convertAxOrientation( PropertyMap rPropMap,
@@ -1408,7 +1408,7 @@ AxMorphDataModelBase::AxMorphDataModelBase() :
 mnBorderStyle( AX_BORDERSTYLE_NONE ),
 mnSpecialEffect( AX_SPECIALEFFECT_SUNKEN ),
 mnDisplayStyle( AX_DISPLAYSTYLE_TEXT ),
-mnMultiSelect( AX_SELCTION_SINGLE ),
+mnMultiSelect( AX_SELECTION_SINGLE ),
 mnScrollBars( AX_SCROLLBAR_NONE ),
 mnMatchEntry( AX_MATCHENTRY_NONE ),
 mnShowDropButton( AX_SHOWDROPBUTTON_NEVER ),
@@ -1535,7 +1535,7 @@ void AxMorphDataModelBase::exportBinaryModel( 
BinaryOutputStream rOutStrm )
 aWriter.skipProperty(); // mnShowDropButton );
 aWriter.skipProperty();
 aWriter.skipProperty(); // drop down style
-if ( mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX  mnMultiSelect != 
AX_SELCTION_SINGLE )
+if ( mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX  mnMultiSelect != 
AX_SELECTION_SINGLE )
 aWriter.writeIntProperty sal_uInt8 ( mnMultiSelect );
 // although CheckBox, ListBox, OptionButton, ToggleButton are also 
supported
 // they can only have the fileformat default
@@ -1924,7 +1924,7 @@ ApiControlType AxListBoxModel::getControlType() const
 
 void AxListBoxModel::convertProperties( PropertyMap rPropMap, const 
ControlConverter rConv ) const
 {
-bool bMultiSelect = (mnMultiSelect == AX_SELCTION_MULTI) || (mnMultiSelect 
== AX_SELCTION_EXTENDED);
+bool bMultiSelect = (mnMultiSelect == AX_SELECTION_MULTI) || 
(mnMultiSelect == AX_SELECTION_EXTENDED);
 rPropMap.setProperty( PROP_MultiSelection, bMultiSelect );
 rPropMap.setProperty( PROP_Dropdown, false );
 rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, 
API_TRANSPARENCY_VOID );
diff --git a/sc/source/filter/oox/drawingfragment.cxx 
b/sc/source/filter/oox/drawingfragment.cxx
index 65bff71..dc047d4 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -535,7 +535,7 @@ Reference XShape  
VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S
 rAxModel.mnSpecialEffect = pClientData-mbNo3D ? 
AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
 rAxModel.mnVerticalAlign = pClientData-mnTextVAlign;
 bool bTriState = (pClientData-mnChecked != 
::oox::vml::VML_CLIENTDATA_UNCHECKED)  (pClientData-mnChecked != 
::oox::vml::VML_CLIENTDATA_CHECKED);
-rAxModel.mnMultiSelect = bTriState ? AX_SELCTION_MULTI : 
AX_SELCTION_SINGLE;
+rAxModel.mnMultiSelect = bTriState ? AX_SELECTION_MULTI : 
AX_SELECTION_SINGLE;
 }
 break;
 
@@ -558,9 +558,9 @@ Reference XShape  
VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S
 rAxModel.mnSpecialEffect = pClientData-mbNo3D2 ? 
AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
 switch(