You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by wa...@apache.org on 2012/09/07 07:33:47 UTC

svn commit: r1381883 - /incubator/ooo/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx

Author: wangzcdl
Date: Fri Sep  7 05:33:47 2012
New Revision: 1381883

URL: http://svn.apache.org/viewvc?rev=1381883&view=rev
Log:
 Fix issue #120627#: [From Symphony]the text on the Y axis is reversed when export ppt file to PDF format. 
   * subversion/main/vcl/source/gdi/pdfwriter_impl.cxx
     []Change nXOffset value from the distance of axis Y between two points to the distance between two points.

   Patch by: Tang Meng<tm...@gmail.com>
   Suggested by: Wang Zhe <ki...@gmail.com>
   Found by: Tang Meng <tm...@gmail.com>
   Review by: Wang Zhe <ki...@gmail.com>

Modified:
    incubator/ooo/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx

Modified: incubator/ooo/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx?rev=1381883&r1=1381882&r2=1381883&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/pdfwriter_impl.cxx Fri Sep  7 05:33:47 2012
@@ -7175,7 +7175,12 @@ void PDFWriterImpl::drawVerticalGlyphs(
         }
         aDeltaPos += (m_pReferenceDevice->PixelToLogic( Point( (int)((double)nXOffset/fXScale), 0 ) ) - m_pReferenceDevice->PixelToLogic( Point() ) );
         if( i < rGlyphs.size()-1 )
-            nXOffset += rGlyphs[i+1].m_aPos.Y() - rGlyphs[i].m_aPos.Y();
+		// [Bug 120627] the text on the Y axis is reversed when export ppt file to PDF format
+		{
+			long nOffsetX = rGlyphs[i+1].m_aPos.X() - rGlyphs[i].m_aPos.X();
+			long nOffsetY = rGlyphs[i+1].m_aPos.Y() - rGlyphs[i].m_aPos.Y();
+			nXOffset += (int)sqrt(double(nOffsetX*nOffsetX + nOffsetY*nOffsetY));
+		}
         if( ! rGlyphs[i].m_nGlyphId )
             continue;