[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Thu May 5 16:00:01 UTC 2016
sw/source/filter/ww8/docxattributeoutput.cxx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit ef7cfddd9196ec1fecc42c7c1c95d1d90c501f3a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 5 16:48:16 2016 +0100
crashtesting: fix a gadzillion docx export crashes
and stop creating a graphic object from a url twice
Change-Id: I94cb1e9ffc4eaf1b56a8bfd5795bd14e126518f8
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b3fbaac..92c4ac4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4126,16 +4126,18 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* pSdrObj )
OUString sUrl;
xPropSet->getPropertyValue("GraphicURL") >>= sUrl;
- Size aOriginalSize( GraphicObject::CreateGraphicObjectFromURL( sUrl ).GetPrefSize() );
+ const GraphicObject aGrafObj(GraphicObject::CreateGraphicObjectFromURL(sUrl));
+
+ Size aOriginalSize(aGrafObj.GetPrefSize());
css::text::GraphicCrop aGraphicCropStruct;
xPropSet->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
const MapMode aMap100mm( MAP_100TH_MM );
- const MapMode& mapMode = GraphicObject::CreateGraphicObjectFromURL( sUrl ).GetPrefMapMode();
- if( mapMode.GetMapUnit() == MAP_PIXEL )
+ const MapMode& rMapMode = aGrafObj.GetPrefMapMode();
+ if (rMapMode.GetMapUnit() == MAP_PIXEL)
{
- aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, aMap100mm );
+ aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, aMap100mm);
}
if ( (0 != aGraphicCropStruct.Left) || (0 != aGraphicCropStruct.Top) || (0 != aGraphicCropStruct.Right) || (0 != aGraphicCropStruct.Bottom) )
More information about the Libreoffice-commits
mailing list