[Libreoffice-commits] core.git: sdext/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Tue Mar 13 07:31:44 UTC 2018
sdext/source/minimizer/graphiccollector.cxx | 11 ++++-------
sdext/source/minimizer/graphiccollector.hxx | 3 ++-
sdext/source/minimizer/impoptimizer.cxx | 1 -
3 files changed, 6 insertions(+), 9 deletions(-)
New commits:
commit d3df14dd7eaac16eb7c6317ad920509468784940
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Mon Mar 12 18:23:31 2018 +0900
change minimizer extension to not use GraphicUrl and FillBitmapUrl
Change-Id: I3a0c22d0e9411e5a427efce6adee0679e2c2de68
Reviewed-on: https://gerrit.libreoffice.org/51109
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx
index d37945eeb542..34e7964049d6 100644
--- a/sdext/source/minimizer/graphiccollector.cxx
+++ b/sdext/source/minimizer/graphiccollector.cxx
@@ -60,15 +60,12 @@ const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentCo
void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const GraphicCollector::GraphicUser& rUser )
{
- const OUString aGraphicURL( rUser.maGraphicURL );
-
- if ( rGraphicSettings.mbEmbedLinkedGraphics ||
- aGraphicURL.isEmpty() || aGraphicURL.match( "vnd.sun.star.GraphicObject:" ) )
+ if ( rGraphicSettings.mbEmbedLinkedGraphics )
{
std::vector< GraphicCollector::GraphicEntity >::iterator aIter( rGraphicEntities.begin() );
while( aIter != rGraphicEntities.end() )
{
- if ( aIter->maUser[ 0 ].maGraphicURL == aGraphicURL )
+ if ( aIter->maUser[ 0 ].mxGraphic == rUser.mxGraphic )
{
if ( rUser.maLogicalSize.Width > aIter->maLogicalSize.Width )
aIter->maLogicalSize.Width = rUser.maLogicalSize.Width;
@@ -98,7 +95,7 @@ void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference
GraphicCollector::GraphicUser aUser;
aUser.mxShape = rxShape;
aUser.mbFillBitmap = false;
- xShapePropertySet->getPropertyValue( "GraphicURL" ) >>= aUser.maGraphicURL;
+ aUser.mxGraphic = xGraphic;
xShapePropertySet->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropLogic;
awt::Size aLogicalSize( rxShape->getSize() );
@@ -180,7 +177,7 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const
}
GraphicCollector::GraphicUser aUser;
aUser.mxPropertySet = rxPropertySet;
- rxPropertySet->getPropertyValue( "FillBitmapURL" ) >>= aUser.maGraphicURL;
+ aUser.mxGraphic = xGraphic;
aUser.mbFillBitmap = true;
aUser.maLogicalSize = aLogicalSize;
aUser.mxPagePropertySet = rxPagePropertySet;
diff --git a/sdext/source/minimizer/graphiccollector.hxx b/sdext/source/minimizer/graphiccollector.hxx
index ae31016574b9..f989a95ad39c 100644
--- a/sdext/source/minimizer/graphiccollector.hxx
+++ b/sdext/source/minimizer/graphiccollector.hxx
@@ -57,7 +57,8 @@ class GraphicCollector
css::uno::Reference< css::drawing::XShape > mxShape; // if mbFillBitmap is false the xShape has
css::uno::Reference< css::beans::XPropertySet > mxPropertySet; // to be used otherwise the PropertySet
css::uno::Reference< css::beans::XPropertySet > mxPagePropertySet;
- OUString maGraphicURL;
+ css::uno::Reference< css::graphic::XGraphic > mxGraphic;
+
css::text::GraphicCrop maGraphicCropLogic;
css::awt::Size maLogicalSize;
bool mbFillBitmap;
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index 2507a657abbb..a04cf0f93ebc 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -417,7 +417,6 @@ void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentCont
if ( aGraphicUserIter->mxShape.is() )
{
Reference< XPropertySet > xShapePropertySet( aGraphicUserIter->mxShape, UNO_QUERY_THROW );
- xShapePropertySet->setPropertyValue( "GraphicURL", Any( OUString() ) );
xShapePropertySet->setPropertyValue( "Graphic", Any( xNewGraphic ) );
if ( aGraphicUserIter->maGraphicCropLogic.Left || aGraphicUserIter->maGraphicCropLogic.Top
More information about the Libreoffice-commits
mailing list