tdf#161826 - Add uniform Glow effect for texts in shapes

- Add new text Glow effect properties for shapes

- Using TextGlowPrimitive for rendering uniform text glow in shapes

- Add/allow new UI Glow Effect for texts in shapes on sidebar
  (Only for Impress/Draw and Calc)

- Import/Export ooxml files with Glow effect on texts in shapes
  (Only PPTX/XLSX)

- Import/Export odf files with Glow effect on texts in shapes

- Add unit test for glow text attributes in ODF

- Add uni tests for OOXML import/export

Note: Also this patch effects on
tdf#144061 - Effects: Allow GLOW to apply to Text (as we have for shapes)

Change-Id: I16586c01654f197f532129e4e06aa2ef9f214395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172216
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
This commit is contained in:
Balazs Varga 2024-08-21 17:34:23 +02:00
parent 786aed3a35
commit 3eac847927
64 changed files with 1056 additions and 34 deletions

View file

@ -11944,6 +11944,7 @@ drawinglayer::attribute::SdrFillGraphicAttribute::getTiling() const
drawinglayer::attribute::SdrFillGraphicAttribute::operator=(drawinglayer::attribute::SdrFillGraphicAttribute const&)
drawinglayer::attribute::SdrFillGraphicAttribute::operator==(drawinglayer::attribute::SdrFillGraphicAttribute const&) const
drawinglayer::attribute::SdrGlowAttribute::operator=(drawinglayer::attribute::SdrGlowAttribute&&)
drawinglayer::attribute::SdrGlowTextAttribute::operator=(drawinglayer::attribute::SdrGlowTextAttribute&&)
drawinglayer::attribute::SdrLightingAttribute::SdrLightingAttribute(drawinglayer::attribute::SdrLightingAttribute&&)
drawinglayer::attribute::SdrLightingAttribute::getAmbientLightColor() const
drawinglayer::attribute::SdrLightingAttribute::operator=(drawinglayer::attribute::SdrLightingAttribute const&)
@ -12251,6 +12252,7 @@ drawinglayer::primitive2d::WrongSpellPrimitive2D::create2DDecomposition(drawingl
drawinglayer::primitive2d::WrongSpellPrimitive2D::getPrimitive2DID() const
drawinglayer::primitive2d::WrongSpellPrimitive2D::operator==(drawinglayer::primitive2d::BasePrimitive2D const&) const
drawinglayer::primitive2d::createEmbeddedGlowPrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::attribute::SdrGlowAttribute const&)
drawinglayer::primitive2d::createEmbeddedTextGlowPrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::attribute::SdrGlowTextAttribute const&)
drawinglayer::primitive2d::createEmbeddedShadowPrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::attribute::SdrShadowAttribute const&, basegfx::B2DHomMatrix const&, drawinglayer::primitive2d::Primitive2DContainer const*)
drawinglayer::primitive2d::createEmbeddedSoftEdgePrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, int)
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(bool, basegfx::B2DRange const&, basegfx::B2DHomMatrix const&)

View file

@ -12420,6 +12420,7 @@ drawinglayer::attribute::SdrFillGraphicAttribute::getTiling() const
drawinglayer::attribute::SdrFillGraphicAttribute::operator=(drawinglayer::attribute::SdrFillGraphicAttribute const&)
drawinglayer::attribute::SdrFillGraphicAttribute::operator==(drawinglayer::attribute::SdrFillGraphicAttribute const&) const
drawinglayer::attribute::SdrGlowAttribute::operator=(drawinglayer::attribute::SdrGlowAttribute&&)
drawinglayer::attribute::SdrGlowTextAttribute::operator=(drawinglayer::attribute::SdrGlowTextAttribute&&)
drawinglayer::attribute::SdrLightingAttribute::SdrLightingAttribute(drawinglayer::attribute::SdrLightingAttribute&&)
drawinglayer::attribute::SdrLightingAttribute::getAmbientLightColor() const
drawinglayer::attribute::SdrLightingAttribute::operator=(drawinglayer::attribute::SdrLightingAttribute const&)
@ -12720,6 +12721,7 @@ drawinglayer::primitive2d::WrongSpellPrimitive2D::getPrimitive2DID() const
drawinglayer::primitive2d::WrongSpellPrimitive2D::operator==(drawinglayer::primitive2d::BasePrimitive2D const&) const
drawinglayer::primitive2d::arePrimitive2DReferencesEqual(rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> const&, rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> const&)
drawinglayer::primitive2d::createEmbeddedGlowPrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::attribute::SdrGlowAttribute const&)
drawinglayer::primitive2d::createEmbeddedTextGlowPrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::attribute::SdrGlowTextAttribute const&)
drawinglayer::primitive2d::createEmbeddedShadowPrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::attribute::SdrShadowAttribute const&, basegfx::B2DHomMatrix const&, drawinglayer::primitive2d::Primitive2DContainer const*)
drawinglayer::primitive2d::createEmbeddedSoftEdgePrimitive(drawinglayer::primitive2d::Primitive2DContainer&&, int)
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(bool, basegfx::B2DRange const&, basegfx::B2DHomMatrix const&)

View file

@ -1046,6 +1046,12 @@ svx/source/sidebar/effect/EffectPropertyPanel.hxx:37
svx::sidebar::EffectPropertyPanel maGlowTransparencyController sfx2::sidebar::ControllerItem
svx/source/sidebar/effect/EffectPropertyPanel.hxx:39
svx::sidebar::EffectPropertyPanel maSoftEdgeRadiusController sfx2::sidebar::ControllerItem
svx/source/sidebar/effect/TextEffectPropertyPanel.hxx:35
svx::sidebar::TextEffectPropertyPanel maTGlowColorController sfx2::sidebar::ControllerItem
svx/source/sidebar/effect/TextEffectPropertyPanel.hxx:36
svx::sidebar::TextEffectPropertyPanel maTGlowRadiusController sfx2::sidebar::ControllerItem
svx/source/sidebar/effect/TextEffectPropertyPanel.hxx:37
svx::sidebar::TextEffectPropertyPanel maTGlowTransparencyController sfx2::sidebar::ControllerItem
svx/source/sidebar/line/LinePropertyPanel.hxx:79
svx::sidebar::LinePropertyPanel maStyleControl sfx2::sidebar::ControllerItem
svx/source/sidebar/line/LinePropertyPanel.hxx:80

View file

@ -94,6 +94,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/attribute/sdrfillattribute \
drawinglayer/source/attribute/sdrfillgraphicattribute \
drawinglayer/source/attribute/sdrglowattribute \
drawinglayer/source/attribute/sdrglowtextattribute \
drawinglayer/source/attribute/sdrlightattribute3d \
drawinglayer/source/attribute/sdrlightingattribute3d \
drawinglayer/source/attribute/sdrlineattribute \

View file

