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:55:38 +0200 |
commit | c703b311c907b4c97850b5c81ae6a9d3ef47954c (patch) | |
tree | 3f94c43188ccd91e4e47de4577891441a85598c7 | |
parent | 262261c39dc68ba7fb8d846fb3dacfa6b4fc98ba (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.
Signed-off-by: Roland Baudin <roland65@free.fr>
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 580000da7f..15708c76f6 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -819,9 +819,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 ); } // <-- @@ -1012,13 +1014,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 ); - } - // <-- } } |