summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/backgrnd.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-13 11:26:50 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-02-13 12:01:02 +0100
commit33fcc140ba412bd7565cc469418e65d445c98b52 (patch)
tree55bebac9bb5a499abe63089824f80548f94f078a /cui/source/tabpages/backgrnd.cxx
parent206c088c092d484dbbed82ff3c18e6dfc00de513 (diff)
SvxBackgroundTabPage::FillItemSet: handle XFILL_BITMAP -> XFILL_GRADIENT
This makes it possible to turn the bitmap background of a Writer frame into a gradient one. Change-Id: Iae88793d40593a2adbcc7f83e82e28265cdd9be7
Diffstat (limited to 'cui/source/tabpages/backgrnd.cxx')
-rw-r--r--cui/source/tabpages/backgrnd.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 15b6d10f0c4e..3553df854308 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -844,8 +844,20 @@ sal_Bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
}
else // Brush <-> Bitmap changed!
{
- if ( bIsBrush )
+ if (bIsBrush || bIsGradient)
+ {
rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) );
+ if (bIsGradient)
+ {
+ // Handle XFILL_BITMAP -> XFILL_GRADIENT
+ XFillStyleItem aFillStyleItem(((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue(), GetWhich(SID_ATTR_FILL_STYLE));
+ rCoreSet.Put(aFillStyleItem);
+
+ const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT);
+ XFillGradientItem aFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue(), GetWhich(SID_ATTR_FILL_GRADIENT));
+ rCoreSet.Put(aFillGradientItem);
+ }
+ }
else
{
SvxBrushItem* pTmpBrush = 0;
@@ -873,7 +885,7 @@ sal_Bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
delete pTmpBrush;
}
}
- bModified = ( bIsBrush || m_pBtnLink->IsChecked() || bIsGraphicValid );
+ bModified = ( bIsBrush || bIsGradient || m_pBtnLink->IsChecked() || bIsGraphicValid );
}
}
else if ( SID_ATTR_BRUSH_CHAR == nSlot && aBgdColor != Color( COL_WHITE ) )