@ -0,0 +1,37 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <drawinglayer/attribute/sdrglowtextattribute.hxx>
namespace drawinglayer::attribute
{
SdrGlowTextAttribute::SdrGlowTextAttribute(sal_Int32 nTextRadius, const Color& rTextColor)
: m_nTextRadius(nTextRadius)
, m_TextColor(rTextColor)
{
}
SdrGlowTextAttribute::SdrGlowTextAttribute() = default;
SdrGlowTextAttribute::SdrGlowTextAttribute(const SdrGlowTextAttribute&) = default;
SdrGlowTextAttribute::SdrGlowTextAttribute(SdrGlowTextAttribute&&) = default;
SdrGlowTextAttribute& SdrGlowTextAttribute::operator=(const SdrGlowTextAttribute&) = default;
SdrGlowTextAttribute& SdrGlowTextAttribute::operator=(SdrGlowTextAttribute&&) = default;
bool SdrGlowTextAttribute::operator==(const SdrGlowTextAttribute& rCandidate) const
{
return m_nTextRadius == rCandidate.m_nTextRadius && m_TextColor == rCandidate.m_TextColor;
}
} // end of namespace drawinglayer::attribute
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -0,0 +1,45 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRGLOWTEXTATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRGLOWTEXTATTRIBUTE_HXX
#include <drawinglayer/drawinglayerdllapi.h>
#include <tools/color.hxx>
namespace drawinglayer::attribute
{
class DRAWINGLAYER_DLLPUBLIC SdrGlowTextAttribute
{
private:
sal_Int32 m_nTextRadius = 0;
Color m_TextColor; // Includes alpha!
public:
SdrGlowTextAttribute(sal_Int32 nTextRadius, const Color& rTextColor);
SdrGlowTextAttribute();
SdrGlowTextAttribute(const SdrGlowTextAttribute&);
SdrGlowTextAttribute(SdrGlowTextAttribute&&);
bool operator==(const SdrGlowTextAttribute& rCandidate) const;
SdrGlowTextAttribute& operator=(const SdrGlowTextAttribute&);
SdrGlowTextAttribute& operator=(SdrGlowTextAttribute&&);
// data access
const Color& getTextColor() const { return m_TextColor; }
sal_Int32 getTextRadius() const { return m_nTextRadius; }
bool isDefault() const { return m_nTextRadius == 0; }
};
} // end of namespace drawinglayer::attribute
#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRGLOWTEXTATTRIBUTE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -0,0 +1,89 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX
#define INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX
#include <oox/drawingml/color.hxx>
#include <oox/helper/propertymap.hxx>
#include <memory>
#include <vector>
#include <map>
namespace model
{
enum class RectangleAlignment;
}
namespace oox::drawingml
{
struct EffectGlowProperties
{
std::optional<sal_Int64> moGlowRad; // size of glow effect
Color moGlowColor;
// TODO saturation and luminance missing
void assignUsed(const EffectGlowProperties& rSourceProps);
};
struct EffectSoftEdgeProperties
{
std::optional<sal_Int64> moRad; // size of effect
void assignUsed(const EffectSoftEdgeProperties& rSourceProps);
};
struct EffectShadowProperties
{
std::optional<sal_Int64> moShadowDist;
std::optional<sal_Int64> moShadowDir;
std::optional<sal_Int64> moShadowSx;
std::optional<sal_Int64> moShadowSy;
Color moShadowColor;
std::optional<sal_Int64> moShadowBlur; // size of blur effect
std::optional<model::RectangleAlignment> moShadowAlignment;
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed(const EffectShadowProperties& rSourceProps);
};
struct Effect
{
OUString msName;
std::map<OUString, css::uno::Any> maAttribs;
Color moColor;
css::beans::PropertyValue getEffect();
};
struct EffectProperties
{
EffectShadowProperties maShadow;
EffectGlowProperties maGlow;
EffectSoftEdgeProperties maSoftEdge;
/** Stores all effect properties, including those not supported by core yet */
std::vector<std::unique_ptr<Effect>> m_Effects;
EffectProperties() {}
EffectProperties(EffectProperties const& rOther) { assignUsed(rOther); }
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed(const EffectProperties& rSourceProps);
/** Writes the properties to the passed property map. */
void pushToPropMap(PropertyMap& rPropMap, const GraphicHelper& rGraphicHelper) const;
};
} // namespace oox::drawingml
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -339,6 +339,7 @@ protected:
bool IsFontworkShape(const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet);
void WriteGlowEffect(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet);
void WriteTextGlowEffect(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet);
void WriteSoftEdgeEffect(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet);
void WriteCustomGeometryPoint(const css::drawing::EnhancedCustomShapeParameterPair& rParamPair,
const EnhancedCustomShape2d& rCustomShape2d,

View file

@ -516,6 +516,9 @@
#define SIP_SA_GLOW_RADIUS NC_("SIP_SA_GLOW_RADIUS", "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_GLOW_TEXT_RADIUS NC_("SIP_SA_GLOW_TEXT_RADIUS", "Radius of text glow effect")
#define SIP_SA_GLOW_TEXT_COLOR NC_("SIP_SA_GLOW_TEXT_COLOR", "Color of text glow effect")
#define SIP_SA_GLOW_TEXT_TRANSPARENCY NC_("SIP_SA_GLOW_TEXT_TRANSPARENCY", "Transparency of text glow effect")
#define SIP_SA_SOFTEDGE_RADIUS NC_("SIP_SA_SOFTEDGE_RADIUS", "Radius of soft edge effect")
#define STR_ObjNameSingulMEDIA NC_("STR_ObjNameSingulMEDIA", "Media object")
#define STR_ObjNamePluralMEDIA NC_("STR_ObjNamePluralMEDIA", "Media objects")

View file

@ -432,20 +432,26 @@ constexpr sal_uInt16 SDRATTR_SOFTEDGE_FIRST(SDRATTR_GLOW_LA
constexpr TypedWhichId<SdrMetricItem> SDRATTR_SOFTEDGE_RADIUS(SDRATTR_SOFTEDGE_FIRST+0); // 1245
constexpr sal_uInt16 SDRATTR_SOFTEDGE_LAST(SDRATTR_SOFTEDGE_RADIUS); // 1245
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_FIRST(SDRATTR_SOFTEDGE_LAST+1); // 1246
constexpr TypedWhichId<SfxInt16Item> SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0); // 1246
constexpr TypedWhichId<SdrMetricItem> SDRATTR_TEXTCOLUMNS_SPACING(SDRATTR_TEXTCOLUMNS_FIRST+1); // 1247
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_LAST(SDRATTR_TEXTCOLUMNS_SPACING); // 1247
constexpr sal_uInt16 SDRATTR_GLOW_TEXT_FIRST(SDRATTR_SOFTEDGE_LAST+1); // 1246
constexpr TypedWhichId<SdrMetricItem> SDRATTR_GLOW_TEXT_RADIUS(SDRATTR_GLOW_TEXT_FIRST+0); // 1246
constexpr TypedWhichId<XColorItem> SDRATTR_GLOW_TEXT_COLOR(SDRATTR_GLOW_TEXT_FIRST+1); // 1247
constexpr TypedWhichId<SdrPercentItem> SDRATTR_GLOW_TEXT_TRANSPARENCY(SDRATTR_GLOW_TEXT_FIRST+2);// 1248
constexpr sal_uInt16 SDRATTR_GLOW_TEXT_LAST(SDRATTR_GLOW_TEXT_TRANSPARENCY); // 1248
constexpr sal_uInt16 SDRATTR_WRITINGMODE2_FIRST(SDRATTR_TEXTCOLUMNS_LAST+1);// 1248
constexpr TypedWhichId<SvxFrameDirectionItem> SDRATTR_WRITINGMODE2(SDRATTR_WRITINGMODE2_FIRST+0); // 1248
constexpr sal_uInt16 SDRATTR_WRITINGMODE2_LAST(SDRATTR_WRITINGMODE2); // 1248
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_FIRST(SDRATTR_GLOW_TEXT_LAST+1); // 1249
constexpr TypedWhichId<SfxInt16Item> SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0); // 1249
constexpr TypedWhichId<SdrMetricItem> SDRATTR_TEXTCOLUMNS_SPACING(SDRATTR_TEXTCOLUMNS_FIRST+1); // 1250
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_LAST(SDRATTR_TEXTCOLUMNS_SPACING); // 1250
constexpr sal_uInt16 SDRATTR_EDGEOOXMLCURVE_FIRST(SDRATTR_WRITINGMODE2_LAST+1);// 1249
constexpr TypedWhichId<SfxBoolItem> SDRATTR_EDGEOOXMLCURVE(SDRATTR_EDGEOOXMLCURVE_FIRST+0); // 1249
constexpr sal_uInt16 SDRATTR_EDGEOOXMLCURVE_LAST(SDRATTR_EDGEOOXMLCURVE); // 1249
constexpr sal_uInt16 SDRATTR_WRITINGMODE2_FIRST(SDRATTR_TEXTCOLUMNS_LAST+1);// 1251
constexpr TypedWhichId<SvxFrameDirectionItem> SDRATTR_WRITINGMODE2(SDRATTR_WRITINGMODE2_FIRST+0); // 1251
constexpr sal_uInt16 SDRATTR_WRITINGMODE2_LAST(SDRATTR_WRITINGMODE2); // 1251
constexpr sal_uInt16 SDRATTR_END (SDRATTR_EDGEOOXMLCURVE_LAST); // 1249
constexpr sal_uInt16 SDRATTR_EDGEOOXMLCURVE_FIRST(SDRATTR_WRITINGMODE2_LAST+1);// 1252
constexpr TypedWhichId<SfxBoolItem> SDRATTR_EDGEOOXMLCURVE(SDRATTR_EDGEOOXMLCURVE_FIRST+0); // 1252
constexpr sal_uInt16 SDRATTR_EDGEOOXMLCURVE_LAST(SDRATTR_EDGEOOXMLCURVE); // 1252
constexpr sal_uInt16 SDRATTR_END (SDRATTR_EDGEOOXMLCURVE_LAST); // 1252
#endif // INCLUDED_SVX_SVDDEF_HXX

View file

@ -437,10 +437,17 @@ class XFillGradientItem;
#define SID_ATTR_TRANSFORM_HORI_MIRROR TypedWhichId<SfxBoolItem>( SID_SVX_START + 317 )
#define SID_ATTR_TRANSFORM_ANCHOR TypedWhichId<SfxInt16Item>( SID_SVX_START + 318 )
#define SID_ATTR_TRANSFORM_VERT_ORIENT TypedWhichId<SfxInt16Item>( SID_SVX_START + 319 )
#define SID_ATTR_GLOW_RADIUS ( SID_SVX_START + 320 )
#define SID_ATTR_GLOW_COLOR ( SID_SVX_START + 321 )
#define SID_ATTR_GLOW_TRANSPARENCY ( SID_SVX_START + 322 )
#define SID_ATTR_SOFTEDGE_RADIUS ( SID_SVX_START + 323 )
#define SID_ATTR_GLOW_TEXT_RADIUS ( SID_SVX_START + 323 )
#define SID_ATTR_GLOW_TEXT_COLOR ( SID_SVX_START + 324 )
#define SID_ATTR_GLOW_TEXT_TRANSPARENCY ( SID_SVX_START + 325 )
#define SID_ATTR_SOFTEDGE_RADIUS ( SID_SVX_START + 326 )
#define SID_SCAN ( SID_SVX_START + 330 )
#define SID_TWAIN_SELECT ( SID_SVX_START + 331 )
#define SID_TWAIN_TRANSFER ( SID_SVX_START + 332 )

View file

@ -225,6 +225,11 @@
#define SOFTEDGE_PROPERTIES \
{ u"SoftEdgeRadius"_ustr, SDRATTR_SOFTEDGE_RADIUS, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
#define GLOW_TEXT_PROPERTIES \
{ u"GlowTextEffectRadius"_ustr, SDRATTR_GLOW_TEXT_RADIUS, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \
{ u"GlowTextEffectColor"_ustr, SDRATTR_GLOW_TEXT_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, \
{ u"GlowTextEffectTransparency"_ustr,SDRATTR_GLOW_TEXT_TRANSPARENCY,::cppu::UnoType<sal_Int16>::get(), 0, 0},
#define SHADOW_PROPERTIES \
{ UNO_NAME_SHADOW, SDRATTR_SHADOW, cppu::UnoType<bool>::get(), 0, 0}, \
{ UNO_NAME_SHADOWCOLOR, SDRATTR_SHADOWCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, \

View file

@ -979,8 +979,11 @@ namespace xmloff::token {
XML_GENERATOR,
XML_GEQ,
XML_GLOW_RADIUS,
XML_GLOW_TEXT_RADIUS,
XML_GLOW_COLOR,
XML_GLOW_TEXT_COLOR,
XML_GLOW_TRANSPARENCY,
XML_GLOW_TEXT_TRANSPARENCY,
XML_GOURAUD,
XML_GRADIENT,
XML_GRADIENT_ANGLE,

View file

@ -724,6 +724,35 @@
</prop>
</node>
<node oor:name="TextEffectPropertyPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Text Effect</value>
</prop>
<prop oor:name="Id" oor:type="xs:string">
<value>TextEffectPropertyPanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
<value>PropertyDeck</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
Calc, Draw, hidden ;
Calc, TextObject, hidden ;
DrawImpress, Draw, hidden ;
DrawImpress, TextObject, hidden ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
<value>private:resource/toolpanel/SvxPanelFactory/TextEffectPropertyPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
<value>350</value>
</prop>
<prop oor:name="WantsAWT" oor:type="xs:boolean">
<value>false</value>
</prop>
</node>
<node oor:name="ShadowPropertyPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Shadow</value>

View file

@ -23,7 +23,9 @@
#include <oox/helper/helper.hxx>
#include <oox/helper/propertymap.hxx>
#include <oox/drawingml/color.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
#include <drawingml/textfont.hxx>
#include <oox/drawingml/effectproperties.hxx>
#include <drawingml/fillproperties.hxx>
#include <drawingml/lineproperties.hxx>
@ -32,6 +34,7 @@ namespace oox { class PropertySet; }
namespace oox::drawingml {
struct EffectProperties;
struct TextCharacterProperties
{
@ -69,6 +72,8 @@ struct TextCharacterProperties
/// In that case we use the default paragraph properties from the
/// <c:txPr><a:p><a:pPr><a:defRPr>...</a:defRPr>
bool mbHasEmptyParaProperties;
/// For text effect properties in shapes
EffectPropertiesPtr mpEffectPropertiesPtr;
std::vector<css::beans::PropertyValue> maTextEffectsProperties;
@ -90,7 +95,10 @@ struct TextCharacterProperties
PropertySet& rPropSet,
const ::oox::core::XmlFilterBase& rFilter ) const;
TextCharacterProperties() : mbHasVisualRunProperties(false), mbHasEmptyParaProperties(false) {}
/** Get effect properties. */
EffectProperties& getEffectProperties() const { return *mpEffectPropertiesPtr; }
TextCharacterProperties() : mbHasVisualRunProperties(false), mbHasEmptyParaProperties(false), mpEffectPropertiesPtr(std::make_shared<EffectProperties>()) {}
};

View file

@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "effectproperties.hxx"
#include <oox/drawingml/effectproperties.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
#include <oox/helper/graphichelper.hxx>
#include <oox/token/properties.hxx>

View file

@ -8,7 +8,7 @@
*/
#include <drawingml/effectpropertiescontext.hxx>
#include "effectproperties.hxx"
#include <oox/drawingml/effectproperties.hxx>
#include <drawingml/colorchoicecontext.hxx>
#include <oox/helper/attributelist.hxx>
#include <oox/token/namespaces.hxx>

View file

@ -29,7 +29,7 @@
#include <drawingml/presetgeometrynames.hxx>
#include <drawingml/shape3dproperties.hxx>
#include <drawingml/scene3dhelper.hxx>
#include "effectproperties.hxx"
#include <oox/drawingml/effectproperties.hxx>
#include <oox/drawingml/shapepropertymap.hxx>
#include <drawingml/textbody.hxx>
#include <drawingml/textparagraph.hxx>
@ -2162,6 +2162,50 @@ Reference< XShape > const & Shape::createAndInsert(
u"SoftEdgeRadius"_ustr, Any(convertEmuToHmm(aEffectProperties.maSoftEdge.moRad.value())));
}
// Set text glow effect for shapes
if (mpTextBody && (!bDoNotInsertEmptyTextBody || !mpTextBody->isEmpty()))
{
const TextParagraphVector& rParagraphs = mpTextBody->getParagraphs();
if (!rParagraphs.empty())
{
EffectProperties aTextEffectProperties;
for (TextParagraphVector::const_iterator aPIt = rParagraphs.begin(), aPEnd = rParagraphs.end(); aPIt != aPEnd; ++aPIt)
{
const TextParagraph& rTextPara = **aPIt;
const TextCharacterProperties & rParaProps = rTextPara.getProperties().getTextCharacterProperties();
if (rParaProps.getEffectProperties().maGlow.moGlowRad.has_value())
{
aTextEffectProperties.assignUsed(rParaProps.getEffectProperties());
goto found;
}
else
{
for (TextRunVector::const_iterator aRIt = rTextPara.getRuns().begin(), aREnd = rTextPara.getRuns().end(); aRIt != aREnd; ++aRIt)
{
const TextRun& rTextRun = **aRIt;
const TextCharacterProperties& rRunrops = rTextRun.getTextCharacterProperties();
if (rRunrops.getEffectProperties().maGlow.moGlowRad.has_value())
{
aTextEffectProperties.assignUsed(rRunrops.getEffectProperties());
goto found;
}
}
}
}
found:
if (aTextEffectProperties.maGlow.moGlowRad.has_value())
{
xSet->setPropertyValue(u"GlowTextEffectRadius"_ustr,
uno::Any(convertEmuToHmm(aTextEffectProperties.maGlow.moGlowRad.value())));
xSet->setPropertyValue(u"GlowTextEffectColor"_ustr,
uno::Any(aTextEffectProperties.maGlow.moGlowColor.getColor(rGraphicHelper)));
xSet->setPropertyValue(u"GlowTextEffectTransparency"_ustr,
uno::Any(aTextEffectProperties.maGlow.moGlowColor.getTransparency()));
}
}
}
// Set the stroke and fill-color properties of the OLE shape
if (aServiceName == "com.sun.star.drawing.OLE2Shape" && mxOleObjectInfo
&& !mxOleObjectInfo->maShapeId.isEmpty())

View file

@ -70,6 +70,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
assignIfUsed( moTextOutlineProperties, rSourceProps.moTextOutlineProperties);
maTextEffectsProperties = rSourceProps.maTextEffectsProperties;
mpEffectPropertiesPtr->assignUsed(*rSourceProps.mpEffectPropertiesPtr);
maFillProperties.assignUsed( rSourceProps.maFillProperties );
}

View file

@ -21,6 +21,7 @@
#include <oox/helper/attributelist.hxx>
#include <drawingml/colorchoicecontext.hxx>
#include <drawingml/effectpropertiescontext.hxx>
#include <drawingml/linepropertiescontext.hxx>
#include <drawingml/misccontexts.hxx>
#include <drawingml/textcharacterproperties.hxx>
@ -129,6 +130,7 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
// EG_EffectProperties
case A_TOKEN( effectDag ): // CT_EffectContainer 5.1.10.25
case A_TOKEN( effectLst ): // CT_EffectList 5.1.10.26
return new EffectPropertiesContext(*this, mrTextCharacterProperties.getEffectProperties());
break;
case A_TOKEN( highlight ): // CT_Color
return new ColorContext(*this, mrTextCharacterProperties.maHighlightColor);

View file

@ -26,7 +26,7 @@
#include <drawingml/textcharacterproperties.hxx>
#include <oox/drawingml/theme.hxx>
#include <oox/helper/attributelist.hxx>
#include "effectproperties.hxx"
#include <oox/drawingml/effectproperties.hxx>
#include <drawingml/effectpropertiescontext.hxx>
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>

View file

@ -2761,6 +2761,13 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
else
WriteSolidFill(COL_BLACK);
}
if (rXShapePropSet.is() && GetDocumentType() != DOCUMENT_DOCX)
{
mpFS->startElementNS(XML_a, XML_effectLst);
WriteTextGlowEffect(rXShapePropSet);
mpFS->endElementNS(XML_a, XML_effectLst);
}
}
}
@ -5573,7 +5580,7 @@ void DrawingML::WriteShapeEffect( std::u16string_view sName, const Sequence< Pro
nEffectToken = FSNS( XML_a, XML_innerShdw );
bContainsColor = true;
}
else if( sName == u"glow" )
else if( sName == u"glow" || sName == u"glowtext" )
{
nEffectToken = FSNS( XML_a, XML_glow );
bContainsColor = true;
@ -5916,6 +5923,30 @@ void DrawingML::WriteGlowEffect(const Reference< XPropertySet >& rXPropSet)
WriteShapeEffect(u"glow", aGlowProps);
}
void DrawingML::WriteTextGlowEffect(const Reference< XPropertySet >& rXPropSet)
{
if (!rXPropSet->getPropertySetInfo()->hasPropertyByName(u"GlowTextEffectRadius"_ustr))
{
return;
}
sal_Int32 nRad = 0;
rXPropSet->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nRad;
if (!nRad)
return;
Sequence< PropertyValue > aGlowAttribs{ comphelper::makePropertyValue(
u"rad"_ustr, oox::drawingml::convertHmmToEmu(nRad)) };
Sequence< PropertyValue > aGlowProps{
comphelper::makePropertyValue(u"Attribs"_ustr, aGlowAttribs),
comphelper::makePropertyValue(u"RgbClr"_ustr, rXPropSet->getPropertyValue(u"GlowTextEffectColor"_ustr)),
comphelper::makePropertyValue(u"RgbClrTransparency"_ustr, rXPropSet->getPropertyValue(u"GlowTextEffectTransparency"_ustr))
};
// TODO other stuff like saturation or luminance
WriteShapeEffect(u"glowtext", aGlowProps);
}
void DrawingML::WriteSoftEdgeEffect(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet)
{
if (!rXPropSet->getPropertySetInfo()->hasPropertyByName(u"SoftEdgeRadius"_ustr))

View file

@ -221,6 +221,10 @@ interface TableDraw
SID_ATTR_GLOW_RADIUS [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
SID_ATTR_GLOW_TRANSPARENCY [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
SID_ATTR_GLOW_TEXT_COLOR [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
SID_ATTR_GLOW_TEXT_RADIUS [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
SID_ATTR_GLOW_TEXT_TRANSPARENCY [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
SID_ATTR_SOFTEDGE_RADIUS [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]
SID_MOVE_SHAPE_HANDLE [ ExecMethod = ExecDrawAttr; ]
SID_ATTR_TEXTCOLUMNS_NUMBER [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ]

View file

@ -400,6 +400,9 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
case SID_ATTR_GLOW_COLOR:
case SID_ATTR_GLOW_RADIUS:
case SID_ATTR_GLOW_TRANSPARENCY:
case SID_ATTR_GLOW_TEXT_COLOR:
case SID_ATTR_GLOW_TEXT_RADIUS:
case SID_ATTR_GLOW_TEXT_TRANSPARENCY:
case SID_ATTR_SOFTEDGE_RADIUS:
case SID_ATTR_TEXTCOLUMNS_NUMBER:
case SID_ATTR_TEXTCOLUMNS_SPACING:

View file

@ -954,6 +954,22 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
<rng:ref name="length"/>
</rng:attribute>
</rng:optional>
<!-- TODO: no proposal for loext:glow-text* -->
<rng:optional>
<rng:attribute name="loext:glow-text-radius">
<rng:ref name="length"/>
</rng:attribute>
</rng:optional>
<rng:optional>
<rng:attribute name="loext:glow-text-color">
<rng:ref name="color"/>
</rng:attribute>
</rng:optional>
<rng:optional>
<rng:attribute name="loext:glow-text-transparency">
<rng:ref name="zeroToHundredPercent"/>
</rng:attribute>
</rng:optional>
</rng:interleave>
</rng:define>

Binary file not shown.

Binary file not shown.

View file

@ -474,6 +474,22 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeGlowEffect)
CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nTransparency);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeTextGlowEffect)
{
createSdImpressDoc("pptx/shape-text-glow-effect.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
sal_Int32 nRadius = -1;
xShape->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nRadius;
CPPUNIT_ASSERT_EQUAL(sal_Int32(706), nRadius); // 20 pt = 706 mm/100
Color nColor;
xShape->getPropertyValue(u"GlowTextEffectColor"_ustr) >>= nColor;
CPPUNIT_ASSERT_EQUAL(Color(0x4EA72E), nColor);
sal_Int16 nTransparency;
xShape->getPropertyValue(u"GlowTextEffectTransparency"_ustr) >>= nTransparency;
CPPUNIT_ASSERT_EQUAL(sal_Int16(5), nTransparency);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testUnderline)
{
createSdImpressDoc("underline.fodp");

View file

@ -1534,6 +1534,47 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testGlow)
"glow-transparency"_ostr, u"60%"_ustr);
}
CPPUNIT_TEST_FIXTURE(SdExportTest, testGlowTextInShape)
{
createSdImpressDoc("odp/shape-text-glow-effect.odp");
saveAndReload(u"impress8"_ustr);
uno::Reference<drawing::XDrawPage> xDP(getPage(0));
uno::Reference<beans::XPropertySet> xShape(xDP->getByIndex(0), uno::UNO_QUERY);
// Check glow text properties in shapes
sal_Int32 nGlowEffectRad = 0;
CPPUNIT_ASSERT(xShape->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nGlowEffectRad);
CPPUNIT_ASSERT_EQUAL(sal_Int32(706), nGlowEffectRad); // 20 pt = 706 mm/100
Color nGlowEffectColor;
CPPUNIT_ASSERT(xShape->getPropertyValue(u"GlowTextEffectColor"_ustr) >>= nGlowEffectColor);
CPPUNIT_ASSERT_EQUAL(Color(0x4EA72E), nGlowEffectColor);
sal_Int16 nGlowEffectTransparency = 0;
CPPUNIT_ASSERT(xShape->getPropertyValue(u"GlowTextEffectTransparency"_ustr)
>>= nGlowEffectTransparency);
CPPUNIT_ASSERT_EQUAL(sal_Int16(5), nGlowEffectTransparency);
// Test ODF element
xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
// check that we actually test graphic style
assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[3]"_ostr,
"family"_ostr, u"graphic"_ustr);
// check loext graphic attributes for th
assertXPath(
pXmlDoc,
"/office:document-content/office:automatic-styles/style:style[3]/style:graphic-properties"_ostr,
"glow-text-radius"_ostr, u"0.706cm"_ustr);
assertXPath(
pXmlDoc,
"/office:document-content/office:automatic-styles/style:style[3]/style:graphic-properties"_ostr,
"glow-text-color"_ostr, u"#4ea72e"_ustr);
assertXPath(
pXmlDoc,
"/office:document-content/office:automatic-styles/style:style[3]/style:graphic-properties"_ostr,
"glow-text-transparency"_ostr, u"5%"_ustr);
}
CPPUNIT_TEST_FIXTURE(SdExportTest, testSoftEdges)
{
createSdDrawDoc("odg/softedges.odg");

View file

@ -1664,6 +1664,22 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeGlowEffectPPTXImpoer)
CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nTransparency);
}
CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeTextGlowEffectPPTXImport)
{
createSdImpressDoc("pptx/shape-text-glow-effect.pptx");
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
sal_Int32 nRadius = -1;
xShape->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nRadius;
CPPUNIT_ASSERT_EQUAL(sal_Int32(706), nRadius); // 20 pt = 706 mm/100
Color nColor;
xShape->getPropertyValue(u"GlowTextEffectColor"_ustr) >>= nColor;
CPPUNIT_ASSERT_EQUAL(Color(0x4EA72E), nColor);
sal_Int16 nTransparency;
xShape->getPropertyValue(u"GlowTextEffectTransparency"_ustr) >>= nTransparency;
CPPUNIT_ASSERT_EQUAL(sal_Int16(5), nTransparency);
}
CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeBlurPPTXImport)
{
createSdImpressDoc("pptx/shape-blur-effect.pptx");

View file

@ -2943,6 +2943,21 @@ interface DrawView
ExecMethod = FuTemporary;
StateMethod = GetAttrState;
]
SID_ATTR_GLOW_TEXT_COLOR
[
ExecMethod = FuTemporary ;
StateMethod = GetAttrState ;
]
SID_ATTR_GLOW_TEXT_RADIUS
[
ExecMethod = FuTemporary;
StateMethod = GetAttrState;
]
SID_ATTR_GLOW_TEXT_TRANSPARENCY
[
ExecMethod = FuTemporary;
StateMethod = GetAttrState;
]
SID_ATTR_SOFTEDGE_RADIUS
[
ExecMethod = FuTemporary;

View file

@ -3626,6 +3626,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ATTR_GLOW_COLOR:
case SID_ATTR_GLOW_RADIUS:
case SID_ATTR_GLOW_TRANSPARENCY:
case SID_ATTR_GLOW_TEXT_COLOR:
case SID_ATTR_GLOW_TEXT_RADIUS:
case SID_ATTR_GLOW_TEXT_TRANSPARENCY:
case SID_ATTR_SOFTEDGE_RADIUS:
case SID_ATTR_TEXTCOLUMNS_NUMBER:
case SID_ATTR_TEXTCOLUMNS_SPACING:

View file

@ -440,6 +440,9 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
case SID_ATTR_GLOW_COLOR:
case SID_ATTR_GLOW_RADIUS:
case SID_ATTR_GLOW_TRANSPARENCY:
case SID_ATTR_GLOW_TEXT_COLOR:
case SID_ATTR_GLOW_TEXT_RADIUS:
case SID_ATTR_GLOW_TEXT_TRANSPARENCY:
case SID_ATTR_SOFTEDGE_RADIUS:
case SID_SET_SUB_SCRIPT:
case SID_SET_SUPER_SCRIPT:

View file

@ -1308,6 +1308,7 @@ gb_emscripten_fs_image_files += \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/selectionmenu.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/sidebararea.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/sidebareffect.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/sidebartexteffect.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/sidebarempty.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/sidebarfontwork.ui \
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/svx/ui/sidebargallery.ui \

View file

@ -235,6 +235,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/area/AreaPropertyPanelBase \
svx/source/sidebar/area/AreaTransparencyGradientPopup \
svx/source/sidebar/effect/EffectPropertyPanel \
svx/source/sidebar/effect/TextEffectPropertyPanel \
svx/source/sidebar/fontwork/FontworkPropertyPanel \
svx/source/sidebar/shadow/ShadowPropertyPanel \
svx/source/sidebar/graphic/GraphicPropertyPanel \

View file

@ -123,6 +123,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/sidebararea \
svx/uiconfig/ui/sidebarempty \
svx/uiconfig/ui/sidebareffect \
svx/uiconfig/ui/sidebartexteffect \
svx/uiconfig/ui/sidebarfontwork \
svx/uiconfig/ui/sidebarshadow \
svx/uiconfig/ui/sidebargallery \

View file

@ -22,6 +22,7 @@
#include <drawinglayer/attribute/sdrshadowattribute.hxx>
#include <sdr/attribute/sdrtextattribute.hxx>
#include <drawinglayer/attribute/sdrglowattribute.hxx>
#include <drawinglayer/attribute/sdrglowtextattribute.hxx>
namespace drawinglayer::attribute
@ -35,6 +36,9 @@ namespace drawinglayer::attribute
// glow effect
SdrGlowAttribute maGlow;
// glow text effect
SdrGlowTextAttribute maGlowText;
// soft edge
sal_Int32 mnSoftEdgeRadius = 0;
@ -43,6 +47,7 @@ namespace drawinglayer::attribute
SdrShadowAttribute aShadow,
SdrTextAttribute aTextAttribute,
SdrGlowAttribute aGlow,
SdrGlowTextAttribute aGlowText,
sal_Int32 nSoftEdgeRadius);
SdrEffectsTextAttribute();
SdrEffectsTextAttribute(const SdrEffectsTextAttribute& rCandidate);
@ -58,6 +63,7 @@ namespace drawinglayer::attribute
const SdrShadowAttribute& getShadow() const { return maShadow; }
const SdrTextAttribute& getText() const { return maTextAttribute; }
const SdrGlowAttribute& getGlow() const { return maGlow; }
const SdrGlowTextAttribute& getGlowText() const { return maGlowText; }
sal_Int32 getSoftEdgeRadius() const { return mnSoftEdgeRadius; }
};

