rpms/openoffice.org/F-9 openoffice.org-2.4.1.ooo81576.vcl.fixscale.patch, NONE, 1.1 openoffice.org.spec, 1.1507, 1.1508

Caolan McNamara caolanm at fedoraproject.org
Tue Oct 7 08:24:32 UTC 2008


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15292

Modified Files:
	openoffice.org.spec 
Added Files:
	openoffice.org-2.4.1.ooo81576.vcl.fixscale.patch 
Log Message:
Resolves: rhbz#465792 openoffice.org-2.4.1.ooo81576.vcl.fixscale.patch

openoffice.org-2.4.1.ooo81576.vcl.fixscale.patch:

--- NEW FILE openoffice.org-2.4.1.ooo81576.vcl.fixscale.patch ---
Index: source/gdi/outdev2.cxx
===================================================================
RCS file: /cvs/gsl/vcl/source/gdi/outdev2.cxx,v
retrieving revision 1.41
retrieving revision 1.43
diff -u -r1.41 -r1.43
--- openoffice.org.orig/vcl/source/gdi/outdev2.cxx	13 Jun 2008 08:47:51 -0000	1.41
+++ openoffice.org/vcl/source/gdi/outdev2.cxx	2 Jul 2008 10:23:33 -0000	1.43
@@ -681,46 +681,57 @@
                  if( meOutDevType == OUTDEV_WINDOW ||
                      (meOutDevType == OUTDEV_VIRDEV && mpPDFWriter == 0 ) )
                 {
-                    // reduce scaling to something reasonable taking into account the output size
-                    if( aPosAry.mnDestWidth > 3*mnOutWidth && aPosAry.mnSrcWidth )
+                    // #i81576# do the following trick only if there is overlap at all
+                    // else the formulae don't work
+                    // theoretically in this case we wouldn't need to draw the bitmap at all
+                    // however there are some esoteric case where that is needed
+                    if( aPosAry.mnDestX + aPosAry.mnDestWidth >= 0
+                        && aPosAry.mnDestX < mnOutWidth
+                        && aPosAry.mnDestY + aPosAry.mnDestHeight >= 0
+                        && aPosAry.mnDestY < mnOutHeight )
                     {
-                        const double nScaleX = aPosAry.mnDestWidth/double(aPosAry.mnSrcWidth);
-
-                        if( aPosAry.mnDestX + aPosAry.mnDestWidth > mnOutWidth )
-                        {
-                            aPosAry.mnDestWidth = Max(long(0),mnOutWidth-aPosAry.mnDestX);
-                        }
-                        if( aPosAry.mnDestX < 0 )
-                        {
-                            aPosAry.mnDestWidth += aPosAry.mnDestX;
-                            aPosAry.mnSrcX -= sal::static_int_cast<long>(aPosAry.mnDestX / nScaleX);
-                            aPosAry.mnDestX = 0;
-                        }
-
-                        aPosAry.mnSrcWidth = sal::static_int_cast<long>(aPosAry.mnDestWidth / nScaleX);
-                    }
-
-                    if( aPosAry.mnDestHeight > 3*mnOutHeight && aPosAry.mnSrcHeight != 0 )
-                    {
-                        const double nScaleY = aPosAry.mnDestHeight/double(aPosAry.mnSrcHeight);
-
-                        if( aPosAry.mnDestY + aPosAry.mnDestHeight > mnOutHeight )
+                        // reduce scaling to something reasonable taking into account the output size
+                        if( aPosAry.mnDestWidth > 3*mnOutWidth && aPosAry.mnSrcWidth )
                         {
-                            aPosAry.mnDestHeight = Max(long(0),mnOutHeight-aPosAry.mnDestY);
+                            const double nScaleX = aPosAry.mnDestWidth/double(aPosAry.mnSrcWidth);
+    
+                            if( aPosAry.mnDestX + aPosAry.mnDestWidth > mnOutWidth )
+                            {
+                                aPosAry.mnDestWidth = Max(long(0),mnOutWidth-aPosAry.mnDestX);
+                            }
+                            if( aPosAry.mnDestX < 0 )
+                            {
+                                aPosAry.mnDestWidth += aPosAry.mnDestX;
+                                aPosAry.mnSrcX -= sal::static_int_cast<long>(aPosAry.mnDestX / nScaleX);
+                                aPosAry.mnDestX = 0;
+                            }
+    
+                            aPosAry.mnSrcWidth = sal::static_int_cast<long>(aPosAry.mnDestWidth / nScaleX);
                         }
-                        if( aPosAry.mnDestY < 0 )
+    
+                        if( aPosAry.mnDestHeight > 3*mnOutHeight && aPosAry.mnSrcHeight != 0 )
                         {
-                            aPosAry.mnDestHeight += aPosAry.mnDestY;
-                            aPosAry.mnSrcY -= sal::static_int_cast<long>(aPosAry.mnDestY / nScaleY);
-                            aPosAry.mnDestY = 0;
+                            const double nScaleY = aPosAry.mnDestHeight/double(aPosAry.mnSrcHeight);
+    
+                            if( aPosAry.mnDestY + aPosAry.mnDestHeight > mnOutHeight )
+                            {
+                                aPosAry.mnDestHeight = Max(long(0),mnOutHeight-aPosAry.mnDestY);
+                            }
+                            if( aPosAry.mnDestY < 0 )
+                            {
+                                aPosAry.mnDestHeight += aPosAry.mnDestY;
+                                aPosAry.mnSrcY -= sal::static_int_cast<long>(aPosAry.mnDestY / nScaleY);
+                                aPosAry.mnDestY = 0;
+                            }
+    
+                            aPosAry.mnSrcHeight = sal::static_int_cast<long>(aPosAry.mnDestHeight / nScaleY);
                         }
-
-                        aPosAry.mnSrcHeight = sal::static_int_cast<long>(aPosAry.mnDestHeight / nScaleY);
                     }
                 }
             }
 
