Commits

vg  committed 67a89d0

CWS-TOOLING: integrate CWS ooo311gsl04_DEV300
2009-06-25 18:59:25 +0200 pl r273391 : add forgotten patch flags for cws: ooo311gsl01,ooo311gsl02,ooo311gsl03,ooo311gsl04,svp02,c28v001
2009-06-25 18:05:10 +0200 pl r273388 : CWS-TOOLING: rebase CWS ooo311gsl04 to branches/OOO310@272865 (milestone: OOO310:m13)
2009-06-15 16:57:19 +0200 pl r273001 : #i98804# check for nil
2009-06-11 07:14:52 +0200 hdu r272842 : #i102603# make rotated+shuffled text export work again

  • Participants
  • Parent commits cd7f359

Comments (0)

Files changed (3)

File fpicker/source/aqua/AquaFilePickerDelegate.mm

 
 - (MacOSBOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
 {
-    if (filterHelper == NULL)
+    if( filterHelper == NULL )
         return true;
+    if( filename == nil )
+        return false;
     return filterHelper->filenameMatchesFilter(filename);
 }
 

File scp2/source/ooo/file_library_ooo.scp

 
 #endif
 
-STD_LIB_FILE(gid_File_Lib_Drawinglayer,drawinglayer)
+STD_LIB_FILE_PATCH(gid_File_Lib_Drawinglayer,drawinglayer)
 
 SPECIAL_UNO_LIB_FILE(gid_File_Lib_Embobj,embobj)
 
 #ifdef QUARTZ
 File gid_File_Lib_Fps_Aqua
     TXT_FILE_BODY;
-    Styles = (PACKED);
+    Styles = (PACKED,PATCH);
     RegistryID = gid_Starregistry_Services_Rdb;
     Dir = gid_Dir_Program;
     Name = SPECIAL_COMPONENT_LIB_NAME(fps_aqua.uno);
 File gid_File_Lib_Vclplug_Gen
     Name = LIBNAME(vclplug_gen);
     TXT_FILE_BODY;
-    Styles = (PACKED);
+    Styles = (PACKED,PATCH);
     Dir = gid_Dir_Program;
 End
 #endif
 File gid_File_Lib_Vclplug_Gtk
     Name = LIBNAME(vclplug_gtk);
     TXT_FILE_BODY;
-    Styles = (PACKED);
+    Styles = (PACKED,PATCH);
     Dir = gid_Dir_Program;
 End
 #endif
 File gid_File_Lib_Vclplug_Kde
     Name = LIBNAME(vclplug_kde);
     TXT_FILE_BODY;
-    Styles = (PACKED);
+    Styles = (PACKED,PATCH);
     Dir = gid_Dir_Program;
 End
 #endif
 #endif
 
 #if defined UNX && ! defined QUARTZ
-STD_LIB_FILE( gid_File_Lib_Vclplug_Svp, vclplug_svp )
+STD_LIB_FILE_PATCH( gid_File_Lib_Vclplug_Svp, vclplug_svp )
 STD_LIB_FILE( gid_File_Lib_BaseBmp, basebmp )
 #endif
 
 File gid_File_Lib_Vcl
     Name = LIBNAME(vcl);
     TXT_FILE_BODY;
+<<<<<<< .working
     Styles = (PACKED,UNO_COMPONENT,PATCH);
+=======
+    Styles = (PACKED,PATCH,UNO_COMPONENT);
+>>>>>>> .merge-right.r273775
     Dir = gid_Dir_Program;
     RegistryID = gid_Starregistry_Services_Rdb;
 End

File vcl/source/gdi/pdfwriter_impl.cxx

 }
 
 // matrix helper class
-namespace vcl
+// TODO: use basegfx matrix class instead or derive from it
+namespace vcl // TODO: use anonymous namespace to keep this class local
 {
 /*	for sparse matrices of the form (2D linear transformations)
  *  f[0] f[1] 0
     void scale( double sx, double sy );
     void rotate( double angle );
     void translate( double tx, double ty );
+    bool invert();
 
     void append( PDFWriterImpl::PDFPage& rPage, OStringBuffer& rBuffer, Point* pBack = NULL );
 
     f[5] += ty;
 }
 
+bool Matrix3::invert()
+{
+	// short circuit trivial cases
+	if( f[1]==f[2] && f[1]==0.0 && f[0]==f[3] && f[0]==1.0 )
+	{
+		f[4] = -f[4];
+		f[5] = -f[5];
+		return true;
+	}
+
+	// check determinant
+	const double fDet = f[0]*f[3]-f[1]*f[2];
+	if( fDet == 0.0 )
+		return false;
+
+	// invert the matrix
+	double fn[6];
+	fn[0] = +f[3] / fDet;
+	fn[1] = -f[1] / fDet;
+	fn[2] = -f[2] / fDet;
+	fn[3] = +f[0] / fDet;
+
+	// apply inversion to translation
+	fn[4] = -(f[4]*fn[0] + f[5]*fn[2]);
+	fn[5] = -(f[4]*fn[1] + f[5]*fn[3]);
+
+	set( fn );
+	return true;
+}
+
 void Matrix3::append( PDFWriterImpl::PDFPage& rPage, OStringBuffer& rBuffer, Point* pBack )
 {
     appendDouble( f[0], rBuffer );
         // subsequent use of that operator would move
         // the texline matrix relative to what was set before
         // making use of that would drive us into rounding issues
+        Matrix3 aMat;
         if( nRun == 0 && fAngle == 0.0 && fXScale == 1.0 && fSkew == 0.0 )
         {
             m_aPages.back().appendPoint( aCurPos, rLine, false );
         }
         else
         {
-            Matrix3 aMat;
             if( fSkew != 0.0 )
                 aMat.skew( 0.0, fSkew );
             aMat.scale( fXScale, 1.0 );
         appendHex( rGlyphs[nBeginRun].m_nMappedGlyphId, aKernedLine );
         appendHex( rGlyphs[nBeginRun].m_nMappedGlyphId, aUnkernedLine );
 
+        aMat.invert();
         bool bNeedKern = false;
         for( sal_uInt32 nPos = nBeginRun+1; nPos < aRunEnds[nRun]; nPos++ )
         {
             appendHex( rGlyphs[nPos].m_nMappedGlyphId, aUnkernedLine );
-            // check for adjustment
-            double fTheoreticalGlyphWidth = rGlyphs[nPos].m_aPos.X() - rGlyphs[nPos-1].m_aPos.X();
-            fTheoreticalGlyphWidth = fabs( fTheoreticalGlyphWidth ); // #i100522# workaround until #i87686# gets fixed
-            fTheoreticalGlyphWidth = 1000.0 * fTheoreticalGlyphWidth / fXScale / double(nPixelFontHeight);
-            sal_Int32 nAdjustment = rGlyphs[nPos-1].m_nNativeWidth - sal_Int32(fTheoreticalGlyphWidth+0.5);
+            // check if glyph advance matches with the width of the previous glyph, else adjust
+            const Point aThisPos = aMat.transform( rGlyphs[nPos].m_aPos );
+            const Point aPrevPos = aMat.transform( rGlyphs[nPos-1].m_aPos );
+            double fAdvance = aThisPos.X() - aPrevPos.X();
+            fAdvance *= 1000.0 / (fXScale * nPixelFontHeight);
+            const sal_Int32 nAdjustment = rGlyphs[nPos-1].m_nNativeWidth - sal_Int32(fAdvance+0.5);
             if( nAdjustment != 0 )
             {
                 bNeedKern = true;