View file

@ -21,6 +21,7 @@
#include <sdr/attribute/sdreffectstextattribute.hxx>
#include <drawinglayer/attribute/sdrglowattribute.hxx>
#include <drawinglayer/attribute/sdrglowtextattribute.hxx>
#include <drawinglayer/attribute/sdrlineattribute.hxx>
#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
@ -40,6 +41,7 @@ namespace drawinglayer::attribute
const SdrShadowAttribute& rShadow,
const SdrTextAttribute& rTextAttribute,
const SdrGlowAttribute& rGlow,
const SdrGlowTextAttribute& rGlowText,
sal_Int32 nSoftEdgeRadius);
SdrLineEffectsTextAttribute();
SdrLineEffectsTextAttribute(const SdrLineEffectsTextAttribute& rCandidate);

View file

@ -41,6 +41,7 @@ namespace drawinglayer::attribute
FillGradientAttribute aFillFloatTransGradient,
const SdrTextAttribute& rTextAttribute,
const SdrGlowAttribute& rGlow,
const SdrGlowTextAttribute& rGlowText,
sal_Int32 nSoftEdgeRadius);
SdrLineFillEffectsTextAttribute();
SdrLineFillEffectsTextAttribute(const SdrLineFillEffectsTextAttribute& rCandidate);

