Hi Ronald,
Roland Baudin píše v Pá 17. 06. 2011 v 23:23 +0200:
> Hi,
>
> here is a small patch for sw that fixes another issue related to bug
> 33781 that I already fixed last month.
>
> The problem is that a graphic object of type "Draw 8" is not
> anti-aliased when anchored as char (see test file for example).
>
> IMHO, this patch is safe and acts exactly the same as the previous fix
> for bug 33781.
It works nice.
Well, just after your new lines there is another hack with aliasing for
http://openoffice.org/bugzilla/show_bug.cgi?id=99665 . It solves the
problem where the aliasing caused problems => we should be more careful
with setting aliasing to ANTIALIASING_ENABLE_B2DDRAW globally.
I prefer the more conservative approach from i#99665. It modifies the
current aliasing using "byte or" (operator |) and restores the original
aliasing at the end of the "if" block.
I see that the aliasing value is always modified by byte operators '&',
'|'. Try to search for ANTIALIASING_ENABLE_B2DDRAW at
http://opengrok.libreoffice.org/
So, what do you think about the attached patch?
It uses the conservative approach from i#99665 also for your two
changes. Also it combines your fix with the fix for i#99665 to avoid two
nFormerAntialiasingAtOutput variables.
I would prefer to sort this out before we cherry-pick it to
libreoffice-3-4 branch.
Best Regards,
Petr
--- sw/source/core/doc/notxtfrm.cxx.old1 2011-06-20 17:00:58.000000000 +0200
+++ sw/source/core/doc/notxtfrm.cxx 2011-06-20 17:24:18.000000000 +0200
@@ -819,9 +819,10 @@ void SwNoTxtFrm::PaintPicture( OutputDev
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( OutputDev
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,22 +958,18 @@ void SwNoTxtFrm::PaintPicture( OutputDev
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());
Size aSize(aAlignedGrfArea.SSize());
@@ -1012,13 +1013,8 @@ void SwNoTxtFrm::PaintPicture( OutputDev
((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 );
- }
- // <--
}
}
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice