[Libreoffice-commits] .: 4 commits - editeng/inc editeng/source offapi/com svx/inc svx/source sw/inc sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jan 28 04:50:01 PST 2013
editeng/inc/editeng/brshitem.hxx | 6 -
editeng/inc/editeng/memberids.hrc | 2
editeng/source/items/frmitems.cxx | 71 -----------------------
offapi/com/sun/star/text/BaseFrameProperties.idl | 6 +
svx/inc/svx/xfillit0.hxx | 1
svx/inc/svx/xflgrit.hxx | 3
svx/inc/svx/xgrad.hxx | 3
svx/source/xoutdev/xattr.cxx | 27 +++++++-
sw/inc/frmatr.hxx | 4 +
sw/inc/hintids.hxx | 2
sw/inc/swatrset.hxx | 4 +
sw/inc/unoprnms.hxx | 3
sw/source/core/access/accpara.cxx | 4 -
sw/source/core/bastyp/init.cxx | 6 +
sw/source/core/doc/notxtfrm.cxx | 6 -
sw/source/core/inc/frame.hxx | 4 +
sw/source/core/inc/frmtool.hxx | 4 -
sw/source/core/layout/paintfrm.cxx | 40 ++++++++++--
sw/source/core/text/inftxt.cxx | 6 +
sw/source/core/text/porfld.cxx | 2
sw/source/core/text/txtfly.cxx | 2
sw/source/core/txtnode/fntcache.cxx | 4 -
sw/source/core/unocore/unoframe.cxx | 59 ++++++++++++++-----
sw/source/core/unocore/unomap.cxx | 10 +--
sw/source/core/unocore/unoprnms.cxx | 1
25 files changed, 161 insertions(+), 119 deletions(-)
New commits:
commit abe9599b9dea6d7b3ad840dee88848ac10f55a04
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Jan 28 13:34:52 2013 +0100
text::BaseFrameProperties: add FillGradientName optional property
Change-Id: Iae428edb97e31ae578d2ab4679f6d346d5339a9f
diff --git a/offapi/com/sun/star/text/BaseFrameProperties.idl b/offapi/com/sun/star/text/BaseFrameProperties.idl
index 8498710..89d7c90 100644
--- a/offapi/com/sun/star/text/BaseFrameProperties.idl
+++ b/offapi/com/sun/star/text/BaseFrameProperties.idl
@@ -310,6 +310,12 @@ published service BaseFrameProperties
@since LibreOffice 4.1
*/
[optional, property] com::sun::star::awt::Gradient FillGradient;
+ /** If the property <member>FillStyle</member> is set to <const>
+ FillStyle::GRADIENT</const>, this is the name of the gradient used.
+
+ @since LibreOffice 4.1
+ */
+ [optional, property] string FillGradientName;
};
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index a9834b3..42027af 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -818,8 +818,9 @@ enum SwPropNameIds
/* 0756 */ UNO_NAME_HIDDEN,
/* 0757 */ UNO_NAME_FILL_STYLE,
/* 0758 */ UNO_NAME_FILL_GRADIENT,
+/* 0759 */ UNO_NAME_FILL_GRADIENT_NAME,
-/* 0759 */ SW_PROPNAME_END
+/* 0760 */ 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 c381419..d9031a4 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -136,7 +136,7 @@ public:
void SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal);
bool GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& pAny );
- bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound);
+ bool FillBaseProperties(SwDoc* pDoc, SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound);
virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) = 0;
@@ -156,7 +156,7 @@ bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId,
return aAnyMap.FillValue( nWID, nMemberId, rpAny );
}
-bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, bool& rSizeFound)
+bool BaseFrameProperties_Impl::FillBaseProperties(SwDoc* pDoc, SfxItemSet& rToSet, const SfxItemSet& rFromSet, bool& rSizeFound)
{
bool bRet = true;
//Anker kommt auf jeden Fall in den Set
@@ -229,11 +229,24 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
{
const ::uno::Any* pFillGradient = 0;
GetProperty(RES_FILL_GRADIENT, MID_FILLGRADIENT, pFillGradient);
- if (pFillGradient)
+ const ::uno::Any* pName = 0;
+ GetProperty(RES_FILL_GRADIENT, MID_NAME, pName);
+ if (pFillGradient || pName)
{
XFillGradientItem aFillGradient( static_cast <const :: XFillGradientItem & > ( rFromSet.Get ( RES_FILL_GRADIENT ) ) );
- bRet &= ((SfxPoolItem&)aFillGradient).PutValue(*pFillGradient, MID_FILLGRADIENT);
- rToSet.Put(aFillGradient);
+ XFillGradientItem* pItem = &aFillGradient;
+ if (pFillGradient)
+ bRet &= ((SfxPoolItem*)pItem)->PutValue(*pFillGradient, MID_FILLGRADIENT);
+ if (pName)
+ bRet &= ((SfxPoolItem*)pItem)->PutValue(*pName, MID_NAME);
+ SdrModel* pModel = pDoc->GetDrawModel();
+ pItem = pItem->checkForUniqueItem( pModel );
+ if (pItem)
+ {
+ rToSet.Put(*pItem);
+ if(pItem != &aFillGradient)
+ delete pItem;
+ }
}
}
{
@@ -578,13 +591,13 @@ bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItem
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle ) );
const :: SfxItemSet *pItemSet = &xStyle->GetItemSet();
- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
+ bRet = FillBaseProperties( pDoc, rSet, *pItemSet, rSizeFound );
lcl_FillCol ( rSet, *pItemSet, pColumns );
}
else
{
const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_FRAME )->GetAttrSet();
- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
+ bRet = FillBaseProperties( pDoc, rSet, *pItemSet, rSizeFound );
lcl_FillCol ( rSet, *pItemSet, pColumns );
}
const ::uno::Any* pEdit;
@@ -659,13 +672,13 @@ bool SwGraphicProperties_Impl::AnyToItemSet(
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) );
const :: SfxItemSet *pItemSet = &xStyle->GetItemSet();
- bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound);
+ bRet = FillBaseProperties(pDoc, rFrmSet, *pItemSet, rSizeFound);
lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet );
}
else
{
const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC )->GetAttrSet();
- bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound);
+ bRet = FillBaseProperties(pDoc, rFrmSet, *pItemSet, rSizeFound);
lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet );
}
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 061f76c..8e1f682 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -290,6 +290,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ 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_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0}, \
{ SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT}, \
+ { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT_NAME), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_NAME}, \
{ 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 }, \
@@ -668,6 +669,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ 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_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0},
{ SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT},
+ { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT_NAME), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_NAME},
// { 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 de71712..f1e0f19 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -788,6 +788,7 @@ const SwPropNameTab aPropNameTab = {
/* 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")},
+/* 0759 UNO_NAME_FILL_GRADIENT_NAME */ {MAP_CHAR_LEN("FillGradientName")},
// new items in this array must match enum SwPropNameIds
};
commit d8de1d6070b7e89fcb5e51307d20b081e83fd02d
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Jan 28 13:27:00 2013 +0100
XFillGradientItem: don't assume the default Which ID
Change-Id: I2baced123f957fb47f7710c122664842e0b1bb1d
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index 9fd0490..52cc5c7 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -38,7 +38,7 @@ public:
XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
XFillGradientItem(sal_uInt16 nWhich_) : NameOrIndex(nWhich_, -1) {}
XFillGradientItem(sal_Int32 nIndex, const XGradient& rTheGradient);
- XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
+ XFillGradientItem(const UniString& rName, const XGradient& rTheGradient, sal_uInt16 nWhich_ = XATTR_FILLGRADIENT);
XFillGradientItem(const XGradient& rTheGradient);
XFillGradientItem(const XFillGradientItem& rItem);
XFillGradientItem(SvStream& rIn, sal_uInt16 nVer = 0);
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 5a176b2..e2e8a15 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -3163,8 +3163,8 @@ XFillGradientItem::XFillGradientItem(sal_Int32 nIndex,
*************************************************************************/
XFillGradientItem::XFillGradientItem(const XubString& rName,
- const XGradient& rTheGradient) :
- NameOrIndex(XATTR_FILLGRADIENT, rName),
+ const XGradient& rTheGradient, sal_uInt16 nWhich_) :
+ NameOrIndex(nWhich_, rName),
aGradient(rTheGradient)
{
}
@@ -3601,7 +3601,7 @@ XFillGradientItem* XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) con
// if the given name is not valid, replace it!
if( aUniqueName != GetName() )
- return new XFillGradientItem( aUniqueName, aGradient );
+ return new XFillGradientItem( aUniqueName, aGradient, Which() );
}
return (XFillGradientItem*)this;
commit a1bef744a24b072adc22035b5b15b376961351d8
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Jan 28 11:56:10 2013 +0100
SwXTextFrame: use XFillGradientItem instead of extending SvxBrushItem
Change-Id: I8863cbe1d01fceac0f4b4152264c1464c90e02b8
diff --git a/editeng/inc/editeng/brshitem.hxx b/editeng/inc/editeng/brshitem.hxx
index b35df0e..fca5653 100644
--- a/editeng/inc/editeng/brshitem.hxx
+++ b/editeng/inc/editeng/brshitem.hxx
@@ -33,7 +33,6 @@ namespace rtl
{
class OUString;
}
-class Gradient;
#define BRUSH_GRAPHIC_VERSION ((sal_uInt16)0x0001)
@@ -112,14 +111,12 @@ public:
const GraphicObject* GetGraphicObject() const;
const String* GetGraphicLink() const { return pStrLink; }
const String* GetGraphicFilter() const { return pStrFilter; }
- 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 SetGradient(Gradient& rNew);
SvxBrushItem& operator=( const SvxBrushItem& rItem);
diff --git a/editeng/inc/editeng/memberids.hrc b/editeng/inc/editeng/memberids.hrc
index 376c219..2ce6c22 100644
--- a/editeng/inc/editeng/memberids.hrc
+++ b/editeng/inc/editeng/memberids.hrc
@@ -170,8 +170,6 @@
#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/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 9bcafd6..6e202da 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -41,7 +41,6 @@
#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>
@@ -56,7 +55,6 @@
#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>
@@ -3327,7 +3325,6 @@ public:
//copied to the GraphicObject when necessary
Link aDoneLink;
SvStream* pStream;
- Gradient aGradient;
SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {}
};
@@ -3642,22 +3639,6 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_GRAPHIC_TRANSPARENCY :
rVal <<= pImpl->nGraphicTransparency;
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;
@@ -3773,23 +3754,6 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
}
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;
@@ -3860,7 +3824,6 @@ SvxBrushItem& SvxBrushItem::operator=( const SvxBrushItem& rItem )
}
}
pImpl->nGraphicTransparency = rItem.pImpl->nGraphicTransparency;
- pImpl->aGradient = rItem.pImpl->aGradient;
return *this;
}
@@ -3872,8 +3835,7 @@ 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->aGradient == rCmp.pImpl->aGradient);
+ pImpl->nGraphicTransparency == rCmp.pImpl->nGraphicTransparency);
if ( bEqual )
{
@@ -4185,16 +4147,6 @@ void SvxBrushItem::ApplyGraphicTransparency_Impl()
}
}
-const Gradient& SvxBrushItem::GetGradient() const
-{
- return pImpl->aGradient;
-}
-
-void SvxBrushItem::SetGradient(Gradient& rNew)
-{
- pImpl->aGradient = rNew;
-}
-
// class SvxFrameDirectionItem ----------------------------------------------
SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue ,
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index b4318cf..9fd0490 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -36,6 +36,7 @@ class SVX_DLLPUBLIC XFillGradientItem : public NameOrIndex
public:
TYPEINFO();
XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
+ XFillGradientItem(sal_uInt16 nWhich_) : NameOrIndex(nWhich_, -1) {}
XFillGradientItem(sal_Int32 nIndex, const XGradient& rTheGradient);
XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
XFillGradientItem(const XGradient& rTheGradient);
diff --git a/svx/inc/svx/xgrad.hxx b/svx/inc/svx/xgrad.hxx
index 0b2c972..ba97db1 100644
--- a/svx/inc/svx/xgrad.hxx
+++ b/svx/inc/svx/xgrad.hxx
@@ -24,6 +24,8 @@
#include <tools/color.hxx>
#include "svx/svxdllapi.h"
+class Gradient;
+
//-----------------
// class XGradient
//-----------------
@@ -73,6 +75,7 @@ public:
sal_uInt16 GetStartIntens() const { return nIntensStart; }
sal_uInt16 GetEndIntens() const { return nIntensEnd; }
sal_uInt16 GetSteps() const { return nStepCount; }
+ Gradient VclGradient() const;
};
#endif
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 6e7355e..5a176b2 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -50,6 +50,7 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/tools/unotools.hxx>
+#include <vcl/gradient.hxx>
#include <stdio.h>
@@ -3119,6 +3120,21 @@ bool XGradient::operator==(const XGradient& rGradient) const
nStepCount == rGradient.nStepCount );
}
+Gradient XGradient::VclGradient() const
+{
+ Gradient aGradient;
+ aGradient.SetStyle((GradientStyle)eStyle);
+ aGradient.SetStartColor(aStartColor);
+ aGradient.SetEndColor(aEndColor);
+ aGradient.SetAngle(nAngle);
+ aGradient.SetBorder(nBorder);
+ aGradient.SetOfsX(nOfsX);
+ aGradient.SetOfsY(nOfsY);
+ aGradient.SetStartIntensity(nIntensStart);
+ aGradient.SetEndIntensity(nIntensEnd);
+ aGradient.SetSteps(nStepCount);
+ return aGradient;
+}
// -----------------------
// class XFillGradientItem
diff --git a/sw/inc/frmatr.hxx b/sw/inc/frmatr.hxx
index 2266c14..402005d 100644
--- a/sw/inc/frmatr.hxx
+++ b/sw/inc/frmatr.hxx
@@ -46,6 +46,8 @@ inline const SvxBrushItem &SwAttrSet::GetBackground(sal_Bool bInP) const
{ return (const SvxBrushItem&)Get( RES_BACKGROUND,bInP); }
inline const XFillStyleItem &SwAttrSet::GetFillStyle(sal_Bool bInP) const
{ return (const XFillStyleItem&)Get( RES_FILL_STYLE,bInP); }
+inline const XFillGradientItem &SwAttrSet::GetFillGradient(sal_Bool bInP) const
+ { return (const XFillGradientItem&)Get( RES_FILL_GRADIENT,bInP); }
inline const SvxShadowItem &SwAttrSet::GetShadow(sal_Bool bInP) const
{ return (const SvxShadowItem&)Get( RES_SHADOW,bInP); }
inline const SvxFmtBreakItem &SwAttrSet::GetBreak(sal_Bool bInP) const
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 8c27a86..e6c5c79 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -221,6 +221,7 @@ RES_FRMATR_BEGIN = RES_PARATR_LIST_END,
RES_FRMATR_STYLE_NAME, // 120
RES_FRMATR_CONDITIONAL_STYLE_NAME, // 121
RES_FILL_STYLE,
+ RES_FILL_GRADIENT,
RES_FRMATR_END
};
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 4889346..65572db 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -75,6 +75,7 @@ class SwFmtAnchor;
class SvxBoxItem;
class SvxBrushItem;
class XFillStyleItem;
+class XFillGradientItem;
class SvxShadowItem;
class SwFmtPageDesc;
class SvxFmtBreakItem;
@@ -272,6 +273,7 @@ public:
inline const SvxFmtKeepItem &GetKeep( sal_Bool = sal_True ) const;
inline const SvxBrushItem &GetBackground( sal_Bool = sal_True ) const;
inline const XFillStyleItem &GetFillStyle( sal_Bool = sal_True ) const;
+ inline const XFillGradientItem &GetFillGradient( sal_Bool = sal_True ) const;
inline const SvxShadowItem &GetShadow( sal_Bool = sal_True ) const;
inline const SwFmtPageDesc &GetPageDesc( sal_Bool = sal_True ) const;
inline const SvxFmtBreakItem &GetBreak( sal_Bool = sal_True ) const;
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 983fb29..9268639 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -914,10 +914,11 @@ static bool lcl_GetBackgroundColor( Color & rColor,
{
const SvxBrushItem* pBackgrdBrush = 0;
const XFillStyleItem* pFillStyleItem = 0;
+ const XFillGradientItem* pFillGradientItem = 0;
const Color* pSectionTOXColor = 0;
SwRect aDummyRect;
if ( pFrm &&
- pFrm->GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pSectionTOXColor, aDummyRect, false ) )
+ pFrm->GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pFillGradientItem, pSectionTOXColor, aDummyRect, false ) )
{
if ( pSectionTOXColor )
{
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 77829f44..8bc3623 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -111,6 +111,7 @@
#include <svl/macitem.hxx>
#include <svx/dialogs.hrc>
#include <svx/xfillit0.hxx>
+#include <svx/xflgrit.hxx>
#include <swcalwrp.hxx>
#include <SwStyleNameMapper.hxx>
#include <tblafmt.hxx>
@@ -381,6 +382,7 @@ SfxItemInfo aSlotTab[] =
{ 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_STYLE_NAME
{ 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_CONDITIONAL_STYLE_NAME
{ 0, SFX_ITEM_POOLABLE }, // RES_FILL_STYLE
+ { 0, SFX_ITEM_POOLABLE }, // RES_FILL_GRADIENT
{ 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_MIRRORGRF
{ SID_ATTR_GRAF_CROP, SFX_ITEM_POOLABLE }, // RES_GRFATR_CROPGRF
@@ -597,6 +599,7 @@ void _InitCore()
aAttrTab[ RES_FRMATR_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_STYLE_NAME, aEmptyStr );
aAttrTab[ RES_FRMATR_CONDITIONAL_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_CONDITIONAL_STYLE_NAME, aEmptyStr );
aAttrTab[ RES_FILL_STYLE - POOLATTR_BEGIN ] = new XFillStyleItem(XFILL_SOLID, RES_FILL_STYLE);
+ aAttrTab[ RES_FILL_GRADIENT - POOLATTR_BEGIN ] = new XFillGradientItem(RES_FILL_GRADIENT);
aAttrTab[ RES_GRFATR_MIRRORGRF- POOLATTR_BEGIN ] = new SwMirrorGrf;
aAttrTab[ RES_GRFATR_CROPGRF- POOLATTR_BEGIN ] = new SwCropGrf;
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 84fc446..137ade3 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -209,10 +209,10 @@ static void lcl_ClearArea( const SwFrm &rFrm,
if ( !aRegion.empty() )
{
- const SvxBrushItem *pItem; const XFillStyleItem* pFillStyleItem; const Color *pCol; SwRect aOrigRect;
- if ( rFrm.GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigRect, sal_False ) )
+ const SvxBrushItem *pItem; const XFillStyleItem* pFillStyleItem; const XFillGradientItem* pFillGradientItem; const Color *pCol; SwRect aOrigRect;
+ if ( rFrm.GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigRect, sal_False ) )
for( sal_uInt16 i = 0; i < aRegion.size(); ++i )
- ::DrawGraphic( pItem, pFillStyleItem, &rOut, aOrigRect, aRegion[i] );
+ ::DrawGraphic( pItem, pFillStyleItem, pFillGradientItem, &rOut, aOrigRect, aRegion[i] );
else
{
rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 96d59bf..febaa8d 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -49,6 +49,7 @@ class SwBorderAttrs;
class SwCache;
class SvxBrushItem;
class XFillStyleItem;
+class XFillGradientItem;
class SwSelectionList;
struct SwPosition;
struct SwCrsrMoveState;
@@ -503,6 +504,7 @@ public:
sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush,
const XFillStyleItem* & rpFillStyle,
+ const XFillGradientItem* & rpFillGradient,
const Color*& rpColor,
SwRect &rOrigRect,
sal_Bool bLowerMode ) const;
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 78af6f0..fc2e763 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -37,6 +37,7 @@ class SdrObject;
class BigInt;
class SvxBrushItem;
class XFillStyleItem;
+class XFillGradientItem;
class SdrMarkList;
class SwNodeIndex;
class OutputDevice;
@@ -51,7 +52,7 @@ class SwPageDesc;
// draw background with brush or graphics
// The 6th parameter indicates that the method should consider background
// transparency, saved in the color of the brush item.
-void DrawGraphic( const SvxBrushItem *, const XFillStyleItem*, OutputDevice *,
+void DrawGraphic( const SvxBrushItem *, const XFillStyleItem*, const XFillGradientItem*, OutputDevice *,
const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum = GRFNUM_NO,
const sal_Bool bConsiderBackgroundTransparency = sal_False );
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 94dedda..e0d0246 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -20,6 +20,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <hintids.hxx>
#include <vcl/lazydelete.hxx>
+#include <vcl/gradient.hxx>
#include <tools/poly.hxx>
#include <svx/xoutbmp.hxx>
#include <sfx2/progress.hxx>
@@ -30,6 +31,7 @@
#include <editeng/shaditem.hxx>
#include <editeng/ulspitem.hxx>
#include <svx/framelink.hxx>
+#include <svx/xflgrit.hxx>
#include <vcl/graph.hxx>
#include <svx/svdpagv.hxx>
#include <tgrditem.hxx>
@@ -1786,6 +1788,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
void DrawGraphic( const SvxBrushItem *pBrush,
const XFillStyleItem* pFillStyleItem,
+ const XFillGradientItem* pFillGradientItem,
OutputDevice *pOutDev,
const SwRect &rOrg,
const SwRect &rOut,
@@ -2077,7 +2080,7 @@ void DrawGraphic( const SvxBrushItem *pBrush,
/// draw poly-polygon transparent
pOutDev->DrawTransparent( aDrawPoly, nTransparencyPercent );
}
- else if (!pFillStyleItem || pFillStyleItem->GetValue() != XFILL_GRADIENT)
+ else if (!pFillStyleItem || pFillStyleItem->GetValue() != XFILL_GRADIENT || !pFillGradientItem)
{
SwRegionRects aRegion( rOut, 4 );
if ( !bGrfIsTransparent )
@@ -2091,7 +2094,7 @@ void DrawGraphic( const SvxBrushItem *pBrush,
}
}
else
- pOutDev->DrawGradient(rOut.SVRect(), pBrush->GetGradient());
+ pOutDev->DrawGradient(rOut.SVRect(), pFillGradientItem->GetGradientValue().VclGradient());
pOutDev ->Pop();
}
@@ -3712,9 +3715,10 @@ sal_Bool SwFlyFrm::IsBackgroundTransparent() const
{
const SvxBrushItem* pBackgrdBrush = 0;
const XFillStyleItem* pFillStyleItem = 0;
+ const XFillGradientItem* pFillGradientItem = 0;
const Color* pSectionTOXColor = 0;
SwRect aDummyRect;
- if ( GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pSectionTOXColor, aDummyRect, false) )
+ if ( GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pFillGradientItem, pSectionTOXColor, aDummyRect, false) )
{
if ( pSectionTOXColor &&
(pSectionTOXColor->GetTransparency() != 0) &&
@@ -6086,6 +6090,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const SvxBrushItem* pItem;
const XFillStyleItem* pFillStyleItem;
+ const XFillGradientItem* pFillGradientItem;
/// OD 05.09.2002 #102912#
/// temporary background brush for a fly frame without a background brush
SvxBrushItem* pTmpBackBrush = 0;
@@ -6094,7 +6099,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const bool bPageFrm = IsPageFrm();
sal_Bool bLowMode = sal_True;
- sal_Bool bBack = GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, bLowerMode );
+ sal_Bool bBack = GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, bLowerMode );
//- Output if a separate background is used.
bool bNoFlyBackground = !bFlyMetafile && !bBack && IsFlyFrm();
if ( bNoFlyBackground )
@@ -6104,7 +6109,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
// <GetBackgroundBrush> disabled this option with the parameter <bLowerMode>
if ( bLowerMode )
{
- bBack = GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, false );
+ bBack = GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, false );
}
// If still no background found for the fly frame, initialize the
// background brush <pItem> with global retouche color and set <bBack>
@@ -6195,7 +6200,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
/// Set missing 5th parameter to the default value GRFNUM_NO
/// - see declaration in /core/inc/frmtool.hxx.
if (IsTxtFrm() || !bOnlyTxtBackground)
- ::DrawGraphic( pItem, pFillStyleItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO,
+ ::DrawGraphic( pItem, pFillStyleItem, pFillGradientItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO,
bConsiderBackgroundTransparency );
}
}
@@ -6873,9 +6878,10 @@ const Color& SwPageFrm::GetDrawBackgrdColor() const
{
const SvxBrushItem* pBrushItem;
const XFillStyleItem* pFillStyleItem;
+ const XFillGradientItem* pFillGradientItem;
const Color* pDummyColor;
SwRect aDummyRect;
- if ( GetBackgroundBrush( pBrushItem, pFillStyleItem, pDummyColor, aDummyRect, true) )
+ if ( GetBackgroundBrush( pBrushItem, pFillStyleItem, pFillGradientItem, pDummyColor, aDummyRect, true) )
return pBrushItem->GetColor();
else
return aGlobalRetoucheColor;
@@ -7003,6 +7009,9 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
@param rpFillStyle
output parameter - constant reference pointer the found background fill style
+ @param rpFillGradient
+ output parameter - constant reference pointer the found background fill gradient
+
@param rpCol
output parameter - constant reference pointer to the color of the index shading
set under special conditions, if background brush is taken from an index section.
@@ -7020,6 +7029,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
*/
sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
const XFillStyleItem* & rpFillStyle,
+ const XFillGradientItem* & rpFillGradient,
const Color*& rpCol,
SwRect &rOrigRect,
sal_Bool bLowerMode ) const
@@ -7029,6 +7039,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
const SwViewOption *pOpt = pSh->GetViewOptions();
rpBrush = 0;
rpFillStyle = 0;
+ rpFillGradient = 0;
rpCol = NULL;
do
{ if ( pFrm->IsPageFrm() && !pOpt->IsPageBack() )
@@ -7036,6 +7047,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
const SvxBrushItem &rBack = pFrm->GetAttrSet()->GetBackground();
const XFillStyleItem &rFillStyle = pFrm->GetAttrSet()->GetFillStyle();
+ const XFillGradientItem &rFillGradient = pFrm->GetAttrSet()->GetFillGradient();
if( pFrm->IsSctFrm() )
{
const SwSection* pSection = ((SwSectionFrm*)pFrm)->GetSection();
@@ -7082,6 +7094,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
{
rpBrush = &rBack;
rpFillStyle = &rFillStyle;
+ rpFillGradient = &rFillGradient;
if ( pFrm->IsPageFrm() &&
pSh->GetViewOptions()->getBrowseMode() )
rOrigRect = pFrm->Frm();
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 8d8543d..3696cb8 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -514,13 +514,14 @@ static sal_Bool lcl_IsDarkBackground( const SwTxtPaintInfo& rInf )
{
const SvxBrushItem* pItem;
const XFillStyleItem* pFillStyleItem;
+ const XFillGradientItem* pFillGradientItem;
SwRect aOrigBackRect;
// Consider, that [GetBackgroundBrush(...)] can set <pCol>
// See implementation in /core/layout/paintfrm.cxx
// There is a background color, if there is a background brush and
// its color is *not* "no fill"/"auto fill".
- if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, sal_False ) )
+ if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, sal_False ) )
{
if ( !pCol )
pCol = &pItem->GetColor();
@@ -885,7 +886,7 @@ void SwTxtPaintInfo::DrawRect( const SwRect &rRect, sal_Bool bNoGraphic,
else
{
OSL_ENSURE( ((SvxBrushItem*)-1) != pBrushItem, "DrawRect: Uninitialized BrushItem!" );
- ::DrawGraphic( pBrushItem, 0, pOut, aItemRect, rRect );
+ ::DrawGraphic( pBrushItem, 0, 0, pOut, aItemRect, rRect );
}
}
}
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 9217a05..a054df4 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -1021,7 +1021,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
}
if( bDraw && aTmp.HasArea() )
- DrawGraphic( pBrush, 0, (OutputDevice*)rInf.GetOut(),
+ DrawGraphic( pBrush, 0, 0, (OutputDevice*)rInf.GetOut(),
aTmp, aRepaint, bReplace ? GRFNUM_REPLACE : GRFNUM_YES );
}
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index bc9ee74..e38086a 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -658,7 +658,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
{
OSL_ENSURE( ((SvxBrushItem*)-1) != rInf.GetBrushItem(),
"DrawRect: Uninitialized BrushItem!" );
- ::DrawGraphic( rInf.GetBrushItem(), 0, pOut, rInf.GetBrushRect(),
+ ::DrawGraphic( rInf.GetBrushItem(), 0, 0, pOut, rInf.GetBrushRect(),
aRegion[i] );
}
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 030e3ef..21408f8 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2540,6 +2540,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
{
const SvxBrushItem* pItem;
const XFillStyleItem* pFillStyleItem;
+ const XFillGradientItem* pFillGradientItem;
SwRect aOrigBackRect;
/// OD 21.08.2002
@@ -2548,7 +2549,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
/// OD 21.08.2002 #99657#
/// There is a user defined setting for the background, if there
/// is a background brush and its color is *not* "no fill"/"auto fill".
- if( GetFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, sal_False ) )
+ if( GetFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, sal_False ) )
{
if ( !pCol )
{
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 07362ca..c381419 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -20,6 +20,7 @@
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/embed/XClassifiedObject.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/embed/XComponentSupplier.hpp>
@@ -28,6 +29,7 @@
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <svx/svxids.hrc>
#include <svx/xfillit0.hxx>
+#include <svx/xflgrit.hxx>
#include <editeng/memberids.hrc>
#include <swtypes.hxx>
@@ -175,8 +177,6 @@ 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* 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;
@@ -189,15 +189,13 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency );
if(pCol || pTrans || pGrURL || pGrFilter || pGrLoc ||
- pGrTranparency || pColTrans || pRGBCol || pGradient)
+ pGrTranparency || pColTrans || pRGBCol)
{
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(pGradient)
- bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGradient, MID_FILL_GRADIENT);
if(pRGBCol)
bRet &= ((SfxPoolItem&)aBrush).PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B);
if(pTrans)
@@ -229,6 +227,16 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
}
}
{
+ const ::uno::Any* pFillGradient = 0;
+ GetProperty(RES_FILL_GRADIENT, MID_FILLGRADIENT, pFillGradient);
+ if (pFillGradient)
+ {
+ XFillGradientItem aFillGradient( static_cast <const :: XFillGradientItem & > ( rFromSet.Get ( RES_FILL_GRADIENT ) ) );
+ bRet &= ((SfxPoolItem&)aFillGradient).PutValue(*pFillGradient, MID_FILLGRADIENT);
+ rToSet.Put(aFillGradient);
+ }
+ }
+ {
const ::uno::Any* pCont = 0;
GetProperty(RES_PROTECT, MID_PROTECT_CONTENT, pCont );
const ::uno::Any* pPos = 0;
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index e80c7cb..061f76c 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -289,7 +289,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ 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_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0}, \
- { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILL_GRADIENT}, \
+ { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT}, \
{ 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 }, \
@@ -667,7 +667,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ 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_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0},
- { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILL_GRADIENT},
+ { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT},
// { 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 },
commit 06de72bea24a83e4a4efbc235853a40781bce168
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Sun Jan 27 20:52:55 2013 +0100
SwXTextFrame: use XFillStyleItem instead of extending SvxBrushItem
Change-Id: I03b841ed703503425c9f1a2045d6399c8899815f
diff --git a/editeng/inc/editeng/brshitem.hxx b/editeng/inc/editeng/brshitem.hxx
index 44354b4..b35df0e 100644
--- a/editeng/inc/editeng/brshitem.hxx
+++ b/editeng/inc/editeng/brshitem.hxx
@@ -23,7 +23,6 @@
#include <vcl/wall.hxx>
#include <tools/link.hxx>
#include <editeng/editengdllapi.h>
-#include <com/sun/star/drawing/FillStyle.hpp>
// class SvxBrushItem ----------------------------------------------------
@@ -113,7 +112,6 @@ 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 );
@@ -121,7 +119,6 @@ public:
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 077bcd2..9bcafd6 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3328,9 +3328,8 @@ public:
Link aDoneLink;
SvStream* pStream;
Gradient aGradient;
- drawing::FillStyle eFillStyle;
- SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0), eFillStyle(drawing::FillStyle_NONE) {}
+ SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {}
};
// -----------------------------------------------------------------------
@@ -3643,9 +3642,6 @@ 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;
@@ -3777,9 +3773,6 @@ 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;
@@ -3867,7 +3860,6 @@ SvxBrushItem& SvxBrushItem::operator=( const SvxBrushItem& rItem )
}
}
pImpl->nGraphicTransparency = rItem.pImpl->nGraphicTransparency;
- pImpl->eFillStyle = rItem.pImpl->eFillStyle;
pImpl->aGradient = rItem.pImpl->aGradient;
return *this;
}
@@ -3881,7 +3873,6 @@ 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->eFillStyle == rCmp.pImpl->eFillStyle &&
pImpl->aGradient == rCmp.pImpl->aGradient);
if ( bEqual )
@@ -4194,21 +4185,11 @@ void SvxBrushItem::ApplyGraphicTransparency_Impl()
}
}
-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;
diff --git a/svx/inc/svx/xfillit0.hxx b/svx/inc/svx/xfillit0.hxx
index a1c56c6..4ed2b9b 100644
--- a/svx/inc/svx/xfillit0.hxx
+++ b/svx/inc/svx/xfillit0.hxx
@@ -35,6 +35,7 @@ class SVX_DLLPUBLIC XFillStyleItem : public SfxEnumItem
public:
TYPEINFO();
XFillStyleItem(XFillStyle = XFILL_SOLID);
+ XFillStyleItem(XFillStyle, sal_uInt16 nWhich);
XFillStyleItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index ce3f1de..6e7355e 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -2768,6 +2768,11 @@ XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle) :
{
}
+XFillStyleItem::XFillStyleItem(XFillStyle eFillStyle, sal_uInt16 nWhich_) :
+ SfxEnumItem(nWhich_, sal::static_int_cast< sal_uInt16 >(eFillStyle))
+{
+}
+
/*************************************************************************
|*
|* XFillStyleItem::XFillStyleItem(SvStream& rIn)
diff --git a/sw/inc/frmatr.hxx b/sw/inc/frmatr.hxx
index f456e6f..2266c14 100644
--- a/sw/inc/frmatr.hxx
+++ b/sw/inc/frmatr.hxx
@@ -44,6 +44,8 @@ inline const SvxFmtKeepItem &SwAttrSet::GetKeep(sal_Bool bInP) const
{ return (const SvxFmtKeepItem&)Get( RES_KEEP,bInP); }
inline const SvxBrushItem &SwAttrSet::GetBackground(sal_Bool bInP) const
{ return (const SvxBrushItem&)Get( RES_BACKGROUND,bInP); }
+inline const XFillStyleItem &SwAttrSet::GetFillStyle(sal_Bool bInP) const
+ { return (const XFillStyleItem&)Get( RES_FILL_STYLE,bInP); }
inline const SvxShadowItem &SwAttrSet::GetShadow(sal_Bool bInP) const
{ return (const SvxShadowItem&)Get( RES_SHADOW,bInP); }
inline const SvxFmtBreakItem &SwAttrSet::GetBreak(sal_Bool bInP) const
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 3c522a5..8c27a86 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -220,6 +220,7 @@ RES_FRMATR_BEGIN = RES_PARATR_LIST_END,
RES_AUTO_STYLE, // 119
RES_FRMATR_STYLE_NAME, // 120
RES_FRMATR_CONDITIONAL_STYLE_NAME, // 121
+ RES_FILL_STYLE,
RES_FRMATR_END
};
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 0f502e2..4889346 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -74,6 +74,7 @@ class SwFmtHoriOrient;
class SwFmtAnchor;
class SvxBoxItem;
class SvxBrushItem;
+class XFillStyleItem;
class SvxShadowItem;
class SwFmtPageDesc;
class SvxFmtBreakItem;
@@ -270,6 +271,7 @@ public:
inline const SvxBoxItem &GetBox( sal_Bool = sal_True ) const;
inline const SvxFmtKeepItem &GetKeep( sal_Bool = sal_True ) const;
inline const SvxBrushItem &GetBackground( sal_Bool = sal_True ) const;
+ inline const XFillStyleItem &GetFillStyle( sal_Bool = sal_True ) const;
inline const SvxShadowItem &GetShadow( sal_Bool = sal_True ) const;
inline const SwFmtPageDesc &GetPageDesc( sal_Bool = sal_True ) const;
inline const SvxFmtBreakItem &GetBreak( sal_Bool = sal_True ) const;
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index a66aeb5..983fb29 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -913,10 +913,11 @@ static bool lcl_GetBackgroundColor( Color & rColor,
SwCrsrShell* pCrsrSh )
{
const SvxBrushItem* pBackgrdBrush = 0;
+ const XFillStyleItem* pFillStyleItem = 0;
const Color* pSectionTOXColor = 0;
SwRect aDummyRect;
if ( pFrm &&
- pFrm->GetBackgroundBrush( pBackgrdBrush, pSectionTOXColor, aDummyRect, false ) )
+ pFrm->GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pSectionTOXColor, aDummyRect, false ) )
{
if ( pSectionTOXColor )
{
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 73bc1df..77829f44 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -110,6 +110,7 @@
#include <rtl/instance.hxx>
#include <svl/macitem.hxx>
#include <svx/dialogs.hrc>
+#include <svx/xfillit0.hxx>
#include <swcalwrp.hxx>
#include <SwStyleNameMapper.hxx>
#include <tblafmt.hxx>
@@ -379,6 +380,7 @@ SfxItemInfo aSlotTab[] =
{ 0, 0 }, // RES_AUTO_STYLE
{ 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_STYLE_NAME
{ 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_CONDITIONAL_STYLE_NAME
+ { 0, SFX_ITEM_POOLABLE }, // RES_FILL_STYLE
{ 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_MIRRORGRF
{ SID_ATTR_GRAF_CROP, SFX_ITEM_POOLABLE }, // RES_GRFATR_CROPGRF
@@ -594,6 +596,7 @@ void _InitCore()
aAttrTab[ RES_AUTO_STYLE - POOLATTR_BEGIN ] = new SwFmtAutoFmt( RES_AUTO_STYLE );
aAttrTab[ RES_FRMATR_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_STYLE_NAME, aEmptyStr );
aAttrTab[ RES_FRMATR_CONDITIONAL_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_CONDITIONAL_STYLE_NAME, aEmptyStr );
+ aAttrTab[ RES_FILL_STYLE - POOLATTR_BEGIN ] = new XFillStyleItem(XFILL_SOLID, RES_FILL_STYLE);
aAttrTab[ RES_GRFATR_MIRRORGRF- POOLATTR_BEGIN ] = new SwMirrorGrf;
aAttrTab[ RES_GRFATR_CROPGRF- POOLATTR_BEGIN ] = new SwCropGrf;
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index e87c9bf..84fc446 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -209,10 +209,10 @@ static void lcl_ClearArea( const SwFrm &rFrm,
if ( !aRegion.empty() )
{
- const SvxBrushItem *pItem; const Color *pCol; SwRect aOrigRect;
- if ( rFrm.GetBackgroundBrush( pItem, pCol, aOrigRect, sal_False ) )
+ const SvxBrushItem *pItem; const XFillStyleItem* pFillStyleItem; const Color *pCol; SwRect aOrigRect;
+ if ( rFrm.GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigRect, sal_False ) )
for( sal_uInt16 i = 0; i < aRegion.size(); ++i )
- ::DrawGraphic( pItem, &rOut, aOrigRect, aRegion[i] );
+ ::DrawGraphic( pItem, pFillStyleItem, &rOut, aOrigRect, aRegion[i] );
else
{
rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 857a666..96d59bf 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -48,6 +48,7 @@ class Color;
class SwBorderAttrs;
class SwCache;
class SvxBrushItem;
+class XFillStyleItem;
class SwSelectionList;
struct SwPosition;
struct SwCrsrMoveState;
@@ -501,6 +502,7 @@ public:
void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;
sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush,
+ const XFillStyleItem* & rpFillStyle,
const Color*& rpColor,
SwRect &rOrigRect,
sal_Bool bLowerMode ) const;
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index ce27567..78af6f0 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -36,6 +36,7 @@ class SwAttrSet;
class SdrObject;
class BigInt;
class SvxBrushItem;
+class XFillStyleItem;
class SdrMarkList;
class SwNodeIndex;
class OutputDevice;
@@ -50,7 +51,7 @@ class SwPageDesc;
// draw background with brush or graphics
// The 6th parameter indicates that the method should consider background
// transparency, saved in the color of the brush item.
-void DrawGraphic( const SvxBrushItem *, OutputDevice *,
+void DrawGraphic( const SvxBrushItem *, const XFillStyleItem*, OutputDevice *,
const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum = GRFNUM_NO,
const sal_Bool bConsiderBackgroundTransparency = sal_False );
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 40cf352..94dedda 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1785,6 +1785,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
} // end of method <lcl_DrawGraphic>
void DrawGraphic( const SvxBrushItem *pBrush,
+ const XFillStyleItem* pFillStyleItem,
OutputDevice *pOutDev,
const SwRect &rOrg,
const SwRect &rOut,
@@ -2076,7 +2077,7 @@ void DrawGraphic( const SvxBrushItem *pBrush,
/// draw poly-polygon transparent
pOutDev->DrawTransparent( aDrawPoly, nTransparencyPercent );
}
- else if (!pBrush || pBrush->GetFillStyle() != drawing::FillStyle_GRADIENT)
+ else if (!pFillStyleItem || pFillStyleItem->GetValue() != XFILL_GRADIENT)
{
SwRegionRects aRegion( rOut, 4 );
if ( !bGrfIsTransparent )
@@ -3710,9 +3711,10 @@ sal_Bool SwFlyFrm::IsBackgroundTransparent() const
static_cast<const SwFlyFrmFmt*>(GetFmt())->IsBackgroundBrushInherited() )
{
const SvxBrushItem* pBackgrdBrush = 0;
+ const XFillStyleItem* pFillStyleItem = 0;
const Color* pSectionTOXColor = 0;
SwRect aDummyRect;
- if ( GetBackgroundBrush( pBackgrdBrush, pSectionTOXColor, aDummyRect, false) )
+ if ( GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pSectionTOXColor, aDummyRect, false) )
{
if ( pSectionTOXColor &&
(pSectionTOXColor->GetTransparency() != 0) &&
@@ -6083,6 +6085,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() );
const SvxBrushItem* pItem;
+ const XFillStyleItem* pFillStyleItem;
/// OD 05.09.2002 #102912#
/// temporary background brush for a fly frame without a background brush
SvxBrushItem* pTmpBackBrush = 0;
@@ -6091,7 +6094,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const bool bPageFrm = IsPageFrm();
sal_Bool bLowMode = sal_True;
- sal_Bool bBack = GetBackgroundBrush( pItem, pCol, aOrigBackRect, bLowerMode );
+ sal_Bool bBack = GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, bLowerMode );
//- Output if a separate background is used.
bool bNoFlyBackground = !bFlyMetafile && !bBack && IsFlyFrm();
if ( bNoFlyBackground )
@@ -6101,7 +6104,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
// <GetBackgroundBrush> disabled this option with the parameter <bLowerMode>
if ( bLowerMode )
{
- bBack = GetBackgroundBrush( pItem, pCol, aOrigBackRect, false );
+ bBack = GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, false );
}
// If still no background found for the fly frame, initialize the
// background brush <pItem> with global retouche color and set <bBack>
@@ -6192,7 +6195,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
/// Set missing 5th parameter to the default value GRFNUM_NO
/// - see declaration in /core/inc/frmtool.hxx.
if (IsTxtFrm() || !bOnlyTxtBackground)
- ::DrawGraphic( pItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO,
+ ::DrawGraphic( pItem, pFillStyleItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO,
bConsiderBackgroundTransparency );
}
}
@@ -6869,9 +6872,10 @@ void SwLayoutFrm::RefreshExtraData( const SwRect &rRect ) const
const Color& SwPageFrm::GetDrawBackgrdColor() const
{
const SvxBrushItem* pBrushItem;
+ const XFillStyleItem* pFillStyleItem;
const Color* pDummyColor;
SwRect aDummyRect;
- if ( GetBackgroundBrush( pBrushItem, pDummyColor, aDummyRect, true) )
+ if ( GetBackgroundBrush( pBrushItem, pFillStyleItem, pDummyColor, aDummyRect, true) )
return pBrushItem->GetColor();
else
return aGlobalRetoucheColor;
@@ -6996,6 +7000,9 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
@param rpBrush
output parameter - constant reference pointer the found background brush
+ @param rpFillStyle
+ output parameter - constant reference pointer the found background fill style
+
@param rpCol
output parameter - constant reference pointer to the color of the index shading
set under special conditions, if background brush is taken from an index section.
@@ -7012,6 +7019,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
@return true, if a background brush for the frame is found
*/
sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
+ const XFillStyleItem* & rpFillStyle,
const Color*& rpCol,
SwRect &rOrigRect,
sal_Bool bLowerMode ) const
@@ -7020,12 +7028,14 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
ViewShell *pSh = getRootFrm()->GetCurrShell();
const SwViewOption *pOpt = pSh->GetViewOptions();
rpBrush = 0;
+ rpFillStyle = 0;
rpCol = NULL;
do
{ if ( pFrm->IsPageFrm() && !pOpt->IsPageBack() )
return sal_False;
const SvxBrushItem &rBack = pFrm->GetAttrSet()->GetBackground();
+ const XFillStyleItem &rFillStyle = pFrm->GetAttrSet()->GetFillStyle();
if( pFrm->IsSctFrm() )
{
const SwSection* pSection = ((SwSectionFrm*)pFrm)->GetSection();
@@ -7067,10 +7077,11 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
if ( !rBack.GetColor().GetTransparency() ||
rBack.GetGraphicPos() != GPOS_NONE ||
rpCol ||
- (bConsiderBackgroundTransparency && (rBack.GetColor() != COL_TRANSPARENT || rBack.GetFillStyle() == drawing::FillStyle_GRADIENT))
+ (bConsiderBackgroundTransparency && (rBack.GetColor() != COL_TRANSPARENT || rFillStyle.GetValue() == XFILL_GRADIENT))
)
{
rpBrush = &rBack;
+ rpFillStyle = &rFillStyle;
if ( pFrm->IsPageFrm() &&
pSh->GetViewOptions()->getBrowseMode() )
rOrigRect = pFrm->Frm();
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index e37128d..8d8543d 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -513,13 +513,14 @@ static sal_Bool lcl_IsDarkBackground( const SwTxtPaintInfo& rInf )
if( ! pCol || COL_TRANSPARENT == pCol->GetColor() )
{
const SvxBrushItem* pItem;
+ const XFillStyleItem* pFillStyleItem;
SwRect aOrigBackRect;
// Consider, that [GetBackgroundBrush(...)] can set <pCol>
// See implementation in /core/layout/paintfrm.cxx
// There is a background color, if there is a background brush and
// its color is *not* "no fill"/"auto fill".
- if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, sal_False ) )
+ if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, sal_False ) )
{
if ( !pCol )
pCol = &pItem->GetColor();
@@ -884,7 +885,7 @@ void SwTxtPaintInfo::DrawRect( const SwRect &rRect, sal_Bool bNoGraphic,
else
{
OSL_ENSURE( ((SvxBrushItem*)-1) != pBrushItem, "DrawRect: Uninitialized BrushItem!" );
- ::DrawGraphic( pBrushItem, pOut, aItemRect, rRect );
+ ::DrawGraphic( pBrushItem, 0, pOut, aItemRect, rRect );
}
}
}
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 94d3986..9217a05 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -1021,7 +1021,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
}
if( bDraw && aTmp.HasArea() )
- DrawGraphic( pBrush, (OutputDevice*)rInf.GetOut(),
+ DrawGraphic( pBrush, 0, (OutputDevice*)rInf.GetOut(),
aTmp, aRepaint, bReplace ? GRFNUM_REPLACE : GRFNUM_YES );
}
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index b6653db..bc9ee74 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -658,7 +658,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
{
OSL_ENSURE( ((SvxBrushItem*)-1) != rInf.GetBrushItem(),
"DrawRect: Uninitialized BrushItem!" );
- ::DrawGraphic( rInf.GetBrushItem(), pOut, rInf.GetBrushRect(),
+ ::DrawGraphic( rInf.GetBrushItem(), 0, pOut, rInf.GetBrushRect(),
aRegion[i] );
}
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index a0ef06a..030e3ef 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2539,6 +2539,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
if( ! pCol || COL_TRANSPARENT == pCol->GetColor() )
{
const SvxBrushItem* pItem;
+ const XFillStyleItem* pFillStyleItem;
SwRect aOrigBackRect;
/// OD 21.08.2002
@@ -2547,7 +2548,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
/// OD 21.08.2002 #99657#
/// There is a user defined setting for the background, if there
/// is a background brush and its color is *not* "no fill"/"auto fill".
- if( GetFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, sal_False ) )
+ if( GetFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, sal_False ) )
{
if ( !pCol )
{
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index b289c7d..07362ca 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -19,6 +19,7 @@
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/embed/XClassifiedObject.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/embed/XComponentSupplier.hpp>
@@ -26,6 +27,7 @@
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <svx/svxids.hrc>
+#include <svx/xfillit0.hxx>
#include <editeng/memberids.hrc>
#include <swtypes.hxx>
@@ -173,8 +175,6 @@ 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;
@@ -189,15 +189,13 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency );
if(pCol || pTrans || pGrURL || pGrFilter || pGrLoc ||
- pGrTranparency || pColTrans || pRGBCol || pFillStyle || pGradient)
+ pGrTranparency || pColTrans || pRGBCol || 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)
@@ -221,6 +219,16 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
}
}
{
+ const ::uno::Any* pFillStyle = 0;
+ GetProperty(RES_FILL_STYLE, 0, pFillStyle);
+ if (pFillStyle)
+ {
+ XFillStyleItem aFillStyle( static_cast <const :: XFillStyleItem & > ( rFromSet.Get ( RES_FILL_STYLE ) ) );
+ bRet &= ((SfxPoolItem&)aFillStyle).PutValue(*pFillStyle);
+ rToSet.Put(aFillStyle);
+ }
+ }
+ {
const ::uno::Any* pCont = 0;
GetProperty(RES_PROTECT, MID_PROTECT_CONTENT, pCont );
const ::uno::Any* pPos = 0;
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index f490343..e80c7cb 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -288,7 +288,7 @@ 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_STYLE), RES_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0}, \
{ 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}, \
@@ -666,7 +666,7 @@ 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_STYLE), RES_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0},
{ 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},
More information about the Libreoffice-commits
mailing list