Kaydet (Commit) 69881c0f authored tarafından Michaël Lefèvre's avatar Michaël Lefèvre Kaydeden (comit) Caolán McNamara

Move *RetoucheFly* into properties container

Change-Id: I07c1751848c55c12bad16735b7f83ea07b150080
Reviewed-on: https://gerrit.libreoffice.org/12484Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 86662e13
...@@ -224,12 +224,6 @@ public: ...@@ -224,12 +224,6 @@ public:
} }
}; };
//Retouch for transparent Flys is done by the background of the Flys.
//The Fly itself should certainly not be spared out. See PaintBackground and
//lcl_SubtractFlys()
static SwFlyFrm *pRetoucheFly = 0;
static SwFlyFrm *pRetoucheFly2 = 0;
// Sizes of a pixel and the corresponding halves. Will be reset when // Sizes of a pixel and the corresponding halves. Will be reset when
// entering SwRootFrm::Paint // entering SwRootFrm::Paint
static long nPixelSzW = 0, nPixelSzH = 0; static long nPixelSzW = 0, nPixelSzH = 0;
...@@ -267,8 +261,13 @@ struct SwPaintProperties { ...@@ -267,8 +261,13 @@ struct SwPaintProperties {
OutputDevice *pSFlyMetafileOut = 0; OutputDevice *pSFlyMetafileOut = 0;
SwViewShell *pSGlobalShell = 0; SwViewShell *pSGlobalShell = 0;
SwFlyFrm *pSRetoucheFly,
*pSRetoucheFly2; //Retouch for transparent Flys is done by the background of the Flys.
//The Fly itself should certainly not be spared out. See PaintBackground and
//lcl_SubtractFlys()
SwFlyFrm *pSRetoucheFly = 0;
SwFlyFrm *pSRetoucheFly2 = 0;
SwFlyFrm *pSFlyOnlyDraw = 0; SwFlyFrm *pSFlyOnlyDraw = 0;
BorderLines *pBLines; BorderLines *pBLines;
SwLineRects *pSLines; SwLineRects *pSLines;
...@@ -386,8 +385,8 @@ SwSavePaintStatics::SwSavePaintStatics() ...@@ -386,8 +385,8 @@ SwSavePaintStatics::SwSavePaintStatics()
bSFlyMetafile = gProp.bSFlyMetafile; bSFlyMetafile = gProp.bSFlyMetafile;
pSGlobalShell = gProp.pSGlobalShell; pSGlobalShell = gProp.pSGlobalShell;
pSFlyMetafileOut = gProp.pSFlyMetafileOut; pSFlyMetafileOut = gProp.pSFlyMetafileOut;
pSRetoucheFly = pRetoucheFly; pSRetoucheFly = gProp.pSRetoucheFly;
pSRetoucheFly2 = pRetoucheFly2; pSRetoucheFly2 = gProp.pSRetoucheFly2;
pSFlyOnlyDraw = gProp.pSFlyOnlyDraw; pSFlyOnlyDraw = gProp.pSFlyOnlyDraw;
pBLines = g_pBorderLines; pBLines = g_pBorderLines;
pSLines = pLines; pSLines = pLines;
...@@ -407,8 +406,8 @@ SwSavePaintStatics::SwSavePaintStatics() ...@@ -407,8 +406,8 @@ SwSavePaintStatics::SwSavePaintStatics()
// Restoring globales to default // Restoring globales to default
gProp.bSFlyMetafile = false; gProp.bSFlyMetafile = false;
gProp.pSFlyMetafileOut = 0; gProp.pSFlyMetafileOut = 0;
pRetoucheFly = 0; gProp.pSRetoucheFly = 0;
pRetoucheFly2 = 0; gProp.pSRetoucheFly2 = 0;
nPixelSzW = nPixelSzH = nPixelSzW = nPixelSzH =
nHalfPixelSzW = nHalfPixelSzH = nHalfPixelSzW = nHalfPixelSzH =
nMinDistPixelW = nMinDistPixelH = 0; nMinDistPixelW = nMinDistPixelH = 0;
...@@ -426,8 +425,8 @@ SwSavePaintStatics::~SwSavePaintStatics() ...@@ -426,8 +425,8 @@ SwSavePaintStatics::~SwSavePaintStatics()
gProp.pSGlobalShell = pSGlobalShell; gProp.pSGlobalShell = pSGlobalShell;
gProp.bSFlyMetafile = bSFlyMetafile; gProp.bSFlyMetafile = bSFlyMetafile;
gProp.pSFlyMetafileOut = pSFlyMetafileOut; gProp.pSFlyMetafileOut = pSFlyMetafileOut;
pRetoucheFly = pSRetoucheFly; gProp.pSRetoucheFly = pSRetoucheFly;
pRetoucheFly2 = pSRetoucheFly2; gProp.pSRetoucheFly2 = pSRetoucheFly2;
gProp.pSFlyOnlyDraw = pSFlyOnlyDraw; gProp.pSFlyOnlyDraw = pSFlyOnlyDraw;
g_pBorderLines = pBLines; g_pBorderLines = pBLines;
pLines = pSLines; pLines = pSLines;
...@@ -1515,9 +1514,9 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect, ...@@ -1515,9 +1514,9 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect,
// const SwRect &rRect, SwRegionRects &rRegion ) // const SwRect &rRect, SwRegionRects &rRegion )
//{ //{
// const SwSortedObjs& rObjs = *pPage->GetSortedObjs(); // const SwSortedObjs& rObjs = *pPage->GetSortedObjs();
// const SwFlyFrm* pSelfFly = pFrm->IsInFly() ? pFrm->FindFlyFrm() : pRetoucheFly2; // const SwFlyFrm* pSelfFly = pFrm->IsInFly() ? pFrm->FindFlyFrm() : gProp.pSRetoucheFly2;
// if ( !pRetoucheFly ) // if ( !gProp.pSRetoucheFly )
// pRetoucheFly = pRetoucheFly2; // gProp.pSRetoucheFly = gProp.pSRetoucheFly2;
// //
// for ( sal_uInt16 j = 0; (j < rObjs.Count()) && !rRegion.empty(); ++j ) // for ( sal_uInt16 j = 0; (j < rObjs.Count()) && !rRegion.empty(); ++j )
// { // {
...@@ -1533,7 +1532,7 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect, ...@@ -1533,7 +1532,7 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect,
// //
// const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pAnchoredObj); // const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
// //
// if ( pSelfFly == pFly || pRetoucheFly == pFly || !rRect.IsOver( pFly->Frm() ) ) // if ( pSelfFly == pFly || gProp.pSRetoucheFly == pFly || !rRect.IsOver( pFly->Frm() ) )
// continue; // continue;
// //
// if ( !pFly->GetFmt()->GetPrint().GetValue() && // if ( !pFly->GetFmt()->GetPrint().GetValue() &&
...@@ -1551,7 +1550,7 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect, ...@@ -1551,7 +1550,7 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect,
// continue; // continue;
// //
// //Any why does it not apply for the RetoucheFly too? // //Any why does it not apply for the RetoucheFly too?
// if ( pRetoucheFly && pRetoucheFly->IsLowerOf( pFly ) ) // if ( gProp.pSRetoucheFly && gProp.pSRetoucheFly->IsLowerOf( pFly ) )
// continue; // continue;
// //
//#if OSL_DEBUG_LEVEL > 0 //#if OSL_DEBUG_LEVEL > 0
...@@ -1584,9 +1583,9 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect, ...@@ -1584,9 +1583,9 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect,
// bStopOnHell = false; // bStopOnHell = false;
// } // }
// } // }
// if ( pRetoucheFly ) // if ( gProp.pSRetoucheFly )
// { // {
// const SdrObject *pTmp = pRetoucheFly->GetVirtDrawObj(); // const SdrObject *pTmp = gProp.pSRetoucheFly->GetVirtDrawObj();
// if ( pSdrObj->GetLayer() == pTmp->GetLayer() ) // if ( pSdrObj->GetLayer() == pTmp->GetLayer() )
// { // {
// if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() ) // if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
...@@ -1595,7 +1594,7 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect, ...@@ -1595,7 +1594,7 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect,
// } // }
// else // else
// { // {
// if ( !pFly->IsLowerOf( pRetoucheFly ) && !pFly->GetFmt()->GetOpaque().GetValue() ) // if ( !pFly->IsLowerOf( gProp.pSRetoucheFly ) && !pFly->GetFmt()->GetOpaque().GetValue() )
// //From other layers we are only interested in non // //From other layers we are only interested in non
// //transparent ones or those that are internal // //transparent ones or those that are internal
// continue; // continue;
...@@ -1674,8 +1673,8 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect, ...@@ -1674,8 +1673,8 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect,
// rRegion -= aRect; // rRegion -= aRect;
// } // }
// } // }
// if ( pRetoucheFly == pRetoucheFly2 ) // if ( gProp.pSRetoucheFly == gProp.pSRetoucheFly2 )
// pRetoucheFly = 0; // gProp.pSRetoucheFly = 0;
//} //}
static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush, static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
...@@ -4189,8 +4188,8 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -4189,8 +4188,8 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( pParentFlyFrm->GetDrawObj()->GetLayer() != if ( pParentFlyFrm->GetDrawObj()->GetLayer() !=
pIDDMA->GetHellId() ) pIDDMA->GetHellId() )
{ {
SwFlyFrm* pOldRet = pRetoucheFly2; SwFlyFrm* pOldRet = gProp.pSRetoucheFly2;
pRetoucheFly2 = const_cast<SwFlyFrm*>(this); gProp.pSRetoucheFly2 = const_cast<SwFlyFrm*>(this);
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pParentFlyFrm ); SwBorderAttrAccess aAccess( SwFrm::GetCache(), pParentFlyFrm );
const SwBorderAttrs &rAttrs = *aAccess.Get(); const SwBorderAttrs &rAttrs = *aAccess.Get();
...@@ -4198,7 +4197,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -4198,7 +4197,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aPaintRect._Intersection( pParentFlyFrm->Frm() ); aPaintRect._Intersection( pParentFlyFrm->Frm() );
pParentFlyFrm->PaintBackground( aPaintRect, pPage, rAttrs, false, false ); pParentFlyFrm->PaintBackground( aPaintRect, pPage, rAttrs, false, false );
pRetoucheFly2 = pOldRet; gProp.pSRetoucheFly2 = pOldRet;
} }
} }
...@@ -5626,7 +5625,7 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol, ...@@ -5626,7 +5625,7 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol,
void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const
{ {
if( !bHasGrid || pRetoucheFly || pRetoucheFly2 ) if( !bHasGrid || gProp.pSRetoucheFly || gProp.pSRetoucheFly2 )
return; return;
SwTextGridItem const*const pGrid(GetGridItem(this)); SwTextGridItem const*const pGrid(GetGridItem(this));
if( pGrid && ( OUTDEV_PRINTER != pOut->GetOutDevType() ? if( pGrid && ( OUTDEV_PRINTER != pOut->GetOutDevType() ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment