[Libreoffice-commits] .: 4 commits - comphelper/inc comphelper/source editeng/inc editeng/source offapi/com sw/inc sw/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 25 02:15:35 PST 2013


 comphelper/inc/comphelper/TypeGeneration.hxx     |    2 
 comphelper/source/property/TypeGeneration.cxx    |    4 +
 editeng/inc/editeng/brshitem.hxx                 |    6 +
 editeng/inc/editeng/memberids.hrc                |    2 
 editeng/source/items/frmitems.cxx                |   72 ++++++++++++++++++++++-
 offapi/com/sun/star/text/BaseFrameProperties.idl |   16 +++++
 sw/inc/unoprnms.hxx                              |    4 -
 sw/source/core/layout/paintfrm.cxx               |    6 +
 sw/source/core/unocore/unoframe.cxx              |   10 ++-
 sw/source/core/unocore/unomap.cxx                |    4 +
 sw/source/core/unocore/unoprnms.cxx              |    2 
 vcl/source/gdi/gradient.cxx                      |   18 ++---
 12 files changed, 131 insertions(+), 15 deletions(-)

New commits:
commit 2448539161d105c2b629ba090c732647d2e99c6d
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jan 25 10:35:52 2013 +0100

    Gradient::operator==: amazing how nobody noticed this for 13 years
    
    Two Gradient instances equal if all of their members equal, not any.
    
    Change-Id: I313c1b145005f295f47b27e7af7ec96d5ee6168f

diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx
index ea8a6bc..72d5ffc 100644
--- a/vcl/source/gdi/gradient.cxx
+++ b/vcl/source/gdi/gradient.cxx
@@ -339,15 +339,15 @@ sal_Bool Gradient::operator==( const Gradient& rGradient ) const
     if ( mpImplGradient == rGradient.mpImplGradient )
         return sal_True;
 
-    if ( (mpImplGradient->meStyle           == rGradient.mpImplGradient->meStyle)           ||
-         (mpImplGradient->mnAngle           == rGradient.mpImplGradient->mnAngle)           ||
-         (mpImplGradient->mnBorder          == rGradient.mpImplGradient->mnBorder)          ||
-         (mpImplGradient->mnOfsX            == rGradient.mpImplGradient->mnOfsX)            ||
-         (mpImplGradient->mnOfsY            == rGradient.mpImplGradient->mnOfsY)            ||
-         (mpImplGradient->mnStepCount       == rGradient.mpImplGradient->mnStepCount)       ||
-         (mpImplGradient->mnIntensityStart  == rGradient.mpImplGradient->mnIntensityStart)  ||
-         (mpImplGradient->mnIntensityEnd    == rGradient.mpImplGradient->mnIntensityEnd)    ||
-         (mpImplGradient->maStartColor      == rGradient.mpImplGradient->maStartColor)      ||
+    if ( (mpImplGradient->meStyle           == rGradient.mpImplGradient->meStyle)           &&
+         (mpImplGradient->mnAngle           == rGradient.mpImplGradient->mnAngle)           &&
+         (mpImplGradient->mnBorder          == rGradient.mpImplGradient->mnBorder)          &&
+         (mpImplGradient->mnOfsX            == rGradient.mpImplGradient->mnOfsX)            &&
+         (mpImplGradient->mnOfsY            == rGradient.mpImplGradient->mnOfsY)            &&
+         (mpImplGradient->mnStepCount       == rGradient.mpImplGradient->mnStepCount)       &&
+         (mpImplGradient->mnIntensityStart  == rGradient.mpImplGradient->mnIntensityStart)  &&
+         (mpImplGradient->mnIntensityEnd    == rGradient.mpImplGradient->mnIntensityEnd)    &&
+         (mpImplGradient->maStartColor      == rGradient.mpImplGradient->maStartColor)      &&
          (mpImplGradient->maEndColor        == rGradient.mpImplGradient->maEndColor) )
          return sal_True;
     else
commit 0544946effdd464e8bfcb8cc64969a6e76a36096
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Jan 24 17:54:37 2013 +0100

    SwFrm::PaintBackground: paint gradient in layout if SvxBrushItem wants it
    
    Change-Id: I72eec18ac6265fd2e0df06eb68115d1d0034be15

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 19d6889..40cf352 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2076,7 +2076,7 @@ void DrawGraphic( const SvxBrushItem *pBrush,
             /// draw poly-polygon transparent
             pOutDev->DrawTransparent( aDrawPoly, nTransparencyPercent );
         }
-        else
+        else if (!pBrush || pBrush->GetFillStyle() != drawing::FillStyle_GRADIENT)
         {
             SwRegionRects aRegion( rOut, 4 );
             if ( !bGrfIsTransparent )
@@ -2089,6 +2089,8 @@ void DrawGraphic( const SvxBrushItem *pBrush,
                 pOutDev->DrawRect( aRegion[i].SVRect() );
             }
         }
+        else
+            pOutDev->DrawGradient(rOut.SVRect(), pBrush->GetGradient());
        pOutDev ->Pop();
     }
 
