diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-11 17:26:22 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-11 18:24:23 +0200 |
commit | d8d31f74236e87ea878f7fac5538e707df5b13ca (patch) | |
tree | 539caa213012a0c2b3f22d528eeeb4c64803e2e0 | |
parent | 14514042f7c908d08c3284135cc6de8da387c118 (diff) |
tdf#49247: no need in extra boolean property, radius is enough
When soft edge has radius 0, the effect is disabled.
Change-Id: I7d66ea7b87e0ed59129a83885d52906b8edf75f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93971
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | include/svx/strings.hrc | 1 | ||||
-rw-r--r-- | include/svx/svddef.hxx | 3 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 3 | ||||
-rw-r--r-- | include/svx/unoshprp.hxx | 1 | ||||
-rw-r--r-- | include/xmloff/xmltoken.hxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 1 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 16 | ||||
-rw-r--r-- | schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng | 10 | ||||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 3 | ||||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 11 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/draw/sdpropls.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/token/tokens.txt | 1 |
14 files changed, 14 insertions, 42 deletions
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index e6ff4f7cc25b..5fbb88d75df3 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -516,7 +516,6 @@ #define SIP_SA_GLOW_RAD NC_("SIP_SA_GLOW_RAD", "Radius of glow effect") #define SIP_SA_GLOW_COLOR NC_("SIP_SA_GLOW_COLOR", "Color of glow effect") #define SIP_SA_GLOW_TRANSPARENCY NC_("SIP_SA_GLOW_TRANSPARENCY", "Transparency of glow effect") -#define SIP_SA_SOFTEDGE NC_("SIP_SA_SOFTEDGE", "Soft edge effect") #define SIP_SA_SOFTEDGE_RAD NC_("SIP_SA_SOFTEDGE_RAD", "Radius of soft edge effect") #define STR_ObjNameSingulMEDIA NC_("STR_ObjNameSingulMEDIA", "Media object") #define STR_ObjNamePluralMEDIA NC_("STR_ObjNamePluralMEDIA", "Media objects") diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx index 2b8fb1e74fbb..3b9be15d315f 100644 --- a/include/svx/svddef.hxx +++ b/include/svx/svddef.hxx @@ -423,8 +423,7 @@ constexpr TypedWhichId<SdrPercentItem> SDRATTR_GLOW_TRANSPARENCY(SDRATTR_GLOW_FI constexpr sal_uInt16 SDRATTR_GLOW_LAST (SDRATTR_GLOW_TRANSPARENCY); constexpr sal_uInt16 SDRATTR_SOFTEDGE_FIRST(SDRATTR_GLOW_LAST + 1); -constexpr TypedWhichId<SdrOnOffItem> SDRATTR_SOFTEDGE(SDRATTR_SOFTEDGE_FIRST + 0); -constexpr TypedWhichId<SdrMetricItem> SDRATTR_SOFTEDGE_RAD(SDRATTR_SOFTEDGE_FIRST + 1); +constexpr TypedWhichId<SdrMetricItem> SDRATTR_SOFTEDGE_RAD(SDRATTR_SOFTEDGE_FIRST + 0); constexpr sal_uInt16 SDRATTR_SOFTEDGE_LAST(SDRATTR_SOFTEDGE_RAD); constexpr sal_uInt16 SDRATTR_END (SDRATTR_SOFTEDGE_LAST); /* 1357 */ /* 1333 V4+++*/ /* 1243 V4+++*/ /*1213*/ /*1085*/ /*1040*/ /*Pool V2: 1123,V1: 1065 */ diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index ab6fce14082c..449258d430d6 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -418,8 +418,7 @@ class SvxSetItem; #define SID_ATTR_GLOW_COLOR ( SID_SVX_START + 321 ) #define SID_ATTR_GLOW_RADIUS ( SID_SVX_START + 322 ) #define SID_ATTR_GLOW_TRANSPARENCY ( SID_SVX_START + 323 ) -#define SID_ATTR_SOFTEDGE ( SID_SVX_START + 324 ) -#define SID_ATTR_SOFTEDGE_RADIUS ( SID_SVX_START + 325 ) +#define SID_ATTR_SOFTEDGE_RADIUS ( SID_SVX_START + 324 ) #define SID_SCAN ( SID_SVX_START + 330 ) #define SID_TWAIN_SELECT ( SID_SVX_START + 331 ) #define SID_TWAIN_TRANSFER ( SID_SVX_START + 332 ) diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index 12188840cfe4..fbc6b1c387b1 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -216,7 +216,6 @@ { OUString{"GlowEffectTransparency"}, SDRATTR_GLOW_TRANSPARENCY,::cppu::UnoType<sal_Int16>::get(), 0, 0 }, #define SOFTEDGE_PROPERTIES \ - { OUString("SoftEdge"), SDRATTR_SOFTEDGE, cppu::UnoType<bool>::get(), 0, 0}, \ { OUString{"SoftEdgeRad"}, SDRATTR_SOFTEDGE_RAD, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, #define SHADOW_PROPERTIES \ diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 4e23277dd485..3911f61c2849 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1695,7 +1695,6 @@ namespace xmloff::token { XML_SLANT_Y, XML_SLIDE, XML_SLOW, - XML_SOFTEDGE, XML_SOFTEDGE_RADIUS, XML_SOLID, XML_SOLID_TYPE, diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 92e145fbe1da..202e2927e80c 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1479,7 +1479,6 @@ Reference< XShape > const & Shape::createAndInsert( if (aEffectProperties.maSoftEdge.moRad.has()) { uno::Reference<beans::XPropertySet> propertySet(mxShape, uno::UNO_QUERY); - propertySet->setPropertyValue("SoftEdge", makeAny(true)); propertySet->setPropertyValue( "SoftEdgeRad", makeAny(convertEmuToHmm(aEffectProperties.maSoftEdge.moRad.get()))); } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 134fa648aff6..12a4506a8e75 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3753,8 +3753,12 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) bool bHasEffects = bHasShadow; if (!bHasEffects && GetProperty(rXPropSet, "GlowEffect")) mAny >>= bHasEffects; - if (!bHasEffects && GetProperty(rXPropSet, "SoftEdge")) - mAny >>= bHasEffects; + if (!bHasEffects && GetProperty(rXPropSet, "SoftEdgeRad")) + { + sal_Int32 rad = 0; + mAny >>= rad; + bHasEffects = rad > 0; + } if (bHasEffects) { @@ -3882,13 +3886,11 @@ void DrawingML::WriteGlowEffect(const Reference< XPropertySet >& rXPropSet) void DrawingML::WriteSoftEdgeEffect(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet) { - bool hasEffect = false; - rXPropSet->getPropertyValue("SoftEdge") >>= hasEffect; - if (!hasEffect) - return; - sal_Int32 nRad = 0; rXPropSet->getPropertyValue("SoftEdgeRad") >>= nRad; + if (!nRad) + return; + css::uno::Sequence<css::beans::PropertyValue> aAttribs(1); aAttribs[0].Name = "rad"; aAttribs[0].Value <<= oox::drawingml::convertHmmToEmu(nRad); diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng index 408754eaa742..df9d84f09b7d 100644 --- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng +++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng @@ -944,15 +944,7 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. <rng:ref name="zeroToHundredPercent"/> </rng:attribute> </rng:optional> - <!-- TODO: no proposal for loext:softedge* --> - <rng:optional> - <rng:attribute name="loext:softedge"> - <rng:choice> - <rng:value>visible</rng:value> - <rng:value>hidden</rng:value> - </rng:choice> - </rng:attribute> - </rng:optional> + <!-- TODO: no proposal for loext:softedge-radius --> <rng:optional> <rng:attribute name="loext:softedge-radius"> <rng:ref name="length"/> diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 72e1110fe693..378189e15fa3 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -2923,9 +2923,6 @@ void SdOOXMLExportTest2::testShapeSoftEdgeEffect() = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/shape-soft-edges.pptx"), PPTX); xDocShRef = saveAndReload(xDocShRef.get(), PPTX); auto xShapeProps(getShapeFromPage(0, 0, xDocShRef)); - bool bHasSoftEdges = false; - xShapeProps->getPropertyValue("SoftEdge") >>= bHasSoftEdges; - CPPUNIT_ASSERT(bHasSoftEdges); sal_Int32 nRadius = -1; xShapeProps->getPropertyValue("SoftEdgeRad") >>= nRadius; CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nRadius); // 18 pt diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index eeac217a3b83..4bdced5fe6fa 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -1316,10 +1316,7 @@ void SdExportTest::testSoftEdges() xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile); auto xShapeProps(getShapeFromPage(0, 0, xDocShRef)); - // Check glow properties - bool bEffect = false; - CPPUNIT_ASSERT(xShapeProps->getPropertyValue("SoftEdge") >>= bEffect); - CPPUNIT_ASSERT(bEffect); + // Check property sal_Int32 nRad = 0; CPPUNIT_ASSERT(xShapeProps->getPropertyValue("SoftEdgeRad") >>= nRad); CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nRad); // 18 pt @@ -1330,11 +1327,7 @@ void SdExportTest::testSoftEdges() // check that we actually test graphic style assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[2]", "family", "graphic"); - // check loext graphic attributes - assertXPath( - pXmlDoc, - "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties", - "softedge", "visible"); + // check loext graphic attribute assertXPath( pXmlDoc, "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties", diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index ed96682bc6f7..785d88e91ebe 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -333,7 +333,6 @@ SdrItemPool::SdrItemPool( rPoolDefaults[ SDRATTR_GLOW_COLOR - SDRATTR_START ] = new XColorItem(SDRATTR_GLOW_COLOR, aNullCol); rPoolDefaults[ SDRATTR_GLOW_TRANSPARENCY - SDRATTR_START ] = new SdrPercentItem(SDRATTR_GLOW_TRANSPARENCY, 0); - rPoolDefaults[SDRATTR_SOFTEDGE - SDRATTR_START] = new SdrOnOffItem(SDRATTR_SOFTEDGE, false); rPoolDefaults[SDRATTR_SOFTEDGE_RAD - SDRATTR_START] = new SdrMetricItem(SDRATTR_SOFTEDGE_RAD, 0); // set own ItemInfos @@ -355,7 +354,6 @@ SdrItemPool::SdrItemPool( mpLocalItemInfos[SDRATTR_GLOW_COLOR - SDRATTR_START]._nSID = SID_ATTR_GLOW_COLOR; mpLocalItemInfos[SDRATTR_GLOW_TRANSPARENCY - SDRATTR_START]._nSID = SID_ATTR_GLOW_TRANSPARENCY; - mpLocalItemInfos[SDRATTR_SOFTEDGE - SDRATTR_START]._nSID = SID_ATTR_SOFTEDGE; mpLocalItemInfos[SDRATTR_SOFTEDGE_RAD - SDRATTR_START]._nSID = SID_ATTR_SOFTEDGE_RADIUS; // it's my own creation level, set Defaults and ItemInfos @@ -469,7 +467,6 @@ OUString SdrItemPool::GetItemName(sal_uInt16 nWhich) case SDRATTR_GLOW_COLOR : pResId = SIP_SA_GLOW_COLOR;break; case SDRATTR_GLOW_TRANSPARENCY : pResId = SIP_SA_GLOW_TRANSPARENCY;break; - case SDRATTR_SOFTEDGE : pResId = SIP_SA_SOFTEDGE; break; case SDRATTR_SOFTEDGE_RAD : pResId = SIP_SA_SOFTEDGE_RAD; break; case SDRATTR_CAPTIONTYPE : pResId = SIP_SA_CAPTIONTYPE;break; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 9c774c5ee46d..18275ebb5ec0 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1701,7 +1701,6 @@ namespace xmloff::token { TOKEN( "slant-y", XML_SLANT_Y ), TOKEN( "slide", XML_SLIDE ), TOKEN( "slow", XML_SLOW ), - TOKEN( "softedge", XML_SOFTEDGE ), TOKEN( "softedge-radius", XML_SOFTEDGE_RADIUS ), TOKEN( "solid", XML_SOLID ), TOKEN( "solid-type", XML_SOLID_TYPE ), diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index bb2a504e4d8b..a6298d892450 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -159,7 +159,6 @@ const XMLPropertyMapEntry aXMLSDProperties[] = GMAPV( "GlowEffectTransparency", XML_NAMESPACE_LO_EXT, XML_GLOW_TRANSPARENCY, XML_TYPE_PERCENT16, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED), // soft edge attributes - GMAPV( "SoftEdge", XML_NAMESPACE_LO_EXT, XML_SOFTEDGE, XML_SD_TYPE_VISIBLE_HIDDEN, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED), GMAPV( "SoftEdgeRad", XML_NAMESPACE_LO_EXT, XML_SOFTEDGE_RADIUS, XML_TYPE_MEASURE , 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED), // graphic attributes diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 9a2c343d44c6..42a83f7ae15a 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -1611,7 +1611,6 @@ slant-x slant-y slide slow -softedge softedge-radius solid solid-type |