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

Move static pSpecsSubLines into properties container

Change-Id: I0ff8ab2c36960a5b9b8108269fca88b325d001f6
Reviewed-on: https://gerrit.libreoffice.org/12487Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6a4b21f3
...@@ -237,8 +237,6 @@ const static double aEdgeScale = 0.5; ...@@ -237,8 +237,6 @@ const static double aEdgeScale = 0.5;
static BorderLines *g_pBorderLines = 0; static BorderLines *g_pBorderLines = 0;
static SwLineRects *pLines = 0; static SwLineRects *pLines = 0;
static SwSubsRects *pSubsLines = 0; static SwSubsRects *pSubsLines = 0;
// global variable for sub-lines of body, header, footer, section and footnote frames.
static SwSubsRects *pSpecSubsLines = 0;
//To optimize the expensive RetouchColor determination //To optimize the expensive RetouchColor determination
Color aGlobalRetoucheColor; Color aGlobalRetoucheColor;
...@@ -264,7 +262,9 @@ struct SwPaintProperties { ...@@ -264,7 +262,9 @@ struct SwPaintProperties {
BorderLines *pBLines; BorderLines *pBLines;
SwLineRects *pSLines; SwLineRects *pSLines;
SwSubsRects *pSSubsLines; SwSubsRects *pSSubsLines;
SwSubsRects* pSSpecSubsLines;
// global variable for sub-lines of body, header, footer, section and footnote frames.
SwSubsRects *pSSpecSubsLines = 0;
SfxProgress *pSProgress = 0; SfxProgress *pSProgress = 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
...@@ -387,7 +387,7 @@ SwSavePaintStatics::SwSavePaintStatics() ...@@ -387,7 +387,7 @@ SwSavePaintStatics::SwSavePaintStatics()
pBLines = g_pBorderLines; pBLines = g_pBorderLines;
pSLines = pLines; pSLines = pLines;
pSSubsLines = pSubsLines; pSSubsLines = pSubsLines;
pSSpecSubsLines = pSpecSubsLines; pSSpecSubsLines = gProp.pSSpecSubsLines;
pSProgress = gProp.pSProgress; pSProgress = gProp.pSProgress;
nSPixelSzW = gProp.nSPixelSzW; nSPixelSzW = gProp.nSPixelSzW;
nSPixelSzH = gProp.nSPixelSzH; nSPixelSzH = gProp.nSPixelSzH;
...@@ -411,7 +411,7 @@ SwSavePaintStatics::SwSavePaintStatics() ...@@ -411,7 +411,7 @@ SwSavePaintStatics::SwSavePaintStatics()
g_pBorderLines = 0; g_pBorderLines = 0;
pLines = 0; pLines = 0;
pSubsLines = 0; pSubsLines = 0;
pSpecSubsLines = 0L; gProp.pSSpecSubsLines = 0L;
gProp.pSProgress = 0; gProp.pSProgress = 0;
} }
...@@ -427,7 +427,7 @@ SwSavePaintStatics::~SwSavePaintStatics() ...@@ -427,7 +427,7 @@ SwSavePaintStatics::~SwSavePaintStatics()
g_pBorderLines = pBLines; g_pBorderLines = pBLines;
pLines = pSLines; pLines = pSLines;
pSubsLines = pSSubsLines; pSubsLines = pSSubsLines;
pSpecSubsLines = pSSpecSubsLines; gProp.pSSpecSubsLines = pSSpecSubsLines;
gProp.pSProgress = pSProgress; gProp.pSProgress = pSProgress;
gProp.nSPixelSzW = nSPixelSzW; gProp.nSPixelSzW = nSPixelSzW;
gProp.nSPixelSzH = nSPixelSzH; gProp.nSPixelSzH = nSPixelSzH;
...@@ -3253,7 +3253,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c ...@@ -3253,7 +3253,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
if ( pSh->GetWin() ) if ( pSh->GetWin() )
{ {
pSubsLines = new SwSubsRects; pSubsLines = new SwSubsRects;
pSpecSubsLines = new SwSubsRects; gProp.pSSpecSubsLines = new SwSubsRects;
} }
g_pBorderLines = new BorderLines; g_pBorderLines = new BorderLines;
...@@ -3336,7 +3336,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c ...@@ -3336,7 +3336,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
// collect sub-lines // collect sub-lines
pPage->RefreshSubsidiary( aPaintRect ); pPage->RefreshSubsidiary( aPaintRect );
// paint special sub-lines // paint special sub-lines
pSpecSubsLines->PaintSubsidiary( pSh->GetOut(), NULL ); gProp.pSSpecSubsLines->PaintSubsidiary( pSh->GetOut(), NULL );
} }
pPage->Paint( aPaintRect ); pPage->Paint( aPaintRect );
...@@ -3354,7 +3354,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c ...@@ -3354,7 +3354,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
{ {
pSubsLines->PaintSubsidiary( pSh->GetOut(), pLines ); pSubsLines->PaintSubsidiary( pSh->GetOut(), pLines );
DELETEZ( pSubsLines ); DELETEZ( pSubsLines );
DELETEZ( pSpecSubsLines ); DELETEZ( gProp.pSSpecSubsLines );
} }
// fdo#42750: delay painting these until after subsidiary lines // fdo#42750: delay painting these until after subsidiary lines
// fdo#45562: delay painting these until after hell layer // fdo#45562: delay painting these until after hell layer
...@@ -4280,22 +4280,22 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -4280,22 +4280,22 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
} }
bool bSpecSubsLineRectsCreated; bool bSpecSubsLineRectsCreated;
if ( pSpecSubsLines ) if ( gProp.pSSpecSubsLines )
{ {
// Lock already existing special subsidiary lines // Lock already existing special subsidiary lines
pSpecSubsLines->LockLines( true ); gProp.pSSpecSubsLines->LockLines( true );
bSpecSubsLineRectsCreated = false; bSpecSubsLineRectsCreated = false;
} }
else else
{ {
// create new special subsidiardy lines // create new special subsidiardy lines
pSpecSubsLines = new SwSubsRects; gProp.pSSpecSubsLines = new SwSubsRects;
bSpecSubsLineRectsCreated = true; bSpecSubsLineRectsCreated = true;
} }
// Add subsidiary lines of fly frame and its lowers // Add subsidiary lines of fly frame and its lowers
RefreshLaySubsidiary( pPage, aRect ); RefreshLaySubsidiary( pPage, aRect );
// paint subsidiary lines of fly frame and its lowers // paint subsidiary lines of fly frame and its lowers
pSpecSubsLines->PaintSubsidiary( pOut, NULL ); gProp.pSSpecSubsLines->PaintSubsidiary( pOut, NULL );
pSubsLines->PaintSubsidiary( pOut, pLines ); pSubsLines->PaintSubsidiary( pOut, pLines );
if ( !bSubsLineRectsCreated ) if ( !bSubsLineRectsCreated )
// unlock subsidiary lines // unlock subsidiary lines
...@@ -4306,11 +4306,11 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -4306,11 +4306,11 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( !bSpecSubsLineRectsCreated ) if ( !bSpecSubsLineRectsCreated )
// unlock special subsidiary lines // unlock special subsidiary lines
pSpecSubsLines->LockLines( false ); gProp.pSSpecSubsLines->LockLines( false );
else else
{ {
// delete created special subsidiary lines container // delete created special subsidiary lines container
DELETEZ( pSpecSubsLines ); DELETEZ( gProp.pSSpecSubsLines );
} }
} }
...@@ -6666,7 +6666,7 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const ...@@ -6666,7 +6666,7 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
{ {
pSubsLines = new SwSubsRects; pSubsLines = new SwSubsRects;
// OD 20.12.2002 #106318# - create container for special subsidiary lines // OD 20.12.2002 #106318# - create container for special subsidiary lines
pSpecSubsLines = new SwSubsRects; gProp.pSSpecSubsLines = new SwSubsRects;
bDelSubs = true; bDelSubs = true;
} }
...@@ -6676,8 +6676,8 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const ...@@ -6676,8 +6676,8 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
{ {
// OD 20.12.2002 #106318# - paint special subsidiary lines // OD 20.12.2002 #106318# - paint special subsidiary lines
// and delete its container // and delete its container
pSpecSubsLines->PaintSubsidiary( gProp.pSGlobalShell->GetOut(), NULL ); gProp.pSSpecSubsLines->PaintSubsidiary( gProp.pSGlobalShell->GetOut(), NULL );
DELETEZ( pSpecSubsLines ); DELETEZ( gProp.pSSpecSubsLines );
pSubsLines->PaintSubsidiary( gProp.pSGlobalShell->GetOut(), pLines ); pSubsLines->PaintSubsidiary( gProp.pSGlobalShell->GetOut(), pLines );
DELETEZ( pSubsLines ); DELETEZ( pSubsLines );
...@@ -7103,7 +7103,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage, ...@@ -7103,7 +7103,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
// sub-lines in <pSpecSubsLine> array. // sub-lines in <pSpecSubsLine> array.
const bool bSpecialSublines = IsBodyFrm() || IsHeaderFrm() || IsFooterFrm() || const bool bSpecialSublines = IsBodyFrm() || IsHeaderFrm() || IsFooterFrm() ||
IsFtnFrm() || IsSctFrm(); IsFtnFrm() || IsSctFrm();
SwLineRects* pUsedSubsLines = bSpecialSublines ? pSpecSubsLines : pSubsLines; SwLineRects* pUsedSubsLines = bSpecialSublines ? gProp.pSSpecSubsLines : pSubsLines;
// NOTE: for cell frames only left and right (horizontal layout) respectively // NOTE: for cell frames only left and right (horizontal layout) respectively
// top and bottom (vertical layout) lines painted. // top and bottom (vertical layout) lines painted.
......
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