diff options
author | Armin Le Grand <alg@apache.org> | 2014-06-02 15:00:50 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-01 13:30:09 +0200 |
commit | 7d9bb549d498d6beed2c4050c402d09643febdfa (patch) | |
tree | 2caf67e36c9ccd058268b003cf2bc39b9b102b53 /sw/source/uibase/frmdlg | |
parent | a5e137eb1d37361c60175e8fba780fc46b377a23 (diff) |
Related: #i124638# Second step of DrawingLayer FillAttributes...
for Writer objects, now added support for Paragraph and PageStyle (including
Header and Footer) for direct attributes and style attributes
(cherry picked from commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b)
Conflicts:
cui/source/factory/dlgfact.cxx
cui/source/factory/dlgfact.hxx
cui/source/inc/bbdlg.hxx
cui/source/inc/cuires.hrc
cui/source/tabpages/bbdlg.cxx
cui/source/tabpages/bbdlg.src
cui/source/tabpages/page.cxx
cui/source/tabpages/tparea.cxx
include/svx/pagectrl.hxx
include/svx/svxdlg.hxx
include/svx/svxids.hrc
include/xmloff/PageMasterStyleMap.hxx
include/xmloff/prstylei.hxx
include/xmloff/txtprmap.hxx
svx/Package_inc.mk
svx/inc/svx/hdft.hxx
svx/source/dialog/hdft.cxx
svx/source/dialog/pagectrl.cxx
svx/source/tbxctrls/tbxcolorupdate.cxx
svx/source/unodraw/unobrushitemhelper.cxx
sw/Library_sw.mk
sw/inc/fillattributes.hxx
sw/inc/format.hxx
sw/inc/frmatr.hxx
sw/inc/frmfmt.hxx
sw/inc/hintids.hxx
sw/inc/hints.hxx
sw/inc/ndtxt.hxx
sw/inc/node.hxx
sw/inc/swunohelper.hxx
sw/inc/unobrushitemhelper.hxx
sw/inc/unoprnms.hxx
sw/source/core/attr/format.cxx
sw/source/core/attr/hints.cxx
sw/source/core/doc/docdesc.cxx
sw/source/core/doc/docdraw.cxx
sw/source/core/doc/docfmt.cxx
sw/source/core/doc/docnew.cxx
sw/source/core/doc/docredln.cxx
sw/source/core/doc/poolfmt.cxx
sw/source/core/doc/visiturl.cxx
sw/source/core/docnode/node.cxx
sw/source/core/inc/frame.hxx
sw/source/core/inc/frmtool.hxx
sw/source/core/inc/rolbck.hxx
sw/source/core/layout/atrfrm.cxx
sw/source/core/layout/fillattributes.cxx
sw/source/core/layout/findfrm.cxx
sw/source/core/layout/paintfrm.cxx
sw/source/core/txtnode/ndtxt.cxx
sw/source/core/txtnode/thints.cxx
sw/source/core/txtnode/txtedt.cxx
sw/source/core/undo/rolbck.cxx
sw/source/core/unocore/swunohelper.cxx
sw/source/core/unocore/unoframe.cxx
sw/source/core/unocore/unomap.cxx
sw/source/core/unocore/unoparagraph.cxx
sw/source/core/unocore/unoprnms.cxx
sw/source/core/unocore/unostyle.cxx
sw/source/ui/chrdlg/paradlg.src
sw/source/ui/chrdlg/pardlg.cxx
sw/source/ui/fmtui/tmpdlg.cxx
sw/source/ui/fmtui/tmpdlg.src
sw/source/uibase/app/docst.cxx
sw/source/uibase/app/docstyle.cxx
sw/source/uibase/frmdlg/colex.cxx
sw/source/uibase/shells/basesh.cxx
sw/source/uibase/shells/textsh1.cxx
sw/source/uibase/uiview/viewstat.cxx
sw/source/uibase/utlui/uitool.cxx
xmloff/inc/PageMasterImportContext.hxx
xmloff/inc/xmloff/XMLShapeStyleContext.hxx
xmloff/source/draw/XMLShapeStyleContext.cxx
xmloff/source/draw/sdpropls.hxx
xmloff/source/style/PageMasterExportPropMapper.cxx
xmloff/source/style/PageMasterImportContext.cxx
xmloff/source/style/PageMasterPropHdlFactory.cxx
xmloff/source/style/PageMasterStyleMap.cxx
xmloff/source/style/prstylei.cxx
xmloff/source/text/txtexppr.cxx
xmloff/source/text/txtprhdl.cxx
xmloff/source/text/txtprmap.cxx
xmloff/source/text/txtstyli.cxx
Conflicts:
svx/source/dialog/hdft.cxx
sw/source/core/doc/visiturl.cxx
sw/source/core/txtnode/thints.cxx
sw/source/core/txtnode/txtatr2.cxx
sw/source/core/unocore/unostyle.cxx
Change-Id: I7e8779db6c0cbd1e242b63eab888f468f2de509a
Diffstat (limited to 'sw/source/uibase/frmdlg')
-rw-r--r-- | sw/source/uibase/frmdlg/colex.cxx | 79 |
1 files changed, 54 insertions, 25 deletions
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index 98b4bad4a852..b1f04173bf80 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -20,7 +20,6 @@ #include "cmdid.h" #include "hintids.hxx" #include <algorithm> - #include <svl/eitem.hxx> #include <editeng/lrspitem.hxx> #include <editeng/ulspitem.hxx> @@ -37,6 +36,9 @@ #include "colex.hxx" #include "colmgr.hxx" +//UUUU +#include <svx/unobrushitemhelper.hxx> + // Taking the updated values from the set void SwPageExample::UpdateExample( const SfxItemSet& rSet ) { @@ -114,12 +116,20 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) SetHdLeft( rLR.GetLeft() ); SetHdRight( rLR.GetRight() ); SetHeader( true ); - if ( rHeaderSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET ) + + if(SFX_ITEM_SET == rHeaderSet.GetItemState(RES_BACKGROUND)) { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rHeaderSet.Get( RES_BACKGROUND ); - SetHdColor( rItem.GetColor() ); + //UUUU create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor()); + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(RES_BACKGROUND)); + SfxItemSet aTempSet(*rHeaderSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + setHeaderFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + aTempSet))); } + if ( rHeaderSet.GetItemState( RES_BOX ) == SFX_ITEM_SET ) { const SvxBoxItem& rItem = @@ -153,12 +163,20 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) SetFtLeft( rLR.GetLeft() ); SetFtRight( rLR.GetRight() ); SetFooter( true ); + if( rFooterSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET ) { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rFooterSet.Get( RES_BACKGROUND ); - SetFtColor( rItem.GetColor() ); + //UUUU create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor()); + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rFooterSet.Get(RES_BACKGROUND)); + SfxItemSet aTempSet(*rFooterSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + setFooterFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + aTempSet))); } + if( rFooterSet.GetItemState( RES_BOX ) == SFX_ITEM_SET ) { const SvxBoxItem& rItem = @@ -169,19 +187,18 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) else SetFooter( false ); } - if( SFX_ITEM_SET == rSet.GetItemState( RES_BACKGROUND, - false, &pItem ) ) - { - SetColor( ( (const SvxBrushItem*)pItem )->GetColor() ); - const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic(); - if ( pGrf ) - { - Bitmap aBitmap = pGrf->GetBitmap(); - SetBitmap( &aBitmap ); - } - else - SetBitmap( NULL ); + if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND, false, &pItem)) + { + //UUUU create FillAttributes from SvxBrushItem + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem); + SfxItemSet aTempSet(*rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + setPageFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + aTempSet))); } Invalidate(); @@ -215,14 +232,23 @@ void SwColExample::DrawPage( const Point& rOrg, - GetFtHeight() - GetFtDist(); DrawRect(aRect); - if(GetColor() == Color(COL_TRANSPARENT)) + //UUUU + const Rectangle aDefineRect(aRect); + + //UUUU + const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes = getPageFillAttributes(); + + if(!rFillAttributes.get() || !rFillAttributes->isUsed()) { + //UUUU If there is no fill, use fallback color const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); const Color& rFieldColor = rStyleSettings.GetFieldColor(); - SetFillColor( rFieldColor ); + + setPageFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + rFieldColor))); } - else - SetFillColor( GetColor() ); // #97495# make sure that the automatic column width's are always equal bool bAutoWidth = pColMgr->IsAutoWidth(); @@ -242,7 +268,10 @@ void SwColExample::DrawPage( const Point& rOrg, if(!bAutoWidth) nAutoColWidth = pColMgr->GetColWidth( i ); aRect.Right() = aRect.Left() + nAutoColWidth; - DrawRect(aRect); + + //UUUU use primitive draw command + drawFillAttributes(getPageFillAttributes(), aRect, aDefineRect); + if(i < nColumnCount - 1) aRect.Left() = aRect.Right() + pColMgr->GetGutterWidth(i); } |