View file

@ -26,12 +26,14 @@
// predefines
class SfxItemSet;
class SdrText;
class SvxFontHeightItem;
namespace drawinglayer::attribute {
class SdrLineAttribute;
class SdrLineStartEndAttribute;
class SdrShadowAttribute;
class SdrGlowAttribute;
class SdrGlowTextAttribute;
class SdrFillAttribute;
class SdrTextAttribute;
class FillGradientAttribute;

View file

@ -21,6 +21,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/attribute/sdrglowattribute.hxx>
#include <drawinglayer/attribute/sdrglowtextattribute.hxx>
#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
#include <svx/svxdllapi.h>
@ -78,6 +79,10 @@ namespace drawinglayer::primitive2d
Primitive2DContainer&& rContent,
const attribute::SdrGlowAttribute& rGlow);
Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedTextGlowPrimitive(
Primitive2DContainer&& rContent,
const attribute::SdrGlowTextAttribute& rGlow);
Primitive2DContainer SVXCORE_DLLPUBLIC createEmbeddedSoftEdgePrimitive(
Primitive2DContainer&& aContent,
sal_Int32 nRadius);

View file

@ -12698,6 +12698,57 @@ SdrPercentItem GlowTransparency SID_ATTR_GLOW_TRANSPARENCY
GroupId = SfxGroupId::Document;
]
XColorItem GlowTextColor SID_ATTR_GLOW_TEXT_COLOR
[
AutoUpdate = TRUE,
FastCall = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = FALSE,
MenuConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = SfxGroupId::Document;
]
SdrMetricItem GlowTextRadius SID_ATTR_GLOW_TEXT_RADIUS
[
AutoUpdate = TRUE,
FastCall = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = FALSE,
MenuConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = SfxGroupId::Document;
]
SdrPercentItem GlowTextTransparency SID_ATTR_GLOW_TEXT_TRANSPARENCY
[
AutoUpdate = TRUE,
FastCall = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = FALSE,
MenuConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = SfxGroupId::Document;
]
SdrMetricItem SoftEdgeRadius SID_ATTR_SOFTEDGE_RADIUS
[

View file

@ -28,10 +28,12 @@ namespace drawinglayer::attribute
SdrShadowAttribute aShadow,
SdrTextAttribute aTextAttribute,
SdrGlowAttribute aGlow,
SdrGlowTextAttribute aGlowText,
sal_Int32 nSoftEdgeRadius)
: maShadow(std::move(aShadow)),
maTextAttribute(std::move(aTextAttribute)),
maGlow(std::move(aGlow)),
maGlowText(std::move(aGlowText)),
mnSoftEdgeRadius(nSoftEdgeRadius)
{
}
@ -44,6 +46,7 @@ namespace drawinglayer::attribute
: maShadow(rCandidate.getShadow()),
maTextAttribute(rCandidate.getText()),
maGlow(rCandidate.maGlow),
maGlowText(rCandidate.maGlowText),
mnSoftEdgeRadius(rCandidate.mnSoftEdgeRadius)
{
}
@ -53,6 +56,7 @@ namespace drawinglayer::attribute
maShadow = rCandidate.getShadow();
maTextAttribute = rCandidate.getText();
maGlow = rCandidate.maGlow;
maGlowText = rCandidate.maGlowText;
mnSoftEdgeRadius = rCandidate.mnSoftEdgeRadius;
return *this;
@ -61,7 +65,8 @@ namespace drawinglayer::attribute
bool SdrEffectsTextAttribute::isDefault() const
{
return (getShadow().isDefault()
&& getText().isDefault() && maGlow.isDefault() && getSoftEdgeRadius() == 0);
&& getText().isDefault() && maGlow.isDefault()
&& maGlowText.isDefault() && getSoftEdgeRadius() == 0);
}
bool SdrEffectsTextAttribute::operator==(const SdrEffectsTextAttribute& rCandidate) const
@ -69,6 +74,7 @@ namespace drawinglayer::attribute
return (getShadow() == rCandidate.getShadow()
&& getText() == rCandidate.getText()
&& getGlow() == rCandidate.getGlow()
&& getGlowText() == rCandidate.getGlowText()
&& getSoftEdgeRadius() == rCandidate.getSoftEdgeRadius());
}

View file

@ -30,8 +30,9 @@ namespace drawinglayer::attribute
const SdrShadowAttribute& rShadow,
const SdrTextAttribute& rTextAttribute,
const SdrGlowAttribute& rGlow,
const SdrGlowTextAttribute& rGlowText,
sal_Int32 nSoftEdgeRadius)
: SdrEffectsTextAttribute(rShadow, rTextAttribute, rGlow, nSoftEdgeRadius),
: SdrEffectsTextAttribute(rShadow, rTextAttribute, rGlow, rGlowText, nSoftEdgeRadius),
maLine(std::move(aLine)),
maLineStartEnd(std::move(aLineStartEnd))
{

View file

@ -32,8 +32,9 @@ namespace drawinglayer::attribute
FillGradientAttribute aFillFloatTransGradient,
const SdrTextAttribute& rTextAttribute,
const SdrGlowAttribute& rGlow,
const SdrGlowTextAttribute& rGlowText,
sal_Int32 nSoftEdgeRadius)
: SdrLineEffectsTextAttribute(rLine, rLineStartEnd, rShadow, rTextAttribute, rGlow, nSoftEdgeRadius),
: SdrLineEffectsTextAttribute(rLine, rLineStartEnd, rShadow, rTextAttribute, rGlow, rGlowText, nSoftEdgeRadius),
maFill(std::move(aFill)),
maFillFloatTransGradient(std::move(aFillFloatTransGradient))
{

View file

@ -72,6 +72,9 @@
#include <svx/svdmodel.hxx>
#include <svx/xflbmsli.hxx>
#include <editeng/editstat.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/editobj.hxx>
#include <osl/diagnose.h>
#include <drawinglayer/attribute/fillhatchattribute.hxx>
#include <drawinglayer/attribute/fillgradientattribute.hxx>
@ -80,12 +83,15 @@
#include <sdr/attribute/sdrformtextattribute.hxx>
#include <sdr/attribute/sdrlinefilleffectstextattribute.hxx>
#include <drawinglayer/attribute/sdrglowattribute.hxx>
#include <drawinglayer/attribute/sdrglowtextattribute.hxx>
#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
#include <sdr/attribute/sdrfilltextattribute.hxx>
#include <com/sun/star/drawing/LineCap.hpp>
#include <math.h>
using namespace com::sun::star;
namespace drawinglayer
@ -187,9 +193,12 @@ namespace drawinglayer
attribute::SdrGlowAttribute createNewSdrGlowAttribute(const SfxItemSet& rSet)
{
sal_Int32 nRadius = rSet.Get(SDRATTR_GLOW_RADIUS).GetValue();
if (!nRadius)
return attribute::SdrGlowAttribute();
Color aColor(rSet.Get(SDRATTR_GLOW_COLOR).GetColorValue());
sal_uInt16 nTransparency(rSet.Get(SDRATTR_GLOW_TRANSPARENCY).GetValue());
if (nTransparency)
aColor.SetAlpha(255 - std::round(nTransparency / 100.0 * 255.0));
@ -198,6 +207,55 @@ namespace drawinglayer
return glowAttr;
}
attribute::SdrGlowTextAttribute createNewSdrGlowTextAttribute(const SfxItemSet& rSet, const SdrTextObj& rTextObj)
{
sal_Int32 nTextRadius = rSet.Get(SDRATTR_GLOW_TEXT_RADIUS).GetValue();
if (!nTextRadius)
return attribute::SdrGlowTextAttribute();
Color aTextColor(rSet.Get(SDRATTR_GLOW_TEXT_COLOR).GetColorValue());
sal_uInt16 nTextTransparency(rSet.Get(SDRATTR_GLOW_TEXT_TRANSPARENCY).GetValue());
if (nTextTransparency)
aTextColor.SetAlpha(255 - std::round(nTextTransparency / 100.0 * 255.0));
// calculate rendering text glow radius from biggest Char size for the full text in shape
double nRadius = 0.0;
const SvxFontHeightItem& rItem = *rSet.GetItemIfSet(EE_CHAR_FONTHEIGHT);
sal_uInt32 nFontSize = rItem.GetHeight();
if (rTextObj.GetOutlinerParaObject())
{
const EditTextObject& aEdit = rTextObj.GetOutlinerParaObject()->GetTextObject();
for (sal_Int32 i = 0; i < aEdit.GetParagraphCount(); i++)
{
std::vector<EECharAttrib> aAttribs;
aEdit.GetCharAttribs(i, aAttribs);
for (const auto& attrib : aAttribs)
{
if (const SvxFontHeightItem* pFontHeight = dynamic_cast<const SvxFontHeightItem*>(attrib.pAttr))
{
if (nFontSize < pFontHeight->GetHeight())
nFontSize = pFontHeight->GetHeight();
}
}
}
}
if (nFontSize)
{
// Rendering_glow_size = Original_glow_size / (154.39 * FontSize ^ -0,621)
// This is an approximate calculation similar to MSO text glow size which is
// depending on font size
nRadius = nTextRadius / (154.39 * pow(nFontSize, -0.621));
nTextRadius = std::round(nRadius);
}
attribute::SdrGlowTextAttribute glowTextAttr{ nTextRadius, aTextColor };
return glowTextAttr;
}
sal_Int32 getSoftEdgeRadius(const SfxItemSet& rSet)
{
return rSet.Get(SDRATTR_SOFTEDGE_RADIUS).GetValue();
@ -749,10 +807,11 @@ namespace drawinglayer::primitive2d
// try shadow
const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
const attribute::SdrGlowAttribute aGlow(createNewSdrGlowAttribute(rSet));
const attribute::SdrGlowTextAttribute aGlowText(createNewSdrGlowTextAttribute(rSet, pText->GetObject()));
const sal_Int32 nSoftEdgeRadius(getSoftEdgeRadius(rSet));
return attribute::SdrEffectsTextAttribute(aShadow, std::move(aText),
aGlow, nSoftEdgeRadius);
aGlow, aGlowText, nSoftEdgeRadius);
}
attribute::SdrLineEffectsTextAttribute createNewSdrLineEffectsTextAttribute(
@ -796,13 +855,15 @@ namespace drawinglayer::primitive2d
// try shadow
attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
attribute::SdrGlowAttribute aGlow = createNewSdrGlowAttribute(rSet);
attribute::SdrGlowTextAttribute aGlowText = createNewSdrGlowTextAttribute(rSet, pText->GetObject());
const sal_Int32 nSoftEdgeRadius(getSoftEdgeRadius(rSet));
return attribute::SdrLineEffectsTextAttribute(std::move(aLine),
std::move(aLineStartEnd),
std::move(aShadow),
std::move(aText),
std::move(aGlow), nSoftEdgeRadius);
std::move(aGlow),
std::move(aGlowText), nSoftEdgeRadius);
}
return attribute::SdrLineEffectsTextAttribute();
@ -868,11 +929,14 @@ namespace drawinglayer::primitive2d
// glow
const attribute::SdrGlowAttribute aGlow = createNewSdrGlowAttribute(rSet);
// text glow
const attribute::SdrGlowTextAttribute aGlowText = createNewSdrGlowTextAttribute(rSet, pText->GetObject());
const sal_Int32 nSoftEdgeRadius(getSoftEdgeRadius(rSet));
return attribute::SdrLineFillEffectsTextAttribute(aLine, std::move(aFill), aLineStartEnd,
aShadow, std::move(aFillFloatTransGradient),
aText, aGlow, nSoftEdgeRadius);
aText, aGlow, aGlowText, nSoftEdgeRadius);
}
return attribute::SdrLineFillEffectsTextAttribute();

View file

@ -44,12 +44,20 @@ namespace drawinglayer::primitive2d
getSdrSTAttribute().getSoftEdgeRadius());
}
// tdf#132199: put glow before shadow, to have shadow of the glow, not the opposite
if (!aRetval.empty() && !getSdrSTAttribute().getGlow().isDefault())
{
// glow
aRetval = createEmbeddedGlowPrimitive(std::move(aRetval), getSdrSTAttribute().getGlow());
}
// add text
if(!getSdrSTAttribute().getText().isDefault())
{
const basegfx::B2DPolygon& aUnitOutline(basegfx::utils::createUnitPolygon());
aRetval.push_back(
Primitive2DContainer aTempContentText;
aTempContentText.push_back(
createTextPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTextBox(),
@ -57,13 +65,14 @@ namespace drawinglayer::primitive2d
attribute::SdrLineAttribute(),
false,
getWordWrap()));
}
// tdf#132199: put glow before shadow, to have shadow of the glow, not the opposite
if (!aRetval.empty() && !getSdrSTAttribute().getGlow().isDefault())
{
// glow
aRetval = createEmbeddedGlowPrimitive(std::move(aRetval), getSdrSTAttribute().getGlow());
// put text glow before, shape glow and shadow
if (!aTempContentText.empty() && !getSdrSTAttribute().getGlowText().isDefault())
{
// add text glow
aTempContentText = createEmbeddedTextGlowPrimitive(std::move(aTempContentText), getSdrSTAttribute().getGlowText());
}
aRetval.append(std::move(aTempContentText));
}
// add shadow

View file

@ -52,6 +52,7 @@
#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
#include <drawinglayer/attribute/sdrshadowattribute.hxx>
#include <drawinglayer/attribute/sdrglowattribute.hxx>
#include <drawinglayer/attribute/sdrglowtextattribute.hxx>
#include <docmodel/theme/FormatScheme.hxx>
#include <osl/diagnose.h>
@ -931,6 +932,20 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
return aRetval;
}
Primitive2DContainer createEmbeddedTextGlowPrimitive(
Primitive2DContainer&& rContent,
const attribute::SdrGlowTextAttribute& rGlow)
{
if (rContent.empty())
return std::move(rContent);
Primitive2DContainer aRetval(2);
aRetval[0] = new GlowPrimitive2D(rGlow.getTextColor(), rGlow.getTextRadius(), Primitive2DContainer(rContent));
aRetval[1] = new GroupPrimitive2D(Primitive2DContainer(std::move(rContent)));
return aRetval;
}
Primitive2DContainer createEmbeddedSoftEdgePrimitive(Primitive2DContainer&& aContent,
sal_Int32 nRadius)
{

View file

@ -92,7 +92,8 @@ namespace drawinglayer::primitive2d
// add text
if(!getSdrLFSTAttribute().getText().isDefault())
{
aRetval.push_back(
Primitive2DContainer aTempContentText;
aTempContentText.push_back(
createTextPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
@ -100,6 +101,14 @@ namespace drawinglayer::primitive2d
getSdrLFSTAttribute().getLine(),
false,
false));
// put text glow before, shape glow and shadow
if (!aTempContentText.empty() && !getSdrLFSTAttribute().getGlowText().isDefault())
{
// add text glow
aTempContentText = createEmbeddedTextGlowPrimitive(std::move(aTempContentText), getSdrLFSTAttribute().getGlowText());
}
aRetval.append(std::move(aTempContentText));
}
// add shadow

View file

@ -71,7 +71,7 @@ namespace sdr::properties
// Graphic attributes, 3D properties, CustomShape
// properties:
SDRATTR_GRAF_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
SDRATTR_GLOW_FIRST, SDRATTR_SOFTEDGE_LAST,
SDRATTR_GLOW_FIRST, SDRATTR_GLOW_TEXT_LAST,
SDRATTR_TEXTCOLUMNS_FIRST, SDRATTR_TEXTCOLUMNS_LAST,
SDRATTR_WRITINGMODE2, SDRATTR_WRITINGMODE2,
// Range from SdrTextObj:

View file

@ -54,6 +54,7 @@ namespace sdr::properties
svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
SDRATTR_GLOW_TEXT_FIRST, SDRATTR_GLOW_TEXT_LAST,
SDRATTR_TEXTCOLUMNS_FIRST, SDRATTR_TEXTCOLUMNS_LAST,
// range from SdrTextObj

View file

@ -27,6 +27,7 @@
#include "fontwork/FontworkPropertyPanel.hxx"
#include "shadow/ShadowPropertyPanel.hxx"
#include "effect/EffectPropertyPanel.hxx"
#include "effect/TextEffectPropertyPanel.hxx"
#include "graphic/GraphicPropertyPanel.hxx"
#include "line/LinePropertyPanel.hxx"
#include "possize/PosSizePropertyPanel.hxx"
@ -153,6 +154,10 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
{
xControl = EffectPropertyPanel::Create(pParent, pBindings);
}
else if (rsResourceURL.endsWith("/TextEffectPropertyPanel"))
{
xControl = TextEffectPropertyPanel::Create(pParent, pBindings);
}
else if (rsResourceURL.endsWith("/GraphicPropertyPanel"))
{
xControl = GraphicPropertyPanel::Create(pParent, pBindings);

View file

@ -0,0 +1,153 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/config.h>
#include "TextEffectPropertyPanel.hxx"
#include <sfx2/dispatch.hxx>
#include <svx/colorbox.hxx>
#include <svx/sdmetitm.hxx>
#include <svx/sdprcitm.hxx>
#include <svx/svddef.hxx>
#include <svx/svxids.hrc>
#include <svx/xcolit.hxx>
#include <svl/itemset.hxx>
namespace svx::sidebar
{
TextEffectPropertyPanel::TextEffectPropertyPanel(weld::Widget* pParent, SfxBindings* pBindings)
: PanelLayout(pParent, u"TextEffectPropertyPanel"_ustr, u"svx/ui/sidebartexteffect.ui"_ustr)
, maTGlowColorController(SID_ATTR_GLOW_TEXT_COLOR, *pBindings, *this)
, maTGlowRadiusController(SID_ATTR_GLOW_TEXT_RADIUS, *pBindings, *this)
, maTGlowTransparencyController(SID_ATTR_GLOW_TEXT_TRANSPARENCY, *pBindings, *this)
, mxFTTTransparency(m_xBuilder->weld_label(u"texttransparency"_ustr))
, mpBindings(pBindings)
, mxTGlowRadius(
m_xBuilder->weld_metric_spin_button(u"LB_GLOW_TEXT_RADIUS"_ustr, FieldUnit::POINT))
, mxLBTGlowColor(new ColorListBox(m_xBuilder->weld_menu_button(u"LB_GLOW_TEXT_COLOR"_ustr),
[this] { return GetFrameWeld(); }))
, mxTGlowTransparency(m_xBuilder->weld_metric_spin_button(u"LB_GLOW_TEXT_TRANSPARENCY"_ustr,
FieldUnit::PERCENT))
, mxFTTColor(m_xBuilder->weld_label(u"glowtextcolorlabel"_ustr))
{
Initialize();
}
TextEffectPropertyPanel::~TextEffectPropertyPanel()
{
mxTGlowRadius.reset();
mxLBTGlowColor.reset();
mxTGlowTransparency.reset();
mxFTTColor.reset();
mxFTTTransparency.reset();
maTGlowColorController.dispose();
maTGlowRadiusController.dispose();
maTGlowTransparencyController.dispose();
}
void TextEffectPropertyPanel::Initialize()
{
mxTGlowRadius->connect_value_changed(LINK(this, TextEffectPropertyPanel, ModifyTGlowRadiusHdl));
mxLBTGlowColor->SetSelectHdl(LINK(this, TextEffectPropertyPanel, ModifyTGlowColorHdl));
mxTGlowTransparency->connect_value_changed(
LINK(this, TextEffectPropertyPanel, ModifyTGlowTransparencyHdl));
}
IMPL_LINK_NOARG(TextEffectPropertyPanel, ModifyTGlowRadiusHdl, weld::MetricSpinButton&, void)
{
SdrMetricItem aItem(SDRATTR_GLOW_TEXT_RADIUS, mxTGlowRadius->get_value(FieldUnit::MM_100TH));
mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_GLOW_TEXT_RADIUS, SfxCallMode::RECORD,
{ &aItem });
}
IMPL_LINK_NOARG(TextEffectPropertyPanel, ModifyTGlowColorHdl, ColorListBox&, void)
{
XColorItem aItem(SDRATTR_GLOW_TEXT_COLOR, mxLBTGlowColor->GetSelectEntryColor());
mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_GLOW_TEXT_COLOR, SfxCallMode::RECORD,
{ &aItem });
}
IMPL_LINK_NOARG(TextEffectPropertyPanel, ModifyTGlowTransparencyHdl, weld::MetricSpinButton&, void)
{
SdrPercentItem aItem(SDRATTR_GLOW_TEXT_TRANSPARENCY,
mxTGlowTransparency->get_value(FieldUnit::PERCENT));
mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_GLOW_TEXT_TRANSPARENCY, SfxCallMode::RECORD,
{ &aItem });
}
void TextEffectPropertyPanel::UpdateControls()
{
const bool bTEnabled = mxTGlowRadius->get_value(FieldUnit::MM_100TH) != 0;
mxLBTGlowColor->set_sensitive(bTEnabled);
mxTGlowTransparency->set_sensitive(bTEnabled);
mxFTTColor->set_sensitive(bTEnabled);
mxFTTTransparency->set_sensitive(bTEnabled);
}
void TextEffectPropertyPanel::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState)
{
switch (nSID)
{
case SID_ATTR_GLOW_TEXT_COLOR:
{
if (eState >= SfxItemState::DEFAULT)
{
const XColorItem* pColorItem = dynamic_cast<const XColorItem*>(pState);
if (pColorItem)
{
mxLBTGlowColor->SelectEntry(pColorItem->GetColorValue());
}
}
}
break;
case SID_ATTR_GLOW_TEXT_RADIUS:
{
if (eState >= SfxItemState::DEFAULT)
{
const SdrMetricItem* pRadiusItem = dynamic_cast<const SdrMetricItem*>(pState);
if (pRadiusItem)
{
mxTGlowRadius->set_value(pRadiusItem->GetValue(), FieldUnit::MM_100TH);
}
}
}
break;
case SID_ATTR_GLOW_TEXT_TRANSPARENCY:
{
if (eState >= SfxItemState::DEFAULT)
{
if (auto pItem = dynamic_cast<const SdrPercentItem*>(pState))
{
mxTGlowTransparency->set_value(pItem->GetValue(), FieldUnit::PERCENT);
}
}
}
break;
}
UpdateControls();
}
std::unique_ptr<PanelLayout> TextEffectPropertyPanel::Create(weld::Widget* pParent,
SfxBindings* pBindings)
{
if (pParent == nullptr)
throw css::lang::IllegalArgumentException(
u"no parent Window given to TextEffectPropertyPanel::Create"_ustr, nullptr, 0);
if (pBindings == nullptr)
throw css::lang::IllegalArgumentException(
u"no SfxBindings given to TextEffectPropertyPanel::Create"_ustr, nullptr, 2);
return std::make_unique<TextEffectPropertyPanel>(pParent, pBindings);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -0,0 +1,58 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_EFFECT_TEXTEFFECTPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_EFFECT_TEXTEFFECTPROPERTYPANEL_HXX
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
class ColorListBox;
namespace svx::sidebar
{
class TextEffectPropertyPanel : public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
TextEffectPropertyPanel(weld::Widget* pParent, SfxBindings* pBindings);
virtual ~TextEffectPropertyPanel() override;
static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent, SfxBindings* pBindings);
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState,
const SfxPoolItem* pState) override;
virtual void GetControlState(const sal_uInt16 /*nSId*/,
boost::property_tree::ptree& /*rState*/) override{};
private:
sfx2::sidebar::ControllerItem maTGlowColorController;
sfx2::sidebar::ControllerItem maTGlowRadiusController;
sfx2::sidebar::ControllerItem maTGlowTransparencyController;
std::unique_ptr<weld::Label> mxFTTTransparency;
SfxBindings* mpBindings;
std::unique_ptr<weld::MetricSpinButton> mxTGlowRadius;
std::unique_ptr<ColorListBox> mxLBTGlowColor;
std::unique_ptr<weld::MetricSpinButton> mxTGlowTransparency;
std::unique_ptr<weld::Label> mxFTTColor;
void Initialize();
void UpdateControls();
DECL_LINK(ModifyTGlowColorHdl, ColorListBox&, void);
DECL_LINK(ModifyTGlowRadiusHdl, weld::MetricSpinButton&, void);
DECL_LINK(ModifyTGlowTransparencyHdl, weld::MetricSpinButton&, void);
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -429,6 +429,10 @@ static ItemInfoPackage& getItemInfoPackageSdr()
{ SDRATTR_SOFTEDGE_RADIUS, new SdrMetricItem(SDRATTR_SOFTEDGE_RADIUS, 0), SID_ATTR_SOFTEDGE_RADIUS, SFX_ITEMINFOFLAG_NONE },
{ SDRATTR_GLOW_TEXT_RADIUS, new SdrMetricItem(SDRATTR_GLOW_TEXT_RADIUS, 0), SID_ATTR_GLOW_TEXT_RADIUS, SFX_ITEMINFOFLAG_NONE },
{ SDRATTR_GLOW_TEXT_COLOR, new XColorItem(SDRATTR_GLOW_TEXT_COLOR, COL_BLACK), SID_ATTR_GLOW_TEXT_COLOR, SFX_ITEMINFOFLAG_NONE },
{ SDRATTR_GLOW_TEXT_TRANSPARENCY, new SdrPercentItem(SDRATTR_GLOW_TEXT_TRANSPARENCY, 0), SID_ATTR_GLOW_TEXT_TRANSPARENCY, SFX_ITEMINFOFLAG_NONE },
{ SDRATTR_TEXTCOLUMNS_NUMBER, new SfxInt16Item(SDRATTR_TEXTCOLUMNS_NUMBER, 1), 0, SFX_ITEMINFOFLAG_NONE },
{ SDRATTR_TEXTCOLUMNS_SPACING, new SdrMetricItem(SDRATTR_TEXTCOLUMNS_SPACING, 0), 0, SFX_ITEMINFOFLAG_NONE },
@ -603,6 +607,10 @@ 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_GLOW_TEXT_RADIUS : pResId = SIP_SA_GLOW_TEXT_RADIUS; break;
case SDRATTR_GLOW_TEXT_COLOR : pResId = SIP_SA_GLOW_TEXT_COLOR; break;
case SDRATTR_GLOW_TEXT_TRANSPARENCY : pResId = SIP_SA_GLOW_TEXT_TRANSPARENCY; break;
case SDRATTR_SOFTEDGE_RADIUS : pResId = SIP_SA_SOFTEDGE_RADIUS; break;
case SDRATTR_CAPTIONTYPE : pResId = SIP_SA_CAPTIONTYPE;break;