-			mpGraphics->DrawBitmap( &aPosAry, *aBmp.ImplGetImpBitmap()->ImplGetSalBitmap(), this );
+            if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
+                mpGraphics->DrawBitmap( &aPosAry, *aBmp.ImplGetImpBitmap()->ImplGetSalBitmap(), this );
 		}
 	}
 }


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/F-9/openoffice.org.spec,v
retrieving revision 1.1507
retrieving revision 1.1508
diff -u -r1.1507 -r1.1508
--- openoffice.org.spec	2 Oct 2008 10:22:24 -0000	1.1507
+++ openoffice.org.spec	7 Oct 2008 08:24:00 -0000	1.1508
@@ -170,6 +170,7 @@
 Patch95: openoffice.org-3.0.0.ooo92343.svtools.strangethrow.patch
 Patch96: openoffice.org-2.4.0.ooo93119.shell.echos.patch
 Patch97: openoffice.org-2.4.1.ooo92217.sal.alloc.patch
+Patch98: openoffice.org-2.4.1.ooo81576.vcl.fixscale.patch
 
 %define instdir %{_libdir}/openoffice.org
 
@@ -1154,6 +1155,7 @@
 %patch95 -p1 -b .ooo92343.svtools.strangethrow.patch
 %patch96 -p1 -b .ooo93119.shell.echos.patch
 %patch97 -p1 -b .ooo92217.sal.alloc.patch
+%patch98 -p1 -b .ooo81576.vcl.fixscale.patch
 
 %build
 echo build start time is `date`, diskspace: `df -h . | tail -n 1`
@@ -2949,8 +2951,9 @@
 
 
 %changelog
-* Thu Oct 02 2008 Caolan McNamara <caolanm at redhat.com> - 1:2.4.1-17.7
+* Tue Oct 07 2008 Caolan McNamara <caolanm at redhat.com> - 1:2.4.1-17.7
 - Resolves: ooo#94495 Toggle weblayout/normal layout and notes
+- Resolves: rhbz#465792 openoffice.org-2.4.1.ooo81576.vcl.fixscale.patch
 
 * Tue Aug 26 2008 Caolan McNamara <caolanm at redhat.com> - 1:2.4.1-17.6
 - Resolves: CVE-2008-3282 numeric truncation error in OOo memory allocator




More information about the fedora-extras-commits mailing list