INTEGRATION: CWS xmlfilter04 (1.2.12); FILE MERGED
2008/02/27 14:40:07 dr 1.2.12.3: add setters to Color class, add gamma to a:scrgbClr 2008/02/27 11:50:24 dr 1.2.12.2: added static Color::getPresetColor() and Color::getSystemColor() 2008/02/21 12:42:00 hbrinkm 1.2.12.1: joined changes from xmlfilter03
This commit is contained in:
parent
01401c0aed
commit
d46a23c360
2 changed files with 16 additions and 11 deletions
|
@ -7,7 +7,7 @@
|
|||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* $RCSfile: fillproperties.cxx,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Revision: 1.5 $
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include "oox/drawingml/fillproperties.hxx"
|
||||
#include "oox/helper/propertyset.hxx"
|
||||
#include "oox/core/namespaces.hxx"
|
||||
#include "oox/core/xmlfilterbase.hxx"
|
||||
#include "tokens.hxx"
|
||||
#include <com/sun/star/awt/Gradient.hpp>
|
||||
#include <com/sun/star/awt/GradientStyle.hpp>
|
||||
|
@ -176,10 +177,10 @@ void FillProperties::pushToPropSet( const ::oox::core::XmlFilterBase& rFilterBas
|
|||
}
|
||||
if ( eFillStyle == drawing::FillStyle_SOLID )
|
||||
{
|
||||
if ( maFillColor->isUsed() && maFillColor->hasAlpha() )
|
||||
if ( maFillColor->isUsed() && maFillColor->hasTransparence() )
|
||||
{
|
||||
const rtl::OUString sFillTransparence( OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "FillTransparence" ) ) );
|
||||
xPropSet->setPropertyValue( sFillTransparence, Any( static_cast< sal_Int16 >( ( 100000 - maFillColor->getAlpha() ) / 1000 ) ) );
|
||||
xPropSet->setPropertyValue( sFillTransparence, Any( maFillColor->getTransparence() ) );
|
||||
}
|
||||
}
|
||||
else if ( eFillStyle == drawing::FillStyle_GRADIENT )
|
||||
|
@ -308,12 +309,15 @@ void FillProperties::createTransformedGraphic( const oox::core::XmlFilterBase& r
|
|||
{
|
||||
sal_Int32 nClrChangeFrom = maColorChangeFrom->getColor( rFilterBase );
|
||||
sal_Int32 nClrChangeTo = maColorChangeTo->getColor( rFilterBase );
|
||||
sal_Int32 nAlphaTo = maColorChangeTo->getAlpha();
|
||||
if ( ( nClrChangeFrom != nClrChangeTo ) || ( maColorChangeTo->hasAlpha() && ( nAlphaTo != 1000000 ) ) )
|
||||
if ( ( nClrChangeFrom != nClrChangeTo ) || maColorChangeTo->hasTransparence() )
|
||||
{
|
||||
Reference< XGraphicTransformer > xTransformer( xGraphic, UNO_QUERY );
|
||||
if ( xTransformer.is() )
|
||||
xGraphic = xTransformer->colorChange( xGraphic, nClrChangeFrom, 9, nClrChangeTo, static_cast< sal_Int8 >( ( nAlphaTo / 39062 ) ) );
|
||||
{
|
||||
sal_Int16 nTransTo = maColorChangeTo->getTransparence();
|
||||
sal_Int8 nAlphaTo = static_cast< sal_Int8 >( (100 - nTransTo) / 39.062 );
|
||||
xGraphic = xTransformer->colorChange( xGraphic, nClrChangeFrom, 9, nClrChangeTo, nAlphaTo );
|
||||
}
|
||||
}
|
||||
}
|
||||
static const OUString sGraphic( CREATE_OUSTRING( "Graphic" ) );
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* $RCSfile: fillpropertiesgroupcontext.cxx,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Revision: 1.5 $
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
|
@ -506,15 +506,16 @@ clrChangeContext::clrChangeContext( ContextHandler& rParent, const Reference< XF
|
|||
: ContextHandler( rParent )
|
||||
, mraClrFrom( raClrFrom )
|
||||
, mraClrTo( raClrTo )
|
||||
, mbUseAlpha( xAttributes->getOptionalValueToken( XML_useA, XML_true ) == XML_true ? sal_True : sal_False )
|
||||
{
|
||||
mraClrFrom = ColorPtr( new Color() );
|
||||
mraClrTo = ColorPtr( new Color() );
|
||||
mraClrFrom.reset( new Color );
|
||||
mraClrTo.reset( new Color );
|
||||
AttributeList aAttribs( xAttributes );
|
||||
mbUseAlpha = aAttribs.getBool( XML_useA, true );
|
||||
}
|
||||
clrChangeContext::~clrChangeContext()
|
||||
{
|
||||
if ( !mbUseAlpha )
|
||||
mraClrTo->mbAlphaColor = sal_False;
|
||||
mraClrTo->clearTransparence();
|
||||
}
|
||||
Reference< XFastContextHandler > clrChangeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& )
|
||||
throw (SAXException, RuntimeException)
|
||||
|
|
Loading…
Reference in a new issue