[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6' - 3 commits - chart2/source oox/inc oox/source

2013-01-21 Thread Libreoffice Gerrit user
 chart2/source/view/axes/VCartesianAxis.cxx |   16 +++-
 oox/inc/oox/drawingml/fillproperties.hxx   |4 +++-
 oox/source/drawingml/fillproperties.cxx|9 -
 oox/source/drawingml/shape.cxx |2 +-
 oox/source/export/drawingml.cxx|5 +
 5 files changed, 32 insertions(+), 4 deletions(-)

New commits:
commit 02eaa6fca4be9288a377ae6de37f06b06bd5277f
Author: Muthu Subramanian sumu...@suse.com
Date:   Wed Dec 26 16:18:51 2012 +0530

n#793999: PPTX Export - background image fit to slide.

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 07d0172..dfc8616 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -572,6 +572,11 @@ void DrawingML::WriteBlipMode( Reference XPropertySet  
rXPropSet )
 case BitmapMode_REPEAT:
 mpFS-singleElementNS( XML_a, XML_tile, FSEND );
 break;
+case BitmapMode_STRETCH:
+mpFS-startElementNS( XML_a, XML_stretch, FSEND );
+mpFS-singleElementNS( XML_a, XML_fillRect, FSEND );
+mpFS-endElementNS( XML_a, XML_stretch );
+break;
 default:
 ;
 }
commit 21cc231fbebecfe65414505918932fe7675b4b7f
Author: Muthu Subramanian sumu...@suse.com
Date:   Wed Dec 19 20:03:51 2012 +0530

n#794350: [PPTX] Flip gradient fill as well.

diff --git a/oox/inc/oox/drawingml/fillproperties.hxx 
b/oox/inc/oox/drawingml/fillproperties.hxx
index dd30edf..59dabba 100644
--- a/oox/inc/oox/drawingml/fillproperties.hxx
+++ b/oox/inc/oox/drawingml/fillproperties.hxx
@@ -129,7 +129,9 @@ struct OOX_DLLPUBLIC FillProperties
 ShapePropertyMap rPropMap,
 const GraphicHelper rGraphicHelper,
 sal_Int32 nShapeRotation = 0,
-sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
+sal_Int32 nPhClr = API_RGB_TRANSPARENT,
+bool bFlipH = false,
+bool bFlipV = false ) const;
 };
 
 // 
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 4a94c01..dde28b5 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -191,7 +191,8 @@ Color FillProperties::getBestSolidColor() const
 }
 
 void FillProperties::pushToPropMap( ShapePropertyMap rPropMap,
-const GraphicHelper rGraphicHelper, sal_Int32 nShapeRotation, 
sal_Int32 nPhClr ) const
+const GraphicHelper rGraphicHelper, sal_Int32 nShapeRotation, 
sal_Int32 nPhClr,
+bool bFlipH, bool bFlipV ) const
 {
 if( moFillType.has() )
 {
@@ -235,6 +236,12 @@ void FillProperties::pushToPropMap( ShapePropertyMap 
rPropMap,
 nStartTrans = 
maGradientProps.maGradientStops.begin()-second.getTransparency()*255/100;
 }
 
+// Adjust for flips
+if ( bFlipH )
+nShapeRotation = 180*6 - nShapeRotation;
+if ( bFlipV )
+nShapeRotation = -nShapeRotation;
+
 // rotate with shape not set, or set to false - do not 
rotate
 if ( !maGradientProps.moRotateWithShape.get( false ) )
 nShapeRotation = 0;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 2a9eb50..156bc09 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -546,7 +546,7 @@ Reference XShape  Shape::createAndInsert(
 mpGraphicPropertiesPtr-pushToPropMap( aShapeProps, rGraphicHelper 
);
 if ( mpTablePropertiesPtr.get()  aServiceName == 
com.sun.star.drawing.TableShape )
 mpTablePropertiesPtr-pushToPropSet( rFilterBase, xSet, 
mpMasterTextListStyle );
-aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, 
mnRotation, nFillPhClr );
+aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, 
mnRotation, nFillPhClr, mbFlipH, mbFlipV );
 aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr 
);
 // TODO: use ph color when applying effect properties
 aEffectProperties.pushToPropMap( aShapeProps, rGraphicHelper );
commit 6a985438f7263e8d9fa84925520bcefecafb8b2f
Author: Muthu Subramanian sumu...@suse.com
Date:   Tue Jan 8 12:40:45 2013 +0530

n#791985: Automatically rotate chart labels (if overlapping).

