diff options
author | Armin Le Grand <alg@apache.org> | 2014-06-02 15:00:50 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2014-06-02 15:00:50 +0000 |
commit | cc25c58f7052827bfebdc9fbeec668c8fa29ed1b (patch) | |
tree | 3bb109699340d8c638372065a2ed2bf4a1e46579 /cui | |
parent | 5abe28ae3af726e94f62c5bcdc22d6b7f48a1a57 (diff) |
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
Notes
Notes:
merged as: 7d9bb549d498d6beed2c4050c402d09643febdfa
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 20 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 11 | ||||
-rw-r--r-- | cui/source/inc/bbdlg.hxx | 13 | ||||
-rwxr-xr-x | cui/source/inc/cuires.hrc | 6 | ||||
-rw-r--r-- | cui/source/inc/page.hxx | 15 | ||||
-rw-r--r-- | cui/source/tabpages/bbdlg.cxx | 81 | ||||
-rw-r--r-- | cui/source/tabpages/bbdlg.src | 46 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 353 | ||||
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 8 |
9 files changed, 390 insertions, 163 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 2c38a1ebb273..69470aaca969 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1363,12 +1363,20 @@ AbstractSvxSearchSimilarityDialog * AbstractDialogFactory_Impl::CreateSvxSearchS return NULL; } -SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg( Window* pParent, - const SfxItemSet& rCoreSet, - sal_Bool bEnableSelector) -{ - SfxTabDialog* pDlg = new SvxBorderBackgroundDlg( pParent, rCoreSet, bEnableSelector); - return new AbstractTabDialog_Impl( pDlg ); +//UUUU +SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg( + Window* pParent, + const SfxItemSet& rCoreSet, + bool bEnableSelector, + bool bEnableDrawingLayerFillStyles) +{ + SfxTabDialog* pDlg = new SvxBorderBackgroundDlg( + pParent, + rCoreSet, + bEnableSelector, + bEnableDrawingLayerFillStyles); + + return new AbstractTabDialog_Impl(pDlg); } AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTabDialog( Window* pParent, diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index cdb579b87d23..39fb0b6fa53f 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -647,9 +647,14 @@ public: virtual AbstractFmShowColsDialog * CreateFmShowColsDialog( Window* pParent ); //add for FmShowColsDialog virtual AbstractSvxZoomDialog * CreateSvxZoomDialog( Window* pParent, //add for SvxZoomDialog const SfxItemSet& rCoreSet); - virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg( Window* pParent, //add for SvxBorderBackgroundDlg - const SfxItemSet& rCoreSet, - sal_Bool bEnableSelector = sal_False) ; + + //UUUU add for SvxBorderBackgroundDlg + virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg( + Window* pParent, + const SfxItemSet& rCoreSet, + bool bEnableSelector = false, + bool bEnableDrawingLayerFillStyles = false); + virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( Window* pParent, //add for SvxTransformTabDialog const SfxItemSet* pAttr, const SdrView* pView, diff --git a/cui/source/inc/bbdlg.hxx b/cui/source/inc/bbdlg.hxx index fe2ac3416c00..51cb1baf65fe 100644 --- a/cui/source/inc/bbdlg.hxx +++ b/cui/source/inc/bbdlg.hxx @@ -34,17 +34,20 @@ class SvxBorderBackgroundDlg: public SfxTabDialog { public: - SvxBorderBackgroundDlg( Window *pParent, - const SfxItemSet& rCoreSet, - sal_Bool bEnableSelector = sal_False ); + SvxBorderBackgroundDlg(Window *pParent, + const SfxItemSet& rCoreSet, + bool bEnableSelector = false, + bool bEnableDrawingLayerFillStyles = false); ~SvxBorderBackgroundDlg(); protected: - virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ); + virtual void PageCreated(sal_uInt16 nPageId,SfxTabPage& rTabPage); private: - sal_Bool bEnableBackgroundSelector; // fuer Border/Background-Dlg + /// bitfield + bool mbEnableBackgroundSelector : 1; // fuer Border/Background-Dlg + bool mbEnableDrawingLayerFillStyles : 1; // for full DrawingLayer FillStyles }; diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index 7a0dac234d7b..17f5fc78b929 100755 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -42,7 +42,11 @@ #define RID_SVXDLG_TEXT (RID_SVX_START + 183) #define RID_SVXDLG_TRANSFORM (RID_SVX_START + 45) #define RID_SVXDLG_LINE (RID_SVX_START + 50) -#define RID_SVXDLG_BBDLG (RID_SVX_START + 40) + +//UUUU +#define RID_SVXDLG_BBDLG_BACKGROUND (RID_SVX_START + 40) +#define RID_SVXDLG_BBDLG_AREA_TRANS (RID_SVX_START + 41) + #define RID_SVXDLG_CAPTION (RID_SVX_START + 151) #define RID_SVXDLG_AREA (RID_SVX_START + 55) #define RID_SVXSTRARY_PAPERSIZE_STD (RID_SVX_START + 142) diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index f49e36df91b9..12222152358a 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -80,7 +80,7 @@ <SvxLRSpaceItem>: <SID_ATTR_LRSPACE> */ -struct SvxPage_Impl; +//UUUU struct SvxPage_Impl; typedef sal_uInt16 MarginPosition; class SvxPageDescPage : public SfxTabPage @@ -88,6 +88,7 @@ class SvxPageDescPage : public SfxTabPage using TabPage::ActivatePage; using TabPage::DeactivatePage; +private: // paper format FixedLine aPaperSizeFl; FixedText aPaperFormatText; @@ -167,7 +168,14 @@ class SvxPageDescPage : public SfxTabPage Paper ePaperStart; Paper ePaperEnd; - SvxPage_Impl* pImpl; + //UUUU SvxPage_Impl* pImpl; + MarginPosition m_nPos; + Printer* mpDefPrinter; + + bool mbDelPrinter : 1; + + //UUUU + bool mbEnableDrawingLayerFillStyles : 1; #ifdef _SVX_PAGE_CXX void Init_Impl(); @@ -208,6 +216,9 @@ class SvxPageDescPage : public SfxTabPage SvxPageDescPage( Window* pParent, const SfxItemSet& rSet ); + //UUUU + void EnableDrawingLayerFillStyles(bool bNew) { mbEnableDrawingLayerFillStyles = bNew; } + protected: virtual void ActivatePage( const SfxItemSet& rSet ); virtual int DeactivatePage( SfxItemSet* pSet = 0 ); diff --git a/cui/source/tabpages/bbdlg.cxx b/cui/source/tabpages/bbdlg.cxx index afaf3c4afb64..7d8c604e32e7 100644 --- a/cui/source/tabpages/bbdlg.cxx +++ b/cui/source/tabpages/bbdlg.cxx @@ -35,18 +35,37 @@ #include "backgrnd.hxx" #include <dialmgr.hxx> -// class SvxBorderBackgroundDlg ------------------------------------------ +//UUUU +#include "cuitabarea.hxx" -SvxBorderBackgroundDlg::SvxBorderBackgroundDlg( Window *pParent, - const SfxItemSet& rCoreSet, - sal_Bool bEnableSelector ) : +// class SvxBorderBackgroundDlg ------------------------------------------ - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_BBDLG ), &rCoreSet ), - bEnableBackgroundSelector( bEnableSelector ) +SvxBorderBackgroundDlg::SvxBorderBackgroundDlg(Window *pParent, + const SfxItemSet& rCoreSet, + bool bEnableSelector, + bool bEnableDrawingLayerFillStyles) +: SfxTabDialog( + pParent, + CUI_RES( + bEnableDrawingLayerFillStyles ? RID_SVXDLG_BBDLG_AREA_TRANS : RID_SVXDLG_BBDLG_BACKGROUND), + &rCoreSet), + mbEnableBackgroundSelector(bEnableSelector), + mbEnableDrawingLayerFillStyles(bEnableDrawingLayerFillStyles) { FreeResource(); - AddTabPage( RID_SVXPAGE_BORDER, SvxBorderTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0 ); + AddTabPage(RID_SVXPAGE_BORDER,SvxBorderTabPage::Create,0); + + if(mbEnableDrawingLayerFillStyles) + { + //UUUU Here we want full DrawingLayer FillStyle access, so add Area and Transparency TabPages + AddTabPage( RID_SVXPAGE_AREA, SvxAreaTabPage::Create, 0 ); + AddTabPage( RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, 0); + } + else + { + //UUUU Use the more simple Background TabPage + AddTabPage(RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0); + } } // ----------------------------------------------------------------------- @@ -57,12 +76,48 @@ SvxBorderBackgroundDlg::~SvxBorderBackgroundDlg() // ----------------------------------------------------------------------- -void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) +void SvxBorderBackgroundDlg::PageCreated(sal_uInt16 nPageId, SfxTabPage& rTabPage) { - // Umschalten zwischen Farbe/Grafik ermoeglichen: + switch(nPageId) + { + case RID_SVXPAGE_BACKGROUND: + { + // allow switching between Color/graphic + if(mbEnableBackgroundSelector) + { + static_cast< SvxBackgroundTabPage& >(rTabPage).ShowSelector(); + } + break; + } - if ( bEnableBackgroundSelector && (RID_SVXPAGE_BACKGROUND == nPageId) ) - ((SvxBackgroundTabPage&)rTabPage).ShowSelector( ); -} + //UUUU inits for Area and Transparency TabPages + // The selection attribute lists (XPropertyList derivates, e.g. XColorList for + // the color table) need to be added as items (e.g. SvxColorTableItem) to make + // these pages find the needed attributes for fill style suggestions. + // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on + // demand, but could also be directly added from the DrawModel. + case RID_SVXPAGE_AREA: + { + SfxItemSet aNew( + *GetInputSetImpl()->GetPool(), + SID_COLOR_TABLE, SID_BITMAP_LIST, + SID_OFFER_IMPORT, SID_OFFER_IMPORT, + 0, 0); + aNew.Put(*GetInputSetImpl()); + + // add flag for direct graphic content selection + aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true)); + + rTabPage.PageCreated(aNew); + break; + } + case RID_SVXPAGE_TRANSPARENCE: + { + rTabPage.PageCreated(*GetInputSetImpl()); + break; + } + } +} +//eof diff --git a/cui/source/tabpages/bbdlg.src b/cui/source/tabpages/bbdlg.src index 520884a6a266..6a8ebc178970 100644 --- a/cui/source/tabpages/bbdlg.src +++ b/cui/source/tabpages/bbdlg.src @@ -24,15 +24,16 @@ #include <cuires.hrc> #include <svx/dialogs.hrc> - // RID_SVXDLG_BBDLG ------------------------------------------------------ -TabDialog RID_SVXDLG_BBDLG +// RID_SVXDLG_BBDLG_BACKGROUND and RID_SVXDLG_BBDLG_AREA_TRANS ------------ + +TabDialog RID_SVXDLG_BBDLG_BACKGROUND { OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 328 , 155 ) ; Text [ en-US ] = "Border / Background" ; Moveable = TRUE ; - // Closeable = TRUE; hat ja einen OKButton + TabControl 1 { OutputSize = TRUE ; @@ -53,6 +54,45 @@ TabDialog RID_SVXDLG_BBDLG }; }; }; + +TabDialog RID_SVXDLG_BBDLG_AREA_TRANS +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 328 , 155 ) ; + Text [ en-US ] = "Border / Background" ; + Moveable = TRUE ; + + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 2 , 10 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PageItem + { + Identifier = RID_SVXPAGE_BORDER ; + Text [ en-US ] = "Borders" ; + }; + + //UUUU new Area and Transparence TabPages + PageItem + { + Identifier = RID_SVXPAGE_AREA; + PageResID = RID_SVXPAGE_AREA; + Text [ en-US ] = "Area" ; + }; + PageItem + { + Identifier = RID_SVXPAGE_TRANSPARENCE; + PageResID = RID_SVXPAGE_TRANSPARENCE; + Text [ en-US ] = "Transparency" ; + }; + }; + }; +}; + // ********************************************************************** EOF diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 3edba4b02c53..887a882f609d 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_cui.hxx" @@ -61,12 +59,15 @@ #include <editeng/eerdll.hxx> #include <editeng/editrids.hrc> // for RID_SVXSTR_PAPERBIN..., #include <svx/svxids.hrc> - -// #i4219# #include <svtools/optionsdrawinglayer.hxx> #include <svl/slstitm.hxx> //CHINA001 #include <svl/aeitem.hxx> //CHINA001 #include <sfx2/request.hxx> //CHINA001 + +//UUUU +#include <svx/xdef.hxx> +#include <svx/unobrushitemhelper.hxx> + // configuration helper ======================================================= /** Helper to get a configuration setting. @@ -208,19 +209,20 @@ sal_Bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) #define MARGIN_TOP ( (MarginPosition)0x0004 ) #define MARGIN_BOTTOM ( (MarginPosition)0x0008 ) -struct SvxPage_Impl -{ - MarginPosition m_nPos; - Printer* mpDefPrinter; - bool mbDelPrinter; - - SvxPage_Impl() : - m_nPos( 0 ), - mpDefPrinter( 0 ), - mbDelPrinter( false ) {} - - ~SvxPage_Impl() { if ( mbDelPrinter ) delete mpDefPrinter; } -}; +//UUUU +//struct SvxPage_Impl +//{ +// MarginPosition m_nPos; +// Printer* mpDefPrinter; +// bool mbDelPrinter; +// +// SvxPage_Impl() : +// m_nPos( 0 ), +// mpDefPrinter( 0 ), +// mbDelPrinter( false ) {} +// +// ~SvxPage_Impl() { if ( mbDelPrinter ) delete mpDefPrinter; } +//}; // class SvxPageDescPage -------------------------------------------------- @@ -240,10 +242,8 @@ SfxTabPage* SvxPageDescPage::Create( Window* pParent, const SfxItemSet& rSet ) // ----------------------------------------------------------------------- -SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PAGE ), rAttr ), - +SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) +: SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PAGE ), rAttr ), aPaperSizeFl ( this, CUI_RES( FL_PAPER_SIZE ) ), aPaperFormatText ( this, CUI_RES( FT_PAPER_FORMAT ) ), aPaperSizeBox ( this, CUI_RES( LB_PAPER_SIZE ) ), @@ -290,8 +290,17 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : eMode ( SVX_PAGE_MODE_STANDARD ), ePaperStart ( PAPER_A3 ), ePaperEnd ( PAPER_ENV_DL ), - pImpl ( new SvxPage_Impl ) + //UUUU + // pImpl ( new SvxPage_Impl ), + + //UUUU + m_nPos( 0 ), + mpDefPrinter( 0 ), + mbDelPrinter( false ), + + //UUUU + mbEnableDrawingLayerFillStyles(false) { bBorderModified = sal_False; FreeResource(); @@ -351,27 +360,28 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : SetFieldUnit( aPaperHeightEdit, eFUnit ); if ( SfxViewShell::Current() && SfxViewShell::Current()->GetPrinter() ) - pImpl->mpDefPrinter = (Printer*)SfxViewShell::Current()->GetPrinter(); + { + mpDefPrinter = (Printer*)SfxViewShell::Current()->GetPrinter(); + } else { - pImpl->mpDefPrinter = new Printer; - pImpl->mbDelPrinter = true; + mpDefPrinter = new Printer; + mbDelPrinter = true; } - MapMode aOldMode = pImpl->mpDefPrinter->GetMapMode(); - pImpl->mpDefPrinter->SetMapMode( MAP_TWIP ); + MapMode aOldMode = mpDefPrinter->GetMapMode(); + mpDefPrinter->SetMapMode( MAP_TWIP ); // First- und Last-Werte f"ur die R"ander setzen - Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize(); - Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize(); + Size aPaperSize = mpDefPrinter->GetPaperSize(); + Size aPrintSize = mpDefPrinter->GetOutputSize(); /* * einen Punkt ( 0,0 ) in logische Koordinaten zu konvertieren, * sieht aus wie Unsinn; ist aber sinnvoll, wenn der Ursprung des * Koordinatensystems verschoben ist. */ - Point aPrintOffset = pImpl->mpDefPrinter->GetPageOffset() - - pImpl->mpDefPrinter->PixelToLogic( Point() ); - pImpl->mpDefPrinter->SetMapMode( aOldMode ); + Point aPrintOffset = mpDefPrinter->GetPageOffset() - mpDefPrinter->PixelToLogic( Point() ); + mpDefPrinter->SetMapMode( aOldMode ); long nOffset = !aPrintOffset.X() && !aPrintOffset.Y() ? 0 : PRINT_OFFSET; aLeftMarginEdit.SetFirst( aLeftMarginEdit.Normalize( aPrintOffset.X() ), FUNIT_TWIP ); @@ -425,7 +435,10 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : SvxPageDescPage::~SvxPageDescPage() { - delete pImpl; + if(mbDelPrinter) + { + delete mpDefPrinter; + } } // ----------------------------------------------------------------------- @@ -509,7 +522,7 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet ) // allgemeine Seitendaten SvxNumType eNumType = SVX_ARABIC; - bLandscape = ( pImpl->mpDefPrinter->GetOrientation() == ORIENTATION_LANDSCAPE ); + bLandscape = ( mpDefPrinter->GetOrientation() == ORIENTATION_LANDSCAPE ); sal_uInt16 nUse = (sal_uInt16)SVX_PAGE_ALL; pItem = GetItem( rSet, SID_ATTR_PAGE ); @@ -538,7 +551,7 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet ) { nPaperBin = ( (const SvxPaperBinItem*)pItem )->GetValue(); - if ( nPaperBin >= pImpl->mpDefPrinter->GetPaperBinCount() ) + if ( nPaperBin >= mpDefPrinter->GetPaperBinCount() ) nPaperBin = PAPERBIN_PRINTER_SETTINGS; } @@ -547,21 +560,21 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet ) if ( PAPERBIN_PRINTER_SETTINGS == nPaperBin ) aBinName = EE_RESSTR( RID_SVXSTR_PAPERBIN_SETTINGS ); else - aBinName = pImpl->mpDefPrinter->GetPaperBinName( (sal_uInt16)nPaperBin ); + aBinName = mpDefPrinter->GetPaperBinName( (sal_uInt16)nPaperBin ); sal_uInt16 nEntryPos = aPaperTrayBox.InsertEntry( aBinName ); aPaperTrayBox.SetEntryData( nEntryPos, (void*)(sal_uLong)nPaperBin ); aPaperTrayBox.SelectEntry( aBinName ); // Size rausholen - Size aPaperSize = SvxPaperInfo::GetPaperSize( pImpl->mpDefPrinter ); + Size aPaperSize = SvxPaperInfo::GetPaperSize( mpDefPrinter ); pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE ); if ( pItem ) aPaperSize = ( (const SvxSizeItem*)pItem )->GetSize(); FASTBOOL bOrientationSupport = - pImpl->mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION ); + mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION ); #ifdef OS2 // unter OS/2 wird bei HasSupport() immer sal_True returned // aber nur als Dummy, deshalb FALSE @@ -1005,11 +1018,11 @@ IMPL_LINK( SvxPageDescPage, PaperBinHdl_Impl, ListBox *, EMPTYARG ) aPaperTrayBox.SetEntryData( nEntryPos, (void*)(sal_uLong)PAPERBIN_PRINTER_SETTINGS ); String aPaperBin( EditResId( RID_SVXSTR_PAPERBIN ) ); - sal_uInt16 nBinCount = pImpl->mpDefPrinter->GetPaperBinCount(); + sal_uInt16 nBinCount = mpDefPrinter->GetPaperBinCount(); for ( sal_uInt16 i = 0; i < nBinCount; ++i ) { - String aName = pImpl->mpDefPrinter->GetPaperBinName(i); + String aName = mpDefPrinter->GetPaperBinName(i); if ( !aName.Len() ) { @@ -1158,27 +1171,26 @@ IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, RadioButton *, pBtn ) void SvxPageDescPage::SwapFirstValues_Impl( FASTBOOL bSet ) { - MapMode aOldMode = pImpl->mpDefPrinter->GetMapMode(); + MapMode aOldMode = mpDefPrinter->GetMapMode(); Orientation eOri = ORIENTATION_PORTRAIT; if ( bLandscape ) eOri = ORIENTATION_LANDSCAPE; - Orientation eOldOri = pImpl->mpDefPrinter->GetOrientation(); - pImpl->mpDefPrinter->SetOrientation( eOri ); - pImpl->mpDefPrinter->SetMapMode( MAP_TWIP ); + Orientation eOldOri = mpDefPrinter->GetOrientation(); + mpDefPrinter->SetOrientation( eOri ); + mpDefPrinter->SetMapMode( MAP_TWIP ); // First- und Last-Werte f"ur die R"ander setzen - Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize(); - Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize(); + Size aPaperSize = mpDefPrinter->GetPaperSize(); + Size aPrintSize = mpDefPrinter->GetOutputSize(); /* * einen Punkt ( 0,0 ) in logische Koordinaten zu konvertieren, * sieht aus wie Unsinn; ist aber sinnvoll, wenn der Ursprung des * Koordinatensystems verschoben ist. */ - Point aPrintOffset = pImpl->mpDefPrinter->GetPageOffset() - - pImpl->mpDefPrinter->PixelToLogic( Point() ); - pImpl->mpDefPrinter->SetMapMode( aOldMode ); - pImpl->mpDefPrinter->SetOrientation( eOldOri ); + Point aPrintOffset = mpDefPrinter->GetPageOffset() - mpDefPrinter->PixelToLogic( Point() ); + mpDefPrinter->SetMapMode( aOldMode ); + mpDefPrinter->SetOrientation( eOldOri ); sal_Int64 nSetL = aLeftMarginEdit.Denormalize( aLeftMarginEdit.GetValue( FUNIT_TWIP ) ); @@ -1260,90 +1272,124 @@ void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground ) // ----------------------------------------------------------------------- -void SvxPageDescPage::ResetBackground_Impl( const SfxItemSet& rSet ) +void SvxPageDescPage::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) + { + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet)); + } + else { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rTmpSet.Get( nWhich ); - aBspWin.SetHdColor( rItem.GetColor() ); + 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)); + } } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + aBspWin.setHeaderFillAttributes(aHeaderFillAttributes); + nWhich = GetWhich(SID_ATTR_BORDER_OUTER); + + if(rTmpSet.GetItemState(nWhich) == SFX_ITEM_SET) { - const SvxBoxItem& rItem = - (const SvxBoxItem&)rTmpSet.Get( nWhich ); - aBspWin.SetHdBorder( rItem ); + const SvxBoxItem& rItem = static_cast< 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)); + } + 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)); + } } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + aBspWin.setFooterFillAttributes(aFooterFillAttributes); + nWhich = GetWhich(SID_ATTR_BORDER_OUTER); + + 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); } } } - const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_BRUSH ); + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aPageFillAttributes; + const SfxPoolItem* pItem = 0; - if ( pItem ) + if(mbEnableDrawingLayerFillStyles) { - aBspWin.SetColor( ( (const SvxBrushItem*)pItem )->GetColor() ); - const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic(); + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rSet)); + } + else + { + pItem = GetItem(rSet, SID_ATTR_BRUSH); - if ( pGrf ) + if(pItem) { - Bitmap aBitmap = pGrf->GetBitmap(); - aBspWin.SetBitmap( &aBitmap ); + //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); + aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); } - else - aBspWin.SetBitmap( NULL ); } - pItem = GetItem( rSet, SID_ATTR_BORDER_OUTER ); + aBspWin.setPageFillAttributes(aPageFillAttributes); + pItem = GetItem(rSet, SID_ATTR_BORDER_OUTER); - if ( pItem ) - aBspWin.SetBorder( (SvxBoxItem&)*pItem ); + if(pItem) + { + aBspWin.SetBorder(static_cast< const SvxBoxItem& >(*pItem)); + } } // ----------------------------------------------------------------------- @@ -1387,15 +1433,30 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) aBspWin.SetHeader( sal_False ); // im Beispiel Hintergrund und Umrandung anzeigen - sal_uInt16 nWhich = GetWhich( SID_ATTR_BRUSH ); + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aHeaderFillAttributes; - if ( rHeaderSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) + if(mbEnableDrawingLayerFillStyles) { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rHeaderSet.Get( nWhich ); - aBspWin.SetHdColor( rItem.GetColor() ); + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rHeaderSet)); + } + else + { + const sal_uInt16 nWhich(GetWhich(SID_ATTR_BRUSH)); + + if(rHeaderSet.GetItemState(nWhich) >= SFX_ITEM_AVAILABLE) + { + //UUUU aBspWin.SetHdColor(rItem.GetColor()); + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(nWhich)); + SfxItemSet aTempSet(*rHeaderSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + } } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); + + aBspWin.setHeaderFillAttributes(aHeaderFillAttributes); + const sal_uInt16 nWhich(GetWhich(SID_ATTR_BORDER_OUTER)); if ( rHeaderSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) { @@ -1434,15 +1495,30 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) aBspWin.SetFooter( sal_False ); // im Beispiel Hintergrund und Umrandung anzeigen - sal_uInt16 nWhich = GetWhich( SID_ATTR_BRUSH ); + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFooterFillAttributes; - if ( rFooterSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) + if(mbEnableDrawingLayerFillStyles) { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rFooterSet.Get( nWhich ); - aBspWin.SetFtColor( rItem.GetColor() ); + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rFooterSet)); } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); + else + { + const sal_uInt16 nWhich(GetWhich(SID_ATTR_BRUSH)); + + if(rFooterSet.GetItemState(nWhich) >= SFX_ITEM_AVAILABLE) + { + //UUUU aBspWin.SetFtColor(rItem.GetColor()); + const SvxBrushItem& rItem = (const SvxBrushItem&)rFooterSet.Get(nWhich); + SfxItemSet aTempSet(*rFooterSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + } + } + + aBspWin.setFooterFillAttributes(aFooterFillAttributes); + const sal_uInt16 nWhich(GetWhich(SID_ATTR_BORDER_OUTER)); if ( rFooterSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) { @@ -1703,7 +1779,7 @@ bool SvxPageDescPage::IsPrinterRangeOverflow( MetricField& rField, long nFirstMargin, long nLastMargin, MarginPosition nPos ) { bool bRet = false; - bool bCheck = ( ( pImpl->m_nPos & nPos ) == 0 ); + bool bCheck = ( ( m_nPos & nPos ) == 0 ); long nValue = static_cast<long>(rField.GetValue()); if ( bCheck && ( nValue < nFirstMargin || nValue > nLastMargin ) && @@ -1722,53 +1798,74 @@ bool SvxPageDescPage::IsPrinterRangeOverflow( void SvxPageDescPage::CheckMarginEdits( bool _bClear ) { if ( _bClear ) - pImpl->m_nPos = 0; + m_nPos = 0; sal_Int64 nValue = aLeftMarginEdit.GetValue(); if ( nValue < nFirstLeftMargin || nValue > nLastLeftMargin ) - pImpl->m_nPos |= MARGIN_LEFT; + m_nPos |= MARGIN_LEFT; nValue = aRightMarginEdit.GetValue(); if ( nValue < nFirstRightMargin || nValue > nLastRightMargin ) - pImpl->m_nPos |= MARGIN_RIGHT; + m_nPos |= MARGIN_RIGHT; nValue = aTopMarginEdit.GetValue(); if ( nValue < nFirstTopMargin || nValue > nLastTopMargin ) - pImpl->m_nPos |= MARGIN_TOP; + m_nPos |= MARGIN_TOP; nValue = aBottomMarginEdit.GetValue(); if ( nValue < nFirstBottomMargin || nValue > nLastBottomMargin ) - pImpl->m_nPos |= MARGIN_BOTTOM; + m_nPos |= MARGIN_BOTTOM; } bool SvxPageDescPage::IsMarginOutOfRange() { - bool bRet = ( ( ( !( pImpl->m_nPos & MARGIN_LEFT ) && + bool bRet = ( ( ( !( m_nPos & MARGIN_LEFT ) && ( aLeftMarginEdit.GetText() != aLeftMarginEdit.GetSavedValue() ) ) && ( aLeftMarginEdit.GetValue() < nFirstLeftMargin || aLeftMarginEdit.GetValue() > nLastLeftMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_RIGHT ) && + ( ( !( m_nPos & MARGIN_RIGHT ) && ( aRightMarginEdit.GetText() != aRightMarginEdit.GetSavedValue() ) ) && ( aRightMarginEdit.GetValue() < nFirstRightMargin || aRightMarginEdit.GetValue() > nLastRightMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_TOP ) && + ( ( !( m_nPos & MARGIN_TOP ) && ( aTopMarginEdit.GetText() != aTopMarginEdit.GetSavedValue() ) ) && ( aTopMarginEdit.GetValue() < nFirstTopMargin || aTopMarginEdit.GetValue() > nLastTopMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_BOTTOM ) && + ( ( !( m_nPos & MARGIN_BOTTOM ) && ( aBottomMarginEdit.GetText() != aBottomMarginEdit.GetSavedValue() ) ) && ( aBottomMarginEdit.GetValue() < nFirstBottomMargin || aBottomMarginEdit.GetValue() > nLastBottomMargin ) ) ); return bRet; } -void SvxPageDescPage::PageCreated (SfxAllItemSet aSet) //add CHINA001 +void SvxPageDescPage::PageCreated(SfxAllItemSet aSet) //add CHINA001 { - SFX_ITEMSET_ARG (&aSet,pModeItem,SfxAllEnumItem,SID_ENUM_PAGE_MODE,sal_False); - SFX_ITEMSET_ARG (&aSet,pPaperStartItem,SfxAllEnumItem,SID_PAPER_START,sal_False); - SFX_ITEMSET_ARG (&aSet,pPaperEndItem,SfxAllEnumItem,SID_PAPER_END,sal_False); - SFX_ITEMSET_ARG (&aSet,pCollectListItem,SfxStringListItem,SID_COLLECT_LIST,sal_False); - if (pModeItem) + SFX_ITEMSET_ARG(&aSet,pModeItem,SfxAllEnumItem,SID_ENUM_PAGE_MODE,sal_False); + SFX_ITEMSET_ARG(&aSet,pPaperStartItem,SfxAllEnumItem,SID_PAPER_START,sal_False); + SFX_ITEMSET_ARG(&aSet,pPaperEndItem,SfxAllEnumItem,SID_PAPER_END,sal_False); + SFX_ITEMSET_ARG(&aSet,pCollectListItem,SfxStringListItem,SID_COLLECT_LIST,sal_False); + + //UUUU + SFX_ITEMSET_ARG (&aSet, pSupportDrawingLayerFillStyleItem, SfxBoolItem, SID_DRAWINGLAYER_FILLSTYLES, sal_False); + + if(pModeItem) + { SetMode((SvxModeType)pModeItem->GetEnumValue()); - if (pPaperStartItem && pPaperEndItem) - SetPaperFormatRanges( (Paper)pPaperStartItem->GetEnumValue(), (Paper)pPaperEndItem->GetEnumValue() ); - if (pCollectListItem) + } + + if(pPaperStartItem && pPaperEndItem) + { + SetPaperFormatRanges((Paper)pPaperStartItem->GetEnumValue(),(Paper)pPaperEndItem->GetEnumValue()); + } + + if(pCollectListItem) + { SetCollectionList(pCollectListItem->GetList()); + } + + if(pSupportDrawingLayerFillStyleItem) + { + const bool bNew(pSupportDrawingLayerFillStyleItem->GetValue()); + + EnableDrawingLayerFillStyles(bNew); + } } + +//eof diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index f175e25e0584..09d68fefc6d7 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -840,8 +840,11 @@ void SvxAreaTabPage::Construct() void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) { - sal_uInt16 _nPos = 0; - sal_uInt16 nCount; + //UUUU use evtl. previously selected entry to avoid changing values just by + // switching TabPages in dialogs using this TabPage + sal_uInt16 _nPos(nPos); + sal_uInt16 nCount(0); + //add CHINA001 Begin SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); SFX_ITEMSET_ARG (&rSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False); @@ -2755,6 +2758,7 @@ void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001 SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False); SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False); + //UUUU SFX_ITEMSET_ARG (&aSet, pOfferImportItem, SfxBoolItem, SID_OFFER_IMPORT, sal_False); |