[Libreoffice-commits] .: Branch 'libreoffice-4-0' - 3 commits - chart2/source oox/inc oox/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Jan 15 05:01:36 PST 2013
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 40fe0c77091f97a30fb550dbd14ed5f3d57b34fe
Author: Muthu Subramanian <sumuthu at 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 course, zero degrees plus skipping of labels
would no longer occur. Better solutions?
Signed-off-by: Noel Power <noel.power at suse.com>
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index f394ef8..40b4886 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -137,6 +137,11 @@ bool doesOverlap( const Reference< drawing::XShape >& xShape1
if( !xShape1.is() || !xShape2.is() )
return false;
+ sal_Int32 nAngle = abs(fRotationAngleDegree);
+
+ if( ( nAngle >= 45 && nAngle <= 135 ) || ( nAngle >= 225 && nAngle <= 315 ) )
+ return false;
+
::basegfx::B2IRectangle aRect1( BaseGFXHelper::makeRectangle(xShape1->getPosition(),ShapeFactory::getSizeAfterRotation( xShape1, fRotationAngleDegree )));
::basegfx::B2IRectangle aRect2( BaseGFXHelper::makeRectangle(xShape2->getPosition(),ShapeFactory::getSizeAfterRotation( xShape2, fRotationAngleDegree )));
return aRect1.overlaps(aRect2);
@@ -662,7 +667,7 @@ bool VCartesianAxis::createTextShapes(
pPREPreviousVisibleTickInfo : pPreviousVisibleTickInfo;
//don't create labels which does not fit into the rhythm
- if( nTick%rAxisLabelProperties.nRhythm != 0)
+ if( nTick%rAxisLabelProperties.nRhythm != 0 )
continue;
//don't create labels for invisible ticks
@@ -776,6 +781,15 @@ bool VCartesianAxis::createTextShapes(
}
if( bOverlapAlsoAfterSwitchingOnAutoStaggering )
{
+ /* Try auto-rotating to 45 degrees */
+ if( !rAxisLabelProperties.bOverlapAllowed && ::rtl::math::approxEqual( rAxisLabelProperties.fRotationAngleDegree, 0.0 ) )
+ {
+ rAxisLabelProperties.fRotationAngleDegree = 45;
+ rAxisLabelProperties.bLineBreakAllowed = false;
+ m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree;
+ removeTextShapesFromTicks();
+ return false;
+ }
if( rAxisLabelProperties.bRhythmIsFix )
{
xTarget->remove(pTickInfo->xTextShape);
commit fb3becfdb10cde48b6ee5d6fdc9337bf71796fd6
Author: Muthu Subramanian <sumuthu at suse.com>
Date: Wed Dec 19 20:03:51 2012 +0530
n#794350: [PPTX] Flip gradient fill as well.
Signed-off-by: Noel Power <noel.power at suse.com>
diff --git a/oox/inc/oox/drawingml/fillproperties.hxx b/oox/inc/oox/drawingml/fillproperties.hxx
index 5467663..fb9aa84 100644
--- a/oox/inc/oox/drawingml/fillproperties.hxx
+++ b/oox/inc/oox/drawingml/fillproperties.hxx
@@ -120,7 +120,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 a7072d9..a400cce 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -182,7 +182,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() )
{
@@ -226,6 +227,12 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
nStartTrans = maGradientProps.maGradientStops.begin()->second.getTransparency()*255/100;
}
+ // Adjust for flips
+ if ( bFlipH )
+ nShapeRotation = 180*60000 - 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 6debbcb..fa5f8e0 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -534,7 +534,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 );
aEffectProperties.pushToPropMap( aShapeProps, rGraphicHelper );
commit 4a6f6d761263a7dc5eb1091efa252b8dc4ccf538
Author: Muthu Subramanian <sumuthu at suse.com>
Date: Wed Dec 26 16:18:51 2012 +0530
n#793999: PPTX Export - background image fit to slide.
Change-Id: I0365c1a2723e5da06c269802c0503d4e45fe7ac1
Signed-off-by: Noel Power <noel.power at suse.com>
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index bc48e60..4eefc90 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -565,6 +565,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:
;
}
More information about the Libreoffice-commits
mailing list