[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - 3 commits - oox/inc oox/source
Muthu Subramanian
sumuthu at collabora.com
Mon Mar 31 02:45:33 PDT 2014
oox/inc/oox/drawingml/textbodyproperties.hxx | 1 +
oox/inc/oox/drawingml/textcharacterproperties.hxx | 2 ++
oox/source/drawingml/textbodyproperties.cxx | 4 ++--
oox/source/drawingml/textbodypropertiescontext.cxx | 4 ++--
oox/source/drawingml/textcharacterproperties.cxx | 3 +++
oox/source/drawingml/textcharacterpropertiescontext.cxx | 4 ++++
oox/source/drawingml/transform2dcontext.cxx | 3 ++-
7 files changed, 16 insertions(+), 5 deletions(-)
New commits:
commit e05d649cbbafe9b22176a49fc316069e89926e70
Author: Muthu Subramanian <sumuthu at collabora.com>
Date: Mon Mar 31 15:13:51 2014 +0530
n#870234: Import gradfill for text colors.
Uses the first color from the gradfill list.
(Which is better than plain black!)
Ported from: cfc76de83e3c0a56abd30a8f3bd7c69d3500d223
Change-Id: I57a3a54a8053a8ce320acbd02940f10941165d1c
diff --git a/oox/inc/oox/drawingml/textcharacterproperties.hxx b/oox/inc/oox/drawingml/textcharacterproperties.hxx
index 1073fa6..35943da 100644
--- a/oox/inc/oox/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/oox/drawingml/textcharacterproperties.hxx
@@ -24,6 +24,7 @@
#include "oox/helper/propertymap.hxx"
#include "oox/drawingml/color.hxx"
#include "oox/drawingml/textfont.hxx"
+#include "oox/drawingml/fillproperties.hxx"
namespace oox { class PropertySet; }
@@ -53,6 +54,7 @@ struct TextCharacterProperties
OptValue< bool > moItalic;
OptValue< bool > moUnderlineLineFollowText;
OptValue< bool > moUnderlineFillFollowText;
+ GradientFillProperties maGradientProps; /// Properties for gradient text colors
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const TextCharacterProperties& rSourceProps );
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index bc23204..4800630 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -60,6 +60,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
moItalic.assignIfUsed( rSourceProps.moItalic );
moUnderlineLineFollowText.assignIfUsed( rSourceProps.moUnderlineLineFollowText );
moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText );
+ maGradientProps.assignUsed( rSourceProps.maGradientProps );
}
void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const
@@ -93,6 +94,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if( maCharColor.isUsed() )
rPropMap[ PROP_CharColor ] <<= maCharColor.getColor( rFilter.getGraphicHelper() );
+ if( maGradientProps.maGradientStops.size() > 0 )
+ rPropMap[ PROP_CharColor ] <<= maGradientProps.maGradientStops.begin()->second.getColor( rFilter.getGraphicHelper() );
if( moLang.has() && !moLang.get().isEmpty() )
{
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 13af2cd..ec37a07 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -161,6 +161,10 @@ Reference< XFastContextHandler > TextCharacterPropertiesContext::createFastChild
case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink
xRet.set( new HyperLinkContext( *this, xAttributes, mrTextCharacterProperties.maHyperlinkPropertyMap ) );
break;
+
+ case A_TOKEN( gradFill ):
+ xRet.set( new GradientFillContext( *this, xAttributes, mrTextCharacterProperties.maGradientProps ) );
+ break;
}
if( !xRet.is() )
xRet.set( this );
commit 193ecefaef948272695b0dd0a42a3bcc3256f631
Author: Muthu Subramanian <sumuthu at collabora.com>
Date: Mon Mar 31 15:04:31 2014 +0530
n#862510: anchorCtr controls the anchoring as well.
Ported from: c17eb67460293fbe72ffa8e80cd10743df493afa
Change-Id: I7b5885c3ac9ec30970bdb8b2c9318dc181dda5bd
diff --git a/oox/inc/oox/drawingml/textbodyproperties.hxx b/oox/inc/oox/drawingml/textbodyproperties.hxx
index f8800be..c026b4e 100644
--- a/oox/inc/oox/drawingml/textbodyproperties.hxx
+++ b/oox/inc/oox/drawingml/textbodyproperties.hxx
@@ -34,6 +34,7 @@ struct TextBodyProperties
{
PropertyMap maPropertyMap;
OptValue< sal_Int32 > moRotation;
+ bool mbAnchorCtr;
OptValue< sal_Int32 > moVert;
boost::optional< sal_Int32 > moInsets[4];
boost::optional< sal_Int32 > moTextOffX;
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index 36f39d9..9e53897 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -80,8 +80,8 @@ void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation )
// Hack for n#760986
// TODO: Preferred method would be to have a textbox on top
// of the shape and the place it according to the (off,ext)
- if( nOff == 0 && moTextOffX ) nVal = *moTextOffX;
- if( nOff == 1 && moTextOffY ) nVal = *moTextOffY;
+ if( nOff == 0 && moTextOffX && mbAnchorCtr ) nVal = *moTextOffX;
+ if( nOff == 1 && moTextOffY && mbAnchorCtr ) nVal = *moTextOffY;
if( nVal < 0 ) nVal = 0;
if( moInsets[i] )
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index 273c5cf..f8e0594 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -61,9 +61,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
mrTextBodyProp.moInsets[i] = GetCoordinate( sValue );
}
- bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
+ mrTextBodyProp.mbAnchorCtr = aAttribs.getBool( XML_anchorCtr, false );
if( xAttributes->hasAttribute( XML_anchorCtr ) ) {
- if( bAnchorCenter )
+ if( mrTextBodyProp.mbAnchorCtr )
mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
TextHorizontalAdjust_CENTER;
}
commit 36611abf83c6ccfab9f5e18dd90a6664f514b7ba
Author: Muthu Subramanian <sumuthu at collabora.com>
Date: Mon Mar 31 15:00:13 2014 +0530
n#862510: Fix text rotation.
Fix breaks document in n#783433 - the one there is
damaged - resaving it using mso 2010 should fix the problem there.
Ported from: e3e12b1d1e36e1a0d4fc4c6423b584d677693897
Change-Id: I56fbefa9de6b0714592cc64dffc011b27d1907f4
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index d35c5d3..4976351 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -50,7 +50,8 @@ Transform2DContext::Transform2DContext( ContextHandler& rParent, const Reference
}
else
{
- mrShape.getTextBody()->getTextProperties().moRotation = aAttributeList.getInteger( XML_rot );
+ if( aAttributeList.hasAttribute( XML_rot ) )
+ mrShape.getTextBody()->getTextProperties().moRotation = -aAttributeList.getInteger( XML_rot ).get();
}
}
More information about the Libreoffice-commits
mailing list