This bug fixes two issues:
* Overlap detection seems to be approximate and
  doesn't work for rotated text. Added a workaround
  for labels rotated at angles 45-135 and 225-315.

* Auto rotate labels, which overlap. This is done
  only for labels having zero degrees rotate.
  For forcing angles, use 'enable overlap' or
  non-zero angles (1 degree).
  Of 

[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6' - 3 commits - chart2/source

2012-12-07 Thread Libreoffice Gerrit user
 chart2/source/controller/dialogs/res_DataLabel.cxx   |9 +
 chart2/source/controller/main/ChartController_Properties.cxx |2 +-
 chart2/source/view/charttypes/PieChart.cxx   |   10 --
 3 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 495be57b8238361297f1834c2afbf808f1e55a3d
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Sat Dec 8 00:00:49 2012 -0500

bnc#791952: Setting properties for all data labels.

You can set different properties to individual data labels.  But setting
new properties to all data labels should overwrite the individual settings.

Change-Id: I934bad89326115aa83feb86275cf380d701a5686

diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx 
b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 1690ecd..c50d2b4 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -291,14 +291,15 @@ void DataLabelResources::EnableControls()
 {
 m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || (m_aCBPercent.IsChecked() 
 m_aCBPercent.IsEnabled()) || m_aCBCategory.IsChecked() );
 
-//enable separator
+// Enable or disable separator, placement and direction based on the check
+// box states. Note that the check boxes are tri-state.
 {
 long nNumberOfCheckedLabelParts = 0;
-if( m_aCBNumber.IsChecked() )
+if (m_aCBNumber.GetState() != STATE_NOCHECK)
 ++nNumberOfCheckedLabelParts;
-if( m_aCBPercent.IsChecked()  m_aCBPercent.IsEnabled() )
+if (m_aCBPercent.GetState() != STATE_NOCHECK  
m_aCBPercent.IsEnabled())
 ++nNumberOfCheckedLabelParts;
-if( m_aCBCategory.IsChecked() )
+if (m_aCBCategory.GetState() != STATE_NOCHECK)
 ++nNumberOfCheckedLabelParts;
 m_aSeparatorResources.Enable( nNumberOfCheckedLabelParts  1 );
 bool bEnableTextDir = nNumberOfCheckedLabelParts  0;
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx 
b/chart2/source/controller/main/ChartController_Properties.cxx
index 19f146a..005c076 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -242,7 +242,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
 xObjectProperties, xSeries, 
rDrawModel.GetItemPool(), rDrawModel,
 pNumberFormatterWrapper,
 uno::Reference 
lang::XMultiServiceFactory ( xChartModel, uno::UNO_QUERY ),
-eMapTo, pRefSize, bDataSeries, 
bUseSpecialFillColor, nSpecialFillColor, false,
+eMapTo, pRefSize, bDataSeries, 
bUseSpecialFillColor, nSpecialFillColor, true,
 nNumberFormat, nPercentNumberFormat );
 break;
 }
commit 4128a957d7f41248f3e449ff002eb9c54b60d276
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Dec 7 21:14:50 2012 -0500

bnc#791952: Use center label placement for Best fit in pie charts.

It works better this way for Excel interoperability.  In Excel, Best fit
is slightly different than the center placement, but the two are pretty
close in pie charts.

Change-Id: I7f04a1babb04fd488d8cf90df247c294fa9d7b67

diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 8d558f1..e1ecf5b 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -460,9 +460,15 @@ void PieChart::createShapes()
 }
 
 sal_Int32 nLabelPlacement = pSeries-getLabelPlacement( 
nPointIndex, m_xChartTypeModel, m_nDimension, m_pPosHelper-isSwapXAndY() );
+
+// AVOID_OVERLAP is in fact Best fit in the UI.
 bool bMovementAllowed = ( nLabelPlacement == 
::com::sun::star::chart::DataLabelPlacement::AVOID_OVERLAP );
 if( bMovementAllowed )
-nLabelPlacement = 
::com::sun::star::chart::DataLabelPlacement::OUTSIDE;
+// Use center for Best fit for now. In the future we
+// may want to implement a real best fit algorithm.
+// But center is good enough, and close to what Excel
+// does.
+nLabelPlacement = 
::com::sun::star::chart::DataLabelPlacement::CENTER;
 
 LabelAlignment eAlignment(LABEL_ALIGN_CENTER);
 sal_Int32 nScreenValueOffsetInRadiusDirection = 0 ;
commit 263861b0f6a3ea4581d966b42a10fae65a21c2fc
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Dec 7 19:48:50 2012 -0500

bnc#791952: Better placement of 3D pie chart data labels.

This value appears to