diff options
author | Petr Mladek <pmladek@suse.cz> | 2011-07-08 10:46:57 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-07-08 10:46:57 +0200 |
commit | e9dadfb0d2e53e6e99ef71388c817c0c164652f2 (patch) | |
tree | d3d95724c3fdc8c4b8718e7e22c9e14e9181ee50 | |
parent | 7b1708cf7f5ab936fd08464099c4854a23574d12 (diff) |
More conservative fix for aliasing problems (fdo#33781)
Inspired by i#99665. It solves the problem where the aliasing caused
problems. It modifies the current aliasing using "byte or" (operator |)
and restores the original aliasing at the end of the "if" block.
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index eaed5a5e88..198bd296c1 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -822,9 +822,10 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons if( pGrfNd ) { // Fix for bug fdo#33781 + const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() ); if (pShell->Imp()->GetDrawView()->IsAntiAliasing()) { - pOut->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW ); + pOut->SetAntialiasing( nFormerAntialiasingAtOutput | ANTIALIASING_ENABLE_B2DDRAW ); } sal_Bool bForceSwap = sal_False, bContinue = sal_True; @@ -938,8 +939,12 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons if( bSwapped && bPrn ) bForceSwap = sal_True; } + if( bForceSwap ) pGrfNd->SwapOut(); + + if ( pShell->Imp()->GetDrawView()->IsAntiAliasing() ) + pOut->SetAntialiasing( nFormerAntialiasingAtOutput ); } else if( bIsChart //charts must be painted resolution dependent!! #i82893#, #i75867# @@ -953,20 +958,17 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons else if( pOLENd ) { // Fix for bug fdo#33781 + const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() ); if (pShell->Imp()->GetDrawView()->IsAntiAliasing()) { - pOut->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW ); - } + sal_uInt16 nNewAntialiasingAtOutput = nFormerAntialiasingAtOutput | ANTIALIASING_ENABLE_B2DDRAW; - // #i99665# - // Adjust AntiAliasing mode at output device for chart OLE - const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() ); - if ( pOLENd->IsChart() && - pShell->Imp()->GetDrawView()->IsAntiAliasing() ) - { - const sal_uInt16 nAntialiasingForChartOLE = - nFormerAntialiasingAtOutput | ANTIALIASING_PIXELSNAPHAIRLINE; - pOut->SetAntialiasing( nAntialiasingForChartOLE ); + // #i99665# + // Adjust AntiAliasing mode at output device for chart OLE + if ( pOLENd->IsChart() ) + nNewAntialiasingAtOutput |= ANTIALIASING_PIXELSNAPHAIRLINE; + + pOut->SetAntialiasing( nNewAntialiasingAtOutput ); } Point aPosition(aAlignedGrfArea.Pos()); @@ -1011,12 +1013,8 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm()); } - // #i99665# - if ( pOLENd->IsChart() && - pShell->Imp()->GetDrawView()->IsAntiAliasing() ) - { + if ( pShell->Imp()->GetDrawView()->IsAntiAliasing() ) pOut->SetAntialiasing( nFormerAntialiasingAtOutput ); - } } } |