summaryrefslogtreecommitdiff
path: root/sw/source/ui/docvw/HeaderFooterWin.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-09-15 10:54:46 +0200
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-09-15 10:57:30 +0200
commitc95d90199397b529de1a9979c065a7f35e52a188 (patch)
tree0d09b69bc627a184716e8d436f4e3403fa6b7938 /sw/source/ui/docvw/HeaderFooterWin.cxx
parent8081794d91884f471494a0bbf41e69f5ec80e247 (diff)
Header/Footer: add the Border and Background... menu item
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 1f7bbaefb54b..a7066398a602 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -45,7 +45,9 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/color/bcolortools.hxx>
+#include <editeng/boxitem.hxx>
#include <svtools/svtdata.hxx>
+#include <svx/hdft.hxx>
#include <vcl/decoview.hxx>
#include <vcl/gradient.hxx>
#include <vcl/menubtn.hxx>
@@ -292,6 +294,52 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
nPageId, &rSh );
}
break;
+ case FN_HEADERFOOTER_BORDERBACK:
+ {
+ const SwPageDesc* pDesc = m_pPageFrm->GetPageDesc();
+ const SwFrmFmt& rMaster = pDesc->GetMaster();
+ SwFrmFmt* pHFFmt = const_cast< SwFrmFmt* >( rMaster.GetFooter().GetFooterFmt() );
+ if ( m_bIsHeader )
+ pHFFmt = const_cast< SwFrmFmt* >( rMaster.GetHeader().GetHeaderFmt() );
+
+
+ SfxItemPool* pPool = pHFFmt->GetAttrSet().GetPool();
+ SfxItemSet aSet( *pPool,
+ RES_BACKGROUND, RES_BACKGROUND,
+ RES_BOX, RES_BOX,
+ SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
+ RES_SHADOW, RES_SHADOW, 0 );
+
+ aSet.Put( pHFFmt->GetAttrSet() );
+
+ // Create a box info item... needed by the dialog
+ SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
+ const SfxPoolItem *pBoxInfo;
+ if ( SFX_ITEM_SET == pHFFmt->GetAttrSet().GetItemState( SID_ATTR_BORDER_INNER,
+ sal_True, &pBoxInfo) )
+ aBoxInfo = *(SvxBoxInfoItem*)pBoxInfo;
+
+ aBoxInfo.SetTable( sal_False );
+ aBoxInfo.SetDist( sal_True);
+ aBoxInfo.SetMinDist( sal_False );
+ aBoxInfo.SetDefDist( MIN_BORDER_DIST );
+ aBoxInfo.SetValid( VALID_DISABLE );
+ aSet.Put( aBoxInfo );
+
+ if ( svx::ShowBorderBackgroundDlg( this, &aSet, true ) )
+ {
+ const SfxPoolItem* pItem;
+ if ( SFX_ITEM_SET == aSet.GetItemState( RES_BACKGROUND, sal_False, &pItem ) )
+ pHFFmt->SetFmtAttr( *pItem );
+
+ if ( SFX_ITEM_SET == aSet.GetItemState( RES_BOX, sal_False, &pItem ) )
+ pHFFmt->SetFmtAttr( *pItem );
+
+ if ( SFX_ITEM_SET == aSet.GetItemState( RES_SHADOW, sal_False, &pItem ) )
+ pHFFmt->SetFmtAttr( *pItem );
+ }
+ }
+ break;
case FN_HEADERFOOTER_DELETE:
{
rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );