diff options
Diffstat (limited to 'svx/source/dialog')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/docrecovery.cxx | 8 | ||||
-rw-r--r-- | svx/source/dialog/hdft.cxx | 476 | ||||
-rw-r--r-- | svx/source/dialog/pagectrl.cxx | 461 | ||||
-rw-r--r-- | svx/source/dialog/pfiledlg.cxx | 2 |
5 files changed, 587 insertions, 362 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 72101ed2acaa..f4f8d65f86bd 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1099,7 +1099,7 @@ Rectangle SvxPixelCtl::implCalFocusRect( const Point& aPosition ) return Rectangle(nLeft,nTop,nRight,nBottom); } -//Solution:Keyboard fucntion +//Solution:Keyboard function void SvxPixelCtl::KeyInput( const KeyEvent& rKEvt ) { KeyCode aKeyCode = rKEvt.GetKeyCode(); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index aec7768ba8b9..fec655dbb057 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -448,7 +448,7 @@ ERecoveryState RecoveryCore::mapDocState2RecoverState(sal_Int32 eDocState) ERecoveryState eRecState = E_NOT_RECOVERED_YET; /* Attention: - Some of the following states can occure at the + Some of the following states can occur at the same time. So we have to check for the "worst case" first! DAMAGED -> INCOMPLETE -> HANDLED @@ -596,7 +596,7 @@ void RecoveryCore::impl_startListening() //=============================================== void RecoveryCore::impl_stopListening() { - // Ignore it, if this instance doesnt listen currently + // Ignore it, if this instance doesn't listen currently if (!m_xRealCore.is()) return; @@ -757,7 +757,7 @@ SaveDialog::SaveDialog(Window* pParent, FreeResource(); // Prepare the office for the following crash save step. - // E.g. hide all open widows so the user cant influence our + // E.g. hide all open widows so the user can't influence our // operation .-) m_pCore->doEmergencySavePrepare(); @@ -1323,7 +1323,7 @@ short RecoveryDialog::execute() Application::Yield(); // TODO: show BrokenRecoveryDialog again, ift he user - // doesnt accepted it last time. + // doesn't accepted it last time. if (m_bUserDecideNext) return DLG_RET_OK; diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 4eb9ca73712b..70bae5fa376b 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -19,12 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -// include --------------------------------------------------------------- #include <tools/shl.hxx> #include <svl/itemiter.hxx> #include <sfx2/app.hxx> @@ -32,31 +29,33 @@ #include <sfx2/module.hxx> #include <vcl/msgbox.hxx> #include <vcl/graph.hxx> - #include <sfx2/sfxsids.hrc> #include <svx/svxids.hrc> #include <svx/dialogs.hrc> #include "hdft.hrc" #include <svl/intitem.hxx> - #define _SVX_HDFT_CXX - #include <svx/hdft.hxx> #include <svx/pageitem.hxx> -//CHINA001 #include "bbdlg.hxx" #include "svx/dlgutil.hxx" #include <svx/dialmgr.hxx> #include "svx/htmlmode.hxx" - #include <editeng/brshitem.hxx> #include <editeng/lrspitem.hxx> #include <editeng/ulspitem.hxx> #include <editeng/shaditem.hxx> #include <editeng/sizeitem.hxx> #include <editeng/boxitem.hxx> - #include <svx/svxdlg.hxx> //CHINA001 #include <svx/dialogs.hrc> //CHINA001 + +//UUUU +#include <svx/xdef.hxx> +#include <svx/xenum.hxx> +#include <svx/xfillit0.hxx> +#include <svx/unobrushitemhelper.hxx> +#include <sfx2/request.hxx> + // static ---------------------------------------------------------------- // --> OD 2004-06-18 #i19922# @@ -70,6 +69,11 @@ static const long DEF_DIST_CALC = 250; // 2,5mm (Calc) static sal_uInt16 pRanges[] = { SID_ATTR_BRUSH, SID_ATTR_BRUSH, + + //UUUU Support DrawingLayer FillStyles (no real call to below GetRanges() + // detected, still do the complete transition) + XATTR_FILL_FIRST, XATTR_FILL_LAST, + SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW, @@ -138,9 +142,8 @@ SvxFooterPage::SvxFooterPage( Window* pParent, const SfxItemSet& rAttr ) : // ----------------------------------------------------------------------- -SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAttr, sal_uInt16 nSetId ) : - - SfxTabPage( pParent, SVX_RES( nResId ), rAttr ), +SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAttr, sal_uInt16 nSetId ) +: SfxTabPage( pParent, SVX_RES( nResId ), rAttr ), aFrm ( this, SVX_RES( FL_FRAME ) ), aTurnOnBox ( this, SVX_RES( CB_TURNON ) ), @@ -158,11 +161,13 @@ SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAtt aBspWin ( this, SVX_RES( WN_BSP ) ), aBackgroundBtn ( this, SVX_RES( BTN_EXTRAS ) ), - nId ( nSetId ), - pBBSet ( NULL ), - bDisableQueryBox ( sal_False ), - bEnableBackgroundSelector ( sal_True ) + nId ( nSetId ), + pBBSet ( NULL ), + // bitfield + mbDisableQueryBox(false), + mbEnableBackgroundSelector(true), + mbEnableDrawingLayerFillStyles(false) { InitHandler(); aBspWin.EnableRTL( sal_False ); @@ -205,34 +210,49 @@ SvxHFPage::~SvxHFPage() sal_Bool SvxHFPage::FillItemSet( SfxItemSet& rSet ) { - const sal_uInt16 nWSize = GetWhich( SID_ATTR_PAGE_SIZE ); - const sal_uInt16 nWLRSpace = GetWhich( SID_ATTR_LRSPACE ); - const sal_uInt16 nWULSpace = GetWhich( SID_ATTR_ULSPACE ); - const sal_uInt16 nWOn = GetWhich( SID_ATTR_PAGE_ON ); - const sal_uInt16 nWDynamic = GetWhich( SID_ATTR_PAGE_DYNAMIC ); - const sal_uInt16 nWDynSpacing = GetWhich( SID_ATTR_HDFT_DYNAMIC_SPACING ); - const sal_uInt16 nWShared = GetWhich( SID_ATTR_PAGE_SHARED ); - const sal_uInt16 nWBrush = GetWhich( SID_ATTR_BRUSH ); - const sal_uInt16 nWBox = GetWhich( SID_ATTR_BORDER_OUTER ); - const sal_uInt16 nWBoxInfo = GetWhich( SID_ATTR_BORDER_INNER ); - const sal_uInt16 nWShadow = GetWhich( SID_ATTR_BORDER_SHADOW ); - const sal_uInt16 aWhichTab[] = { nWSize, nWSize, - nWLRSpace, nWLRSpace, - nWULSpace, nWULSpace, - nWOn, nWOn, - nWDynamic, nWDynamic, - nWShared, nWShared, - nWBrush, nWBrush, - nWBoxInfo, nWBoxInfo, - nWBox, nWBox, - nWShadow, nWShadow, - nWDynSpacing, nWDynSpacing, - 0 }; - const SfxItemSet& rOldSet = GetItemSet(); - SfxItemPool* pPool = rOldSet.GetPool(); - DBG_ASSERT( pPool, "no pool :-(" ); - SfxMapUnit eUnit = pPool->GetMetric( nWSize ); - SfxItemSet aSet ( *pPool, aWhichTab ); + const sal_uInt16 nWSize = GetWhich(SID_ATTR_PAGE_SIZE); + const sal_uInt16 nWLRSpace = GetWhich(SID_ATTR_LRSPACE); + const sal_uInt16 nWULSpace = GetWhich(SID_ATTR_ULSPACE); + const sal_uInt16 nWOn = GetWhich(SID_ATTR_PAGE_ON); + const sal_uInt16 nWDynamic = GetWhich(SID_ATTR_PAGE_DYNAMIC); + const sal_uInt16 nWDynSpacing = GetWhich(SID_ATTR_HDFT_DYNAMIC_SPACING); + const sal_uInt16 nWShared = GetWhich(SID_ATTR_PAGE_SHARED); + const sal_uInt16 nWBrush = GetWhich(SID_ATTR_BRUSH); + const sal_uInt16 nWBox = GetWhich(SID_ATTR_BORDER_OUTER); + const sal_uInt16 nWBoxInfo = GetWhich(SID_ATTR_BORDER_INNER); + const sal_uInt16 nWShadow = GetWhich(SID_ATTR_BORDER_SHADOW); + + const sal_uInt16 aWhichTab[] = { + nWSize, nWSize, + nWLRSpace, nWLRSpace, + nWULSpace, nWULSpace, + nWOn, nWOn, + nWDynamic, nWDynamic, + nWShared, nWShared, + nWBrush, nWBrush, + nWBoxInfo, nWBoxInfo, + nWBox, nWBox, + nWShadow, nWShadow, + nWDynSpacing, nWDynSpacing, + + //UUUU take over DrawingLayer FillStyles + XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 + + 0, 0}; + + const SfxItemSet& rOldSet = GetItemSet(); + SfxItemPool* pPool = rOldSet.GetPool(); + DBG_ASSERT(pPool,"no pool :-("); + SfxMapUnit eUnit = pPool->GetMetric(nWSize); + SfxItemSet aSet(*pPool,aWhichTab); + + if(mbEnableDrawingLayerFillStyles) + { + //UUUU When using the XATTR_FILLSTYLE DrawingLayer FillStyle definition + // extra action has to be done here since the pool default is XFILL_SOLID + // instead of XFILL_NONE (to have the default blue fill color at start). + aSet.Put(XFillStyleItem(XFILL_NONE)); + } //-------------------------------------------------------------------- @@ -274,26 +294,47 @@ sal_Bool SvxHFPage::FillItemSet( SfxItemSet& rSet ) aSet.Put( aUL ); // Hintergrund und Umrandung? - if ( pBBSet ) - aSet.Put( *pBBSet ); + if(pBBSet) + { + aSet.Put(*pBBSet); + } else { const SfxItemSet* _pSet; const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == - GetItemSet().GetItemState( GetWhich( nId ), sal_False, &pItem ) ) + if(SFX_ITEM_SET == GetItemSet().GetItemState(GetWhich(nId), sal_False, &pItem)) { - _pSet = &( (SvxSetItem*)pItem )->GetItemSet(); - - if ( _pSet->GetItemState( nWBrush ) == SFX_ITEM_SET ) - aSet.Put( (const SvxBrushItem&)_pSet->Get( nWBrush ) ); - if ( _pSet->GetItemState( nWBoxInfo ) == SFX_ITEM_SET ) - aSet.Put( (const SvxBoxInfoItem&)_pSet->Get( nWBoxInfo ) ); - if ( _pSet->GetItemState( nWBox ) == SFX_ITEM_SET ) - aSet.Put( (const SvxBoxItem&)_pSet->Get( nWBox ) ); - if ( _pSet->GetItemState( nWShadow ) == SFX_ITEM_SET ) - aSet.Put( (const SvxShadowItem&)_pSet->Get( nWShadow ) ); + _pSet = &(static_cast< const SvxSetItem* >(pItem)->GetItemSet()); + + if(_pSet->GetItemState(nWBrush) == SFX_ITEM_SET) + { + aSet.Put(_pSet->Get(nWBrush)); + } + + if(_pSet->GetItemState(nWBoxInfo) == SFX_ITEM_SET) + { + aSet.Put(_pSet->Get(nWBoxInfo)); + } + + if(_pSet->GetItemState(nWBox) == SFX_ITEM_SET) + { + aSet.Put(_pSet->Get(nWBox)); + } + + if(_pSet->GetItemState(nWShadow) == SFX_ITEM_SET) + { + aSet.Put(_pSet->Get(nWShadow)); + } + + //UUUU take care of [XATTR_XATTR_FILL_FIRST .. XATTR_FILL_LAST] + for(sal_uInt16 nFillStyleId(XATTR_FILL_FIRST); nFillStyleId <= XATTR_FILL_LAST; nFillStyleId++) + { + if(_pSet->GetItemState(nFillStyleId) == SFX_ITEM_SET) + { + aSet.Put(_pSet->Get(nFillStyleId)); + } + } } } @@ -466,7 +507,7 @@ IMPL_LINK( SvxHFPage, TurnOnHdl, CheckBox *, pBox ) { sal_Bool bDelete = sal_True; - if ( !bDisableQueryBox && pBox && aTurnOnBox.GetSavedValue() == sal_True ) + if ( !mbDisableQueryBox && pBox && aTurnOnBox.GetSavedValue() == sal_True ) bDelete = ( QueryBox( this, SVX_RES( RID_SVXQBX_DELETE_HEADFOOT ) ).Execute() == RET_YES ); if ( bDelete ) @@ -529,80 +570,169 @@ IMPL_LINK_INLINE_END( SvxHFPage, BorderModify, MetricField *, EMPTYARG ) IMPL_LINK( SvxHFPage, BackgroundHdl, Button *, EMPTYARG ) { - if ( !pBBSet ) + if(!pBBSet) { // nur die n"otigen Items f"uer Umrandung und Hintergrund benutzen - sal_uInt16 nBrush = GetWhich( SID_ATTR_BRUSH ); - sal_uInt16 nOuter = GetWhich( SID_ATTR_BORDER_OUTER ); - sal_uInt16 nInner = GetWhich( SID_ATTR_BORDER_INNER, sal_False ); - sal_uInt16 nShadow = GetWhich( SID_ATTR_BORDER_SHADOW ); - - // einen leeren Set erzeugenc - pBBSet = new SfxItemSet( *GetItemSet().GetPool(), nBrush, nBrush, - nOuter, nOuter, nInner, nInner, - nShadow, nShadow, 0 ); + const sal_uInt16 nOuter(GetWhich(SID_ATTR_BORDER_OUTER)); + const sal_uInt16 nInner(GetWhich(SID_ATTR_BORDER_INNER, sal_False)); + const sal_uInt16 nShadow(GetWhich(SID_ATTR_BORDER_SHADOW)); + + if(mbEnableDrawingLayerFillStyles) + { + pBBSet = new SfxItemSet( + *GetItemSet().GetPool(), + XATTR_FILL_FIRST, XATTR_FILL_LAST, // DrawingLayer FillStyle definitions + SID_COLOR_TABLE, SID_BITMAP_LIST, // XPropertyLists for Color, Gradient, Hatch and Graphic fills + nOuter, nOuter, + nInner, nInner, + nShadow, nShadow, + 0, 0); + + //UUUU copy items for XPropertyList entries from the DrawModel so that + // the Area TabPage can access them + static const sal_uInt16 nCopyFlags[] = { + SID_COLOR_TABLE, + SID_GRADIENT_LIST, + SID_HATCH_LIST, + SID_BITMAP_LIST, + 0 + }; + + for(sal_uInt16 a(0); nCopyFlags[a]; a++) + { + const SfxPoolItem* pItem = GetItemSet().GetItem(nCopyFlags[a]); + + if(pItem) + { + pBBSet->Put(*pItem); + } + else + { + OSL_ENSURE(false, "XPropertyList missing (!)"); + } + } + } + else + { + const sal_uInt16 nBrush(GetWhich(SID_ATTR_BRUSH)); + + pBBSet = new SfxItemSet( + *GetItemSet().GetPool(), + nBrush, nBrush, + nOuter, nOuter, + nInner, nInner, + nShadow, nShadow, + 0, 0); + } + const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == - GetItemSet().GetItemState( GetWhich( nId ), sal_False, &pItem ) ) - // wenn es schon einen gesetzen Set gibt, dann diesen benutzen - pBBSet->Put( ( (SvxSetItem*)pItem)->GetItemSet() ); + if(SFX_ITEM_SET == GetItemSet().GetItemState(GetWhich(nId), sal_False, &pItem)) + { + // If a SfxItemSet from the SetItem for SID_ATTR_PAGE_HEADERSET or + // SID_ATTR_PAGE_FOOTERSET exists, use it's content + pBBSet->Put(((SvxSetItem*)pItem)->GetItemSet()); + } + else + { + if(mbEnableDrawingLayerFillStyles) + { + //UUUU The style for header/footer is not yet created, need to reset + // XFillStyleItem to XFILL_NONE which is the same as in the style + // initialization. This needs to be done since the pool default for + // XFillStyleItem is XFILL_SOLID + pBBSet->Put(XFillStyleItem(XFILL_NONE)); + } + } - if ( SFX_ITEM_SET == - GetItemSet().GetItemState( nInner, sal_False, &pItem ) ) + if(SFX_ITEM_SET == GetItemSet().GetItemState(nInner, sal_False, &pItem)) + { // das gesetze InfoItem wird immer ben"otigt - pBBSet->Put( *pItem ); + pBBSet->Put(*pItem); + } } - //CHINA001 SvxBorderBackgroundDlg* pDlg = -//CHINA001 new SvxBorderBackgroundDlg( this, *pBBSet, bEnableBackgroundSelector ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + if(pFact) { - SfxAbstractTabDialog* pDlg = pFact->CreateSvxBorderBackgroundDlg( this, *pBBSet, bEnableBackgroundSelector ); - DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 - if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() ) + //UUUU + SfxAbstractTabDialog* pDlg = pFact->CreateSvxBorderBackgroundDlg( + this, + *pBBSet, + mbEnableBackgroundSelector, + mbEnableDrawingLayerFillStyles); + + DBG_ASSERT(pDlg,"Dialogdiet fail!");//CHINA001 + if(RET_OK == pDlg->Execute() && pDlg->GetOutputItemSet()) { - SfxItemIter aIter( *pDlg->GetOutputItemSet() ); + SfxItemIter aIter(*pDlg->GetOutputItemSet()); const SfxPoolItem* pItem = aIter.FirstItem(); - while ( pItem ) + while(pItem) { - if ( !IsInvalidItem( pItem ) ) - pBBSet->Put( *pItem ); + if(!IsInvalidItem(pItem)) + { + pBBSet->Put(*pItem); + } + pItem = aIter.NextItem(); } //---------------------------------------------------------------- - - sal_uInt16 nWhich = GetWhich( SID_ATTR_BRUSH ); - - if ( pBBSet->GetItemState( nWhich ) == SFX_ITEM_SET ) { - const SvxBrushItem& rItem = (const SvxBrushItem&)pBBSet->Get( nWhich ); - if ( nId == SID_ATTR_PAGE_HEADERSET ) - aBspWin.SetHdColor( rItem.GetColor() ); + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes; + + if(mbEnableDrawingLayerFillStyles) + { + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(*pBBSet)); + } else - aBspWin.SetFtColor( rItem.GetColor() ); + { + const sal_uInt16 nWhich = GetWhich(SID_ATTR_BRUSH); + + if(pBBSet->GetItemState(nWhich) == SFX_ITEM_SET) + { + //UUUU create FillAttributes from SvxBrushItem + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(pBBSet->Get(nWhich)); + SfxItemSet aTempSet(*pBBSet->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + } + } + + if(SID_ATTR_PAGE_HEADERSET == nId) + { + //aBspWin.SetHdColor(rItem.GetColor()); + aBspWin.setHeaderFillAttributes(aFillAttributes); + } + else + { + //aBspWin.SetFtColor(rItem.GetColor()); + aBspWin.setFooterFillAttributes(aFillAttributes); + } } //---------------------------------------------------------------- - - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - - if ( pBBSet->GetItemState( nWhich ) == SFX_ITEM_SET ) { - const SvxBoxItem& rItem = (const SvxBoxItem&)pBBSet->Get( nWhich ); + const sal_uInt16 nWhich = GetWhich(SID_ATTR_BORDER_OUTER); - if ( nId == SID_ATTR_PAGE_HEADERSET ) - aBspWin.SetHdBorder( rItem ); - else - aBspWin.SetFtBorder( rItem ); + if(pBBSet->GetItemState(nWhich) == SFX_ITEM_SET) + { + const SvxBoxItem& rItem = (const SvxBoxItem&)pBBSet->Get(nWhich); + + if(nId == SID_ATTR_PAGE_HEADERSET) + aBspWin.SetHdBorder(rItem); + else + aBspWin.SetFtBorder(rItem); + } } UpdateExample(); } - delete pDlg; + delete pDlg; } return 0; } @@ -638,87 +768,122 @@ void SvxHFPage::UpdateExample() void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) { - sal_uInt16 nWhich = GetWhich( SID_ATTR_PAGE_HEADERSET ); + sal_uInt16 nWhich(GetWhich(SID_ATTR_PAGE_HEADERSET)); - if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET ) + if(SFX_ITEM_SET == rSet.GetItemState(nWhich, sal_False)) { - const SvxSetItem& rSetItem = - (const SvxSetItem&)rSet.Get( nWhich, sal_False ); + const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, sal_False)); const SfxItemSet& rTmpSet = rSetItem.GetItemSet(); - const SfxBoolItem& rOn = - (const SfxBoolItem&)rTmpSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); + const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON))); - if ( rOn.GetValue() ) + if(rOn.GetValue()) { - nWhich = GetWhich( SID_ATTR_BRUSH ); + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aHeaderFillAttributes; - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + if(mbEnableDrawingLayerFillStyles) { - const SvxBrushItem& rItem = (const SvxBrushItem&)rTmpSet.Get( nWhich ); - aBspWin.SetHdColor( rItem.GetColor() ); + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet)); } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); + else + { + nWhich = GetWhich(SID_ATTR_BRUSH); + + if(SFX_ITEM_SET == rTmpSet.GetItemState(nWhich)) + { + //UUUU create FillAttributes from SvxBrushItem + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); + SfxItemSet aTempSet(*rTmpSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + } + } + + aBspWin.setHeaderFillAttributes(aHeaderFillAttributes); + nWhich = GetWhich(SID_ATTR_BORDER_OUTER); - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + if(rTmpSet.GetItemState(nWhich) == SFX_ITEM_SET) { const SvxBoxItem& rItem = - (const SvxBoxItem&)rTmpSet.Get( nWhich ); - aBspWin.SetHdBorder( rItem ); + (const SvxBoxItem&)rTmpSet.Get(nWhich); + aBspWin.SetHdBorder(rItem); } } } - nWhich = GetWhich( SID_ATTR_PAGE_FOOTERSET ); + nWhich = GetWhich(SID_ATTR_PAGE_FOOTERSET); - if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET ) + if(SFX_ITEM_SET == rSet.GetItemState(nWhich, sal_False)) { - const SvxSetItem& rSetItem = - (const SvxSetItem&)rSet.Get( nWhich, sal_False ); + const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, sal_False)); const SfxItemSet& rTmpSet = rSetItem.GetItemSet(); - const SfxBoolItem& rOn = - (const SfxBoolItem&)rTmpSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); + const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON))); - if ( rOn.GetValue() ) + if(rOn.GetValue()) { - nWhich = GetWhich( SID_ATTR_BRUSH ); + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFooterFillAttributes; - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + if(mbEnableDrawingLayerFillStyles) { - const SvxBrushItem& rItem = (const SvxBrushItem&)rTmpSet.Get( nWhich ); - aBspWin.SetFtColor( rItem.GetColor() ); + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet)); } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); + else + { + nWhich = GetWhich(SID_ATTR_BRUSH); + + if(SFX_ITEM_SET == rTmpSet.GetItemState(nWhich)) + { + //UUUU create FillAttributes from SvxBrushItem + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); + SfxItemSet aTempSet(*rTmpSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + } + } + + aBspWin.setFooterFillAttributes(aFooterFillAttributes); + nWhich = GetWhich(SID_ATTR_BORDER_OUTER); - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + if(rTmpSet.GetItemState(nWhich) == SFX_ITEM_SET) { - const SvxBoxItem& rItem = - (const SvxBoxItem&)rTmpSet.Get( nWhich ); - aBspWin.SetFtBorder( rItem ); + const SvxBoxItem& rItem = static_cast< const SvxBoxItem& >(rTmpSet.Get(nWhich)); + aBspWin.SetFtBorder(rItem); } } } - nWhich = GetWhich( SID_ATTR_BRUSH ); - if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aPageFillAttributes; + + if(mbEnableDrawingLayerFillStyles) + { + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rSet)); + } + else { - const SvxBrushItem& rItem = (const SvxBrushItem&)rSet.Get( nWhich ); - aBspWin.SetColor( rItem.GetColor() ); - const Graphic* pGrf = rItem.GetGraphic(); + nWhich = GetWhich(SID_ATTR_BRUSH); - if ( pGrf ) + if(rSet.GetItemState(nWhich) >= SFX_ITEM_AVAILABLE) { - Bitmap aBitmap = pGrf->GetBitmap(); - aBspWin.SetBitmap( &aBitmap ); + //UUUU create FillAttributes from SvxBrushItem + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rSet.Get(nWhich)); + SfxItemSet aTempSet(*rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); } - else - aBspWin.SetBitmap( NULL ); } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) + aBspWin.setPageFillAttributes(aPageFillAttributes); + nWhich = GetWhich(SID_ATTR_BORDER_OUTER); + + if(rSet.GetItemState(nWhich) >= SFX_ITEM_AVAILABLE) { - const SvxBoxItem& rItem = (const SvxBoxItem&)rSet.Get( nWhich ); - aBspWin.SetBorder( rItem ); + const SvxBoxItem& rItem = static_cast< const SvxBoxItem& >(rSet.Get(nWhich)); + aBspWin.SetBorder(rItem); } } @@ -973,6 +1138,7 @@ void lcl_Move(Window& rWin, sal_Int32 nDiff) aPos.Y() -= nDiff; rWin.SetPosPixel(aPos); } + void SvxHFPage::EnableDynamicSpacing() { aDynSpacingCB.Show(); @@ -991,3 +1157,17 @@ void SvxHFPage::EnableDynamicSpacing() lcl_Move(*aMoveWindows[nIdx++], nOffset); } +void SvxHFPage::PageCreated(SfxAllItemSet aSet) +{ + //UUUU + SFX_ITEMSET_ARG (&aSet, pSupportDrawingLayerFillStyleItem, SfxBoolItem, SID_DRAWINGLAYER_FILLSTYLES); + + if(pSupportDrawingLayerFillStyleItem) + { + const bool bNew(pSupportDrawingLayerFillStyleItem->GetValue()); + + EnableDrawingLayerFillStyles(bNew); + } +} + +//eof diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 9a6be7a907a9..745d05c5412a 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -19,45 +19,20 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -// include --------------------------------------------------------------- - - #include <vcl/bitmap.hxx> #include <editeng/frmdiritem.hxx> #include <svx/pageitem.hxx> #include <svx/pagectrl.hxx> #include <editeng/boxitem.hxx> - #include <algorithm> - -// struct PageWindow_Impl ------------------------------------------------ - -struct PageWindow_Impl -{ - SvxBoxItem* pBorder; - Bitmap aBitmap; - bool bBitmap; - sal_Bool bResetBackground; - sal_Bool bFrameDirection; - sal_Int32 nFrameDirection; - - - PageWindow_Impl() : - pBorder(0), - bBitmap(sal_False), - bResetBackground(sal_False), - bFrameDirection(sal_False), - nFrameDirection(0) {} - - void EnableFrameDirection(sal_Bool bEnable){bFrameDirection = bEnable;} - void SetFrameDirection(sal_Int32 nDirection){nFrameDirection = nDirection;} - -}; +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> +#include <drawinglayer/processor2d/processor2dtools.hxx> +#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> // STATIC DATA ----------------------------------------------------------- @@ -66,44 +41,57 @@ struct PageWindow_Impl // class SvxPageWindow --------------------------------------------------- -SvxPageWindow::SvxPageWindow( Window* pParent, const ResId& rId ) : - - Window( pParent, rId ), - - nTop ( 0 ), - nBottom ( 0 ), - nLeft ( 0 ), - nRight ( 0 ), - aColor ( COL_TRANSPARENT ), - nHdLeft ( 0 ), - nHdRight ( 0 ), - nHdDist ( 0 ), - nHdHeight ( 0 ), - aHdColor ( COL_TRANSPARENT ), - pHdBorder ( 0 ), - nFtLeft ( 0 ), - nFtRight ( 0 ), - nFtDist ( 0 ), - nFtHeight ( 0 ), - aFtColor ( COL_TRANSPARENT ), - pFtBorder ( 0 ), - bFooter ( sal_False ), - bHeader ( sal_False ), - bTable ( sal_False ), - bHorz ( sal_False ), - bVert ( sal_False ), - eUsage ( SVX_PAGE_ALL ) +SvxPageWindow::SvxPageWindow(Window* pParent,const ResId& rId) +: Window(pParent,rId), + aWinSize(), + aSize(), + + nTop(0), + nBottom(0), + nLeft(0), + nRight(0), + + //UUUU + pBorder(0), + bResetBackground(sal_False), + bFrameDirection(sal_False), + nFrameDirection(0), + + nHdLeft(0), + nHdRight(0), + nHdDist(0), + nHdHeight(0), + + pHdBorder(0), + nFtLeft(0), + nFtRight(0), + nFtDist(0), + nFtHeight(0), + + pFtBorder(0), + + maHeaderFillAttributes(), + maFooterFillAttributes(), + maPageFillAttributes(), + + bFooter(sal_False), + bHeader(sal_False), + bTable(sal_False), + bHorz(sal_False), + bVert(sal_False), + eUsage(SVX_PAGE_ALL), + + aLeftText(), + aRightText() { - pImpl = new PageWindow_Impl; - // defaultmaessing in Twips rechnen - SetMapMode( MapMode( MAP_TWIP ) ); + SetMapMode(MapMode(MAP_TWIP)); aWinSize = GetOutputSizePixel(); aWinSize.Height() -= 4; aWinSize.Width() -= 4; - aWinSize = PixelToLogic( aWinSize ); + aWinSize = PixelToLogic(aWinSize); SetBackground(); } @@ -111,67 +99,66 @@ SvxPageWindow::SvxPageWindow( Window* pParent, const ResId& rId ) : SvxPageWindow::~SvxPageWindow() { - delete pImpl; delete pHdBorder; delete pFtBorder; } // ----------------------------------------------------------------------- -void __EXPORT SvxPageWindow::Paint( const Rectangle& ) +void __EXPORT SvxPageWindow::Paint(const Rectangle&) { - Fraction aXScale( aWinSize.Width(), std::max( (long) (aSize.Width() * 2 + aSize.Width() / 8), 1L ) ); - Fraction aYScale( aWinSize.Height(), std::max( aSize.Height(), 1L ) ); - MapMode aMapMode( GetMapMode() ); + Fraction aXScale(aWinSize.Width(),std::max((long)(aSize.Width() * 2 + aSize.Width() / 8),1L)); + Fraction aYScale(aWinSize.Height(),std::max(aSize.Height(),1L)); + MapMode aMapMode(GetMapMode()); - if ( aYScale < aXScale ) + if(aYScale < aXScale) { - aMapMode.SetScaleX( aYScale ); - aMapMode.SetScaleY( aYScale ); + aMapMode.SetScaleX(aYScale); + aMapMode.SetScaleY(aYScale); } else { - aMapMode.SetScaleX( aXScale ); - aMapMode.SetScaleY( aXScale ); + aMapMode.SetScaleX(aXScale); + aMapMode.SetScaleY(aXScale); } - SetMapMode( aMapMode ); - Size aSz( PixelToLogic( GetSizePixel() ) ); - long nYPos = ( aSz.Height() - aSize.Height() ) / 2; + SetMapMode(aMapMode); + Size aSz(PixelToLogic(GetSizePixel())); + long nYPos = (aSz.Height() - aSize.Height()) / 2; - if ( eUsage == SVX_PAGE_ALL ) + if(eUsage == SVX_PAGE_ALL) { // alle Seiten gleich -> eine Seite malen - if ( aSize.Width() > aSize.Height() ) + if(aSize.Width() > aSize.Height()) { // Querformat in gleicher Gr"osse zeichnen Fraction aX = aMapMode.GetScaleX(); Fraction aY = aMapMode.GetScaleY(); - Fraction a2( 1.5 ); + Fraction a2(1.5); aX *= a2; aY *= a2; - aMapMode.SetScaleX( aX ); - aMapMode.SetScaleY( aY ); - SetMapMode( aMapMode ); - aSz = PixelToLogic( GetSizePixel() ); - nYPos = ( aSz.Height() - aSize.Height() ) / 2; - long nXPos = ( aSz.Width() - aSize.Width() ) / 2; - DrawPage( Point( nXPos, nYPos ), sal_True, sal_True ); + aMapMode.SetScaleX(aX); + aMapMode.SetScaleY(aY); + SetMapMode(aMapMode); + aSz = PixelToLogic(GetSizePixel()); + nYPos = (aSz.Height() - aSize.Height()) / 2; + long nXPos = (aSz.Width() - aSize.Width()) / 2; + DrawPage(Point(nXPos,nYPos),sal_True,sal_True); } else // Hochformat - DrawPage( Point( ( aSz.Width() - aSize.Width() ) / 2, nYPos ), sal_True, sal_True ); + DrawPage(Point((aSz.Width() - aSize.Width()) / 2,nYPos),sal_True,sal_True); } else { // Linke und rechte Seite unterschiedlich -> ggf. zwei Seiten malen - DrawPage( Point( 0, nYPos ), sal_False, (sal_Bool)( eUsage & SVX_PAGE_LEFT ) ); - DrawPage( Point( aSize.Width() + aSize.Width() / 8, nYPos ), sal_True, - (sal_Bool)( eUsage & SVX_PAGE_RIGHT ) ); + DrawPage(Point(0,nYPos),sal_False,(sal_Bool)(eUsage & SVX_PAGE_LEFT)); + DrawPage(Point(aSize.Width() + aSize.Width() / 8,nYPos),sal_True, + (sal_Bool)(eUsage & SVX_PAGE_RIGHT)); } } // ----------------------------------------------------------------------- -void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const sal_Bool bEnabled ) +void SvxPageWindow::DrawPage(const Point& rOrg,const sal_Bool bSecond,const sal_Bool bEnabled) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); const Color& rFieldColor = rStyleSettings.GetFieldColor(); @@ -180,37 +167,37 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s const Color& rDlgColor = rStyleSettings.GetDialogColor(); // background - if(!bSecond || pImpl->bResetBackground) + if(!bSecond || bResetBackground) { - SetLineColor( Color(COL_TRANSPARENT) ); - SetFillColor( rDlgColor ); + SetLineColor(Color(COL_TRANSPARENT)); + SetFillColor(rDlgColor); Size winSize(GetOutputSize()); - DrawRect( Rectangle( Point(0,0), winSize ) ); + DrawRect(Rectangle(Point(0,0),winSize)); - if ( pImpl->bResetBackground ) - pImpl->bResetBackground = sal_False; + if(bResetBackground) + bResetBackground = sal_False; } - SetLineColor( rFieldTextColor ); + SetLineColor(rFieldTextColor); // Schatten Size aTempSize = aSize; // Seite - if ( !bEnabled ) + if(!bEnabled) { - SetFillColor( rDisableColor ); - DrawRect( Rectangle( rOrg, aTempSize ) ); + SetFillColor(rDisableColor); + DrawRect(Rectangle(rOrg,aTempSize)); return; } - SetFillColor( rFieldColor ); - DrawRect( Rectangle( rOrg, aTempSize ) ); + SetFillColor(rFieldColor); + DrawRect(Rectangle(rOrg,aTempSize)); // Border Top Bottom Left Right - Point aBegin( rOrg ); - Point aEnd( rOrg ); + Point aBegin(rOrg); + Point aEnd(rOrg); long nL = nLeft; long nR = nRight; - if ( eUsage == SVX_PAGE_MIRROR && !bSecond ) + if(eUsage == SVX_PAGE_MIRROR && !bSecond) { // f"ur gespiegelt drehen nL = nRight; @@ -219,91 +206,94 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s Rectangle aRect; - aRect.Left() = rOrg.X() + nL; + aRect.Left() = rOrg.X() + nL; aRect.Right() = rOrg.X() + aTempSize.Width() - nR; - aRect.Top() = rOrg.Y() + nTop; - aRect.Bottom()= rOrg.Y() + aTempSize.Height() - nBottom; + aRect.Top() = rOrg.Y() + nTop; + aRect.Bottom() = rOrg.Y() + aTempSize.Height() - nBottom; - Rectangle aHdRect( aRect ); - Rectangle aFtRect( aRect ); + Rectangle aHdRect(aRect); + Rectangle aFtRect(aRect); - if ( bHeader ) + if(bHeader || bFooter) { - // ggf. Header anzeigen - aHdRect.Left() += nHdLeft; - aHdRect.Right() -= nHdRight; - aHdRect.Bottom() = aRect.Top() + nHdHeight; - aRect.Top() += nHdHeight + nHdDist; - SetFillColor( aHdColor ); - DrawRect( aHdRect ); - } + //UUUU Header and/or footer used + const Color aLineColor(GetLineColor()); - if ( bFooter ) - { - // ggf. Footer anzeigen - aFtRect.Left() += nFtLeft; - aFtRect.Right() -= nFtRight; - aFtRect.Top() = aRect.Bottom() - nFtHeight; - aRect.Bottom() -= nFtHeight + nFtDist; - SetFillColor( aFtColor ); - DrawRect( aFtRect ); - } + //UUUU draw PageFill first and on the whole page, no outline + SetLineColor(); + drawFillAttributes(maPageFillAttributes, aRect, aRect); + SetLineColor(aLineColor); - // Body malen - SetFillColor( aColor ); - if ( pImpl->bBitmap ) - { - DrawRect( aRect ); - Point aBmpPnt = aRect.TopLeft(); - Size aBmpSiz = aRect.GetSize(); - long nDeltaX = aBmpSiz.Width() / 15; - long nDeltaY = aBmpSiz.Height() / 15; - aBmpPnt.X() += nDeltaX; - aBmpPnt.Y() += nDeltaY; - aBmpSiz.Width() -= nDeltaX * 2; - aBmpSiz.Height() -= nDeltaY * 2; - DrawBitmap( aBmpPnt, aBmpSiz, pImpl->aBitmap ); + if(bHeader) + { + // ggf. Header anzeigen + aHdRect.Left() += nHdLeft; + aHdRect.Right() -= nHdRight; + aHdRect.Bottom() = aRect.Top() + nHdHeight; + aRect.Top() += nHdHeight + nHdDist; + + // draw header over PageFill, plus outline + drawFillAttributes(maHeaderFillAttributes, aHdRect, aHdRect); + } + + if(bFooter) + { + // ggf. Footer anzeigen + aFtRect.Left() += nFtLeft; + aFtRect.Right() -= nFtRight; + aFtRect.Top() = aRect.Bottom() - nFtHeight; + aRect.Bottom() -= nFtHeight + nFtDist; + + // draw footer over PageFill, plus outline + drawFillAttributes(maFooterFillAttributes, aFtRect, aFtRect); + } + + // draw page's reduced outline, only outline + drawFillAttributes(drawinglayer::attribute::SdrAllFillAttributesHelperPtr(), aRect, aRect); } else - DrawRect( aRect ); + { + //UUUU draw PageFill and outline + drawFillAttributes(maPageFillAttributes, aRect, aRect); + } - if(pImpl->bFrameDirection && !bTable) + if(bFrameDirection && !bTable) { - //pImpl->nFrameDirection + //pImpl->nFrameDirection Point aPos; Font aFont(GetFont()); const Size aSaveSize = aFont.GetSize(); - Size aDrawSize( 0, aRect.GetHeight() / 6); + Size aDrawSize(0,aRect.GetHeight() / 6); aFont.SetSize(aDrawSize); SetFont(aFont); String sText(String::CreateFromAscii("ABC")); - Point aMove(1, GetTextHeight()); + Point aMove(1,GetTextHeight()); sal_Unicode cArrow = 0x2193; long nAWidth = GetTextWidth(String(sText.GetChar(0))); - switch(pImpl->nFrameDirection) + switch(nFrameDirection) { - case FRMDIR_HORI_LEFT_TOP: - aPos = aRect.TopLeft(); - aPos.X() += PixelToLogic(Point(1,1)).X(); - aMove.Y() = 0; - cArrow = 0x2192; + case FRMDIR_HORI_LEFT_TOP: + aPos = aRect.TopLeft(); + aPos.X() += PixelToLogic(Point(1,1)).X(); + aMove.Y() = 0; + cArrow = 0x2192; break; - case FRMDIR_HORI_RIGHT_TOP: - aPos = aRect.TopRight(); - aPos.X() -= nAWidth; - aMove.Y() = 0; - aMove.X() *= -1; - cArrow = 0x2190; + case FRMDIR_HORI_RIGHT_TOP: + aPos = aRect.TopRight(); + aPos.X() -= nAWidth; + aMove.Y() = 0; + aMove.X() *= -1; + cArrow = 0x2190; break; - case FRMDIR_VERT_TOP_LEFT: - aPos = aRect.TopLeft(); - aPos.X() += PixelToLogic(Point(1,1)).X(); - aMove.X() = 0; + case FRMDIR_VERT_TOP_LEFT: + aPos = aRect.TopLeft(); + aPos.X() += PixelToLogic(Point(1,1)).X(); + aMove.X() = 0; break; - case FRMDIR_VERT_TOP_RIGHT: - aPos = aRect.TopRight(); - aPos.X() -= nAWidth; - aMove.X() = 0; + case FRMDIR_VERT_TOP_RIGHT: + aPos = aRect.TopRight(); + aPos.X() -= nAWidth; + aMove.X() = 0; break; } sText.Append(cArrow); @@ -315,13 +305,13 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s sal_Bool bHorizontal = 0 == aMove.Y(); if(!bHorizontal) { - nHDiff = (nAWidth - nCharWidth)/2; + nHDiff = (nAWidth - nCharWidth) / 2; aPos.X() += nHDiff; } - DrawText(aPos, sDraw); + DrawText(aPos,sDraw); if(bHorizontal) { - aPos.X() += aMove.X() < 0 ? - nCharWidth : nCharWidth; + aPos.X() += aMove.X() < 0 ? -nCharWidth : nCharWidth; } else { @@ -333,85 +323,140 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s SetFont(aFont); } - if ( bTable ) + if(bTable) { // Tabelle malen, ggf. zentrieren - SetLineColor( Color(COL_LIGHTGRAY) ); + SetLineColor(Color(COL_LIGHTGRAY)); - long nW = aRect.GetWidth(), nH = aRect.GetHeight(); - long nTW = CELL_WIDTH * 3, nTH = CELL_HEIGHT * 3; + long nW = aRect.GetWidth(),nH = aRect.GetHeight(); + long nTW = CELL_WIDTH * 3,nTH = CELL_HEIGHT * 3; long _nLeft = bHorz ? aRect.Left() + ((nW - nTW) / 2) : aRect.Left(); long _nTop = bVert ? aRect.Top() + ((nH - nTH) / 2) : aRect.Top(); - Rectangle aCellRect( Point( _nLeft, _nTop ), Size( CELL_WIDTH, CELL_HEIGHT ) ); + Rectangle aCellRect(Point(_nLeft,_nTop),Size(CELL_WIDTH,CELL_HEIGHT)); - for ( sal_uInt16 i = 0; i < 3; ++i ) + for(sal_uInt16 i = 0; i < 3; ++i) { aCellRect.Left() = _nLeft; aCellRect.Right() = _nLeft + CELL_WIDTH; - if ( i > 0 ) - aCellRect.Move( 0, CELL_HEIGHT ); + if(i > 0) + aCellRect.Move(0,CELL_HEIGHT); - for ( sal_uInt16 j = 0; j < 3; ++j ) + for(sal_uInt16 j = 0; j < 3; ++j) { - if ( j > 0 ) - aCellRect.Move( CELL_WIDTH, 0 ); - DrawRect( aCellRect ); + if(j > 0) + aCellRect.Move(CELL_WIDTH,0); + DrawRect(aCellRect); } } } } -// ----------------------------------------------------------------------- - -void SvxPageWindow::SetBorder( const SvxBoxItem& rNew ) +//UUUU +void SvxPageWindow::drawFillAttributes( + const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes, + const Rectangle& rPaintRange, + const Rectangle& rDefineRange) { - delete pImpl->pBorder; - pImpl->pBorder = new SvxBoxItem( rNew ); + const basegfx::B2DRange aPaintRange( + rPaintRange.Left(), + rPaintRange.Top(), + rPaintRange.Right(), + rPaintRange.Bottom()); + + if(!aPaintRange.isEmpty() && + !basegfx::fTools::equalZero(aPaintRange.getWidth()) && + !basegfx::fTools::equalZero(aPaintRange.getHeight())) + { + const basegfx::B2DRange aDefineRange( + rDefineRange.Left(), + rDefineRange.Top(), + rDefineRange.Right(), + rDefineRange.Bottom()); + + // prepare primitive sequence + drawinglayer::primitive2d::Primitive2DSequence aSequence; + + // create fill geometry if there is something to fill + if(rFillAttributes.get() && rFillAttributes->isUsed()) + { + aSequence = rFillAttributes->getPrimitive2DSequence( + aPaintRange, + aDefineRange); + } + + // create line geometry if a LineColor is set at the target device + if(IsLineColor()) + { + const drawinglayer::primitive2d::Primitive2DReference xOutline( + new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( + basegfx::tools::createPolygonFromRect(aPaintRange), + GetLineColor().getBColor())); + + drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence( + aSequence, + xOutline); + } + + // draw that if we have something to draw + if(aSequence.getLength()) + { + const drawinglayer::geometry::ViewInformation2D aViewInformation2D( + basegfx::B2DHomMatrix(), + GetViewTransformation(), + aPaintRange, + 0, + 0.0, + com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >()); + drawinglayer::processor2d::BaseProcessor2D* pProcessor = drawinglayer::processor2d::createProcessor2DFromOutputDevice( + *this, + aViewInformation2D); + + if(pProcessor) + { + pProcessor->process(aSequence); + + delete pProcessor; + } + } + } } // ----------------------------------------------------------------------- -void SvxPageWindow::SetBitmap( Bitmap* pBmp ) +void SvxPageWindow::SetBorder(const SvxBoxItem& rNew) { - if ( pBmp ) - { - pImpl->aBitmap = *pBmp; - pImpl->bBitmap = sal_True; - } - else - pImpl->bBitmap = sal_False; + delete pBorder; + pBorder = new SvxBoxItem(rNew); } // ----------------------------------------------------------------------- -void SvxPageWindow::SetHdBorder( const SvxBoxItem& rNew ) +void SvxPageWindow::SetHdBorder(const SvxBoxItem& rNew) { delete pHdBorder; - pHdBorder = new SvxBoxItem( rNew ); + pHdBorder = new SvxBoxItem(rNew); } // ----------------------------------------------------------------------- -void SvxPageWindow::SetFtBorder( const SvxBoxItem& rNew ) +void SvxPageWindow::SetFtBorder(const SvxBoxItem& rNew) { delete pFtBorder; - pFtBorder = new SvxBoxItem( rNew ); + pFtBorder = new SvxBoxItem(rNew); } -/* -----------------------------13.06.2002 16:16------------------------------ - ---------------------------------------------------------------------------*/ -void SvxPageWindow::EnableFrameDirection(sal_Bool bEnable) +void SvxPageWindow::EnableFrameDirection(sal_Bool bEnable) { - pImpl->EnableFrameDirection(bEnable); + bFrameDirection = bEnable; } -/* -----------------------------13.06.2002 16:16------------------------------ - ---------------------------------------------------------------------------*/ -void SvxPageWindow::SetFrameDirection(sal_Int32 nFrameDirection) +void SvxPageWindow::SetFrameDirection(sal_Int32 nDirection) { - pImpl->SetFrameDirection(nFrameDirection); + nFrameDirection = nDirection; } void SvxPageWindow::ResetBackground() { - pImpl->bResetBackground = sal_True; + bResetBackground = sal_True; } + +//eof diff --git a/svx/source/dialog/pfiledlg.cxx b/svx/source/dialog/pfiledlg.cxx index b41a590a7e26..4b6ddd1d386a 100644 --- a/svx/source/dialog/pfiledlg.cxx +++ b/svx/source/dialog/pfiledlg.cxx @@ -204,7 +204,7 @@ SvxPluginFileDlg::~SvxPluginFileDlg() /************************************************************************* |* |* Plugins available for the the MIME-Typ in nKind -|* (whith nKind = SID_INSERT_SOUND for MIME-Type audio +|* (with nKind = SID_INSERT_SOUND for MIME-Type audio |* SID_INSERT_VIDEO for MIME-Type video |* \************************************************************************/ |