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 /cui | |
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 'cui')
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 20 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 10 | ||||
-rw-r--r-- | cui/source/inc/bbdlg.hxx | 13 | ||||
-rw-r--r-- | cui/source/inc/page.hxx | 15 | ||||
-rw-r--r-- | cui/source/tabpages/bbdlg.cxx | 70 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 327 | ||||
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 7 |
7 files changed, 321 insertions, 141 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 55d20b3ccc17..523c6414ddb4 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1309,12 +1309,20 @@ AbstractSvxSearchSimilarityDialog * AbstractDialogFactory_Impl::CreateSvxSearchS return NULL; } -SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg( Window* pParent, - const SfxItemSet& rCoreSet, - bool bEnableSelector) -{ - SfxTabDialog* pDlg = new SvxBorderBackgroundDlg( pParent, rCoreSet, bEnableSelector); - return new CuiAbstractTabDialog_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 CuiAbstractTabDialog_Impl(pDlg); } AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTabDialog( Window* pParent, diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 1cf6b4c43f95..df9a0870ff6f 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -571,9 +571,13 @@ public: virtual AbstractFmShowColsDialog * CreateFmShowColsDialog( Window* pParent ) SAL_OVERRIDE; virtual AbstractSvxZoomDialog * CreateSvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet) SAL_OVERRIDE; - virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg( Window* pParent, - const SfxItemSet& rCoreSet, - bool bEnableSelector = false) SAL_OVERRIDE ; + //UUUU add for SvxBorderBackgroundDlg + virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg( + Window* pParent, + const SfxItemSet& rCoreSet, + bool bEnableSelector = false, + bool bEnableDrawingLayerFillStyles = false) SAL_OVERRIDE; + virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr, const SdrView* pView, diff --git a/cui/source/inc/bbdlg.hxx b/cui/source/inc/bbdlg.hxx index c4393bd9e1f7..f5fc9d242f88 100644 --- a/cui/source/inc/bbdlg.hxx +++ b/cui/source/inc/bbdlg.hxx @@ -28,17 +28,22 @@ class SvxBorderBackgroundDlg: public SfxTabDialog { public: - SvxBorderBackgroundDlg(Window *pParent, const SfxItemSet& rCoreSet, - bool bEnableSelector = false); + SvxBorderBackgroundDlg(Window *pParent, + const SfxItemSet& rCoreSet, + bool bEnableSelector = false, + bool bEnableDrawingLayerFillStyles = false); protected: virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) SAL_OVERRIDE; private: - bool m_bEnableBackgroundSelector; ///< for Border/Background + /// bitfield + bool mbEnableBackgroundSelector : 1; ///< for Border/Background + bool mbEnableDrawingLayerFillStyles : 1; ///< for full DrawingLayer FillStyles sal_uInt16 m_nBackgroundPageId; + sal_uInt16 m_nAreaPageId; + sal_uInt16 m_nTransparencePageId; }; - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index a64ca325d271..dcbdc212807f 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -64,7 +64,7 @@ <SvxLRSpaceItem>: <SID_ATTR_LRSPACE> */ -struct SvxPage_Impl; +//UUUU struct SvxPage_Impl; typedef sal_uInt16 MarginPosition; class SvxPageDescPage : public SfxTabPage @@ -72,6 +72,7 @@ class SvxPageDescPage : public SfxTabPage using TabPage::ActivatePage; using TabPage::DeactivatePage; +private: // paper format ListBox* m_pPaperSizeBox; @@ -137,7 +138,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; void Init_Impl(); DECL_LINK(LayoutHdl_Impl, void *); @@ -172,6 +180,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 ) SAL_OVERRIDE; virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; diff --git a/cui/source/tabpages/bbdlg.cxx b/cui/source/tabpages/bbdlg.cxx index 30a487c7f12f..d0d7752d4fff 100644 --- a/cui/source/tabpages/bbdlg.cxx +++ b/cui/source/tabpages/bbdlg.cxx @@ -20,24 +20,76 @@ #include "bbdlg.hxx" #include "border.hxx" #include "backgrnd.hxx" +//UUUU +#include "svx/svxids.hrc" +#include "cuitabarea.hxx" SvxBorderBackgroundDlg::SvxBorderBackgroundDlg(Window *pParent, - const SfxItemSet& rCoreSet, bool bEnableSelector) - - : SfxTabDialog(pParent, "BorderBackgroundDialog", - "cui/ui/borderbackgrounddialog.ui", &rCoreSet) - , m_bEnableBackgroundSelector(bEnableSelector) + const SfxItemSet& rCoreSet, + bool bEnableSelector, + bool bEnableDrawingLayerFillStyles) + : SfxTabDialog(pParent, + bEnableDrawingLayerFillStyles + ? OString("BorderAreaTransparencyDialog") + : OString("BorderBackgroundDialog"), + bEnableDrawingLayerFillStyles + ? OUString("cui/ui/borderareatransparencydialog.ui") + : OUString("cui/ui/borderbackgrounddialog.ui"), + &rCoreSet) + , mbEnableBackgroundSelector(bEnableSelector) + , mbEnableDrawingLayerFillStyles(bEnableDrawingLayerFillStyles) , m_nBackgroundPageId(0) + , m_nAreaPageId(0) + , m_nTransparencePageId(0) { AddTabPage("borders", SvxBorderTabPage::Create, 0 ); - m_nBackgroundPageId = AddTabPage("background", SvxBackgroundTabPage::Create, 0 ); + if (mbEnableDrawingLayerFillStyles) + { + //UUUU Here we want full DrawingLayer FillStyle access, so add Area and Transparency TabPages + m_nAreaPageId = AddTabPage("area", SvxAreaTabPage::Create, 0); + m_nTransparencePageId = AddTabPage("transparence", SvxTransparenceTabPage::Create, 0); + } + else + { + m_nBackgroundPageId = AddTabPage("background", SvxBackgroundTabPage::Create, 0 ); + } } void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) { - // Make it possible to switch between color/graphic: - if ( m_bEnableBackgroundSelector && (nPageId == m_nBackgroundPageId) ) - ((SvxBackgroundTabPage&)rTabPage).ShowSelector( ); + if (nPageId == m_nBackgroundPageId) + { + // allow switching between Color/graphic + if(mbEnableBackgroundSelector) + { + static_cast< 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. + else if (nPageId == m_nAreaPageId) + { + 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); + } + else if (nPageId == m_nTransparencePageId) + { + rTabPage.PageCreated(*GetInputSetImpl()); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index d9018026ec39..477b4122f3cb 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -55,6 +55,10 @@ #include <svl/aeitem.hxx> #include <sfx2/request.hxx> +//UUUU +#include <svx/xdef.hxx> +#include <svx/unobrushitemhelper.hxx> + #include <numpages.hxx> // static ---------------------------------------------------------------- @@ -141,19 +145,20 @@ 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 -------------------------------------------------- @@ -170,8 +175,6 @@ SfxTabPage* SvxPageDescPage::Create( Window* pParent, const SfxItemSet* rSet ) return new SvxPageDescPage( pParent, *rSet ); } - - SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : SfxTabPage( pParent, "PageFormatPage", "cui/ui/pageformatpage.ui", &rAttr ), @@ -180,8 +183,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) { get(m_pPaperSizeBox,"comboPageFormat"); get(m_pPaperWidthEdit,"spinWidth"); @@ -281,27 +293,28 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : SetFieldUnit( *m_pPaperHeightEdit, 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 ); // set first- and last-values for the margins - Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize(); - Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize(); + Size aPaperSize = mpDefPrinter->GetPaperSize(); + Size aPrintSize = mpDefPrinter->GetOutputSize(); /* * To convert a point ( 0,0 ) into logic coordinates * looks like nonsense; but it makes sense when the * coordinate system's origin has been moved. */ - 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; m_pLeftMarginEdit->SetFirst( m_pLeftMarginEdit->Normalize( aPrintOffset.X() ), FUNIT_TWIP ); @@ -359,7 +372,10 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : SvxPageDescPage::~SvxPageDescPage() { - delete pImpl; + if(mbDelPrinter) + { + delete mpDefPrinter; + } } @@ -434,7 +450,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // general page data 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 ); @@ -467,7 +483,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; } @@ -476,20 +492,20 @@ 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 = m_pPaperTrayBox->InsertEntry( aBinName ); m_pPaperTrayBox->SetEntryData( nEntryPos, (void*)(sal_uLong)nPaperBin ); m_pPaperTrayBox->SelectEntry( aBinName ); - 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(); bool bOrientationSupport = - pImpl->mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION ); + mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION ); if ( !bOrientationSupport && aPaperSize.Width() > aPaperSize.Height() ) @@ -923,11 +939,11 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl) m_pPaperTrayBox->SetEntryData( nEntryPos, (void*)(sal_uLong)PAPERBIN_PRINTER_SETTINGS ); OUString aPaperBin( EditResId( RID_SVXSTR_PAPERBIN ) ); - sal_uInt16 nBinCount = pImpl->mpDefPrinter->GetPaperBinCount(); + sal_uInt16 nBinCount = mpDefPrinter->GetPaperBinCount(); for ( sal_uInt16 i = 0; i < nBinCount; ++i ) { - OUString aName = pImpl->mpDefPrinter->GetPaperBinName(i); + OUString aName = mpDefPrinter->GetPaperBinName(i); if ( aName.isEmpty() ) { @@ -1074,27 +1090,26 @@ IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, RadioButton *, pBtn ) void SvxPageDescPage::SwapFirstValues_Impl( bool 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 ); // set first- and last-values for margins - Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize(); - Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize(); + Size aPaperSize = mpDefPrinter->GetPaperSize(); + Size aPrintSize = mpDefPrinter->GetOutputSize(); /* * To convert a point ( 0,0 ) into logic coordinates * looks like nonsense; but it makes sense if the * coordinate system's origin has been moved. */ - 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 = m_pLeftMarginEdit->Denormalize( m_pLeftMarginEdit->GetValue( FUNIT_TWIP ) ); @@ -1175,31 +1190,44 @@ 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, false ) == SFX_ITEM_SET ) + if (SFX_ITEM_SET == rSet.GetItemState(nWhich, false)) { - const SvxSetItem& rSetItem = - (const SvxSetItem&)rSet.Get( nWhich, 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 ); - m_pBspWin->SetHdColor( rItem.GetColor() ); + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aHeaderFillAttributes.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); + aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + } } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + m_pBspWin->setHeaderFillAttributes(aHeaderFillAttributes); + nWhich = GetWhich(SID_ATTR_BORDER_OUTER); + + if(rTmpSet.GetItemState(nWhich) == SFX_ITEM_SET) { const SvxBoxItem& rItem = (const SvxBoxItem&)rTmpSet.Get( nWhich ); @@ -1208,61 +1236,81 @@ void SvxPageDescPage::ResetBackground_Impl( const SfxItemSet& rSet ) } } - nWhich = GetWhich( SID_ATTR_PAGE_FOOTERSET ); + nWhich = GetWhich(SID_ATTR_PAGE_FOOTERSET); - if ( rSet.GetItemState( nWhich, false ) == SFX_ITEM_SET ) + if (SFX_ITEM_SET == rSet.GetItemState(nWhich, false)) { - const SvxSetItem& rSetItem = - (const SvxSetItem&)rSet.Get( nWhich, 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 ); - m_pBspWin->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 ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) + 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)); + } + } + + m_pBspWin->setFooterFillAttributes(aFooterFillAttributes); + nWhich = GetWhich(SID_ATTR_BORDER_OUTER); + + if(rTmpSet.GetItemState(nWhich) == SFX_ITEM_SET) { - const SvxBoxItem& rItem = - (const SvxBoxItem&)rTmpSet.Get( nWhich ); - m_pBspWin->SetFtBorder( rItem ); + const SvxBoxItem& rItem = static_cast< const SvxBoxItem& >(rTmpSet.Get(nWhich)); + m_pBspWin->SetFtBorder(rItem); } } } - const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_BRUSH ); + drawinglayer::attribute::SdrAllFillAttributesHelperPtr aPageFillAttributes; + const SfxPoolItem* pItem = 0; - if ( pItem ) + if(mbEnableDrawingLayerFillStyles) + { + //UUUU create FillAttributes directly from DrawingLayer FillStyle entries + aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rSet)); + } + else { - m_pBspWin->SetColor( ( (const SvxBrushItem*)pItem )->GetColor() ); - const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic(); + pItem = GetItem(rSet, SID_ATTR_BRUSH); - if ( pGrf ) + if(pItem) { - Bitmap aBitmap = pGrf->GetBitmap(); - m_pBspWin->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 - m_pBspWin->SetBitmap( NULL ); } - pItem = GetItem( rSet, SID_ATTR_BORDER_OUTER ); + m_pBspWin->setPageFillAttributes(aPageFillAttributes); + pItem = GetItem(rSet, SID_ATTR_BORDER_OUTER); - if ( pItem ) - m_pBspWin->SetBorder( (SvxBoxItem&)*pItem ); + if(pItem) + { + m_pBspWin->SetBorder(static_cast< const SvxBoxItem& >(*pItem)); + } } - - void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) { bLandscape = m_pLandscapeBtn->IsChecked(); @@ -1302,15 +1350,30 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) m_pBspWin->SetHeader( false ); // show background and border in the example - 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 ); - m_pBspWin->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 ); + + m_pBspWin->setHeaderFillAttributes(aHeaderFillAttributes); + const sal_uInt16 nWhich(GetWhich(SID_ATTR_BORDER_OUTER)); if ( rHeaderSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) { @@ -1349,15 +1412,30 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) m_pBspWin->SetFooter( false ); // show background and border in the example - 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 ); - m_pBspWin->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)); + } + } + + m_pBspWin->setFooterFillAttributes(aFooterFillAttributes); + const sal_uInt16 nWhich(GetWhich(SID_ATTR_BORDER_OUTER)); if ( rFooterSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) { @@ -1612,7 +1690,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 ) && @@ -1631,37 +1709,37 @@ bool SvxPageDescPage::IsPrinterRangeOverflow( void SvxPageDescPage::CheckMarginEdits( bool _bClear ) { if ( _bClear ) - pImpl->m_nPos = 0; + m_nPos = 0; sal_Int64 nValue = m_pLeftMarginEdit->GetValue(); if ( nValue < nFirstLeftMargin || nValue > nLastLeftMargin ) - pImpl->m_nPos |= MARGIN_LEFT; + m_nPos |= MARGIN_LEFT; nValue = m_pRightMarginEdit->GetValue(); if ( nValue < nFirstRightMargin || nValue > nLastRightMargin ) - pImpl->m_nPos |= MARGIN_RIGHT; + m_nPos |= MARGIN_RIGHT; nValue = m_pTopMarginEdit->GetValue(); if ( nValue < nFirstTopMargin || nValue > nLastTopMargin ) - pImpl->m_nPos |= MARGIN_TOP; + m_nPos |= MARGIN_TOP; nValue = m_pBottomMarginEdit->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 ) && m_pLeftMarginEdit->IsValueChangedFromSaved() ) && ( m_pLeftMarginEdit->GetValue() < nFirstLeftMargin || m_pLeftMarginEdit->GetValue() > nLastLeftMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_RIGHT ) && + ( ( !( m_nPos & MARGIN_RIGHT ) && m_pRightMarginEdit->IsValueChangedFromSaved() ) && ( m_pRightMarginEdit->GetValue() < nFirstRightMargin || m_pRightMarginEdit->GetValue() > nLastRightMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_TOP ) && + ( ( !( m_nPos & MARGIN_TOP ) && m_pTopMarginEdit->IsValueChangedFromSaved() ) && ( m_pTopMarginEdit->GetValue() < nFirstTopMargin || m_pTopMarginEdit->GetValue() > nLastTopMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_BOTTOM ) && + ( ( !( m_nPos & MARGIN_BOTTOM ) && m_pBottomMarginEdit->IsValueChangedFromSaved() ) && ( m_pBottomMarginEdit->GetValue() < nFirstBottomMargin || m_pBottomMarginEdit->GetValue() > nLastBottomMargin ) ) ); @@ -1674,12 +1752,31 @@ void SvxPageDescPage::PageCreated(const SfxAllItemSet& aSet) SFX_ITEMSET_ARG (&aSet,pPaperStartItem,SfxAllEnumItem,SID_PAPER_START,false); SFX_ITEMSET_ARG (&aSet,pPaperEndItem,SfxAllEnumItem,SID_PAPER_END,false); SFX_ITEMSET_ARG (&aSet,pCollectListItem,SfxStringListItem,SID_COLLECT_LIST,false); + + //UUUU + SFX_ITEMSET_ARG (&aSet, pSupportDrawingLayerFillStyleItem, SfxBoolItem, SID_DRAWINGLAYER_FILLSTYLES, 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); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 20924d00bbf7..1fdcbe5a7404 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -790,7 +790,7 @@ void SvxAreaTabPage::Construct() void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) { - sal_Int32 nCount; + sal_Int32 nCount(0); SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,false); SFX_ITEMSET_ARG (&rSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,false); if (pPageTypeItem) @@ -803,7 +803,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) if( pColorList.is() ) { - sal_Int32 _nPos = 0; + //UUUU use evtl. previously selected entry to avoid changing values just by + // switching TabPages in dialogs using this TabPage + sal_Int32 _nPos(nPos); if( *pnBitmapListState ) { @@ -2383,6 +2385,7 @@ void SvxAreaTabPage::PageCreated(const SfxAllItemSet& aSet) SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,false); SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,false); SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,false); + //UUUU SFX_ITEMSET_ARG (&aSet, pOfferImportItem, SfxBoolItem, SID_OFFER_IMPORT, false); |