sw/inc/format.hxx                  |    4 ++
 sw/inc/frmfmt.hxx                  |    2 +
 sw/inc/swtblfmt.hxx                |   51 ++++++++++++++--------------
 sw/source/core/attr/format.cxx     |   18 +++++++---
 sw/source/core/layout/atrfrm.cxx   |   15 +++++---
 sw/source/core/layout/paintfrm.cxx |    2 -
 sw/source/core/table/swtable.cxx   |   66 +++++++++++++++++++++++++++++++++++++
 7 files changed, 121 insertions(+), 37 deletions(-)

New commits:
commit 36cc153d32bc262c2285d333a1369f6ca36a7fba
Author: Armin Le Grand <a...@apache.org>
Date:   Mon Oct 6 13:59:33 2014 +0000

    i125163 Corrected FillStyle handling for tables in Writer

diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 360358c..070a273 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -333,6 +333,10 @@ public:
     */
     virtual sal_Bool IsShadowTransparent() const;
 
+    //UUUU decide if DrawingLayer FillAttributes are supported. If answering 
this with yes
+    // the full FillStyle ItemSet will be used to handle/visualize the element
+    virtual bool supportsFullDrawingLayerFillAttributeSet() const;
+
     //UUUU Access to DrawingLayer FillAttributes in a preprocessed form for 
primitive usage
     virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr 
getSdrAllFillAttributesHelper() const;
 };
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index f5ce6ad..39ecd23 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -71,6 +71,8 @@ protected:
 
 public:
     TYPEINFO();     //Bereits in Basisklasse Client drin.
+    //UUUU
+    ~SwFrmFmt();
 
     //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt).
     virtual void DelFrms();
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index fe27009..5bba53a 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -32,18 +32,17 @@ class SW_DLLPUBLIC SwTableFmt : public SwFrmFmt
     friend class SwDoc;
 
 protected:
-    SwTableFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
-                    SwFrmFmt *pDrvdFrm )
-        : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-    {}
-    SwTableFmt( SwAttrPool& rPool, const String &rFmtNm,
-                    SwFrmFmt *pDrvdFrm )
-        : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-    {}
-
+    //UUUU
+    SwTableFmt(SwAttrPool& rPool,const sal_Char* pFmtNm, SwFrmFmt *pDrvdFrm);
+    SwTableFmt(SwAttrPool& rPool,const String &rFmtNm, SwFrmFmt *pDrvdFrm);
 
 public:
     TYPEINFO();     //Bereits in Basisklasse Client drin.
+    //UUUU
+    virtual ~SwTableFmt();
+
+    //UUUU
+    virtual bool supportsFullDrawingLayerFillAttributeSet() const;
 
     DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt)
 };
@@ -53,17 +52,17 @@ class SwTableLineFmt : public SwFrmFmt
     friend class SwDoc;
 
 protected:
-    SwTableLineFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
-                    SwFrmFmt *pDrvdFrm )
-        : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
-    {}
-    SwTableLineFmt( SwAttrPool& rPool, const String &rFmtNm,
-                    SwFrmFmt *pDrvdFrm )
-        : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
-    {}
+    //UUUU
+    SwTableLineFmt(SwAttrPool& rPool,const sal_Char* pFmtNm, SwFrmFmt 
*pDrvdFrm);
+    SwTableLineFmt(SwAttrPool& rPool,const String &rFmtNm, SwFrmFmt *pDrvdFrm);
 
 public:
     TYPEINFO();     //Bereits in Basisklasse Client drin.
+    //UUUU
+    virtual ~SwTableLineFmt();
+
+    //UUUU
+    virtual bool supportsFullDrawingLayerFillAttributeSet() const;
 
     DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt)
 };
@@ -73,20 +72,20 @@ class SW_DLLPUBLIC SwTableBoxFmt : public SwFrmFmt
     friend class SwDoc;
 
 protected:
-    SwTableBoxFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
-                    SwFrmFmt *pDrvdFrm )
-        : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
-    {}
-    SwTableBoxFmt( SwAttrPool& rPool, const String &rFmtNm,
-                    SwFrmFmt *pDrvdFrm )
-        : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
-    {}
+    //UUUU
+    SwTableBoxFmt(SwAttrPool& rPool,const sal_Char* pFmtNm, SwFrmFmt 
*pDrvdFrm);
+    SwTableBoxFmt(SwAttrPool& rPool,const String &rFmtNm, SwFrmFmt *pDrvdFrm);
 
     // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
-   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue 
);
+    virtual void Modify(const SfxPoolItem* pOld,const SfxPoolItem* pNewValue);
 
 public:
     TYPEINFO();     //Bereits in Basisklasse Client drin.
+    //UUUU
+    virtual ~SwTableBoxFmt();
+
+    //UUUU
+    virtual bool supportsFullDrawingLayerFillAttributeSet() const;
 
     DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt)
 };
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 456d9d1..6f67dd5 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -436,7 +436,7 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
 
 const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich, sal_Bool bInParents ) 
const
 {
-    if(RES_BACKGROUND == nWhich && (RES_FLYFRMFMT == Which() || RES_FRMFMT == 
Which()))
+    if(RES_BACKGROUND == nWhich && supportsFullDrawingLayerFillAttributeSet())
     {
         //UUUU FALLBACKBREAKHERE should not be used; instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST]
         OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in 
place and used)");
@@ -456,7 +456,7 @@ const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich, 
sal_Bool bInParents ) c
 
 SfxItemState SwFmt::GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent, 
const SfxPoolItem **ppItem ) const
 {
-    if(RES_BACKGROUND == nWhich && (RES_FLYFRMFMT == Which() || RES_FRMFMT == 
Which()))
+    if(RES_BACKGROUND == nWhich && supportsFullDrawingLayerFillAttributeSet())
     {
         //UUUU FALLBACKBREAKHERE should not be used; instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST]
         OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in 
place and used)");
@@ -500,7 +500,7 @@ sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
     sal_Bool bRet = sal_False;
 
     //UUUU
-    if(RES_BACKGROUND == rAttr.Which() && (RES_FLYFRMFMT == Which() || 
RES_FRMFMT == Which()))
+    if(RES_BACKGROUND == rAttr.Which() && 
supportsFullDrawingLayerFillAttributeSet())
     {
         //UUUU FALLBACKBREAKHERE should not be used; instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST]
         OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in 
place and used)");
@@ -601,7 +601,7 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
     }
 
     //UUUU   FlyFrame              PageStyle
-    if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())
+    if(supportsFullDrawingLayerFillAttributeSet())
     {
         const SfxPoolItem* pSource = 0;
 
@@ -842,7 +842,7 @@ IDocumentChartDataProviderAccess* 
SwFmt::getIDocumentChartDataProviderAccess() {
 const SvxBrushItem& SwFmt::GetBackground(sal_Bool bInP) const
 {
     //UUUU   FlyFrame              PageStyle
-    if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())
+    if(supportsFullDrawingLayerFillAttributeSet())
     {
         //UUUU FALLBACKBREAKHERE should not be used; instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST]
         OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use 
[XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in 
place and used)");
@@ -860,6 +860,14 @@ const SvxBrushItem& SwFmt::GetBackground(sal_Bool bInP) 
const
 }
 
 //UUUU
+bool SwFmt::supportsFullDrawingLayerFillAttributeSet() const
+{
+    // base definition - probably not completely correct, e.g. for Table 
FillStyles
+    //UUUU  FlyFrame                    PageStyle
+    return (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which());
+}
+
+//UUUU
 drawinglayer::attribute::SdrAllFillAttributesHelperPtr 
SwFmt::getSdrAllFillAttributesHelper() const
 {
     return drawinglayer::attribute::SdrAllFillAttributesHelperPtr();
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index fa28d8c..d862713 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2508,6 +2508,11 @@ SwFrmFmt::SwFrmFmt(
 {
 }
 
+//UUUU
+SwFrmFmt::~SwFrmFmt()
+{
+}
+
 void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
 {
     SwFmtHeader *pH = 0;
@@ -2523,7 +2528,7 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const 
SfxPoolItem* pNew )
             RES_FOOTER, sal_False, (const SfxPoolItem**)&pF );
 
         //UUUU reset fill information
-        if(maFillAttributes.get() && (RES_FLYFRMFMT == Which() || RES_FRMFMT 
== Which()))
+        if(maFillAttributes.get() && 
supportsFullDrawingLayerFillAttributeSet())
         {
             SfxItemIter aIter(*((SwAttrSetChg*)pNew)->GetChgSet());
             bool bReset(false);
@@ -2542,7 +2547,7 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const 
SfxPoolItem* pNew )
     else if(RES_FMT_CHG == nWhich)
     {
         //UUUU reset fill information on format change (e.g. style changed)
-        if(maFillAttributes.get() && (RES_FLYFRMFMT == Which() || RES_FRMFMT 
== Which()))
+        if(maFillAttributes.get() && 
supportsFullDrawingLayerFillAttributeSet())
         {
             maFillAttributes.reset();
         }
@@ -3086,7 +3091,7 @@ const String SwFlyFrmFmt::GetObjDescription() const
 sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
 {
     //UUUU
-    if((RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) && 
getSdrAllFillAttributesHelper())
+    if(supportsFullDrawingLayerFillAttributeSet() && 
getSdrAllFillAttributesHelper())
     {
         return getSdrAllFillAttributesHelper()->isTransparent();
     }
@@ -3130,7 +3135,7 @@ sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
 sal_Bool SwFlyFrmFmt::IsBackgroundBrushInherited() const
 {
     //UUUU
-    if((RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) && 
getSdrAllFillAttributesHelper())
+    if(supportsFullDrawingLayerFillAttributeSet() && 
getSdrAllFillAttributesHelper())
     {
         return !getSdrAllFillAttributesHelper()->isUsed();
     }
@@ -3377,7 +3382,7 @@ SwFrmFmt* SwFrmFmt::GetCaptionFmt() const
 //UUUU
 drawinglayer::attribute::SdrAllFillAttributesHelperPtr 
SwFrmFmt::getSdrAllFillAttributesHelper() const
 {
-    if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())
+    if(supportsFullDrawingLayerFillAttributeSet())
     {
         // create FillAttributes on demand
         if(!maFillAttributes.get())
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 2cb2186..9ff50d0 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3665,7 +3665,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData 
const*const) const
         {
             const SwFrmFmt* pSwFrmFmt = dynamic_cast< const SwFrmFmt* 
>(GetFmt());
 
-            if(pSwFrmFmt && (RES_FLYFRMFMT == pSwFrmFmt->Which() || RES_FRMFMT 
== pSwFrmFmt->Which()))
+            if(pSwFrmFmt && 
pSwFrmFmt->supportsFullDrawingLayerFillAttributeSet())
             {
                 //UUUU check for transparency
                 const drawinglayer::attribute::SdrAllFillAttributesHelperPtr 
aFillAttributes(pSwFrmFmt->getSdrAllFillAttributesHelper());
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index f1652f7..d395edb 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -79,10 +79,76 @@ using namespace com::sun::star;
 TYPEINIT1( SwTable, SwClient );
 TYPEINIT1( SwTableBox, SwClient );
 TYPEINIT1( SwTableLine, SwClient );
+
+//UUUU
 TYPEINIT1( SwTableFmt, SwFrmFmt );
+
+SwTableFmt::SwTableFmt(SwAttrPool& rPool,const sal_Char* pFmtNm, SwFrmFmt 
*pDrvdFrm)
+:   SwFrmFmt(rPool,pFmtNm,pDrvdFrm,RES_FRMFMT,aTableSetRange)
+{
+}
+
+SwTableFmt::SwTableFmt(SwAttrPool& rPool,const String &rFmtNm, SwFrmFmt 
*pDrvdFrm)
+:   SwFrmFmt(rPool,rFmtNm,pDrvdFrm,RES_FRMFMT,aTableSetRange)
+{
+}
+
+SwTableFmt::~SwTableFmt()
+{
+}
+
+//UUUU Do not support for table frames - may change later if support will be 
added
+bool SwTableFmt::supportsFullDrawingLayerFillAttributeSet() const
+{
+    return false;
+}
+
+//UUUU
 TYPEINIT1( SwTableBoxFmt, SwFrmFmt );
+
+SwTableBoxFmt::SwTableBoxFmt(SwAttrPool& rPool,const sal_Char* pFmtNm, 
SwFrmFmt *pDrvdFrm)
+: SwFrmFmt(rPool,pFmtNm,pDrvdFrm,RES_FRMFMT,aTableBoxSetRange)
+{
+}
+
+SwTableBoxFmt::SwTableBoxFmt(SwAttrPool& rPool,const String &rFmtNm, SwFrmFmt 
*pDrvdFrm)
+:   SwFrmFmt(rPool,rFmtNm,pDrvdFrm,RES_FRMFMT,aTableBoxSetRange)
+{
+}
+
+SwTableBoxFmt::~SwTableBoxFmt()
+{
+}
+
+//UUUU Do not support for table frames - may change later if support will be 
added
+bool SwTableBoxFmt::supportsFullDrawingLayerFillAttributeSet() const
+{
+    return false;
+}
+
+//UUUU
 TYPEINIT1( SwTableLineFmt, SwFrmFmt );
 
+SwTableLineFmt::SwTableLineFmt(SwAttrPool& rPool,const sal_Char* pFmtNm, 
SwFrmFmt *pDrvdFrm)
+:   SwFrmFmt(rPool,pFmtNm,pDrvdFrm,RES_FRMFMT,aTableLineSetRange)
+{
+}
+
+SwTableLineFmt::SwTableLineFmt(SwAttrPool& rPool,const String &rFmtNm, 
SwFrmFmt *pDrvdFrm)
+:   SwFrmFmt(rPool,rFmtNm,pDrvdFrm,RES_FRMFMT,aTableLineSetRange)
+{
+}
+
+SwTableLineFmt::~SwTableLineFmt()
+{
+}
+
+//UUUU Do not support for table frames - may change later if support will be 
added
+bool SwTableLineFmt::supportsFullDrawingLayerFillAttributeSet() const
+{
+    return false;
+}
+
 SV_IMPL_PTRARR(SwTableLines,SwTableLine*);
 SV_IMPL_PTRARR(SwTableBoxes,SwTableBox*);
 SV_IMPL_PTRARR_SORT(SwTableSortBoxes,SwTableBoxPtr);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to