@@ -7065,7 +7067,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
         if ( !rBack.GetColor().GetTransparency() ||
              rBack.GetGraphicPos() != GPOS_NONE ||
              rpCol ||
-             (bConsiderBackgroundTransparency && (rBack.GetColor() != COL_TRANSPARENT))
+             (bConsiderBackgroundTransparency && (rBack.GetColor() != COL_TRANSPARENT || rBack.GetFillStyle() == drawing::FillStyle_GRADIENT))
            )
         {
             rpBrush = &rBack;
commit 2a34dd723baac31e9ce0c639ce9244c0ced4ff06
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Jan 24 18:08:38 2013 +0100

    text::BaseFrameProperties: add FillStyle and FillGradient optional properties
    
    Change-Id: I854cc5e4da2ce87ef4a7af6e9c0cf6f208714e4c

diff --git a/comphelper/inc/comphelper/TypeGeneration.hxx b/comphelper/inc/comphelper/TypeGeneration.hxx
index 8c99fca..0ced57b 100644
--- a/comphelper/inc/comphelper/TypeGeneration.hxx
+++ b/comphelper/inc/comphelper/TypeGeneration.hxx
@@ -109,6 +109,8 @@ namespace comphelper
         CPPUTYPE_REFXGRAPHIC,       //getCppuType( Reference< graphic::XGraphic >*)0)
         CPPUTYPE_TABLEBORDERDISTANCES, //getCppuType( (table::TableBorderDistances*)0 )
         CPPUTPYE_REFEMBEDDEDOBJECT, // XEmbeddedObject::static_type
+        CPPUTYPE_FILLSTYLE,         //getCppuType( (drawing::FillStyle*)0 )
+        CPPUTYPE_GRADIENT,          //getCppuType( (awt::Gradient*)0 )
 
         CPPUTYPE_END
     };
diff --git a/comphelper/source/property/TypeGeneration.cxx b/comphelper/source/property/TypeGeneration.cxx
index 1dd04e4..6925c67 100644
--- a/comphelper/source/property/TypeGeneration.cxx
+++ b/comphelper/source/property/TypeGeneration.cxx
@@ -120,6 +120,8 @@
 #include <com/sun/star/graphic/XGraphic.hpp>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/awt/Gradient.hpp>
 
 using ::rtl::OUString;
 using namespace ::com::sun::star;
@@ -219,6 +221,8 @@ namespace comphelper
             case CPPUTYPE_TABLEBORDERDISTANCES:     pType = &::getCppuType( (table::TableBorderDistances*)0 ); break;
             case CPPUTPYE_REFEMBEDDEDOBJECT:        pType = &embed::XEmbeddedObject::static_type(); break;
             case CPPUTYPE_LINESTYLE:        pType = &::getCppuType( (drawing::LineStyle*)0 ); break;
+            case CPPUTYPE_FILLSTYLE:        pType = &::getCppuType( (drawing::FillStyle*)0 ); break;
+            case CPPUTYPE_GRADIENT:         pType = &::getCppuType( (awt::Gradient*)0 ); break;
             default:
                 OSL_FAIL( "Unknown CPPU type" );
         }
diff --git a/editeng/inc/editeng/memberids.hrc b/editeng/inc/editeng/memberids.hrc
index 2ce6c22..376c219 100644
--- a/editeng/inc/editeng/memberids.hrc
+++ b/editeng/inc/editeng/memberids.hrc
@@ -170,6 +170,8 @@
 #define MID_GRAPHIC_TRANSPARENCY 8
 #define MID_BACK_COLOR_R_G_B    9
 #define MID_BACK_COLOR_TRANSPARENCY 10
+#define MID_FILL_STYLE 11
+#define MID_FILL_GRADIENT 12
 
 //SvxFmtBreakItem
 #define MID_BREAK_BEFORE        0
diff --git a/offapi/com/sun/star/text/BaseFrameProperties.idl b/offapi/com/sun/star/text/BaseFrameProperties.idl
index e569b08..8498710 100644
--- a/offapi/com/sun/star/text/BaseFrameProperties.idl
+++ b/offapi/com/sun/star/text/BaseFrameProperties.idl
@@ -27,6 +27,8 @@
 #include <com/sun/star/awt/Size.idl>
 #include <com/sun/star/util/Color.idl>
 #include <com/sun/star/xml/UserDefinedAttributesSupplier.idl>
+#include <com/sun/star/drawing/FillStyle.idl>
+#include <com/sun/star/awt/Gradient.idl>
 
 
  module com {  module sun {  module star {  module text {
@@ -295,6 +297,20 @@ published service BaseFrameProperties
             @since OOo 3.2
         */
         [optional, property] string Description;
+        /** This enumeration selects the style the area will be filled with.
+
+            <p>Currently only set for gradients.</p>
+
+            @since LibreOffice 4.1
+        */
+        [optional, property] com::sun::star::drawing::FillStyle FillStyle;
+        /** If the property <member>FillStyle</member> is set to <const>
+            FillStyle::GRADIENT</const>, this describes the gradient used.
+
+            @since LibreOffice 4.1
+        */
+        [optional, property] com::sun::star::awt::Gradient FillGradient;
+
 };
 
 
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index b681c11..a9834b3 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -816,8 +816,10 @@ enum SwPropNameIds
 
 /* 0755 */  UNO_NAME_REPLACEMENT_GRAPHIC_URL,
 /* 0756 */  UNO_NAME_HIDDEN,
+/* 0757 */  UNO_NAME_FILL_STYLE,
+/* 0758 */  UNO_NAME_FILL_GRADIENT,
 
-/* 0757 */  SW_PROPNAME_END
+/* 0759 */  SW_PROPNAME_END
 
 // new items in this array must match SwPropNameTab aPropNameTab
 };
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 4e3d783..b289c7d 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -173,6 +173,10 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
         GetProperty(RES_BACKGROUND, MID_BACK_COLOR_R_G_B, pRGBCol );
         const ::uno::Any* pColTrans = 0;
         GetProperty(RES_BACKGROUND, MID_BACK_COLOR_TRANSPARENCY, pColTrans);
+        const ::uno::Any* pFillStyle = 0;
+        GetProperty(RES_BACKGROUND, MID_FILL_STYLE, pFillStyle);
+        const ::uno::Any* pGradient = 0;
+        GetProperty(RES_BACKGROUND, MID_FILL_GRADIENT, pGradient);
         const ::uno::Any* pTrans = 0;
         GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENT, pTrans );
         const ::uno::Any* pGrLoc = 0;
@@ -185,13 +189,17 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
         GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency     );
 
         if(pCol || pTrans || pGrURL || pGrFilter || pGrLoc ||
-                            pGrTranparency || pColTrans || pRGBCol)
+                            pGrTranparency || pColTrans || pRGBCol || pFillStyle || pGradient)
         {
             SvxBrushItem aBrush ( static_cast < const :: SvxBrushItem & > ( rFromSet.Get ( RES_BACKGROUND ) ) );
             if(pCol )
                 bRet &= ((SfxPoolItem&)aBrush).PutValue(*pCol,MID_BACK_COLOR    );
             if(pColTrans)
                 bRet &= ((SfxPoolItem&)aBrush).PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
+            if(pFillStyle)
+                bRet &= ((SfxPoolItem&)aBrush).PutValue(*pFillStyle, MID_FILL_STYLE);
+            if(pGradient)
+                bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGradient, MID_FILL_GRADIENT);
             if(pRGBCol)
                 bRet &= ((SfxPoolItem&)aBrush).PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B);
             if(pTrans)
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 9c6fe6e..f490343 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -288,6 +288,8 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
     { SW_PROP_NMID(UNO_NAME_BACK_COLOR), RES_BACKGROUND,            CPPU_E2T(CPPUTYPE_INT32),           PROPERTY_NONE ,MID_BACK_COLOR        },                      \
     { SW_PROP_NMID(UNO_NAME_BACK_COLOR_R_G_B), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR_R_G_B},    \
     { SW_PROP_NMID(UNO_NAME_BACK_COLOR_TRANSPARENCY), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE ,MID_BACK_COLOR_TRANSPARENCY},    \
+    { SW_PROP_NMID(UNO_NAME_FILL_STYLE), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,MID_FILL_STYLE}, \
+    { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILL_GRADIENT}, \
     { SW_PROP_NMID(UNO_NAME_CONTENT_PROTECTED), RES_PROTECT,            CPPU_E2T(CPPUTYPE_BOOLEAN),             PROPERTY_NONE, MID_PROTECT_CONTENT  },                          \
     { SW_PROP_NMID(UNO_NAME_FRAME_STYLE_NAME), FN_UNO_FRAME_STYLE_NAME,CPPU_E2T(CPPUTYPE_OUSTRING),         PROPERTY_NONE, 0},                                   \
     { SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_OUSTRING),        PROPERTY_NONE ,MID_GRAPHIC_URL    },                 \
@@ -664,6 +666,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { SW_PROP_NMID(UNO_NAME_BACK_COLOR), RES_BACKGROUND,            CPPU_E2T(CPPUTYPE_INT32),           PROPERTY_NONE ,MID_BACK_COLOR        },
                     { SW_PROP_NMID(UNO_NAME_BACK_COLOR_R_G_B), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR_R_G_B},
                     { SW_PROP_NMID(UNO_NAME_BACK_COLOR_TRANSPARENCY), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE ,MID_BACK_COLOR_TRANSPARENCY},    \
+                    { SW_PROP_NMID(UNO_NAME_FILL_STYLE), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,MID_FILL_STYLE},
+                    { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_BACKGROUND,      CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILL_GRADIENT},
                 //  { SW_PROP_NMID(UNO_NAME_CHAIN_NEXT_NAME), RES_CHAIN,                CPPU_E2T(CPPUTYPE_OUSTRING),            PROPERTY_NONE ,MID_CHAIN_NEXTNAME},
                 //  { SW_PROP_NMID(UNO_NAME_CHAIN_PREV_NAME), RES_CHAIN,                CPPU_E2T(CPPUTYPE_OUSTRING),            PROPERTY_NONE ,MID_CHAIN_PREVNAME},
                 /*not impl*/    { SW_PROP_NMID(UNO_NAME_CLIENT_MAP), RES_URL,               CPPU_E2T(CPPUTYPE_BOOLEAN),         PROPERTY_NONE ,MID_URL_CLIENTMAP         },
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 88eb7eb..de71712 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -786,6 +786,8 @@ const SwPropNameTab aPropNameTab = {
 /* 0754 UNO_NAME_INITIALS */            {MAP_CHAR_LEN("TableBorder2")},
 /* 0755 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")},
 /* 0756 UNO_NAME_HIDDEN */              {MAP_CHAR_LEN("Hidden")},
+/* 0757 UNO_NAME_FILL_STYLE */              {MAP_CHAR_LEN("FillStyle")},
+/* 0758 UNO_NAME_FILL_GRADIENT */              {MAP_CHAR_LEN("FillGradient")},
 
 // new items in this array must match enum SwPropNameIds
 };
commit 2aec78c0d931a53edbee0adeaf1efc399e235f17
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Jan 24 18:07:19 2013 +0100

    SvxBrushItem: extend this with a vcl Gradient and drawing::FillStyle
    
    So Writer fly frames can have gradient info as well.
    
    Change-Id: If59ae9092fedabbe112f034e13fbe801815ebaaf

diff --git a/editeng/inc/editeng/brshitem.hxx b/editeng/inc/editeng/brshitem.hxx
index fca5653..44354b4 100644
--- a/editeng/inc/editeng/brshitem.hxx
+++ b/editeng/inc/editeng/brshitem.hxx
@@ -23,6 +23,7 @@
 #include <vcl/wall.hxx>
 #include <tools/link.hxx>
 #include <editeng/editengdllapi.h>
+#include <com/sun/star/drawing/FillStyle.hpp>
 
 // class SvxBrushItem ----------------------------------------------------
 
@@ -33,6 +34,7 @@ namespace rtl
 {
     class OUString;
 }
+class Gradient;
 
 #define BRUSH_GRAPHIC_VERSION   ((sal_uInt16)0x0001)
 
@@ -111,12 +113,16 @@ public:
     const GraphicObject*    GetGraphicObject() const;
     const String*           GetGraphicLink() const      { return pStrLink; }
     const String*           GetGraphicFilter() const    { return pStrFilter; }
+    com::sun::star::drawing::FillStyle GetFillStyle() const;
+    const Gradient& GetGradient() const;
 
     void                SetGraphicPos( SvxGraphicPosition eNew );
     void                SetGraphic( const Graphic& rNew );
     void                SetGraphicObject( const GraphicObject& rNewObj );
     void                SetGraphicLink( const String& rNew );
     void                SetGraphicFilter( const String& rNew );
+    void                SetFillStyle(com::sun::star::drawing::FillStyle eNew);
+    void                SetGradient(Gradient& rNew);
 
     SvxBrushItem&       operator=( const SvxBrushItem& rItem);
 
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index c457256..077bcd2 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -41,6 +41,7 @@
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/frame/status/UpperLowerMarginScale.hpp>
+#include <com/sun/star/awt/Gradient.hpp>
 
 #include <unotools/ucbstreamhelper.hxx>
 #include <limits.h>
@@ -55,6 +56,7 @@
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <vcl/graphicfilter.hxx>
+#include <vcl/gradient.hxx>
 #include <editeng/editids.hrc>
 #include <editeng/editrids.hrc>
 #include <editeng/pbinitem.hxx>
@@ -3325,8 +3327,10 @@ public:
                                           //copied to the GraphicObject when necessary
     Link            aDoneLink;
     SvStream*       pStream;
+    Gradient aGradient;
+    drawing::FillStyle eFillStyle;
 
-    SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {}
+    SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0), eFillStyle(drawing::FillStyle_NONE) {}
 };
 
 // -----------------------------------------------------------------------
@@ -3639,6 +3643,25 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         case MID_GRAPHIC_TRANSPARENCY :
             rVal <<= pImpl->nGraphicTransparency;
         break;
