[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - cui/source sal/prj sal/qa sc/source svx/inc svx/Library_svxcore.mk svx/Package_inc.mk svx/source sw/inc sw/Library_sw.mk sw/source xmloff/inc xmloff/source
Jürgen Schmidt
jsc at apache.org
Mon Jun 2 09:07:50 PDT 2014
cui/source/factory/dlgfact.cxx | 20
cui/source/factory/dlgfact.hxx | 11
cui/source/inc/bbdlg.hxx | 13
cui/source/inc/cuires.hrc | 6
cui/source/inc/page.hxx | 15
cui/source/tabpages/bbdlg.cxx | 81
cui/source/tabpages/bbdlg.src | 46
cui/source/tabpages/page.cxx | 353 +-
cui/source/tabpages/tparea.cxx | 8
sal/prj/build.lst | 1
sal/qa/osl/condition/makefile.mk | 29
sal/qa/osl/condition/osl_Condition.cxx | 349 --
sal/qa/osl/condition/osl_Condition_Const.h | 4
sc/source/core/data/documen9.cxx | 29
svx/Library_svxcore.mk | 2
svx/Package_inc.mk | 2
svx/inc/svx/hdft.hxx | 22
svx/inc/svx/pagectrl.hxx | 143 -
svx/inc/svx/sdr/attribute/sdrallfillattributeshelper.hxx | 98
svx/inc/svx/svxdlg.hxx | 11
svx/inc/svx/svxids.hrc | 3
svx/inc/svx/unobrushitemhelper.hxx | 56
svx/source/dialog/hdft.cxx | 476 ++-
svx/source/dialog/pagectrl.cxx | 461 +--
svx/source/sdr/attribute/sdrallfillattributeshelper.cxx | 275 +
svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 6
svx/source/sidebar/tools/ColorControl.cxx | 12
svx/source/tbxctrls/tbxcolorupdate.cxx | 16
svx/source/unodraw/unobrushitemhelper.cxx | 330 ++
sw/Library_sw.mk | 2
sw/inc/cmdid.h | 20
sw/inc/fillattributes.hxx | 74
sw/inc/format.hxx | 27
sw/inc/frmatr.hxx | 2
sw/inc/frmfmt.hxx | 8
sw/inc/hintids.hxx | 9
sw/inc/hints.hxx | 26
sw/inc/ndtxt.hxx | 6
sw/inc/node.hxx | 9
sw/inc/swatrset.hxx | 6
sw/inc/swunohelper.hxx | 9
sw/inc/unobrushitemhelper.hxx | 33
sw/inc/unoframe.hxx | 5
sw/inc/unoprnms.hxx | 56
sw/inc/unostyle.hxx | 7
sw/source/core/access/accpara.cxx | 2
sw/source/core/attr/cellatr.cxx | 6
sw/source/core/attr/format.cxx | 34
sw/source/core/attr/hints.cxx | 16
sw/source/core/bastyp/init.cxx | 6
sw/source/core/doc/docdesc.cxx | 73
sw/source/core/doc/docdraw.cxx | 42
sw/source/core/doc/docedt.cxx | 6
sw/source/core/doc/docfly.cxx | 8
sw/source/core/doc/docfmt.cxx | 18
sw/source/core/doc/docnew.cxx | 17
sw/source/core/doc/docredln.cxx | 21
sw/source/core/doc/notxtfrm.cxx | 2
sw/source/core/doc/poolfmt.cxx | 3
sw/source/core/doc/visiturl.cxx | 12
sw/source/core/docnode/node.cxx | 8
sw/source/core/inc/frame.hxx | 13
sw/source/core/inc/frmtool.hxx | 2
sw/source/core/inc/rolbck.hxx | 8
sw/source/core/layout/atrfrm.cxx | 58
sw/source/core/layout/fillattributes.cxx | 168 -
sw/source/core/layout/findfrm.cxx | 13
sw/source/core/layout/frmtool.cxx | 23
sw/source/core/layout/paintfrm.cxx | 118
sw/source/core/text/inftxt.cxx | 2
sw/source/core/text/txtfrm.cxx | 6
sw/source/core/txtnode/fntcache.cxx | 2
sw/source/core/txtnode/ndtxt.cxx | 88
sw/source/core/txtnode/thints.cxx | 29
sw/source/core/txtnode/txtatr2.cxx | 18
sw/source/core/txtnode/txtedt.cxx | 8
sw/source/core/undo/rolbck.cxx | 91
sw/source/core/unocore/swunohelper.cxx | 41
sw/source/core/unocore/unobrushitemhelper.cxx | 328 --
sw/source/core/unocore/unoframe.cxx | 68
sw/source/core/unocore/unomap.cxx | 204 +
sw/source/core/unocore/unoparagraph.cxx | 281 +-
sw/source/core/unocore/unoprnms.cxx | 107
sw/source/core/unocore/unostyle.cxx | 2101 +++++++++------
sw/source/ui/app/docst.cxx | 57
sw/source/ui/app/docstyle.cxx | 59
sw/source/ui/chrdlg/paradlg.src | 24
sw/source/ui/chrdlg/pardlg.cxx | 178 -
sw/source/ui/fmtui/tmpdlg.cxx | 340 +-
sw/source/ui/fmtui/tmpdlg.src | 45
sw/source/ui/frmdlg/colex.cxx | 85
sw/source/ui/shells/basesh.cxx | 241 -
sw/source/ui/shells/textsh1.cxx | 57
sw/source/ui/uiview/viewstat.cxx | 17
sw/source/ui/utlui/uitool.cxx | 38
xmloff/inc/PageMasterImportContext.hxx | 7
xmloff/inc/xmloff/PageMasterStyleMap.hxx | 27
xmloff/inc/xmloff/XMLShapeStyleContext.hxx | 3
xmloff/inc/xmloff/prstylei.hxx | 41
xmloff/inc/xmloff/txtprmap.hxx | 8
xmloff/inc/xmlsdtypes.hxx | 208 +
xmloff/source/draw/XMLShapeStyleContext.cxx | 74
xmloff/source/draw/sdpropls.hxx | 173 -
xmloff/source/style/PageMasterExportPropMapper.cxx | 120
xmloff/source/style/PageMasterImportContext.cxx | 165 +
xmloff/source/style/PageMasterPropHdlFactory.cxx | 49
xmloff/source/style/PageMasterStyleMap.cxx | 336 +-
xmloff/source/style/prstylei.cxx | 287 +-
xmloff/source/style/xmlimppr.cxx | 2
xmloff/source/style/xmlprmap.cxx | 2
xmloff/source/text/txtexppr.cxx | 20
xmloff/source/text/txtprhdl.cxx | 82
xmloff/source/text/txtprmap.cxx | 42
xmloff/source/text/txtstyli.cxx | 230 +
114 files changed, 6445 insertions(+), 3800 deletions(-)
New commits:
commit 1118f619fd1680a18a1dbfda156f7e97d121386f
Author: Jürgen Schmidt <jsc at apache.org>
Date: Mon Jun 2 15:06:55 2014 +0000
#125003# add include for Windows
diff --git a/sal/qa/osl/condition/osl_Condition.cxx b/sal/qa/osl/condition/osl_Condition.cxx
index a9568c7..2feee84 100644
--- a/sal/qa/osl/condition/osl_Condition.cxx
+++ b/sal/qa/osl/condition/osl_Condition.cxx
@@ -29,6 +29,10 @@
//------------------------------------------------------------------------
#include <osl_Condition_Const.h>
+#ifdef WNT
+#include <Windows.h>
+#endif
+
#include "gtest/gtest.h"
using namespace osl;
commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b
Author: Armin Le Grand <alg at apache.org>
Date: Mon Jun 2 15:00:50 2014 +0000
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
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 2c38a1e..69470aa 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 cdb579b..39fb0b6 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 fe2ac34..51cb1ba 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 7a0dac2..17f5fc7 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 f49e36d..1222215 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 afaf3c4..7d8c604 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 520884a..6a8ebc1 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 3edba4b..887a882 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 f175e25..09d68fe 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);
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 882af4c..ec06ee0 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -161,6 +161,22 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell )
if (GetLinkManager())
pDrawLayer->SetLinkManager( pLinkManager );
+ //UUUU set DrawingLayer's SfxItemPool at Calc's SfxItemPool as
+ // secondary pool to support DrawingLayer FillStyle ranges (and similar)
+ // in SfxItemSets using the Calc SfxItemPool. This is e.g. needed when
+ // the PageStyle using SvxBrushItem is visualized and will be potentially
+ // used more intense in the future
+ if(xPoolHelper.isValid())
+ {
+ ScDocumentPool* pLocalPool = xPoolHelper->GetDocPool();
+
+ if(pLocalPool)
+ {
+ OSL_ENSURE(!pLocalPool->GetSecondaryPool(), "OOps, already a secondary pool set where the DrawingLayer ItemPool is to be placed (!)");
+ pLocalPool->SetSecondaryPool(&pDrawLayer->GetItemPool());
+ }
+ }
+
// Drawing pages are accessed by table number, so they must also be present
// for preceding table numbers, even if the tables aren't allocated
// (important for clipboard documents).
@@ -254,7 +270,20 @@ IMPL_LINK_INLINE_END( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex
void ScDocument::DeleteDrawLayer()
{
+ //UUUU remove DrawingLayer's SfxItemPool from Calc's SfxItemPool where
+ // it is registered as secondary pool
+ if(xPoolHelper.isValid())
+ {
+ ScDocumentPool* pLocalPool = xPoolHelper->GetDocPool();
+
+ if(pLocalPool && pLocalPool->GetSecondaryPool())
+ {
+ pLocalPool->SetSecondaryPool(0);
+ }
+ }
+
delete pDrawLayer;
+ pDrawLayer = 0;
}
sal_Bool ScDocument::DrawGetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 24bdc0a..36b420e 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -189,6 +189,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/sdr/animation/scheduler \
svx/source/sdr/animation/objectanimator \
svx/source/sdr/animation/animationstate \
+ svx/source/sdr/attribute/sdrallfillattributeshelper \
svx/source/sdr/attribute/sdrlinefillshadowtextattribute \
svx/source/sdr/attribute/sdrfilltextattribute \
svx/source/sdr/attribute/sdrshadowtextattribute \
@@ -392,6 +393,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/unodraw/gluepts \
svx/source/unodraw/shapepropertynotifier \
svx/source/unodraw/tableshape \
+ svx/source/unodraw/unobrushitemhelper \
svx/source/unodraw/unobtabl \
svx/source/unodraw/unodtabl \
svx/source/unodraw/UnoGraphicExporter \
diff --git a/svx/Package_inc.mk b/svx/Package_inc.mk
index 632a854..bf583b7 100644
--- a/svx/Package_inc.mk
+++ b/svx/Package_inc.mk
@@ -204,6 +204,7 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdprcitm.hxx,svx/sdprcitm.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/animation/animationstate.hxx,svx/sdr/animation/animationstate.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/animation/objectanimator.hxx,svx/sdr/animation/objectanimator.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/animation/scheduler.hxx,svx/sdr/animation/scheduler.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/attribute/sdrallfillattributeshelper.hxx,svx/sdr/attribute/sdrallfillattributeshelper.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/attribute/sdrfilltextattribute.hxx,svx/sdr/attribute/sdrfilltextattribute.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/attribute/sdrformtextattribute.hxx,svx/sdr/attribute/sdrformtextattribute.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx,svx/sdr/attribute/sdrformtextoutlineattribute.hxx))
@@ -485,6 +486,7 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/ucsubset.hrc,svx/ucsubset.hrc)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ucsubset.hxx,svx/ucsubset.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unoapi.hxx,svx/unoapi.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unofill.hxx,svx/unofill.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unobrushitemhelper.hxx,svx/unobrushitemhelper.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unomaster.hxx,svx/unomaster.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unomid.hxx,svx/unomid.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unomod.hxx,svx/unomod.hxx))
diff --git a/svx/inc/svx/hdft.hxx b/svx/inc/svx/hdft.hxx
index 4208efb..307e044 100644
--- a/svx/inc/svx/hdft.hxx
+++ b/svx/inc/svx/hdft.hxx
@@ -43,11 +43,15 @@
// class SvxHFPage ------------------------------------------------------
-class SVX_DLLPUBLIC SvxHFPage: public SfxTabPage
+class SVX_DLLPUBLIC SvxHFPage : public SfxTabPage
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
+private:
+ //UUUU
+ void EnableDrawingLayerFillStyles(bool bNew) { mbEnableDrawingLayerFillStyles = bNew; }
+
public:
virtual sal_Bool FillItemSet( SfxItemSet& rOutSet );
@@ -55,8 +59,12 @@ public:
virtual ~SvxHFPage();
- void DisableDeleteQueryBox() { bDisableQueryBox = sal_True; }
- void EnableBackgroundSelector( sal_Bool bNew ) { bEnableBackgroundSelector = bNew; }
+ void DisableDeleteQueryBox() { mbDisableQueryBox = true; }
+ void EnableBackgroundSelector(bool bNew) { mbEnableBackgroundSelector = bNew; }
+
+ //UUUU
+ virtual void PageCreated(SfxAllItemSet aSet);
+
void EnableDynamicSpacing();
protected:
@@ -84,9 +92,11 @@ protected:
sal_uInt16 nId;
SfxItemSet* pBBSet;
- sal_Bool bDisableQueryBox;
- sal_Bool bEnableBackgroundSelector;
- FASTBOOL bInReset;
+
+ /// bitfield
+ bool mbDisableQueryBox : 1;
+ bool mbEnableBackgroundSelector : 1;
+ bool mbEnableDrawingLayerFillStyles : 1;
void InitHandler();
DECL_LINK( TurnOnHdl, CheckBox*);
diff --git a/svx/inc/svx/pagectrl.hxx b/svx/inc/svx/pagectrl.hxx
index 471b72c..df3e758 100644
--- a/svx/inc/svx/pagectrl.hxx
+++ b/svx/inc/svx/pagectrl.hxx
@@ -19,19 +19,14 @@
*
*************************************************************/
-
#ifndef _SVX_PAGECTRL_HXX
#define _SVX_PAGECTRL_HXX
-// include ---------------------------------------------------------------
-
#include <vcl/window.hxx>
#include "svx/svxdllapi.h"
-
-// forward ---------------------------------------------------------------
+#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
class SvxBoxItem;
-struct PageWindow_Impl;
// class SvxPageWindow ---------------------------------------------------
@@ -47,29 +42,34 @@ private:
long nBottom;
long nLeft;
long nRight;
- Color aColor;
- PageWindow_Impl* pImpl;
+ SvxBoxItem* pBorder;
+ sal_Bool bResetBackground;
+ sal_Bool bFrameDirection;
+ sal_Int32 nFrameDirection;
long nHdLeft;
long nHdRight;
long nHdDist;
long nHdHeight;
- Color aHdColor;
SvxBoxItem* pHdBorder;
long nFtLeft;
long nFtRight;
long nFtDist;
long nFtHeight;
- Color aFtColor;
SvxBoxItem* pFtBorder;
- sal_Bool bFooter :1;
- sal_Bool bHeader :1;
- sal_Bool bTable :1;
- sal_Bool bHorz :1;
- sal_Bool bVert :1;
+ //UUUU
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes;
+ drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes;
+
+ sal_Bool bFooter : 1;
+ sal_Bool bHeader : 1;
+ sal_Bool bTable : 1;
+ sal_Bool bHorz : 1;
+ sal_Bool bVert : 1;
sal_uInt16 eUsage;
@@ -77,90 +77,95 @@ private:
String aRightText;
protected:
- virtual void Paint( const Rectangle& rRect );
+ virtual void Paint(const Rectangle& rRect);
- virtual void DrawPage( const Point& rPoint,
- const sal_Bool bSecond,
- const sal_Bool bEnabled );
+ virtual void DrawPage(const Point& rPoint,
+ const sal_Bool bSecond,
+ const sal_Bool bEnabled);
+
+ //UUUU
+ void drawFillAttributes(
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes,
+ const Rectangle& rPaintRange,
+ const Rectangle& rDefineRange);
public:
- SvxPageWindow( Window* pParent, const ResId& rId );
+ SvxPageWindow(Window* pParent,const ResId& rId);
~SvxPageWindow();
- void SetWidth( long nW ) { aSize.Width() = nW; }
- void SetHeight( long nH ) { aSize.Height() = nH; }
+ //UUUU
+ void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) { maHeaderFillAttributes = rFillAttributes; }
+ void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) { maFooterFillAttributes = rFillAttributes; }
+ void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) { maPageFillAttributes = rFillAttributes; }
+ const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& getPageFillAttributes() const { return maPageFillAttributes; }
+
+ void SetWidth(long nW) { aSize.Width() = nW; }
+ void SetHeight(long nH) { aSize.Height() = nH; }
- void SetSize( const Size& rSz ) { aSize = rSz; }
+ void SetSize(const Size& rSz) { aSize = rSz; }
const Size& GetSize() const { return aSize; }
- void SetTop( long nNew ) { nTop = nNew; }
- void SetBottom( long nNew ) { nBottom = nNew; }
- void SetLeft( long nNew ) { nLeft = nNew; }
- void SetRight( long nNew ) { nRight = nNew; }
- void SetColor( const Color& rNew ) { aColor = rNew; }
- void SetBorder( const SvxBoxItem& rNew );
- void SetBitmap( Bitmap* pBmp );
-
- long GetTop() const { return nTop; }
- long GetBottom() const { return nBottom;}
- long GetLeft() const { return nLeft; }
+ void SetTop(long nNew) { nTop = nNew; }
+ void SetBottom(long nNew) { nBottom = nNew; }
+ void SetLeft(long nNew) { nLeft = nNew; }
+ void SetRight(long nNew) { nRight = nNew; }
+ void SetBorder(const SvxBoxItem& rNew);
+
+ long GetTop() const { return nTop; }
+ long GetBottom() const { return nBottom; }
+ long GetLeft() const { return nLeft; }
long GetRight() const { return nRight; }
- const Color& GetColor() const { return aColor; }
const SvxBoxItem& GetBorder() const;
- void SetHdLeft( long nNew ) { nHdLeft = nNew; }
- void SetHdRight( long nNew ) { nHdRight = nNew; }
- void SetHdDist( long nNew ) { nHdDist = nNew; }
- void SetHdHeight( long nNew ) { nHdHeight = nNew; }
- void SetHdColor( const Color& aNew ) { aHdColor = aNew; }
- void SetHdBorder( const SvxBoxItem& rNew );
+ void SetHdLeft(long nNew) { nHdLeft = nNew; }
+ void SetHdRight(long nNew) { nHdRight = nNew; }
+ void SetHdDist(long nNew) { nHdDist = nNew; }
+ void SetHdHeight(long nNew) { nHdHeight = nNew; }
+ void SetHdBorder(const SvxBoxItem& rNew);
- long GetHdLeft() const { return nHdLeft; }
+ long GetHdLeft() const { return nHdLeft; }
long GetHdRight() const { return nHdRight; }
- long GetHdDist() const { return nHdDist; }
- long GetHdHeight() const { return nHdHeight;}
+ long GetHdDist() const { return nHdDist; }
+ long GetHdHeight() const { return nHdHeight; }
- const Color& GetHdColor() const { return aHdColor; }
const SvxBoxItem& GetHdBorder() const { return *pHdBorder; }
- void SetFtLeft( long nNew ) { nFtLeft = nNew; }
- void SetFtRight( long nNew ) { nFtRight = nNew; }
- void SetFtDist( long nNew ) { nFtDist = nNew; }
- void SetFtHeight( long nNew ) { nFtHeight = nNew; }
- void SetFtColor( const Color& aNew ) { aFtColor = aNew; }
- void SetFtBorder( const SvxBoxItem& rNew );
+ void SetFtLeft(long nNew) { nFtLeft = nNew; }
+ void SetFtRight(long nNew) { nFtRight = nNew; }
+ void SetFtDist(long nNew) { nFtDist = nNew; }
+ void SetFtHeight(long nNew) { nFtHeight = nNew; }
+ void SetFtBorder(const SvxBoxItem& rNew);
- long GetFtLeft() const { return nFtLeft; }
+ long GetFtLeft() const { return nFtLeft; }
long GetFtRight() const { return nFtRight; }
- long GetFtDist() const { return nFtDist; }
- long GetFtHeight() const { return nFtHeight;}
+ long GetFtDist() const { return nFtDist; }
+ long GetFtHeight() const { return nFtHeight; }
- const Color& GetFtColor() const { return aFtColor; }
const SvxBoxItem& GetFtBorder() const { return *pFtBorder; }
- void SetUsage( sal_uInt16 eU ) { eUsage = eU; }
- sal_uInt16 GetUsage() const { return eUsage;}
+ void SetUsage(sal_uInt16 eU) { eUsage = eU; }
+ sal_uInt16 GetUsage() const { return eUsage; }
- void SetHeader( sal_Bool bNew ) { bHeader = bNew; }
- sal_Bool GetHeader() const { return bHeader;}
- void SetFooter( sal_Bool bNew ) { bFooter = bNew; }
- sal_Bool GetFooter() const { return bFooter;}
+ void SetHeader(sal_Bool bNew) { bHeader = bNew; }
+ sal_Bool GetHeader() const { return bHeader; }
+ void SetFooter(sal_Bool bNew) { bFooter = bNew; }
+ sal_Bool GetFooter() const { return bFooter; }
- void SetTable( sal_Bool bNew ) { bTable = bNew; }
- sal_Bool GetTable() const { return bTable;}
- void SetHorz( sal_Bool bNew ) { bHorz = bNew; }
- sal_Bool GetHorz() const { return bHorz;}
- void SetVert( sal_Bool bNew ) { bVert = bNew; }
- sal_Bool GetVert() const { return bVert;}
+ void SetTable(sal_Bool bNew) { bTable = bNew; }
+ sal_Bool GetTable() const { return bTable; }
+ void SetHorz(sal_Bool bNew) { bHorz = bNew; }
+ sal_Bool GetHorz() const { return bHorz; }
+ void SetVert(sal_Bool bNew) { bVert = bNew; }
+ sal_Bool GetVert() const { return bVert; }
void EnableFrameDirection(sal_Bool bEnable);
//uses enum SvxFrameDirection
- void SetFrameDirection(sal_Int32 nFrameDirection);
+ void SetFrameDirection(sal_Int32 nDirection);
void ResetBackground();
};
#endif // #ifndef _SVX_PAGECTRL_HXX
-
+//eof
diff --git a/svx/inc/svx/sdr/attribute/sdrallfillattributeshelper.hxx b/svx/inc/svx/sdr/attribute/sdrallfillattributeshelper.hxx
new file mode 100755
index 0000000..3983db2
--- /dev/null
+++ b/svx/inc/svx/sdr/attribute/sdrallfillattributeshelper.hxx
@@ -0,0 +1,98 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _SDR_ATTRIBUTE_SDRALLFILLATTRIBUTESHELPER_HXX
+#define _SDR_ATTRIBUTE_SDRALLFILLATTRIBUTESHELPER_HXX
+
+#include "svx/svxdllapi.h"
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <boost/shared_ptr.hpp>
+#include <tools/color.hxx>
+#include <svl/itemset.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SVX_DLLPUBLIC SdrAllFillAttributesHelper
+ {
+ private:
+ basegfx::B2DRange maLastPaintRange;
+ basegfx::B2DRange maLastDefineRange;
+ boost::shared_ptr< drawinglayer::attribute::SdrFillAttribute > maFillAttribute;
+ boost::shared_ptr< drawinglayer::attribute::FillGradientAttribute > maFillGradientAttribute;
+ drawinglayer::primitive2d::Primitive2DSequence maPrimitives;
+
+ void createPrimitive2DSequence(
+ const basegfx::B2DRange& rPaintRange,
+ const basegfx::B2DRange& rDefineRange);
+
+ protected:
+ public:
+ SdrAllFillAttributesHelper();
+ SdrAllFillAttributesHelper(const Color& rColor);
+ SdrAllFillAttributesHelper(const SfxItemSet& rSet);
+ ~SdrAllFillAttributesHelper();
+
+ bool isUsed() const;
+ bool hasSdrFillAttribute() const { return maFillAttribute.get(); }
+ bool hasFillGradientAttribute() const { return maFillGradientAttribute.get(); }
+ bool isTransparent() const;
+
+ const drawinglayer::attribute::SdrFillAttribute& getFillAttribute() const;
+ const drawinglayer::attribute::FillGradientAttribute& getFillGradientAttribute() const;
+ const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence(
+ const basegfx::B2DRange& rPaintRange,
+ const basegfx::B2DRange& rDefineRange) const;
+
+ // get average fill color; tries to calculate a 'medium' color
+ // which e.g. may be used as comparison to decide if other
+ // colors are visible
+ basegfx::BColor getAverageColor(const basegfx::BColor& rFallback) const;
+
+ // return if a repaint of this content needs a complete repaint. This
+ // is e.g. not needed for no fill or color fill (a partial repaint
+ // will do the trick), but necessary for everything that is not top-left
+ // oriented
+ bool needCompleteRepaint() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ typedef boost::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr;
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRALLFILLATTRIBUTESHELPER_HXX
+
+// eof
diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx
index bea905e..55589a2 100644
--- a/svx/inc/svx/svxdlg.hxx
+++ b/svx/inc/svx/svxdlg.hxx
@@ -385,9 +385,14 @@ public:
sal_uInt16 nOther,
sal_uInt16 nShorter,
sal_uInt16 nLonger ) = 0;
- virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg( Window* pParent, //add for SvxBorderBackgroundDlg
- const SfxItemSet& rCoreSet,
- sal_Bool bEnableSelector = sal_False) = 0;
+
+ //UUUU add for SvxBorderBackgroundDlg
+ virtual SfxAbstractTabDialog* CreateSvxBorderBackgroundDlg(
+ Window* pParent,
+ const SfxItemSet& rCoreSet,
+ bool bEnableSelector = false,
+ bool bEnableDrawingLayerFillStyles = false) = 0;
+
virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( Window* pParent, //add for SvxTransformTabDialog
const SfxItemSet* pAttr,
const SdrView* pView,
diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc
index 67b145f..f48c4ff 100755
--- a/svx/inc/svx/svxids.hrc
+++ b/svx/inc/svx/svxids.hrc
@@ -1347,9 +1347,10 @@
//UUUU
#define SID_OFFER_IMPORT ( SID_SVX_START + 1119)
+#define SID_DRAWINGLAYER_FILLSTYLES ( SID_SVX_START + 1120)
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE (SID_OFFER_IMPORT + 1)
+#define SID_SVX_FIRSTFREE (SID_DRAWINGLAYER_FILLSTYLES + 1)
// --------------------------------------------------------------------------
// Overflow check for slot IDs
diff --git a/svx/inc/svx/unobrushitemhelper.hxx b/svx/inc/svx/unobrushitemhelper.hxx
new file mode 100644
index 0000000..a943d4c
--- /dev/null
+++ b/svx/inc/svx/unobrushitemhelper.hxx
@@ -0,0 +1,56 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _UNOBRUSHITEMHELPER_HXX
+#define _UNOBRUSHITEMHELPER_HXX
+
+#include "svx/svxdllapi.h"
+#include <editeng/brshitem.hxx>
+
+//UUUU Helper function definintions for UNO API fallbacks to replace SvxBrushItem. The
+// idea is to have fallbacks to create a SvxBrushItem if needed for backwards compatibility
+// if needed from the SfxItemSet and vice versa. This is used in cases where e.g. UNO API
+// accesses to slots in the SvxBrushItem are used (see cases in SvxBrushItem::QueryValue
+// and SvxBrushItem::PutValue as MID_BACK_COLOR and similar).
+// To make this work, a cycle of creating a SvxBrushItem from a SfxItemSet, changing a value
+// using PutValue, putting back to the SfxItemSet should create the *same* SvxBrushItem
+// the next time this will be created using getSvxBrushItemFromSourceSet. For more details,
+// see comments at the implementations of that two methods.
+
+// Set the equivalent in the range [XATTR_FILL_FIRST .. XATTR_FILL_LAST] in the given
+// SfxItemSet to create the same FillStyle as is expressed by the given SvxBrushItem.
+// This method will reset all items in the XATTR_FILL_* range first.
+void SVX_DLLPUBLIC setSvxBrushItemAsFillAttributesToTargetSet(
+ const SvxBrushItem& rBrush,
+ SfxItemSet& rToSet);
+
+// Create a SvxBrushItem as close as possible to the settings in the DrawingLayer
+// items in the range [XATTR_FILL_FIRST .. XATTR_FILL_LAST]. Since this is not 100%
+// representable this may lead to reduced data. With nBackgroundID a Which-ID for the
+// to-be-created SvxBrushItem has to be given (default should be 99 as in RES_BACKGROUND).
+SvxBrushItem SVX_DLLPUBLIC getSvxBrushItemFromSourceSet(
+ const SfxItemSet& rSourceSet,
+ sal_uInt16 nBackgroundID,
+ sal_Bool bSearchInParents = sal_True);
+
+#endif // _UNOBRUSHITEMHELPER_HXX
+
+//eof
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 8b0350f..a7b506a 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, sal_False);
+
+ 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 0917aa0..745d05c 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;
- FASTBOOL 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 )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list