[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-08-04 Thread Felix Zhang
 oox/source/drawingml/shape.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 774a45341b7b69d6c1ce508e55c23d78efa43871
Author: Felix Zhang 
Date:   Mon Jul 1 17:04:12 2013 +0800

bnc#593612: workaround for grpFill

Change-Id: Ib75f2e5e0d77b5a65c6d3d75e7dd477251948bcc
(cherry picked from commit 3b35ad42ed8bea8cab32e2131c81b03c8347cb67)

Signed-off-by: Thorsten Behrens 

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 6c30d12..dc2a7db 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -524,9 +524,8 @@ Reference< XShape > Shape::createAndInsert(
 
 // group fill inherits from parent
 if ( getFillProperties().moFillType.has() && 
getFillProperties().moFillType.get() == XML_grpFill )
-aFillProperties.assignUsed( rShapeOrParentShapeFillProps );
-else
-aFillProperties.assignUsed( getFillProperties() );
+getFillProperties().assignUsed( rShapeOrParentShapeFillProps );
+aFillProperties.assignUsed( getFillProperties() );
 aEffectProperties.assignUsed ( getEffectProperties() );
 
 ShapePropertyMap aShapeProps( rFilterBase.getModelObjectHelper() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-12-19 Thread Muthu Subramanian
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8f0f3b0154f915cd2e9eea2907dcc1e117854760
Author: Muthu Subramanian 
Date:   Thu Dec 19 16:48:20 2013 +0530

n#828390: Bullet sizes set wrong.

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ff3f62a..3986989 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1102,7 +1102,7 @@ void DrawingML::WriteParagraphNumbering( Reference< 
XPropertySet > rXPropSet, sa
 } else {
 if( nBulletRelSize && nBulletRelSize != 100 )
 mpFS->singleElementNS( XML_a, XML_buSzPct,
-   XML_val, IS( std::min( 
(sal_Int32)25000, std::max( (sal_Int32)40, 1000*( (sal_Int32)nBulletRelSize 
) ) ) ), FSEND );
+   XML_val, IS( std::max( 
(sal_Int32)25000, std::min( (sal_Int32)40, 1000*( (sal_Int32)nBulletRelSize 
) ) ) ), FSEND );
 if( bHasFontDesc )
 mpFS->singleElementNS( XML_a, XML_buFont,
XML_typeface, 
OUStringToOString( aFontDesc.Name, RTL_TEXTENCODING_UTF8 ).getStr(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-06-21 Thread Cédric Bosdonnat
 oox/source/vml/vmlshape.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 08db0b22bdce0f779e4af01a209aef1be29e9907
Author: Cédric Bosdonnat 
Date:   Fri Jun 21 10:47:42 2013 +0200

n#820504: Some imported VML paths are closed, try to detect the

Change-Id: Idefd0277a85bd7b2b727f59cc4e568869b4932a1

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 414cc03..d34bf33 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -683,12 +683,19 @@ awt::Rectangle LineShape::getRelRectangle() const
 // 
 
 BezierShape::BezierShape(Drawing& rDrawing)
-: SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape")
+: SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape") // TODO 
Could we need both Open and Closed?
 {
 }
 
 Reference< XShape > BezierShape::implConvertAndInsert( const Reference< 
XShapes >& rxShapes, const awt::Rectangle& rShapeRect ) const
 {
+// If we have an 'x' in the last part of the path it means it is closed...
+sal_Int32 nPos = maShapeModel.maVmlPath.lastIndexOf(',');
+if ( nPos != -1 && maShapeModel.maVmlPath.copy(nPos).indexOf('x') != -1 )
+{
+const_cast( this )->setService( 
"com.sun.star.drawing.ClosedBezierShape" );
+}
+
 Reference< XShape > xShape = SimpleShape::implConvertAndInsert( rxShapes, 
rShapeRect );
 awt::Rectangle aCoordSys = getCoordSystem();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-06-24 Thread Cédric Bosdonnat
 oox/source/vml/vmlformatting.cxx |   20 ++--
 oox/source/vml/vmlshape.cxx  |2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 442ad6eef9d6e1588e4985e97ec3eafd6289f9ae
Author: Cédric Bosdonnat 
Date:   Mon Jun 24 10:37:05 2013 +0200

n#820504: VML path import fixes: get back missing points

nParamsCount was set to the double of the expected value, but the code
handling the command only took the first set of parameters. Removing
this 2* in nParamsCount.

Change-Id: I2a4bb07fc9167e056a52c7adfbee9e1ef8e2636c

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 02559d4..d59ff6a 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -319,7 +319,7 @@ bool lclExtractDouble( double& orfValue, sal_Int32& 
ornEndPos, const OUString& r
 rPointLists.back().push_back( Point( aCoordList[ 0 ], 
aCoordList[ 1 ] ) );
 rFlagLists.back().push_back( PolygonFlags_NORMAL );
 aCurrentPoint = rPointLists.back().back();
-nParamCount = 2 * 2;
+nParamCount = 2;
 break;
 
 case MOVE_ABS: // 2 params -> no param count reset
@@ -350,7 +350,7 @@ bool lclExtractDouble( double& orfValue, sal_Int32& 
ornEndPos, const OUString& r
 rFlagLists.back().push_back( PolygonFlags_CONTROL );
 rFlagLists.back().push_back( PolygonFlags_NORMAL );
 aCurrentPoint = rPointLists.back().back();
-nParamCount = 2 * 6;
+nParamCount = 6;
 break;
 
 case LINE_REL: // 2* params -> param count reset
@@ -358,14 +358,14 @@ bool lclExtractDouble( double& orfValue, sal_Int32& 
ornEndPos, const OUString& r
 aCurrentPoint.Y + aCoordList[ 1 ] 
) );
 rFlagLists.back().push_back( PolygonFlags_NORMAL );
 aCurrentPoint = rPointLists.back().back();
-nParamCount = 2 * 2;
+nParamCount = 2;
 break;
 
 case LINE_ABS: // 2* params -> param count reset
 rPointLists.back().push_back( Point( aCoordList[ 0 ], 
aCoordList[ 1 ] ) );
 rFlagLists.back().push_back( PolygonFlags_NORMAL );
 aCurrentPoint = rPointLists.back().back();
-nParamCount = 2 * 2;
+nParamCount = 2;
 break;
 
 case CLOSE: // 0 param
@@ -389,12 +389,12 @@ bool lclExtractDouble( double& orfValue, sal_Int32& 
ornEndPos, const OUString& r
 // Move on to current command state
 switch ( rPath[ i ] )
 {
-case 't': state = MOVE_REL; nTokenLen = 0; nParamCount = 2 * 2; 
break;
-case 'm': state = MOVE_ABS; nTokenLen = 0; nParamCount = 2 * 2; 
break;
-case 'v': state = BEZIER_REL; nTokenLen = 0; nParamCount = 2 * 6; 
break;
-case 'c': state = BEZIER_ABS; nTokenLen = 0; nParamCount = 2 * 6; 
break;
-case 'r': state = LINE_REL; nTokenLen = 0; nParamCount = 2 * 2; 
break;
-case 'l': state = LINE_ABS; nTokenLen = 0; nParamCount = 2 * 2; 
break;
+case 't': state = MOVE_REL; nTokenLen = 0; nParamCount = 2; break;
+case 'm': state = MOVE_ABS; nTokenLen = 0; nParamCount =  2; break;
+case 'v': state = BEZIER_REL; nTokenLen = 0; nParamCount = 6; 
break;
+case 'c': state = BEZIER_ABS; nTokenLen = 0; nParamCount = 6; 
break;
+case 'r': state = LINE_REL; nTokenLen = 0; nParamCount = 2; break;
+case 'l': state = LINE_ABS; nTokenLen = 0; nParamCount = 2; break;
 case 'x': state = CLOSE; nTokenLen = 0; break;
 case 'e': state = END; break;
 }
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index d34bf33..44910b5 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -683,7 +683,7 @@ awt::Rectangle LineShape::getRelRectangle() const
 // 
 
 BezierShape::BezierShape(Drawing& rDrawing)
-: SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape") // TODO 
Could we need both Open and Closed?
+: SimpleShape(rDrawing, "com.sun.star.drawing.OpenBezierShape")
 {
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-11-13 Thread Muthu Subramanian
 oox/source/export/drawingml.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 884070670824a210832739c9235693cd3fd6cca8
Author: Muthu Subramanian 
Date:   Wed Nov 13 20:54:46 2013 +0530

n#828390: Export subscript text.

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index afb9e02..bfe3ed9 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -665,6 +665,7 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet 
> rRun, sal_Bool bIs
 const char* italic = NULL;
 const char* underline = NULL;
 sal_Int32 nSize = 1800;
+sal_Int32 nCharEscapement = 0;
 
 if( GETAD( CharHeight ) )
 nSize = (sal_Int32) (100*(*((float*) mAny.getValue(;
@@ -751,12 +752,24 @@ void DrawingML::WriteRunProperties( Reference< 
XPropertySet > rRun, sal_Bool bIs
 usLanguage = usLanguageBuffer.makeStringAndClear();
 }
 
+if( GETAD( CharEscapement ) )
+mAny >>= nCharEscapement;
+
+if( nCharEscapement && GETAD( CharEscapementHeight ) ) {
+sal_uInt32 nCharEscapementHeight;
+mAny >>= nCharEscapementHeight;
+nSize = (nSize * nCharEscapementHeight) / 100;
+// MSO uses default ~58% size
+nSize = (nSize / 0.58);
+}
+
 mpFS->startElementNS( XML_a, XML_rPr,
   XML_b, bold,
   XML_i, italic,
   XML_lang, usLanguage.isEmpty() ? NULL : USS( 
usLanguage ),
   XML_sz, nSize == 1800 ? NULL : IS( nSize ),
   XML_u, underline,
+  XML_baseline, nCharEscapement == 0 ? NULL : IS( 
nCharEscapement*1000 ),
   FSEND );
 
 // mso doesn't like text color to be placed after typeface
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-06-12 Thread Cédric Bosdonnat
 oox/source/vml/vmlshape.cxx |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 3ad1d411f658b0c2bc8e318aebb999ab75675327
Author: Cédric Bosdonnat 
Date:   Wed Jun 12 16:01:00 2013 +0200

n#779642: 0 width or height in //v:shape[@style] produces weird results

(cherry picked from commit b7144acb2bfa369fb89146d060dbd8ddd547f4c1)

Conflicts:
oox/source/vml/vmlshape.cxx

Change-Id: I37ba59dd54ac692f234f3228e442799c5a5f450b

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1c3cbac..414cc03 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -190,11 +190,18 @@ awt::Rectangle ShapeType::getAbsRectangle() const
 
 awt::Rectangle ShapeType::getRelRectangle() const
 {
+sal_Int32 nWidth = maTypeModel.maWidth.toInt32();
+if ( nWidth == 0 )
+nWidth = 1;
+
+sal_Int32 nHeight = maTypeModel.maHeight.toInt32();
+if ( nHeight == 0 )
+nHeight = 1;
+
 return awt::Rectangle(
 maTypeModel.maLeft.toInt32(),
 maTypeModel.maTop.toInt32(),
-maTypeModel.maWidth.toInt32(),
-maTypeModel.maHeight.toInt32() );
+nWidth, nHeight );
 }
 
 // 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-06-13 Thread Petr Mladek
 oox/source/drawingml/customshapegeometry.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit f3e29add840d5c6db8c1deff6b48b3701991a0ff
Author: Petr Mladek 
Date:   Thu Jun 13 14:30:06 2013 +0200

Revert "bnc#819614: Fix runaway lines."

It caused several regressions when displaying shapes; for example,
in the test document for bnc#762695:

+ missing hyperboloids on several slides, e.g. 13, 14, 15
+ broken bubles on slide 32

This reverts commit c4345bcf488d24a45a6412cda41474de6baf00da.

diff --git a/oox/source/drawingml/customshapegeometry.cxx 
b/oox/source/drawingml/customshapegeometry.cxx
index 55cf132..dada581 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -407,9 +407,8 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( 
CustomShapeProperties& rCu
 n = rValue[ 1 ];
 }
 if ( ( n >= '0' ) && ( n <= '9' ) )
-{
-// seems to be a ST_Coordinate - convert EMUs to 1/100th mm
-aRet.Value = Any( GetCoordinate( rValue ) );
+{   // seems to be a ST_Coordinate
+aRet.Value = Any( (sal_Int32)(rValue.toInt32() ) );
 aRet.Type = EnhancedCustomShapeParameterType::NORMAL;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2014-01-02 Thread Muthu Subramanian
 oox/source/drawingml/textbodycontext.cxx |1 -
 oox/source/drawingml/textcharacterproperties.cxx |2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 950de3b92fbab4eee931973bb95170e205b16a4b
Author: Muthu Subramanian 
Date:   Thu Jan 2 14:03:22 2014 +0530

Fix compilation problems.

diff --git a/oox/source/drawingml/textbodycontext.cxx 
b/oox/source/drawingml/textbodycontext.cxx
index a8b3d64..7bc29a0 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -54,7 +54,6 @@ TextParagraphContext::TextParagraphContext( ContextHandler& 
rParent, TextParagra
 : ContextHandler( rParent )
 , mrParagraph( rPara )
 {
-mbEnableTrimSpace = false;
 }
 
 // 
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index c531bc1..bc23204 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -21,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "oox/helper/helper.hxx"
 #include "oox/helper/propertyset.hxx"
 #include "oox/core/xmlfilterbase.hxx"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-08-22 Thread Muthu Subramanian
 oox/source/drawingml/shape.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit b6f35687e4d53c67fd5d104fd99f92c6d11bf815
Author: Muthu Subramanian 
Date:   Thu Aug 15 17:41:26 2013 +0530

n#831457: Placeholders text size is not correct.

Placeholders (or shapes without text imported from
the files) have wrong font size. This is because the
size (and probably other text attributes) aren't applied from
the mastertextlist to the shape itself.

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index dc2a7db..2e460d3 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -535,6 +535,9 @@ Reference< XShape > Shape::createAndInsert(
 {
 mpTextBody->getTextProperties().pushRotationAdjustments( 
mnRotation );
 aShapeProps.assignUsed( 
mpTextBody->getTextProperties().maPropertyMap );
+// Push char properties as well - specifically useful when this is 
a placeholder
+if( mpMasterTextListStyle &&  
mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.has()
 )
+aShapeProps[ PROP_CharHeight ] <<= GetFontHeight( 
mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.get()
 );
 }
 
 // applying properties
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-09-11 Thread Muthu Subramanian
 oox/source/drawingml/chart/axisconverter.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cb4cd3e302783ec8345a899be81a2bd7c0bf02ca
Author: Muthu Subramanian 
Date:   Mon Sep 9 21:05:42 2013 +0530

n#834722: Chart shown flipped.

Auto and manual axis positioning seems to cause a problem.
Needs to be tested with more charts.

diff --git a/oox/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index bade987..ba01c52 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -324,7 +324,8 @@ void AxisConverter::convertFromModel( const Reference< 
XCoordinateSystem >& rxCo
 case XML_max:   eAxisPos = cssc::ChartAxisPosition_END; 
break;
 case XML_autoZero:  eAxisPos = cssc::ChartAxisPosition_VALUE;   
break;
 }
-aAxisProp.setProperty( PROP_CrossoverPosition, eAxisPos );
+if( !mrModel.mbAuto )
+aAxisProp.setProperty( PROP_CrossoverPosition, eAxisPos );
 
 // calculate automatic origin depending on scaling mode of crossing 
axis
 bool bCrossingLogScale = pCrossingAxis && lclIsLogarithmicScale( 
*pCrossingAxis );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-09-22 Thread Muthu Subramanian
 oox/source/drawingml/chart/axisconverter.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 63eafc88befd398e0ee94a94aff945712a179d48
Author: Muthu Subramanian 
Date:   Wed Sep 11 21:41:43 2013 +0530

n#834720: Labels wrongly interpreted as dates.

If the numFormat is available we should probably use that.

diff --git a/oox/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index ba01c52..7feb6c9 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -307,10 +307,8 @@ void AxisConverter::convertFromModel( const Reference< 
XCoordinateSystem >& rxCo
 {
 bool bPercent = false;
 if( mrModel.maNumberFormat.maFormatCode.indexOf('%') >= 0)
-{
-mrModel.maNumberFormat.mbSourceLinked = false;
 bPercent = true;
-}
+mrModel.maNumberFormat.mbSourceLinked = false;
 getFormatter().convertNumberFormat( aAxisProp, 
mrModel.maNumberFormat, bPercent );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-10-22 Thread Muthu Subramanian
 oox/source/drawingml/chart/typegroupconverter.cxx |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit 59f17072a0999c83293a0497132fc08dfd7d3f5e
Author: Muthu Subramanian 
Date:   Tue Oct 22 14:47:56 2013 +0530

n#839727: Chart missing dataset.

This was because there is no explicit category
in the chart - while libreoffice expects it.

diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx 
b/oox/source/drawingml/chart/typegroupconverter.cxx
index 7b72fd4..164abb0 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -270,6 +270,7 @@ Reference< XCoordinateSystem > 
TypeGroupConverter::createCoordinateSystem()
 
 Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence()
 {
+sal_Int32 nMaxValues = 0;
 Reference< XLabeledDataSequence > xLabeledSeq;
 /*  Find first existing category sequence. The bahaviour of Excel 2007 is
 different to Excel 2003, which always used the category sequence of the
@@ -281,6 +282,24 @@ Reference< XLabeledDataSequence > 
TypeGroupConverter::createCategorySequence()
 SeriesConverter aSeriesConv( *this, **aIt );
 xLabeledSeq = aSeriesConv.createCategorySequence( CREATE_OUSTRING( 
"categories" ) );
 }
+else if( nMaxValues <= 0 && (*aIt)->maSources.has( SeriesModel::VALUES 
) )
+{
+DataSourceModel *pValues = (*aIt)->maSources.get( 
SeriesModel::VALUES ).get();
+if( pValues->mxDataSeq.is() )
+nMaxValues = pValues->mxDataSeq.get()->maData.size();
+}
+}
+/* n#839727 Create Category Sequence when none are found */
+if( !xLabeledSeq.is() && mrModel.maSeries.size() > 0 ) {
+if( nMaxValues < 0 )
+nMaxValues = 2;
+SeriesModel &aModel = mrModel.maSeries.create();
+DataSourceModel &aSrc = aModel.maSources.create( 
SeriesModel::CATEGORIES );
+DataSequenceModel &aSeq = aSrc.mxDataSeq.create();
+for( sal_Int32 i = 0; i < nMaxValues; i++ )
+aSeq.maData[ i ] <<= OUString::number( i + 1 );
+SeriesConverter aSeriesConv( *this,  aModel );
+xLabeledSeq = aSeriesConv.createCategorySequence( "categories" );
 }
 return xLabeledSeq;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-10-22 Thread Muthu Subramanian
 oox/source/drawingml/chart/seriesconverter.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3b7487c8eaabe65b9019702ab8e0f9c919d81eac
Author: Muthu Subramanian 
Date:   Tue Oct 22 15:13:41 2013 +0530

n#839727: Crash fix.

diff --git a/oox/source/drawingml/chart/seriesconverter.cxx 
b/oox/source/drawingml/chart/seriesconverter.cxx
index e2f9034..419a316 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -631,7 +631,8 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( 
const TypeGroupConve
 {
 // Use number format code from Value series
 DataSourceModel* pValues = mrModel.maSources.get( 
SeriesModel::VALUES ).get();
-xLabels->maNumberFormat.maFormatCode = 
pValues->mxDataSeq->maFormatCode;
+if( pValues )
+xLabels->maNumberFormat.maFormatCode = 
pValues->mxDataSeq->maFormatCode;
 }
 DataLabelsConverter aLabelsConv( *this, *xLabels );
 aLabelsConv.convertFromModel( xDataSeries, rTypeGroup );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-10-28 Thread Miklos Vajna
 oox/source/drawingml/chart/typegroupconverter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 82bd538a76493eaa325b768d22e2486b072d6950
Author: Miklos Vajna 
Date:   Mon Oct 28 12:29:48 2013 +0100

oox: fix build

OUString::number() -> OUString::valueOf()

diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx 
b/oox/source/drawingml/chart/typegroupconverter.cxx
index 164abb0..ab43614 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -297,7 +297,7 @@ Reference< XLabeledDataSequence > 
TypeGroupConverter::createCategorySequence()
 DataSourceModel &aSrc = aModel.maSources.create( 
SeriesModel::CATEGORIES );
 DataSequenceModel &aSeq = aSrc.mxDataSeq.create();
 for( sal_Int32 i = 0; i < nMaxValues; i++ )
-aSeq.maData[ i ] <<= OUString::number( i + 1 );
+aSeq.maData[ i ] <<= OUString::valueOf( i + 1 );
 SeriesConverter aSeriesConv( *this,  aModel );
 xLabeledSeq = aSeriesConv.createCategorySequence( "categories" );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2014-03-14 Thread Muthu Subramanian
 oox/source/drawingml/textcharacterpropertiescontext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit df861737beaa883ccd2b11bfa896cd546dd51b6f
Author: Muthu Subramanian 
Date:   Fri Mar 14 20:03:45 2014 +0530

n#862510: Ignore baseline attributes with zero.

Ported from 19abfaffe74b925e4428943d14187a7008797982

Change-Id: I5447c16193f7c3e619ce10658c9696014d3d5a22

diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx 
b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 2119dc6..13af2cd 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -56,7 +56,7 @@ 
TextCharacterPropertiesContext::TextCharacterPropertiesContext(
 mrTextCharacterProperties.moUnderline = aAttribs.getToken( XML_u );
 if ( aAttribs.hasAttribute( XML_strike ) )
 mrTextCharacterProperties.moStrikeout = aAttribs.getToken( XML_strike 
);
-if ( aAttribs.hasAttribute( XML_baseline ) )
+if ( aAttribs.hasAttribute( XML_baseline ) && aAttribs.getInteger( 
XML_baseline ).get() != 0 )
 mrTextCharacterProperties.moBaseline = aAttribs.getInteger( 
XML_baseline );
 
 //  mrTextCharacterProperties.moCaseMap = aAttribs.getToken( XML_cap );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-04-16 Thread Felix Zhang
 oox/source/drawingml/textparagraphproperties.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 5c5f3782d8e324fb19c52df9781be1386d2b8407
Author: Felix Zhang 
Date:   Thu Mar 28 21:00:11 2013 +0800

bnc#793414: Fixed the left margin of bullet

Change-Id: I4726ab00a6e2700407ffcf5258d3736ed0161514

diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index edf13fb..7889da2 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "oox/helper/helper.hxx"
 #include "oox/helper/propertyset.hxx"
@@ -418,6 +419,7 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 {
 if ( noParaLeftMargin )
 {
+aPropSet.setProperty( PROP_ParaLeftMargin, static_cast< sal_Int32 
>(0));
 rioBulletMap[ PROP_LeftMargin ] <<= static_cast< sal_Int32 >( 
*noParaLeftMargin );
 noParaLeftMargin = boost::none;
 }
@@ -425,7 +427,7 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 {
 // Force Paragraph property as zero - impress seems to use the 
value from previous
 // (non) bullet line if not set to zero explicitly :(
-aPropSet.setProperty( PROP_ParaFirstLineIndent, static_cast< 
sal_Int32>(0) );
+aPropSet.setProperty( PROP_ParaFirstLineIndent, static_cast< 
sal_Int32 >(0) );
 rioBulletMap[ PROP_FirstLineOffset ] <<= static_cast< sal_Int32 >( 
*noFirstLineIndentation );
 noFirstLineIndentation = boost::none;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-04-18 Thread Noel Power
 oox/source/ole/axcontrol.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit dbd84f33def04f555fb7b61c0f78f9d312bba633
Author: Noel Power 
Date:   Thu Apr 18 12:32:24 2013 +0100

fix Frame import for oox filter

Change-Id: Ie165b509ea7668a3064e16b537bf2e51345324ba

diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 04373b2..3f7b11c 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -624,6 +624,7 @@ OUString ControlModelBase::getServiceName() const
 case API_CONTROL_SCROLLBAR: return CREATE_OUSTRING( 
"com.sun.star.form.component.ScrollBar" );
 case API_CONTROL_PROGRESSBAR:   return CREATE_OUSTRING( 
"com.sun.star.awt.UnoControlProgressBarModel" );
 case API_CONTROL_GROUPBOX:  return CREATE_OUSTRING( 
"com.sun.star.form.component.GroupBox" );
+case API_CONTROL_FRAME: return CREATE_OUSTRING( 
"com.sun.star.awt.UnoFrameModel" );
 case API_CONTROL_PAGE:  return CREATE_OUSTRING( 
"com.sun.star.awt.UnoPageModel" );
 case API_CONTROL_MULTIPAGE: return CREATE_OUSTRING( 
"com.sun.star.awt.UnoMultiPageModel" );
 case API_CONTROL_DIALOG:return CREATE_OUSTRING( 
"com.sun.star.awt.UnoControlDialogModel" );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-04-25 Thread Muthu Subramanian
 oox/source/drawingml/chart/axisconverter.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 976a85dc20b0f274d0f51e9eb83e08b4763bdd2a
Author: Muthu Subramanian 
Date:   Thu Apr 25 17:37:32 2013 +0530

n#813291: [PPTX] Axis Labels with percentage.

Added the check only in the Axis Labels import.
Maybe this check can be moved to convertNumberFormat()

diff --git a/oox/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index bf4b4f8..bade987 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -305,9 +305,13 @@ void AxisConverter::convertFromModel( const Reference< 
XCoordinateSystem >& rxCo
 
 if( (aScaleData.AxisType == cssc2::AxisType::REALNUMBER) || 
(aScaleData.AxisType == cssc2::AxisType::PERCENT) )
 {
+bool bPercent = false;
 if( mrModel.maNumberFormat.maFormatCode.indexOf('%') >= 0)
+{
 mrModel.maNumberFormat.mbSourceLinked = false;
-getFormatter().convertNumberFormat( aAxisProp, 
mrModel.maNumberFormat );
+bPercent = true;
+}
+getFormatter().convertNumberFormat( aAxisProp, 
mrModel.maNumberFormat, bPercent );
 }
 
 // position of crossing axis --
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-04-25 Thread Felix Zhang
 oox/source/drawingml/textparagraphproperties.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e01435a0c1910caf86712ab71f7b714f6ed9c782
Author: Felix Zhang 
Date:   Thu Apr 25 19:22:29 2013 +0530

bnc#793414: Bullet points are not indented correctly.

diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 7889da2..94ad04f 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -380,6 +380,8 @@ void TextParagraphProperties::apply( const 
TextParagraphProperties& rSourceProps
 moParaLeftMargin = rSourceProps.moParaLeftMargin;
 if ( rSourceProps.moFirstLineIndentation )
 moFirstLineIndentation = rSourceProps.moFirstLineIndentation;
+if( rSourceProps.mnLevel )
+mnLevel = rSourceProps.mnLevel;
 }
 
 void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* 
pFilterBase,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-04-26 Thread Muthu Subramanian
 oox/source/drawingml/chart/datasourcecontext.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1ffe3891866ace5ce62ef92224f4a60b5906c0ac
Author: Muthu Subramanian 
Date:   Thu Mar 28 20:12:54 2013 +0530

n#810508: Fixes import of Scatternet and Bubble charts.

xVal needs to be imported as double and not as strings.

diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx 
b/oox/source/drawingml/chart/datasourcecontext.cxx
index 0620b6a..f4f6b95 100644
--- a/oox/source/drawingml/chart/datasourcecontext.cxx
+++ b/oox/source/drawingml/chart/datasourcecontext.cxx
@@ -96,10 +96,10 @@ void DoubleSequenceContext::onCharacters( const OUString& 
rChars )
 {
 /* Import categories as String even though it could
  * be values.
+ * n#810508: xVal needs to be imported as double
  * TODO: NumberFormat conversion, remove the check then.
  */
-if( isParentElement( C_TOKEN( cat ), 4 ) ||
-isParentElement( C_TOKEN( xVal ), 4 ) )
+if( isParentElement( C_TOKEN( cat ), 4 ) )
 mrModel.maData[ mnPtIndex ] <<= rChars;
 else
 mrModel.maData[ mnPtIndex ] <<= rChars.toDouble();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source

2013-05-22 Thread Jan Holesovsky
 oox/source/drawingml/customshapegeometry.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c4345bcf488d24a45a6412cda41474de6baf00da
Author: Jan Holesovsky 
Date:   Wed May 15 16:08:26 2013 +0200

bnc#819614: Fix runaway lines.

Change-Id: I360ec44872dbb555870d7d3fc8a9ed81c95e8c07

diff --git a/oox/source/drawingml/customshapegeometry.cxx 
b/oox/source/drawingml/customshapegeometry.cxx
index dada581..55cf132 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -407,8 +407,9 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( 
CustomShapeProperties& rCu
 n = rValue[ 1 ];
 }
 if ( ( n >= '0' ) && ( n <= '9' ) )
-{   // seems to be a ST_Coordinate
-aRet.Value = Any( (sal_Int32)(rValue.toInt32() ) );
+{
+// seems to be a ST_Coordinate - convert EMUs to 1/100th mm
+aRet.Value = Any( GetCoordinate( rValue ) );
 aRet.Type = EnhancedCustomShapeParameterType::NORMAL;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - oox/source sw/qa

2013-06-07 Thread Miklos Vajna
 oox/source/vml/vmltextboxcontext.cxx   |4 
 sw/qa/extras/ooxmlimport/data/n820788.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   13 +
 3 files changed, 17 insertions(+)

New commits:
commit 1538e78227b6fb6c8676dbfa951f583d985ba053
Author: Miklos Vajna 
Date:   Fri Jun 7 11:49:10 2013 +0200

bnc#820788 VML import of v:textbox's mso-fit-shape-to-text style property

Change-Id: I74a0ecd50ca61a4f5bf7ebdbf12743dc1fd9368a
(cherry picked from commit a22ef599bd3fdcf0bd5c3616aa566a5922624ff3)

diff --git a/oox/source/vml/vmltextboxcontext.cxx 
b/oox/source/vml/vmltextboxcontext.cxx
index b96bb60..17b0872 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -188,6 +188,10 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& 
rParent, TextBox& rTextBo
 if( ConversionHelper::separatePair( aName, aValue, sStyle.getToken( 0, 
';', nIndex ), ':' ) )
 {
 if( aName == "layout-flow" )  rTextBox.maLayoutFlow = aValue;
+else if (aName == "mso-fit-shape-to-text")
+rTextBox.mrTypeModel.mbAutoHeight = true;
+else
+SAL_WARN("oox", "unhandled style property: " << aName);
 }
 }
 }
diff --git a/sw/qa/extras/ooxmlimport/data/n820788.docx 
b/sw/qa/extras/ooxmlimport/data/n820788.docx
new file mode 100755
index 000..759c408
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n820788.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bd85ca2..7eb556c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -124,6 +125,7 @@ public:
 void testWatermark();
 void testPageBorderShadow();
 void testN820509();
+void testN820788();
 
 CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -198,6 +200,7 @@ void Test::run()
 {"watermark.docx", &Test::testWatermark},
 {"page-border-shadow.docx", &Test::testPageBorderShadow},
 {"n820509.docx", &Test::testN820509},
+{"n820788.docx", &Test::testN820788},
 };
 for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
 {
@@ -1246,6 +1249,16 @@ void Test::testN820509()
 CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty(xPropertySet, 
"DateFormat"));
 }
 
+void Test::testN820788()
+{
+// The problem was that AutoSize was not enabled for the text frame.
+uno::Reference xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+uno::Reference xFrame(xIndexAccess->getByIndex(0), 
uno::UNO_QUERY);
+// This was text::SizeType::FIX.
+CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty(xFrame, 
"SizeType"));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits