Kaydet (Commit) 584454ce authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

oox: BlipFillProperties rename mxGraphic to mxFillGraphic

Change-Id: Iea4b48e79c7c727bbd7dafd816538f6c1dd25bf8
Reviewed-on: https://gerrit.libreoffice.org/50868Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 19b6b8f8
...@@ -98,8 +98,7 @@ struct ArtisticEffectProperties ...@@ -98,8 +98,7 @@ struct ArtisticEffectProperties
struct BlipFillProperties struct BlipFillProperties
{ {
css::uno::Reference< css::graphic::XGraphic > css::uno::Reference<css::graphic::XGraphic> mxFillGraphic; /// The fill graphic.
mxGraphic; /// The fill graphic.
OptValue< sal_Int32 > moBitmapMode; /// Bitmap tile or stretch. OptValue< sal_Int32 > moBitmapMode; /// Bitmap tile or stretch.
OptValue< css::geometry::IntegerRectangle2D > OptValue< css::geometry::IntegerRectangle2D >
moFillRect; /// Stretch fill offsets. moFillRect; /// Stretch fill offsets.
......
...@@ -68,7 +68,7 @@ Reference< XGraphic > lclCheckAndApplyDuotoneTransform( const BlipFillProperties ...@@ -68,7 +68,7 @@ Reference< XGraphic > lclCheckAndApplyDuotoneTransform( const BlipFillProperties
::Color nColor2 = aBlipProps.maDuotoneColors[1].getColor( rGraphicHelper, nPhClr ); ::Color nColor2 = aBlipProps.maDuotoneColors[1].getColor( rGraphicHelper, nPhClr );
try try
{ {
Reference< XGraphicTransformer > xTransformer( aBlipProps.mxGraphic, UNO_QUERY_THROW ); Reference< XGraphicTransformer > xTransformer( aBlipProps.mxFillGraphic, UNO_QUERY_THROW );
return xTransformer->applyDuotone( xGraphic, sal_Int32(nColor1), sal_Int32(nColor2) ); return xTransformer->applyDuotone( xGraphic, sal_Int32(nColor1), sal_Int32(nColor2) );
} }
catch( Exception& ) catch( Exception& )
...@@ -89,7 +89,7 @@ Reference< XGraphic > lclCheckAndApplyChangeColorTransform( const BlipFillProper ...@@ -89,7 +89,7 @@ Reference< XGraphic > lclCheckAndApplyChangeColorTransform( const BlipFillProper
{ {
sal_Int16 nToTransparence = aBlipProps.maColorChangeTo.getTransparency(); sal_Int16 nToTransparence = aBlipProps.maColorChangeTo.getTransparency();
sal_Int8 nToAlpha = static_cast< sal_Int8 >( (100 - nToTransparence) * 2.55 ); sal_Int8 nToAlpha = static_cast< sal_Int8 >( (100 - nToTransparence) * 2.55 );
Reference< XGraphicTransformer > xTransformer( aBlipProps.mxGraphic, UNO_QUERY_THROW ); Reference< XGraphicTransformer > xTransformer( aBlipProps.mxFillGraphic, UNO_QUERY_THROW );
return xTransformer->colorChange( xGraphic, sal_Int32(nFromColor), 9, sal_Int32(nToColor), nToAlpha ); return xTransformer->colorChange( xGraphic, sal_Int32(nFromColor), 9, sal_Int32(nToColor), nToAlpha );
} }
catch( Exception& ) catch( Exception& )
...@@ -187,8 +187,8 @@ void PatternFillProperties::assignUsed( const PatternFillProperties& rSourceProp ...@@ -187,8 +187,8 @@ void PatternFillProperties::assignUsed( const PatternFillProperties& rSourceProp
void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps ) void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps )
{ {
if( rSourceProps.mxGraphic.is() ) if(rSourceProps.mxFillGraphic.is())
mxGraphic = rSourceProps.mxGraphic; mxFillGraphic = rSourceProps.mxFillGraphic;
moBitmapMode.assignIfUsed( rSourceProps.moBitmapMode ); moBitmapMode.assignIfUsed( rSourceProps.moBitmapMode );
moFillRect.assignIfUsed( rSourceProps.moFillRect ); moFillRect.assignIfUsed( rSourceProps.moFillRect );
moTileOffsetX.assignIfUsed( rSourceProps.moTileOffsetX ); moTileOffsetX.assignIfUsed( rSourceProps.moTileOffsetX );
...@@ -598,10 +598,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, ...@@ -598,10 +598,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
case XML_blipFill: case XML_blipFill:
// do not start complex graphic transformation if property is not supported... // do not start complex graphic transformation if property is not supported...
if (maBlipProps.mxGraphic.is() && rPropMap.supportsProperty(ShapeProperty::FillBitmap)) if (maBlipProps.mxFillGraphic.is() && rPropMap.supportsProperty(ShapeProperty::FillBitmap))
{ {
Reference< XGraphic > xGraphic = lclCheckAndApplyDuotoneTransform( maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, nPhClr ); uno::Reference<graphic::XGraphic> xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, maBlipProps.mxFillGraphic, rGraphicHelper, nPhClr);
uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
// TODO: "rotate with shape" is not possible with our current core // TODO: "rotate with shape" is not possible with our current core
if (xGraphic.is()) if (xGraphic.is())
...@@ -631,7 +630,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, ...@@ -631,7 +630,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
RectanglePoint eRectPoint = lclGetRectanglePoint( maBlipProps.moTileAlign.get( XML_tl ) ); RectanglePoint eRectPoint = lclGetRectanglePoint( maBlipProps.moTileAlign.get( XML_tl ) );
rPropMap.setProperty( ShapeProperty::FillBitmapRectanglePoint, eRectPoint ); rPropMap.setProperty( ShapeProperty::FillBitmapRectanglePoint, eRectPoint );
awt::Size aOriginalSize = lclGetOriginalSize( rGraphicHelper, maBlipProps.mxGraphic ); awt::Size aOriginalSize = lclGetOriginalSize(rGraphicHelper, maBlipProps.mxFillGraphic);
if( (aOriginalSize.Width > 0) && (aOriginalSize.Height > 0) ) if( (aOriginalSize.Width > 0) && (aOriginalSize.Height > 0) )
{ {
// size of one bitmap tile (given as 1/1000 percent of bitmap size), convert to 1/100 mm // size of one bitmap tile (given as 1/1000 percent of bitmap size), convert to 1/100 mm
...@@ -726,10 +725,10 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe ...@@ -726,10 +725,10 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
case XML_grayscl: eColorMode = ColorMode_GREYS; break; case XML_grayscl: eColorMode = ColorMode_GREYS; break;
} }
if( maBlipProps.mxGraphic.is() ) if (maBlipProps.mxFillGraphic.is())
{ {
// created transformed graphic // created transformed graphic
Reference< XGraphic > xGraphic = lclCheckAndApplyChangeColorTransform(maBlipProps, maBlipProps.mxGraphic, rGraphicHelper, API_RGB_TRANSPARENT); uno::Reference<graphic::XGraphic> xGraphic = lclCheckAndApplyChangeColorTransform(maBlipProps, maBlipProps.mxFillGraphic, rGraphicHelper, API_RGB_TRANSPARENT);
xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, xGraphic, rGraphicHelper, API_RGB_TRANSPARENT); xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, xGraphic, rGraphicHelper, API_RGB_TRANSPARENT);
if (eColorMode == ColorMode_STANDARD && nBrightness == 70 && nContrast == -70) if (eColorMode == ColorMode_STANDARD && nBrightness == 70 && nContrast == -70)
......
...@@ -148,8 +148,8 @@ BlipContext::BlipContext( ContextHandler2Helper const & rParent, ...@@ -148,8 +148,8 @@ BlipContext::BlipContext( ContextHandler2Helper const & rParent,
{ {
// internal picture URL // internal picture URL
OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( embed ), OUString() ) ); OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( embed ), OUString() ) );
if( !aFragmentPath.isEmpty() ) if (!aFragmentPath.isEmpty())
mrBlipProps.mxGraphic = getFilter().getGraphicHelper().importEmbeddedGraphic( aFragmentPath ); mrBlipProps.mxFillGraphic = getFilter().getGraphicHelper().importEmbeddedGraphic( aFragmentPath );
} }
else if( rAttribs.hasAttribute( R_TOKEN( link ) ) ) else if( rAttribs.hasAttribute( R_TOKEN( link ) ) )
{ {
...@@ -164,7 +164,7 @@ BlipContext::BlipContext( ContextHandler2Helper const & rParent, ...@@ -164,7 +164,7 @@ BlipContext::BlipContext( ContextHandler2Helper const & rParent,
aMed.Download(); aMed.Download();
Reference< io::XInputStream > xInStrm = aMed.GetInputStream(); Reference< io::XInputStream > xInStrm = aMed.GetInputStream();
if ( xInStrm.is() ) if ( xInStrm.is() )
mrBlipProps.mxGraphic = getFilter().getGraphicHelper().importGraphic( xInStrm ); mrBlipProps.mxFillGraphic = getFilter().getGraphicHelper().importGraphic( xInStrm );
} }
} }
......
...@@ -148,8 +148,8 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext() ...@@ -148,8 +148,8 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
rPropertyMap.setProperty( PROP_ParaTabStops, aSeq); rPropertyMap.setProperty( PROP_ParaTabStops, aSeq);
} }
if ( mxBlipProps.get() && mxBlipProps->mxGraphic.is() ) if (mxBlipProps.get() && mxBlipProps->mxFillGraphic.is())
mrBulletList.setGraphic( mxBlipProps->mxGraphic ); mrBulletList.setGraphic(mxBlipProps->mxFillGraphic);
if( mrBulletList.is() ) if( mrBulletList.is() )
rPropertyMap.setProperty( PROP_IsNumbering, true); rPropertyMap.setProperty( PROP_IsNumbering, true);
......
...@@ -819,8 +819,8 @@ void FillModel::pushToPropMap( ShapePropertyMap& rPropMap, const GraphicHelper& ...@@ -819,8 +819,8 @@ void FillModel::pushToPropMap( ShapePropertyMap& rPropMap, const GraphicHelper&
{ {
if( moBitmapPath.has() && !moBitmapPath.get().isEmpty() ) if( moBitmapPath.has() && !moBitmapPath.get().isEmpty() )
{ {
aFillProps.maBlipProps.mxGraphic = rGraphicHelper.importEmbeddedGraphic( moBitmapPath.get() ); aFillProps.maBlipProps.mxFillGraphic = rGraphicHelper.importEmbeddedGraphic(moBitmapPath.get());
if( aFillProps.maBlipProps.mxGraphic.is() ) if (aFillProps.maBlipProps.mxFillGraphic.is())
{ {
aFillProps.moFillType = XML_blipFill; aFillProps.moFillType = XML_blipFill;
aFillProps.maBlipProps.moBitmapMode = (nFillType == XML_frame) ? XML_stretch : XML_tile; aFillProps.maBlipProps.moBitmapMode = (nFillType == XML_frame) ? XML_stretch : XML_tile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment