Author: alg Date: Mon Oct 6 13:59:33 2014 New Revision: 1629663 URL: http://svn.apache.org/r1629663 Log: i125163 Corrected FillStyle handling for tables in Writer
Modified: openoffice/trunk/main/sw/inc/format.hxx openoffice/trunk/main/sw/inc/frmfmt.hxx openoffice/trunk/main/sw/inc/swtblfmt.hxx openoffice/trunk/main/sw/source/core/attr/format.cxx openoffice/trunk/main/sw/source/core/layout/atrfrm.cxx openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx openoffice/trunk/main/sw/source/core/table/swtable.cxx Modified: openoffice/trunk/main/sw/inc/format.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/inc/format.hxx?rev=1629663&r1=1629662&r2=1629663&view=diff ============================================================================== --- openoffice/trunk/main/sw/inc/format.hxx (original) +++ openoffice/trunk/main/sw/inc/format.hxx Mon Oct 6 13:59:33 2014 @@ -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; }; Modified: openoffice/trunk/main/sw/inc/frmfmt.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/inc/frmfmt.hxx?rev=1629663&r1=1629662&r2=1629663&view=diff ============================================================================== --- openoffice/trunk/main/sw/inc/frmfmt.hxx (original) +++ openoffice/trunk/main/sw/inc/frmfmt.hxx Mon Oct 6 13:59:33 2014 @@ -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(); Modified: openoffice/trunk/main/sw/inc/swtblfmt.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/inc/swtblfmt.hxx?rev=1629663&r1=1629662&r2=1629663&view=diff ============================================================================== --- openoffice/trunk/main/sw/inc/swtblfmt.hxx (original) +++ openoffice/trunk/main/sw/inc/swtblfmt.hxx Mon Oct 6 13:59:33 2014 @@ -1,5 +1,5 @@ /************************************************************** - * + * * 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 @@ -7,16 +7,16 @@ * 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. - * + * *************************************************************/ @@ -29,66 +29,65 @@ class SwDoc; class SW_DLLPUBLIC SwTableFmt : public SwFrmFmt { - friend class SwDoc; + 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. + TYPEINFO(); //Bereits in Basisklasse Client drin. + //UUUU + virtual ~SwTableFmt(); + + //UUUU + virtual bool supportsFullDrawingLayerFillAttributeSet() const; - DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt) + DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt) }; class SwTableLineFmt : public SwFrmFmt { - friend class SwDoc; + 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. + TYPEINFO(); //Bereits in Basisklasse Client drin. + //UUUU + virtual ~SwTableLineFmt(); - DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt) + //UUUU + virtual bool supportsFullDrawingLayerFillAttributeSet() const; + + DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt) }; class SW_DLLPUBLIC SwTableBoxFmt : public SwFrmFmt { - friend class SwDoc; + 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 ); + // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute) + virtual void Modify(const SfxPoolItem* pOld,const SfxPoolItem* pNewValue); public: - TYPEINFO(); //Bereits in Basisklasse Client drin. + TYPEINFO(); //Bereits in Basisklasse Client drin. + //UUUU + virtual ~SwTableBoxFmt(); + + //UUUU + virtual bool supportsFullDrawingLayerFillAttributeSet() const; - DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt) + DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt) }; Modified: openoffice/trunk/main/sw/source/core/attr/format.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/attr/format.cxx?rev=1629663&r1=1629662&r2=1629663&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/attr/format.cxx (original) +++ openoffice/trunk/main/sw/source/core/attr/format.cxx Mon Oct 6 13:59:33 2014 @@ -436,7 +436,7 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pD 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( sa 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 SfxPool 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 SfxIte } //UUUU FlyFrame PageStyle - if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) + if(supportsFullDrawingLayerFillAttributeSet()) { const SfxPoolItem* pSource = 0; @@ -842,7 +842,7 @@ IDocumentChartDataProviderAccess* SwFmt: 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)"); @@ -859,6 +859,14 @@ const SvxBrushItem& SwFmt::GetBackground return aSet.GetBackground(bInP); } +//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 { Modified: openoffice/trunk/main/sw/source/core/layout/atrfrm.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/layout/atrfrm.cxx?rev=1629663&r1=1629662&r2=1629663&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/layout/atrfrm.cxx (original) +++ openoffice/trunk/main/sw/source/core/layout/atrfrm.cxx Mon Oct 6 13:59:33 2014 @@ -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 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 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::GetObjDescript 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::IsBackgroundTransp 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() cons //UUUU drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFrmFmt::getSdrAllFillAttributesHelper() const { - if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) + if(supportsFullDrawingLayerFillAttributeSet()) { // create FillAttributes on demand if(!maFillAttributes.get()) Modified: openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx?rev=1629663&r1=1629662&r2=1629663&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx (original) +++ openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx Mon Oct 6 13:59:33 2014 @@ -3665,7 +3665,7 @@ void SwFlyFrm::Paint(SwRect const& rRect { 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()); Modified: openoffice/trunk/main/sw/source/core/table/swtable.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/table/swtable.cxx?rev=1629663&r1=1629662&r2=1629663&view=diff ============================================================================== --- openoffice/trunk/main/sw/source/core/table/swtable.cxx (original) +++ openoffice/trunk/main/sw/source/core/table/swtable.cxx Mon Oct 6 13:59:33 2014 @@ -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);