+        case MID_FILL_STYLE:
+            rVal <<= pImpl->eFillStyle;
+        break;
+        case MID_FILL_GRADIENT:
+        {
+            awt::Gradient aGradient;
+            aGradient.Style = (awt::GradientStyle)pImpl->aGradient.GetStyle();
+            aGradient.StartColor = pImpl->aGradient.GetStartColor().GetColor();
+            aGradient.EndColor = pImpl->aGradient.GetEndColor().GetColor();
+            aGradient.Angle = pImpl->aGradient.GetAngle();
+            aGradient.Border = pImpl->aGradient.GetBorder();
+            aGradient.XOffset = pImpl->aGradient.GetOfsX();
+            aGradient.YOffset = pImpl->aGradient.GetOfsY();
+            aGradient.StartIntensity = pImpl->aGradient.GetStartIntensity();
+            aGradient.EndIntensity = pImpl->aGradient.GetEndIntensity();
+            aGradient.StepCount = pImpl->aGradient.GetSteps();
+            rVal <<= aGradient;
+        }
+        break;
     }
 
     return true;
@@ -3754,6 +3777,26 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             }
         }
         break;
+        case MID_FILL_STYLE:
+            rVal >>= pImpl->eFillStyle;
+        break;
+        case MID_FILL_GRADIENT:
+        {
+            awt::Gradient aGradient;
+            if (!(rVal >>= aGradient))
+                return false;
+            pImpl->aGradient.SetStyle((GradientStyle)aGradient.Style);
+            pImpl->aGradient.SetStartColor(aGradient.StartColor);
+            pImpl->aGradient.SetEndColor(aGradient.EndColor);
+            pImpl->aGradient.SetAngle(aGradient.Angle);
+            pImpl->aGradient.SetBorder(aGradient.Border);
+            pImpl->aGradient.SetOfsX(aGradient.XOffset);
+            pImpl->aGradient.SetOfsY(aGradient.YOffset);
+            pImpl->aGradient.SetStartIntensity(aGradient.StartIntensity);
+            pImpl->aGradient.SetEndIntensity(aGradient.EndIntensity);
+            pImpl->aGradient.SetSteps(aGradient.StepCount);
+        }
+        break;
     }
 
     return true;
@@ -3824,6 +3867,8 @@ SvxBrushItem& SvxBrushItem::operator=( const SvxBrushItem& rItem )
         }
     }
     pImpl->nGraphicTransparency = rItem.pImpl->nGraphicTransparency;
+    pImpl->eFillStyle = rItem.pImpl->eFillStyle;
+    pImpl->aGradient = rItem.pImpl->aGradient;
     return *this;
 }
 
@@ -3835,7 +3880,9 @@ int SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
 
     SvxBrushItem& rCmp = (SvxBrushItem&)rAttr;
     sal_Bool bEqual = ( aColor == rCmp.aColor && eGraphicPos == rCmp.eGraphicPos &&
-        pImpl->nGraphicTransparency == rCmp.pImpl->nGraphicTransparency);
+        pImpl->nGraphicTransparency == rCmp.pImpl->nGraphicTransparency &&
+        pImpl->eFillStyle == rCmp.pImpl->eFillStyle &&
+        pImpl->aGradient == rCmp.pImpl->aGradient);
 
     if ( bEqual )
     {
@@ -4146,6 +4193,27 @@ void  SvxBrushItem::ApplyGraphicTransparency_Impl()
         pImpl->pGraphicObject->SetAttr(aAttr);
     }
 }
+
+drawing::FillStyle SvxBrushItem::GetFillStyle() const
+{
+    return pImpl->eFillStyle;
+}
+
+const Gradient& SvxBrushItem::GetGradient() const
+{
+    return pImpl->aGradient;
+}
+
+void SvxBrushItem::SetFillStyle(drawing::FillStyle eNew)
+{
+    pImpl->eFillStyle = eNew;
+}
+
+void SvxBrushItem::SetGradient(Gradient& rNew)
+{
+    pImpl->aGradient = rNew;
+}
+
 // class SvxFrameDirectionItem ----------------------------------------------
 
 SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue ,


More information about the Libreoffice-commits mailing list