Kaydet (Commit) 383b82ef authored tarafından Andras Timar's avatar Andras Timar

tdf#91429 do not convert ooxml preset shape modifier values

Revert "Resolves: #i124703# adapt coordinate range from ms relative..."

This reverts commit c764a3d9.

The reverted commit did not fix anything in LibreOffice in the
first place. The document referenced in #i124703# is as good
without the patch as with it. But it caused a regression.

Conflicts:
	oox/source/drawingml/customshapeproperties.cxx

Change-Id: I65eb114423039e9c9c684cc55009275fd06caacd
Reviewed-on: https://gerrit.libreoffice.org/15875Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
(cherry picked from commit da0a44b4)
üst f7a40e14
......@@ -30,7 +30,6 @@
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <basegfx/numeric/ftools.hxx>
#include <osl/diagnose.h>
using namespace ::oox::core;
......@@ -209,15 +208,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
}
} else if ( aAdjustmentSeq.getLength() > 0 ) {
EnhancedCustomShapeAdjustmentValue aAdjustmentVal;
sal_Int32 nValue((*aIter).maFormula.toInt32());
// #i124703# The ms control point coordinates are relative to the
// object center in the range [-50000 .. 50000] while our customshapes
// use a range from [0 .. 21600], so adapt the value as needed
nValue = basegfx::fround((double(nValue) + 50000.0) * (21600.0 / 100000.0));
aAdjustmentVal.Value <<= nValue;
aAdjustmentVal.Value <<= (*aIter).maFormula.toInt32();
aAdjustmentVal.State = PropertyState_DIRECT_VALUE;
aAdjustmentVal.Name = (*aIter).maName;
aAdjustmentSeq[ nIndex++ ] = aAdjustmentVal;
......
......@@ -990,6 +990,15 @@ DECLARE_OOXMLEXPORT_TEST(testExportShadow, "bnc637947.odt")
assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr", "val" , "000000");
assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:spPr/a:effectLst/a:outerShdw/a:srgbClr/a:alpha", "val" , "38000");
}
DECLARE_OOXMLEXPORT_TEST(testExportAdjustmentValue, "tdf91429.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd", "fmla", "val 50000");
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
......
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