View file

@ -2900,7 +2900,8 @@ static const WhichRangesContainer& GetFormatRangeImpl(bool bTextOnly, bool withP
SDRATTR_MISC_LAST, // table cell formats
SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST, SDRATTR_TABLE_FIRST, SDRATTR_TABLE_LAST,
SDRATTR_GLOW_FIRST, SDRATTR_GLOW_LAST, SDRATTR_SOFTEDGE_FIRST,
SDRATTR_SOFTEDGE_LAST, EE_PARA_START, EE_PARA_END, EE_CHAR_START, EE_CHAR_END>);
SDRATTR_SOFTEDGE_LAST, SDRATTR_GLOW_TEXT_FIRST, SDRATTR_GLOW_TEXT_LAST,
EE_PARA_START, EE_PARA_END, EE_CHAR_START, EE_CHAR_END>);
static const WhichRangesContainer gTextOnly(
svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, EE_CHAR_START, EE_CHAR_END>);

View file

@ -65,6 +65,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxShapePropertyMap()
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
// #FontWork#
@ -89,6 +90,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxTextShapePropertyMap()
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
// #FontWork#
@ -114,6 +116,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxConnectorPropertyMap()
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
// #FontWork#
@ -139,6 +142,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxDimensioningPropertyMa
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
// #FontWork#
@ -164,6 +168,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxCirclePropertyMap()
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
// #FontWork#
@ -191,6 +196,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxPolyPolygonPropertyMap
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
// #FontWork#
@ -221,6 +227,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxGraphicObjectPropertyM
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
// #FontWork#
@ -366,6 +373,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxAllPropertyMap()
{
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
LINE_PROPERTIES
LINE_PROPERTIES_START_END
@ -428,6 +436,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxOle2PropertyMap()
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
FONTWORK_PROPERTIES
@ -682,6 +691,7 @@ static std::span<SfxItemPropertyMapEntry const> ImplGetSvxCustomShapePropertyMap
LINKTARGET_PROPERTIES
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
TEXT_PROPERTIES
{u"UserDefinedAttributes"_ustr, SDRATTR_XMLATTRIBUTES, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
@ -764,6 +774,7 @@ static std::span<comphelper::PropertyMapEntry const> ImplGetSvxDrawingDefaultsPr
{
GLOW_PROPERTIES
SOFTEDGE_PROPERTIES
GLOW_TEXT_PROPERTIES
SHADOW_PROPERTIES
LINE_PROPERTIES_DEFAULTS
FILL_PROPERTIES_BMP

View file

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface domain="svx">
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">150</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<!-- n-columns=1 n-rows=1 -->
<object class="GtkGrid" id="TextEffectPropertyPanel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<!-- n-columns=2 n-rows=4 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="border-width">6</property>
<property name="row-spacing">3</property>
<property name="column-spacing">6</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" context="sidebartextglow|glow">Text Glow</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="radiustextglow">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="sidebartextglow|radius">Radius:</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">LB_GLOW_TEXT_RADIUS</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="glowtextcolorlabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="sidebartextglow|color">Color:</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">LB_GLOW_TEXT_COLOR</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="texttransparency">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="sidebartextglow|transparency">Transparency:</property>
<property name="use-underline">True</property>
<property name="mnemonic-widget">LB_GLOW_TEXT_TRANSPARENCY</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="LB_GLOW_TEXT_RADIUS">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="truncate-multiline">True</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="LB_GLOW_TEXT_COLOR">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="valign">center</property>
<property name="xalign">0</property>
<property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="LB_GLOW_TEXT_TRANSPARENCY">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="truncate-multiline">True</property>
<property name="adjustment">adjustment2</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
</object>
</interface>

View file

@ -189,6 +189,27 @@ interface TextDraw : TextDrawBase
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GLOW_TEXT_COLOR
[
ExecMethod = ExecDrawAttrArgs ;
StateMethod = GetDrawAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GLOW_TEXT_RADIUS
[
ExecMethod = ExecDrawAttrArgs ;
StateMethod = GetDrawAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_GLOW_TEXT_TRANSPARENCY
[
ExecMethod = ExecDrawAttrArgs ;
StateMethod = GetDrawAttrState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_SOFTEDGE_RADIUS
[
ExecMethod = ExecDrawAttrArgs ;

View file

@ -381,6 +381,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
|| rUIFile == u"svx/ui/mediaplayback.ui"
|| rUIFile == u"svx/ui/sidebararea.ui"
|| rUIFile == u"svx/ui/sidebareffect.ui"
|| rUIFile == u"svx/ui/sidebartexteffect.ui"
|| rUIFile == u"svx/ui/sidebarempty.ui"
|| rUIFile == u"svx/ui/sidebarfontwork.ui"
|| rUIFile == u"svx/ui/sidebargallery.ui"

View file

@ -318,6 +318,9 @@ inline constexpr OUString PROP_GapWidth = u"GapWidth"_ustr;
inline constexpr OUString PROP_GlowEffectColor = u"GlowEffectColor"_ustr;
inline constexpr OUString PROP_GlowEffectRadius = u"GlowEffectRadius"_ustr;
inline constexpr OUString PROP_GlowEffectTransparency = u"GlowEffectTransparency"_ustr;
inline constexpr OUString PROP_GlowTextEffectColor = u"GlowTextEffectColor"_ustr;
inline constexpr OUString PROP_GlowTextEffectRadius = u"GlowTextEffectRadius"_ustr;
inline constexpr OUString PROP_GlowTextEffectTransparency = u"GlowTextEffectTransparency"_ustr;
inline constexpr OUString PROP_GraphicColorMode = u"GraphicColorMode"_ustr;
inline constexpr OUString PROP_GraphicCrop = u"GraphicCrop"_ustr;
inline constexpr OUString PROP_GraphicIsInverted = u"GraphicIsInverted"_ustr;

View file

@ -991,8 +991,11 @@ namespace xmloff::token {
TOKEN( "generator", XML_GENERATOR ),
TOKEN( "geq", XML_GEQ ),
TOKEN( "glow-radius", XML_GLOW_RADIUS ),
TOKEN( "glow-text-radius", XML_GLOW_TEXT_RADIUS ),
TOKEN( "glow-color", XML_GLOW_COLOR ),
TOKEN( "glow-text-color", XML_GLOW_TEXT_COLOR ),
TOKEN( "glow-transparency", XML_GLOW_TRANSPARENCY ),
TOKEN( "glow-text-transparency", XML_GLOW_TEXT_TRANSPARENCY ),
TOKEN( "gouraud", XML_GOURAUD ),
TOKEN( "gradient", XML_GRADIENT ),
TOKEN( "angle", XML_GRADIENT_ANGLE ),

View file

@ -174,6 +174,11 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
// soft edge attributes
GMAPV( PROP_SoftEdgeRadius, XML_NAMESPACE_LO_EXT, XML_SOFTEDGE_RADIUS, XML_TYPE_MEASURE , 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED),
// glow text attributes
GMAPV(PROP_GlowTextEffectRadius, XML_NAMESPACE_LO_EXT, XML_GLOW_TEXT_RADIUS, XML_TYPE_MEASURE , 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED),
GMAPV(PROP_GlowTextEffectColor, XML_NAMESPACE_LO_EXT, XML_GLOW_TEXT_COLOR, XML_TYPE_COLOR , 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED),
GMAPV(PROP_GlowTextEffectTransparency, XML_NAMESPACE_LO_EXT, XML_GLOW_TEXT_TRANSPARENCY, XML_TYPE_PERCENT16, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED),
// graphic attributes
GMAP( PROP_GraphicColorMode, XML_NAMESPACE_DRAW, XML_COLOR_MODE, XML_TYPE_COLOR_MODE, 0 ), // exists in SW, too, with same property name
GMAP( PROP_AdjustLuminance, XML_NAMESPACE_DRAW, XML_LUMINANCE, XML_TYPE_PERCENT16, 0 ), // signed? exists in SW, too, with same property name

View file

@ -896,8 +896,11 @@ gcd
generator
geq
glow-radius
glow-text-radius
glow-color
glow-text-color
glow-transparency
glow-text-transparency
gouraud
gradient
angle