You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2012/10/12 23:29:49 UTC

svn commit: r1397728 [10/10] - in /incubator/ooo/branches/buildsys: ./ ext_sources/ extras/l10n/source/da/ extras/l10n/source/gd/ extras/l10n/source/pl/ main/ main/basctl/source/basicide/ main/basegfx/inc/basegfx/pixel/ main/basegfx/inc/basegfx/point/ ...

Modified: incubator/ooo/branches/buildsys/main/vcl/source/gdi/outdev4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/vcl/source/gdi/outdev4.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/vcl/source/gdi/outdev4.cxx (original)
+++ incubator/ooo/branches/buildsys/main/vcl/source/gdi/outdev4.cxx Fri Oct 12 21:29:36 2012
@@ -170,12 +170,8 @@ void OutputDevice::ImplDrawLinearGradien
 										   const Gradient& rGradient,
 										   sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
 {
-	// rotiertes BoundRect ausrechnen
+	// get BoundRect of rotated rectangle
 	Rectangle aRect = rRect;
-	aRect.Left()--;
-	aRect.Top()--;
-	aRect.Right()++;
-	aRect.Bottom()++;
 	sal_uInt16	nAngle = rGradient.GetAngle() % 3600;
 	double	fAngle	= nAngle * F_PI1800;
 	double	fWidth	= aRect.GetWidth();
@@ -191,224 +187,205 @@ void OutputDevice::ImplDrawLinearGradien
 	aRect.Top()    -= (long)fDY;
 	aRect.Bottom() += (long)fDY;
 
-	// Rand berechnen und Rechteck neu setzen
+	sal_Bool	bLinear = ( rGradient.GetStyle() == GRADIENT_LINEAR );
+	double		fBorder = rGradient.GetBorder() * aRect.GetHeight() / 100.0;
 	Point		aCenter = rRect.Center();
-	Rectangle	aFullRect = aRect;
-	long		nBorder = (long)rGradient.GetBorder() * aRect.GetHeight() / 100;
-	sal_Bool		bLinear;
+    if ( !bLinear )
+    {
+        fBorder /= 2.0;
+    }
+    Rectangle aMirrorRect = aRect; // used in style axial
+    aMirrorRect.Top() = ( aRect.Top() + aRect.Bottom() ) / 2;
+    if ( !bLinear )
+    {
+        aRect.Bottom() = aMirrorRect.Top();
+    }
 
-	// Rand berechnen und Rechteck neu setzen fuer linearen Farbverlauf
-	if ( rGradient.GetStyle() == GRADIENT_LINEAR )
-	{
-		bLinear = sal_True;
-		aRect.Top() += nBorder;
-	}
-	// Rand berechnen und Rechteck neu setzen fuer axiale Farbverlauf
-	else
-	{
-		bLinear = sal_False;
-		nBorder >>= 1;
+	// Intensitaeten von Start- und Endfarbe ggf. aendern
+	long    nFactor;
+	Color	aStartCol	= rGradient.GetStartColor();
+	Color	aEndCol 	= rGradient.GetEndColor();
+	long	nStartRed	= aStartCol.GetRed();
+	long	nStartGreen = aStartCol.GetGreen();
+	long	nStartBlue	= aStartCol.GetBlue();
+	long	nEndRed 	= aEndCol.GetRed();
+	long	nEndGreen	= aEndCol.GetGreen();
+	long	nEndBlue	= aEndCol.GetBlue();
+            nFactor 	= rGradient.GetStartIntensity();
+			nStartRed	= (nStartRed   * nFactor) / 100;
+			nStartGreen = (nStartGreen * nFactor) / 100;
+			nStartBlue	= (nStartBlue  * nFactor) / 100;
+			nFactor 	= rGradient.GetEndIntensity();
+			nEndRed 	= (nEndRed	 * nFactor) / 100;
+			nEndGreen	= (nEndGreen * nFactor) / 100;
+			nEndBlue	= (nEndBlue  * nFactor) / 100;
 
-		aRect.Top()    += nBorder;
-		aRect.Bottom() -= nBorder;
-	}
+    // gradient style axial has exchanged start and end colors
+    if ( !bLinear)
+    {
+        long nTempColor = nStartRed;
+        nStartRed = nEndRed;
+        nEndRed = nTempColor;
+        nTempColor = nStartGreen;
+        nStartGreen = nEndGreen;
+        nEndGreen = nTempColor;
+        nTempColor = nStartBlue;
+        nStartBlue = nEndBlue;
+        nEndBlue = nTempColor;
+    }
 
-	// Top darf nicht groesser als Bottom sein
-	aRect.Top() = Min( aRect.Top(), (long)(aRect.Bottom() - 1) );
+    sal_uInt8   nRed;
+    sal_uInt8   nGreen;
+    sal_uInt8   nBlue;
+
+    // Create border
+    Rectangle aBorderRect = aRect;
+    Polygon     aPoly( 4 );
+    if (fBorder > 0.0)
+    {
+        nRed        = (sal_uInt8)nStartRed;
+        nGreen      = (sal_uInt8)nStartGreen;
+        nBlue       = (sal_uInt8)nStartBlue;
+        if ( bMtf )
+            mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
+        else
+            mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
 
+        aBorderRect.Bottom() = (long)( aBorderRect.Top() + fBorder );
+        aRect.Top() = aBorderRect.Bottom();
+        aPoly[0] = aBorderRect.TopLeft();
+        aPoly[1] = aBorderRect.TopRight();
+        aPoly[2] = aBorderRect.BottomRight();
+        aPoly[3] = aBorderRect.BottomLeft();
+        aPoly.Rotate( aCenter, nAngle );
+        if ( bMtf )
+            mpMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
+        else
+            ImplDrawPolygon( aPoly, pClipPolyPoly );
+        if ( !bLinear)
+        {
+            aBorderRect = aMirrorRect;
+            aBorderRect.Top() = (long) ( aBorderRect.Bottom() - fBorder );
+            aMirrorRect.Bottom() = aBorderRect.Top();
+            aPoly[0] = aBorderRect.TopLeft();
+            aPoly[1] = aBorderRect.TopRight();
+            aPoly[2] = aBorderRect.BottomRight();
+            aPoly[3] = aBorderRect.BottomLeft();
+            aPoly.Rotate( aCenter, nAngle );
+            if ( bMtf )
+                mpMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
+            else
+                ImplDrawPolygon( aPoly, pClipPolyPoly );
+        }
+    }
+    
+    // calculate step count
+    long    nStepCount  = rGradient.GetSteps();
+	// generate nStepCount, if not passed
 	long nMinRect = aRect.GetHeight();
-
-	// Intensitaeten von Start- und Endfarbe ggf. aendern und
-	// Farbschrittweiten berechnen
-	long			nFactor;
-	Color			aStartCol	= rGradient.GetStartColor();
-	Color			aEndCol 	= rGradient.GetEndColor();
-	long			nStartRed	= aStartCol.GetRed();
-	long			nStartGreen = aStartCol.GetGreen();
-	long			nStartBlue	= aStartCol.GetBlue();
-	long			nEndRed 	= aEndCol.GetRed();
-	long			nEndGreen	= aEndCol.GetGreen();
-	long			nEndBlue	= aEndCol.GetBlue();
-					nFactor 	= rGradient.GetStartIntensity();
-					nStartRed	= (nStartRed   * nFactor) / 100;
-					nStartGreen = (nStartGreen * nFactor) / 100;
-					nStartBlue	= (nStartBlue  * nFactor) / 100;
-					nFactor 	= rGradient.GetEndIntensity();
-					nEndRed 	= (nEndRed	 * nFactor) / 100;
-					nEndGreen	= (nEndGreen * nFactor) / 100;
-					nEndBlue	= (nEndBlue  * nFactor) / 100;
-	long			nRedSteps	= nEndRed	- nStartRed;
-	long			nGreenSteps = nEndGreen - nStartGreen;
-	long			nBlueSteps	= nEndBlue	- nStartBlue;
-	long            nStepCount = rGradient.GetSteps();
-
-	// Bei nicht linearen Farbverlaeufen haben wir nur die halben Steps
-	// pro Farbe
-	if ( !bLinear )
-	{
-		nRedSteps	<<= 1;
-		nGreenSteps <<= 1;
-		nBlueSteps	<<= 1;
-	}
-
-	// Anzahl der Schritte berechnen, falls nichts uebergeben wurde
 	if ( !nStepCount )
 	{
-		long nInc;
-
+		long nInc = 1;
 		if ( meOutDevType != OUTDEV_PRINTER && !bMtf )
         {
 			nInc = (nMinRect < 50) ? 2 : 4;
         }
 		else
         {
-            // #105998# Use display-equivalent step size calculation
+            // Use display-equivalent step size calculation
 			nInc = (nMinRect < 800) ? 10 : 20;
         }
-
-		if ( !nInc )
-			nInc = 1;
-
 		nStepCount = nMinRect / nInc;
 	}
-	// minimal drei Schritte und maximal die Anzahl der Farbunterschiede
-	long nSteps = Max( nStepCount, 2L );
-	long nCalcSteps  = Abs( nRedSteps );
-	long nTempSteps = Abs( nGreenSteps );
-	if ( nTempSteps > nCalcSteps )
-		nCalcSteps = nTempSteps;
-	nTempSteps = Abs( nBlueSteps );
-	if ( nTempSteps > nCalcSteps )
-		nCalcSteps = nTempSteps;
-	if ( nCalcSteps < nSteps )
-		nSteps = nCalcSteps;
-	if ( !nSteps )
-		nSteps = 1;
-
-	// Falls axialer Farbverlauf, muss die Schrittanzahl ungerade sein
-	if ( !bLinear && !(nSteps & 1) )
-		nSteps++;
-
-	// Berechnung ueber Double-Addition wegen Genauigkeit
-	double fScanLine = aRect.Top();
-	double fScanInc  = (double)aRect.GetHeight() / (double)nSteps;
-
-	// Startfarbe berechnen und setzen
-	sal_uInt8	nRed;
-	sal_uInt8	nGreen;
-	sal_uInt8	nBlue;
-	long	nSteps2;
-	long	nStepsHalf = 0;
-	if ( bLinear )
-	{
-		// Um 1 erhoeht, um die Border innerhalb der Schleife
-		// zeichnen zu koennen
-		nSteps2 	= nSteps + 1;
-		nRed		= (sal_uInt8)nStartRed;
-		nGreen		= (sal_uInt8)nStartGreen;
-		nBlue		= (sal_uInt8)nStartBlue;
-	}
-	else
-	{
-		// Um 2 erhoeht, um die Border innerhalb der Schleife
-		// zeichnen zu koennen
-		nSteps2 	= nSteps + 2;
-		nRed		= (sal_uInt8)nEndRed;
-		nGreen		= (sal_uInt8)nEndGreen;
-		nBlue		= (sal_uInt8)nEndBlue;
-		nStepsHalf	= nSteps >> 1;
-	}
-
-	if ( bMtf )
-		mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
-	else
-		mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
-
-	// Startpolygon erzeugen (== Borderpolygon)
-	Polygon 	aPoly( 4 );
-	Polygon 	aTempPoly( 2 );
-	aPoly[0] = aFullRect.TopLeft();
-	aPoly[1] = aFullRect.TopRight();
-	aPoly[2] = aRect.TopRight();
-	aPoly[3] = aRect.TopLeft();
-	aPoly.Rotate( aCenter, nAngle );
-
-	// Schleife, um rotierten Verlauf zu fuellen
-	for ( long i = 0; i < nSteps2; i++ )
-	{
-		// berechnetesPolygon ausgeben
-		if ( bMtf )
-			mpMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
-		else
-			ImplDrawPolygon( aPoly, pClipPolyPoly );
 
-		// neues Polygon berechnen
-		aRect.Top() = (long)(fScanLine += fScanInc);
+	// minimal three steps and maximal as max color steps
+	long   nAbsRedSteps   = Abs( nEndRed   - nStartRed );
+	long   nAbsGreenSteps = Abs( nEndGreen - nStartGreen );
+	long   nAbsBlueSteps  = Abs( nEndBlue  - nStartBlue );
+	long   nMaxColorSteps = Max( nAbsRedSteps , nAbsGreenSteps );
+    nMaxColorSteps = Max( nMaxColorSteps, nAbsBlueSteps );
+	long nSteps = Min( nStepCount, nMaxColorSteps );
+    if ( nSteps < 3)
+    {
+        nSteps = 3;
+    }
 
-		// unteren Rand komplett fuellen
-		if ( i == nSteps )
-		{
-			aTempPoly[0] = aFullRect.BottomLeft();
-			aTempPoly[1] = aFullRect.BottomRight();
-		}
-		else
-		{
-			aTempPoly[0] = aRect.TopLeft();
-			aTempPoly[1] = aRect.TopRight();
-		}
-		aTempPoly.Rotate( aCenter, nAngle );
+    double fScanInc = ((double)aRect.GetHeight()) / (double) nSteps;
+    double fGradientLine = (double)aRect.Top();
+    double fMirrorGradientLine = (double) aMirrorRect.Bottom();
+
+    double fAlpha = 0.0;
+    const double fStepsMinus1 = ((double)nSteps) - 1.0;
+    double fTempColor;
+    if ( !bLinear)
+    {
+        nSteps -= 1; // draw middle polygons as one polygon after loop to avoid gap
+    }
+    for ( long i = 0; i < nSteps; i++ )
+    {
+        // linear interpolation of color
+        fAlpha = ((double)i) / fStepsMinus1;
+        fTempColor = ((double)nStartRed) * (1.0-fAlpha) + ((double)nEndRed) * fAlpha;
+        nRed = ImplGetGradientColorValue((long)fTempColor);
+        fTempColor = ((double)nStartGreen) * (1.0-fAlpha) + ((double)nEndGreen) * fAlpha;
+        nGreen = ImplGetGradientColorValue((long)fTempColor);
+        fTempColor = ((double)nStartBlue) * (1.0-fAlpha) + ((double)nEndBlue) * fAlpha;
+        nBlue = ImplGetGradientColorValue((long)fTempColor);
+        if ( bMtf )
+            mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
+        else
+            mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
 
-		aPoly[0] = aPoly[3];
-		aPoly[1] = aPoly[2];
-		aPoly[2] = aTempPoly[1];
-		aPoly[3] = aTempPoly[0];
-
-		// Farbintensitaeten aendern...
-		// fuer lineare FV
-		if ( bLinear )
-		{
-			nRed	= ImplGetGradientColorValue( nStartRed+((nRedSteps*i)/nSteps2) );
-			nGreen	= ImplGetGradientColorValue( nStartGreen+((nGreenSteps*i)/nSteps2) );
-			nBlue	= ImplGetGradientColorValue( nStartBlue+((nBlueSteps*i)/nSteps2) );
-		}
-		// fuer radiale FV
-		else
-		{
-			// fuer axiale FV muss die letzte Farbe der ersten
-			// Farbe entsprechen
-            // #107350# Setting end color one step earlier, as the
-            // last time we get here, we drop out of the loop later
-            // on.
-			if ( i >= nSteps )
-			{
-				nRed	= (sal_uInt8)nEndRed;
-				nGreen	= (sal_uInt8)nEndGreen;
-				nBlue	= (sal_uInt8)nEndBlue;
-			}
-			else
-			{
-				if ( i <= nStepsHalf )
-				{
-					nRed	= ImplGetGradientColorValue( nEndRed-((nRedSteps*i)/nSteps2) );
-					nGreen	= ImplGetGradientColorValue( nEndGreen-((nGreenSteps*i)/nSteps2) );
-					nBlue	= ImplGetGradientColorValue( nEndBlue-((nBlueSteps*i)/nSteps2) );
-				}
-				// genau die Mitte und hoeher
-				else
-				{
-					long i2 = i - nStepsHalf;
-					nRed	= ImplGetGradientColorValue( nStartRed+((nRedSteps*i2)/nSteps2) );
-					nGreen	= ImplGetGradientColorValue( nStartGreen+((nGreenSteps*i2)/nSteps2) );
-					nBlue	= ImplGetGradientColorValue( nStartBlue+((nBlueSteps*i2)/nSteps2) );
-				}
-			}
-		}
+        // Polygon for this color step
+        aRect.Top() = (long)( fGradientLine + ((double) i) * fScanInc );
+        aRect.Bottom() = (long)( fGradientLine + ( ((double) i) + 1.0 ) * fScanInc );
+        aPoly[0] = aRect.TopLeft();
+        aPoly[1] = aRect.TopRight();
+        aPoly[2] = aRect.BottomRight();
+        aPoly[3] = aRect.BottomLeft();
+        aPoly.Rotate( aCenter, nAngle );
+        if ( bMtf )
+            mpMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
+        else
+            ImplDrawPolygon( aPoly, pClipPolyPoly );
+        if ( !bLinear )
+        {
+            aMirrorRect.Bottom() = (long)( fMirrorGradientLine - ((double) i) * fScanInc );
+            aMirrorRect.Top() = (long)( fMirrorGradientLine - (((double) i) + 1.0)* fScanInc );
+            aPoly[0] = aMirrorRect.TopLeft();
+            aPoly[1] = aMirrorRect.TopRight();
+            aPoly[2] = aMirrorRect.BottomRight();
+            aPoly[3] = aMirrorRect.BottomLeft();
+            aPoly.Rotate( aCenter, nAngle );
+            if ( bMtf )
+                mpMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
+            else
+                ImplDrawPolygon( aPoly, pClipPolyPoly );
+        }
+    }
+    if ( !bLinear)
+    {
+        // draw middle polygon with end color
+        nRed = ImplGetGradientColorValue(nEndRed);
+        nGreen = ImplGetGradientColorValue(nEndGreen);
+        nBlue = ImplGetGradientColorValue(nEndBlue);
+        if ( bMtf )
+            mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
+        else
+            mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
 
-		if ( bMtf )
-			mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), sal_True ) );
-		else
-			mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
-	}
+        aRect.Top() = (long)( fGradientLine + ((double)nSteps) * fScanInc );
+        aRect.Bottom() = (long)( fMirrorGradientLine - ((double) nSteps) * fScanInc );
+        aPoly[0] = aRect.TopLeft();
+        aPoly[1] = aRect.TopRight();
+        aPoly[2] = aRect.BottomRight();
+        aPoly[3] = aRect.BottomLeft();
+        aPoly.Rotate( aCenter, nAngle );
+        if ( bMtf )
+            mpMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
+        else
+            ImplDrawPolygon( aPoly, pClipPolyPoly );
+    }
 }
 
 // -----------------------------------------------------------------------
@@ -1170,51 +1147,76 @@ void OutputDevice::AddHatchActions( cons
 
 void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf )
 {
-	Rectangle	aRect( rPolyPoly.GetBoundRect() );
-	const long	nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 );
-	const long	nWidth = ImplDevicePixelToLogicWidth( Max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) );
-	Point*		pPtBuffer = new Point[ HATCH_MAXPOINTS ];
-	Point		aPt1, aPt2, aEndPt1;
-	Size		aInc;
-
-	// Single hatch
-	aRect.Left() -= nLogPixelWidth; aRect.Top() -= nLogPixelWidth; aRect.Right() += nLogPixelWidth; aRect.Bottom() += nLogPixelWidth;
-	ImplCalcHatchValues( aRect, nWidth, rHatch.GetAngle(), aPt1, aPt2, aInc, aEndPt1 );
-	do
-	{
-		ImplDrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer, bMtf );
-		aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height();
-		aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height();
-	}
-	while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
+    if(rPolyPoly.Count())
+    {
+        // #115630# ImplDrawHatch does not work with beziers included in the polypolygon, take care of that
+        bool bIsCurve(false);
 
-	if( ( rHatch.GetStyle() == HATCH_DOUBLE ) || ( rHatch.GetStyle() == HATCH_TRIPLE ) )
-	{
-		// Double hatch
-		ImplCalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 900, aPt1, aPt2, aInc, aEndPt1 );
-		do
-		{
-			ImplDrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer, bMtf );
-			aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height();
-			aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height();
-		}
-		while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
+        for(sal_uInt16 a(0); !bIsCurve && a < rPolyPoly.Count(); a++)
+        {
+            if(rPolyPoly[a].HasFlags())
+            {
+                bIsCurve = true;
+            }
+        }
 
-		if( rHatch.GetStyle() == HATCH_TRIPLE )
-		{
-			// Triple hatch
-			ImplCalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 450, aPt1, aPt2, aInc, aEndPt1 );
-			do
-			{
-				ImplDrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer, bMtf );
-				aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height();
-				aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height();
-			}
-			while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
-		}
-	}
+        if(bIsCurve)
+        {
+            OSL_ENSURE(false, "ImplDrawHatch does *not* support curves, falling back to AdaptiveSubdivide()...");
+            PolyPolygon aPolyPoly;
 
-	delete[] pPtBuffer;
+            rPolyPoly.AdaptiveSubdivide(aPolyPoly);
+            ImplDrawHatch(aPolyPoly, rHatch, bMtf);
+        }
+        else
+        {
+	        Rectangle	aRect( rPolyPoly.GetBoundRect() );
+	        const long	nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 );
+	        const long	nWidth = ImplDevicePixelToLogicWidth( Max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) );
+	        Point*		pPtBuffer = new Point[ HATCH_MAXPOINTS ];
+	        Point		aPt1, aPt2, aEndPt1;
+	        Size		aInc;
+
+	        // Single hatch
+	        aRect.Left() -= nLogPixelWidth; aRect.Top() -= nLogPixelWidth; aRect.Right() += nLogPixelWidth; aRect.Bottom() += nLogPixelWidth;
+	        ImplCalcHatchValues( aRect, nWidth, rHatch.GetAngle(), aPt1, aPt2, aInc, aEndPt1 );
+	        do
+	        {
+		        ImplDrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer, bMtf );
+		        aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height();
+		        aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height();
+	        }
+	        while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
+
+	        if( ( rHatch.GetStyle() == HATCH_DOUBLE ) || ( rHatch.GetStyle() == HATCH_TRIPLE ) )
+	        {
+		        // Double hatch
+		        ImplCalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 900, aPt1, aPt2, aInc, aEndPt1 );
+		        do
+		        {
+			        ImplDrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer, bMtf );
+			        aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height();
+			        aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height();
+		        }
+		        while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
+
+		        if( rHatch.GetStyle() == HATCH_TRIPLE )
+		        {
+			        // Triple hatch
+			        ImplCalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 450, aPt1, aPt2, aInc, aEndPt1 );
+			        do
+			        {
+				        ImplDrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer, bMtf );
+				        aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height();
+				        aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height();
+			        }
+			        while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) );
+		        }
+	        }
+
+	        delete[] pPtBuffer;
+        }
+    }
 }
 
 // -----------------------------------------------------------------------

Modified: incubator/ooo/branches/buildsys/main/xmloff/source/core/RDFaImportHelper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/main/xmloff/source/core/RDFaImportHelper.cxx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/main/xmloff/source/core/RDFaImportHelper.cxx (original)
+++ incubator/ooo/branches/buildsys/main/xmloff/source/core/RDFaImportHelper.cxx Fri Oct 12 21:29:36 2012
@@ -210,15 +210,15 @@ RDFaReader::ReadCURIE(::rtl::OUString co
             else
             {
                 OSL_TRACE( "ReadCURIE: invalid CURIE: invalid prefix" );
-                return ::rtl::OUString();
             }
         }
     }
     else
     {
         OSL_TRACE( "ReadCURIE: invalid CURIE: no prefix" );
-        return ::rtl::OUString();
     }
+
+    return ::rtl::OUString();
 }
 
 ::std::vector< ::rtl::OUString >

Propchange: incubator/ooo/branches/buildsys/test/
------------------------------------------------------------------------------
  Merged /incubator/ooo/trunk/main/expat/test:r1390954-1397703
  Merged /incubator/ooo/trunk/test:r1390954-1397703

Modified: incubator/ooo/branches/buildsys/test/run
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/run?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/run (original)
+++ incubator/ooo/branches/buildsys/test/run Fri Oct 12 21:29:36 2012
@@ -1,5 +1,8 @@
 #! /bin/sh
 . /etc/profile
-export DISPLAY=:0.0
+if [ -z "$DISPLAY" ]; then
+	export DISPLAY=:0.0
+fi
+
 BASE=$(cd `dirname "$0"`; pwd)
 eval java -cp \"$BASE/lib/junit.jar:$BASE/testcommon/bin:$BASE/testgui/bin:$BASE/testuno/bin:$BASE/testgui/data:$BASE/testuno/data\" org.openoffice.test.Run -r org.openoffice.test.common.Installer -l org.openoffice.test.common.XMLReporter -l org.openoffice.test.common.ReportUploader \"-Dtestspace=$BASE/testspace\" -Dsingleton=true "$*"

Modified: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/OpenOffice.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/OpenOffice.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/OpenOffice.java (original)
+++ incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/OpenOffice.java Fri Oct 12 21:29:36 2012
@@ -86,7 +86,7 @@ public class OpenOffice {
 	
 	private String id = UUID.randomUUID().toString().replace("-", "");
 	
-	private String processPattern = ".*soffice\\.bin.*" + id + ".*|.*soffice\\.exe.*" + id + ".*-env.*";
+	private String processPattern = SystemUtil.isMac() ? ".*soffice .*" + id + ".*" : ".*soffice\\.bin.*" + id + ".*|.*soffice\\.exe.*" + id + ".*-env.*";
 	
 	public OpenOffice() {
 		this(null);

Modified: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/Run.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/Run.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/Run.java (original)
+++ incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/Run.java Fri Oct 12 21:29:36 2012
@@ -55,7 +55,7 @@ public class Run {
 		System.out.println("	-l	Set a test listeners.");
 		System.out.println("	-tp	Define a test suite with test packages separated by comma. Format: [name]:org.package1,org.package2...");
 		System.out.println("	-tc	Define a test suite with test classes separated by comma. Format: [name]:org.package.Class1,org.package.Class2...");
-		System.out.println("	-tc	Define a test suite with test methods separated by comma. Format: [name]:org.package.Class1.method1,org.package.Class2.method1...");
+		System.out.println("	-tm	Define a test suite with test methods separated by comma. Format: [name]:org.package.Class1.method1,org.package.Class2.method1...");
 		System.out.println("Example:");
 		System.out.println("-tp mytest:com.test");
 		System.out.println("-tc mytest:com.test.TestName1,com.test.TestName2");

Modified: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/FileUtil.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/FileUtil.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/FileUtil.java (original)
+++ incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/FileUtil.java Fri Oct 12 21:29:36 2012
@@ -304,8 +304,18 @@ public class FileUtil {
 		return strBuffer.toString();
 	}
 	
-	
-	
+
+	public static boolean isSymbolicLink(File file) {
+		try {
+			File parent = file.getParentFile();
+			String name = file.getName() ;
+			File toTest = parent != null ? new File(parent.getCanonicalPath(), name) : new File(name);
+			return !toTest.getAbsolutePath().equals(toTest.getCanonicalPath());
+		} catch (Exception e) {
+			return false;
+		}
+	}
+
 	/**
 	 * Find the first file matching the given name.
 	 * @param dir The directory to search in
@@ -329,6 +339,23 @@ public class FileUtil {
 		return null;
 	}
 	
+	public static File findFile(File dir, String name, boolean followSymbolicLink) {
+		if (!dir.isDirectory())
+			return null;
+		File[] files = dir.listFiles();
+		for (int i = 0; i < files.length; i++) {
+			if (files[i].isDirectory() && (followSymbolicLink || !isSymbolicLink(files[i]))) {
+				File ret = findFile(files[i], name);
+				if (ret != null)
+					return ret;
+			} else if (files[i].getName().matches(name)) {
+				return files[i];
+			}
+		}
+		
+		return null;
+	}
+	
 	/**
 	 * Find the last file matching the given name.
 	 * @param dir The directory to search in

Modified: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/Installer.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/Installer.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/Installer.java (original)
+++ incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/Installer.java Fri Oct 12 21:29:36 2012
@@ -91,7 +91,7 @@ public class Installer implements Runnab
 				if (files != null && files.length == 1 && files[0].isDirectory()) {
 					files[0].renameTo(installDir);
 				}
-				File sofficeBin = FileUtil.findFile(installDir, "soffice.bin");
+				File sofficeBin = FileUtil.findFile(installDir, "soffice.bin", false);
 				if (sofficeBin == null) 
 					throw new RuntimeException(MessageFormat.format("{0} is not a valid openoffice installation package!" , packFile));
 				try {

Modified: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/SystemUtil.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/SystemUtil.java (original)
+++ incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/SystemUtil.java Fri Oct 12 21:29:36 2012
@@ -275,7 +275,8 @@ public class SystemUtil {
 	 */
 	public static void sleep(double second) {
 		try {
-			Thread.sleep((long) (second * 1000));
+			if (second > 0)
+				Thread.sleep((long) (second * 1000));
 		} catch (InterruptedException e) {
 		}
 	}

Modified: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl (original)
+++ incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl Fri Oct 12 21:29:36 2012
@@ -27,143 +27,24 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <style>
-body {
-	font: 90% Arial, sans-serif;
-}
-
-tr.Success {
-	color:#118811;
-}
-
-tr.Failure {
-	color:#F27D15;
-}
-
-tr.Ignored {
-	color:#F4C700;
-}
-
-tr.Error {
-	color:#FC130F;
-}
-
-th.Success {
-	background:#118811;
-}
-
-th.Failure {
-	background: #F27D15;
-}
-
-th.Ignored {
-	background:#F4C700;
-}
-
-th.Error {
-	background:#FC130F;
-}
-
-a.unchecked {
-	text-decoration: none;
-	padding: 0px 4px;
-	color: #000000;
-	font-weight: bold;
-	border-bottom: 2px solid #AAAAAA;
-}
-
-a.checked {
-	text-decoration: none;
-	border-bottom: 2px solid #E6820E;
-	padding: 0px 4px;
-	color: #000000;
-	font-weight: bold;
-}
-
-.container {
-	width: 100%;
-	float: left;
-	margin-right: -300px;
-}
-
-.content {
-	margin-right: 300px;
-}
-
-.sidebar {
-	width: 300px;
-	float: right;
-}
-
-table {
-	font-size: 90%;
-	border-collapse:collapse;
-    width:100%;
-    background: white;
-	border: 1px solid #666;
-}
-
-td {
-	border: 1px solid #BBB;
-	padding: 4px;
-	text-align: left;
-	vertical-align: top;
-}
-
-th {
-	background: #DDD;
-	border: 1px solid #BBB;
-	padding: 4px;
-	width: 80px;
-	font-weight: bold;
-	text-align: left;
-}
-
-.pieContainer {
-     height: 100px;
-}
-.pieBackground {
-     background-color: grey;
-     position: absolute;
-     width: 100px;
-     height: 100px;
-     -moz-border-radius: 50px;
-     -webkit-border-radius: 50px;
-     -o-border-radius: 50px;
-     border-radius: 50px;
-     -moz-box-shadow: -1px 1px 3px #000;
-     -webkit-box-shadow: -1px 1px 3px #000;
-     -o-box-shadow: -1px 1px 3px #000;
-     box-shadow: -1px 1px 3px #000;
-} 
-
-.pie {
-         position: absolute;
-         width: 100px;
-         height: 100px;
-         -moz-border-radius: 50px;
-         -webkit-border-radius: 50px;
-         -o-border-radius: 50px;
-         border-radius: 50px;
-         clip: rect(0px, 50px, 100px, 0px);
-    }
-.hold {
-     position: absolute;
-     width: 100px;
-     height: 100px;
-     -moz-border-radius: 50px;
-     -webkit-border-radius: 50px;
-     -o-border-radius: 50px;
-     border-radius: 50px;
-     clip: rect(0px, 100px, 100px, 50px);
-}
-#pieSlice1 .pie {
-     background-color: #1b458b;
-     -webkit-transform:rotate(50deg);
-     -moz-transform:rotate(50deg);
-     -o-transform:rotate(50deg);
-     transform:rotate(50deg);
-}
-
+body,td,div { -webkit-text-size-adjust:none; font-size: 11px; font-family: verdana, arial, sans-serif; padding: 0; margin: 0}
+a.unchecked {text-decoration: none;padding: 0px 4px;color: #000000;font-weight: bold;border-bottom: 2px solid #AAAAAA;}
+a.checked {text-decoration: none;border-bottom: 2px solid #E6820E;padding: 0px 4px;color: #000000;font-weight: bold;}
+.container {width: 100%;float: left;margin-right: -300px;}
+.content {margin-right: 300px;}
+.sidebar {width: 300px;float: right;}
+.header {font-weight: bold; margin: 4px; border-radius: 3px;-moz-border-radius: 4px;-webkit-border-radius: 4px;background: #61B7CF;padding: 4px;}
+table {border-collapse:collapse; border: 1px solid #eeeeee;}
+td {border: 1px solid #eeeeee;padding:4px}
+th {border: 1px solid #eeeeee;background:#f5f5f5; padding:4px;text-align:left}
+tr.Success {color:#118811;}
+tr.Failure {color:#F27D15;}
+tr.Ignored {color:#F4C700;}
+tr.Error {color:#FC130F;}
+th.Success {background:#118811;}
+th.Failure {background: #FF8888;}
+th.Ignored {background:#F4C700;}
+th.Error {background:#FF0000;}
 	</style>
 	<title>JUnit Report</title>
 </head>
@@ -171,9 +52,9 @@ th {
 
 <div class="container">
 	<div class="content">
-		<div style="font-weight: bold;padding: 6px">Information</div>
+		<div class="header">Information</div>
 		<div style="padding: 6px">
-		<table class="infoTable">
+		<table class="infoTable"  width="100%">
 		<tr><th>Build ID</th><td><span id="info.app.buildid">Unknown</span> (<span id="info.app.AllLanguages"></span>)</td></tr>
 		<tr><th>Revision</th><td id="info.app.Revision">Unknown</td></tr>
 		<tr><th>OS</th><td><span id="info.os.name">Unknown</span>-<span id="info.os.version">Unknown</span>-<span id="info.os.arch">Unknown</span></td></tr>
@@ -185,9 +66,9 @@ th {
 </div>
 
 <div class="sidebar">
-	<div style="font-weight: bold;padding: 6px">Summary</div>
+	<div class="header">Summary</div>
 	<div style="padding: 6px">
-	<table class="summaryTable">
+	<table class="summaryTable" width="100%">
 		<tr><th>All</th><td><a href="#" onclick="showAllRecord()" id="AllNo" class="checked" >0</a></td></tr>
 		<tr><th class="Success">Success</th><td><a href="#" onclick="toggleRecord('Success')" class="checked" id="SuccessNo">0</a></td></tr>
 		<tr><th class="Failure">Failure</th><td><a href="#" onclick="toggleRecord('Failure')" class="checked" id="FailureNo">0</a></td></tr>
@@ -196,22 +77,16 @@ th {
 	</table>
 	</div>
 </div>
-<div style="clear:both; padding: 6px;font-weight: bold">
-	<div style="float:left">Record</div>
+<div style="clear:both;" class="header">
+	<div style="float:left" >Record</div>
 	<div style="float:right;">
-	View:
 	</div>
+	<div style="clear:both;"></div>
 </div>
-<div style="clear:both;padding: 6px">
-	<table class="recordTable">
-		<thead>
-			<tr><th>Class</th><th>Method</th><th>Status</th><th width="80%">Message</th><th>Time</th><th>Screenshot</th></tr>
-		</thead>
-		<tbody id="recordTable">
-		</tbody>
-	</table>
+<div style="padding: 6px" id="recordTableContainer">
 </div>
 
+
 <script>
 <xsl:text disable-output-escaping='yes'>
 <![CDATA[
@@ -271,24 +146,28 @@ function refresh() {
 	$('java.runtime.version').innerHTML = props['java.runtime.version'] || 'Unknown';
 	
 	var testcaseEls = $$s(data, 'testcase');
-	var html = '';
+	var html = '<table class="recordTable"><thead><tr><th>Class</th><th>Method</th><th>Status</th><th width="80%">Message</th><th>Time</th><th>Screenshot</th></tr></thead><tbody id="recordTable">';
+
 	for (var i = 0; i < testcaseEls.length; i++){
 		var e = testcaseEls[i], c = null;
 		var status = 'Success', message = '', screenshot= '';
 		if (c = $$(e, 'failure')) {
 			status = 'Failure';
-			message = text(c.getAttribute("message"));
+			message = '<div>' + text(c.getAttribute("message")) + '</div>';
+			message += '<pre>' + text(c.innerHTML) + '</pre>';
 			screenshot = '<a href="screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
 		} else if (c = $$(e, 'error')) {
 			status = 'Error';
-			message = text(c.getAttribute("message"));
+			message = '<div>' + text(c.getAttribute("message")) + '</div>';
+			message += '<pre>' + text(c.innerHTML) + '</pre>';
 			screenshot = '<a href="screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
 		} else if (c = $$(e, 'ignored')) {
 			status = 'Ignored';
 			message = text(c.getAttribute("message"));
-		    var bugPattern = /(.*)#(\d+)(.*)/;
-		    bugPattern.test(message);
-		    message = '<a href="https://issues.apache.org/ooo/show_bug.cgi?id=' + RegExp.$2 + '">' + RegExp.$1 + RegExp.$2 + '</a>' + RegExp.$3;
+			var bugPattern = /(.*)#(\d+)(.*)/;
+			if( bugPattern.test(message) ) {
+				message = '<a href="https://issues.apache.org/ooo/show_bug.cgi?id=' + RegExp.$2 + '">' + RegExp.$1 + RegExp.$2 + '</a>' + RegExp.$3;
+			}
 		}
 		
 		html += '<tr class="' + status + '"><td>' 
@@ -298,9 +177,10 @@ function refresh() {
 			+ message + '</td><td>' 
 			+ e.getAttribute("time") + '</td><td>' 
 			+ screenshot + '</td></tr>';
+			
 	}
 	
-	$('recordTable').innerHTML = html;
+	$('recordTableContainer').innerHTML = html + '</tbody></table>';
 }
 
 function showAllRecord() {
@@ -342,11 +222,11 @@ function onload() {
 ]]>
 </xsl:text>
 </script>
-<xml id="data" style="display:none">
+<div id="data" style="display:none">
 	<xsl:copy-of select="*" />
-</xml>
+</div>
 </body>
 </html>
 </xsl:template>
 </xsl:stylesheet>    
-   
\ No newline at end of file
+   

Propchange: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/vcl/
------------------------------------------------------------------------------
  Merged /incubator/ooo/trunk/main/expat/test/testcommon/source/org/openoffice/test/vcl:r1390954-1397703
  Merged /incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/vcl:r1390954-1397703

Modified: incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/vcl/widgets/VclControl.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/vcl/widgets/VclControl.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/vcl/widgets/VclControl.java (original)
+++ incubator/ooo/branches/buildsys/test/testcommon/source/org/openoffice/test/vcl/widgets/VclControl.java Fri Oct 12 21:29:36 2012
@@ -301,6 +301,8 @@ public class VclControl extends VclWidge
 
 	public Rectangle getValidScreenRectangle() {
 		Rectangle rect = getScreenRectangle();
+		Tester.sleep(0.1);
+		rect = getScreenRectangle();
 		if (rect == null)
 			throw new RuntimeException(this + " - screen rectangle could not be computed! Maybe it is not showing!");
 		return rect;

Modified: incubator/ooo/branches/buildsys/test/testgui/data/pvt/complex_400p.docx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/data/pvt/complex_400p.docx?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/formula/importexport/CreateFormulaInDifferentWays.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/formula/importexport/CreateFormulaInDifferentWays.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/formula/importexport/CreateFormulaInDifferentWays.java (original)
+++ incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/formula/importexport/CreateFormulaInDifferentWays.java Fri Oct 12 21:29:36 2012
@@ -185,7 +185,8 @@ public class CreateFormulaInDifferentWay
 	 * 
 	 * @throws Exception
 	 */
-	@Ignore("Bug 119077 - defect in windows only")
+	@Test
+	@Ignore("Bug #119077 - defect in windows only")
 	public void testUndoRedoInMath() throws Exception {
 
 		// Make Elements window pop up

Modified: incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/filter/Fitler.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/filter/Fitler.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/filter/Fitler.java (original)
+++ incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/filter/Fitler.java Fri Oct 12 21:29:36 2012
@@ -62,8 +62,7 @@ public class Fitler {
 	 * 
 	 * Verify 2+ won't be treated as 2
 	 */
-	@Ignore("Bug 120076")
-	@Test
+	@Ignore("Bug #120076")
 	public void testAutoFilterWithPlusSign() {
 		String expect = "2+";
 		SCTool.selectRange("A1");

Modified: incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java (original)
+++ incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java Fri Oct 12 21:29:36 2012
@@ -114,7 +114,7 @@ public class SortDialogSetting {
 	 * 
 	 * @throws Exception
 	 */
-	@Ignore("Bug 119035")
+	@Ignore("Bug #119035")
 	public void testSortOptionsCopyResultTo() throws Exception {
 
 		// Input some data

Modified: incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java (original)
+++ incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java Fri Oct 12 21:29:36 2012
@@ -235,7 +235,7 @@ public class ValidityDialogSetting {
 	/**
 	 * test Allow Text length, less than in Validity.
 	 */
-	@Ignore("Bug 93128")
+	@Test
 	public void testAllowLessThanTextLength() {
 
 		app.dispatch(".uno:Validation");

Modified: incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sw/table/TableGeneral.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sw/table/TableGeneral.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sw/table/TableGeneral.java (original)
+++ incubator/ooo/branches/buildsys/test/testgui/source/fvt/gui/sw/table/TableGeneral.java Fri Oct 12 21:29:36 2012
@@ -63,8 +63,7 @@ public class TableGeneral {
 	// Test setting table cell background in text document
 
 	@Test
-	@Ignore
-	// bug120378
+	@Ignore("Bug #120378")
 	public void testTableBackground() throws Exception {
 		writerInsertTable.ok();
 		assertNotNull(statusBar.getItemTextById(8));
@@ -451,4 +450,4 @@ public class TableGeneral {
 		else
 			assertEquals("Converted text", "1\t2\n3\t4\n", app.getClipboard());
 	}
-}
\ No newline at end of file
+}

Modified: incubator/ooo/branches/buildsys/test/testgui/source/pvt/gui/Benchmark.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/source/pvt/gui/Benchmark.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testgui/source/pvt/gui/Benchmark.java (original)
+++ incubator/ooo/branches/buildsys/test/testgui/source/pvt/gui/Benchmark.java Fri Oct 12 21:29:36 2012
@@ -34,7 +34,9 @@ import static testlib.gui.UIMap.*;
 import java.awt.Rectangle;
 import java.util.HashMap;
 
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
@@ -59,6 +61,8 @@ public class Benchmark {
 	
 	private static int repeat = 8;
 	
+	private int i  = 0;
+	
 	public Benchmark() {
 
 	}
@@ -66,7 +70,7 @@ public class Benchmark {
 	@BeforeClass
 	public static void beforeClass() throws Exception {
 		OpenOffice.killAll();
-		result = new DataSheet(getFile("output/pvt_gui_benchmark.xml"), true);
+		result = new DataSheet(getFile("output/" + Benchmark.class.getName() + ".xml"));
 		result.addRow("data", "Scenario", "No", "Consumed Time", "Memory(VSZ)", "Memory(RSS)", "Handles(Windows Only)");
 	}
 	
@@ -75,7 +79,19 @@ public class Benchmark {
 		app.stop();
 	}
 	
-	private void addRecord(int i, long start, long end) {
+	@Before
+	public void before() {
+		app.start(true);
+		app.quit();
+	}
+	
+	@After
+	public void after() {
+		if (i < repeat)
+			result.addRow("data", testname.getMethodName(), i, "err", "err", "err", "err", "err");
+	}
+	
+	private void addRecord(long start, long end) {
 		sleep(2);
 		HashMap<String, Object>  perf = aoo.getPerfData();
 		result.addRow("data", testname.getMethodName(), i, (end - start), perf.get("vsz"), perf.get("rss"), perf.get("handles"));
@@ -83,93 +99,83 @@ public class Benchmark {
 	
 	@Test
 	public void coolStartup() throws Exception {
-		app.stop();
-		for (int i = 0; i < repeat; i++) {
+		for (i = 0; i < repeat; i++) {
 			aoo.cleanUserInstallation();
 			assertFalse("User profile exists", aoo.getUserInstallation().exists());
 			aoo.start();
 			long start = System.currentTimeMillis();
 			startcenter.waitForExistence(120, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			app.quit();
 		}
+		
 	}
 	
 	@Test
 	public void warmStartup() throws Exception {
-		// Make sure we has generated user profile
-		app.start(true);
-		app.quit();
-		
-		for (int i = 0; i < repeat; i++) {
+		for (i = 0; i < repeat; i++) {
 			assertTrue("User profile exists", aoo.getUserInstallation().exists());
 			aoo.start();
 			long start = System.currentTimeMillis();
 			startcenter.waitForExistence(120, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			app.quit();
 		}
+		
 	}
 
 	@Test
 	public void newTextDocument() {
-		app.start(true);
-		app.quit();
-		
-		for (int i = 0; i < repeat; i++) {
+		for (i = 0; i < repeat; i++) {
 			app.start();
 			startCenterWriterButton.click(0.5, 0.5);
 			long start = System.currentTimeMillis();
 			writer.waitForExistence(60, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			app.quit();
 		}
+		
 	}
 
 	@Test
 	public void newSpreadsheet() {
-		app.start(true);
-		app.quit();
-		for (int i = 0; i < repeat; i++) {
+		for (i = 0; i < repeat; i++) {
 			app.start();
 			startCenterCalcButton.click(0.5, 0.5);
 			long start = System.currentTimeMillis();
 			calc.waitForExistence(60, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			app.quit();
 		}
+		
 	}
 	
 	@Test
 	public void newPresentation() {
-		app.start(true);
-		app.quit();
-		for (int i = 0; i < repeat; i++) {
+		for (i = 0; i < repeat; i++) {
 			app.start();
 			startCenterImpressButton.click(0.5, 0.5);
 			presentationWizard.click(0.9, 0.95);
 			long start = System.currentTimeMillis();
 			impress.waitForExistence(60, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			app.quit();
 		}
+		
 	}
 	
 	@Test
 	public void slideShow() {
-		app.start(true);
-		app.quit();
-		
 		String path = prepareData("pvt/slideshow.odp");
 		final Rectangle rect = GraphicsUtil.getScreenRectangle();
 		// when slide show is running, top-center area will be filled with green
 		rect.setRect(rect.getCenterX(), 2, 2, 2);
-		for (int i = 0; i < repeat; i++) {
+		for (i = 0; i < repeat; i++) {
 			app.start();
 			open(path);
 			impress.waitForExistence(60, 1);
@@ -186,11 +192,12 @@ public class Benchmark {
 				
 			}.waitForTrue("", 120, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			slideShow.typeKeys("<esc>");
 			sleep(2);
 			app.quit();
 		}
+		
 	}
 	
 	@Test
@@ -205,7 +212,7 @@ public class Benchmark {
 	
 	@Test
 	public void loadFinishPlainDOCX() {
-		loadFinish("pvt/plain_200p.docx", "Page 1 / 19[0-9]{1}");
+		loadFinish("pvt/plain_200p.docx", "Page 1 / 1[8-9]{1}[0-9]{1}");
 	}
 	
 	@Test
@@ -245,7 +252,7 @@ public class Benchmark {
 	
 	@Test
 	public void loadFinishComplexDOCX() {
-		loadFinish("pvt/complex_400p.doc", "Page 1 / 4[0-9]{2}");
+		loadFinish("pvt/complex_400p.docx", "Page 1 / 3[2-9]{2}");
 	}
 	
 	@Test
@@ -255,7 +262,17 @@ public class Benchmark {
 	
 	@Test
 	public void loadFinishComplexODS() {
-		loadFinish("pvt/complex_19s.odt", "Sheet 8 / 19");
+		loadFinish("pvt/complex_19s.ods", "Sheet 8 / 19");
+	}
+	
+	@Test
+	public void loadFinishComplexXLS() {
+		loadFinish("pvt/complex_29s.xls", "Sheet 2 / 29");
+	}
+	
+	@Test
+	public void loadFinishComplexXLSX() {
+		loadFinish("pvt/complex_29s.xlsx", "Sheet 29 / 29");
 	}
 	
 	@Test
@@ -263,11 +280,20 @@ public class Benchmark {
 		loadFinish("pvt/complex_150p.odp", "Slide 1 / 150");
 	}
 	
+	@Test
+	public void loadFinishComplexPPT() {
+		loadFinish("pvt/complex_100p.ppt", "Slide 1 / 100");
+	}
+	
+	@Test
+	public void loadFinishComplexPPTX() {
+		loadFinish("pvt/complex_100p.pptx", "Slide 1 / 100");
+	}
+	
 	public void loadFinish(String file, final String indicator) {
 		final int openIndicatorIndex = file.matches(".*\\.(odp|ppt|pptx)$") ? 4 : 0;
 		String path = prepareData(file);
-		app.stop();
-		for (int i = 0; i < 8; i++) {
+		for (i = 0; i < repeat; i++) {
 			app.start();
 			app.dispatch(".uno:Open");
 			filePickerPath.setText(path);
@@ -287,15 +313,11 @@ public class Benchmark {
 				
 			}.waitForTrue("", 120, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			discard();
 			app.quit();
 		}
-	}
-	
-	@Test
-	public void savePlainDOC() {
-		save("pvt/plain_50p.doc", "Page i / 5[0-9]{1}");
+		
 	}
 	
 	@Test
@@ -304,13 +326,13 @@ public class Benchmark {
 	}
 	
 	@Test
-	public void saveComplexDOC() {
-		save("pvt/complex_300p.doc", "Page 1 / 3[0-9]{2}");
+	public void savePlainDOC() {
+		save("pvt/plain_50p.doc", "Page i / 5[0-9]{1}");
 	}
 	
 	@Test
-	public void saveComplexODT() {
-		save("pvt/complex_800p.odt", "Page 1 / 8[0-9]{2}");
+	public void savePlainODS() {
+		save("pvt/plain_11s.ods", "Sheet 1 / 11");
 	}
 	
 	@Test
@@ -319,23 +341,33 @@ public class Benchmark {
 	}
 	
 	@Test
-	public void savePlainODS() {
-		save("pvt/plain_11s.ods", "Sheet 1 / 11");
+	public void savePlainODP() {
+		save("pvt/plain_200p.odp", "Slide 1 / 200");
 	}
 	
 	@Test
-	public void saveComplexODS() {
-		save("pvt/complex_19s.ods", "Sheet 8 / 19");
+	public void savePlainPPT() {
+		save("pvt/plain_200p.ppt", "Slide 1 / 200");
 	}
 	
 	@Test
-	public void savePlainODP() {
-		save("pvt/plain_200p.odp", "Slide 1 / 200");
+	public void saveComplexODT() {
+		save("pvt/complex_800p.odt", "Page 1 / 8[0-9]{2}");
 	}
 	
 	@Test
-	public void savePlainPPT() {
-		save("pvt/plain_200p.ppt", "Slide 1 / 200");
+	public void saveComplexDOC() {
+		save("pvt/complex_300p.doc", "Page 1 / 3[0-9]{2}");
+	}
+
+	@Test
+	public void saveComplexODS() {
+		save("pvt/complex_19s.ods", "Sheet 8 / 19");
+	}
+
+	@Test
+	public void saveComplexXLS() {
+		save("pvt/complex_29s.xls", "Sheet 2 / 29");
 	}
 	
 	@Test
@@ -343,13 +375,17 @@ public class Benchmark {
 		save("pvt/complex_150p.odp", "Slide 1 / 150");
 	}
 	
+	@Test
+	public void saveComplexPPT() {
+		save("pvt/complex_100p.ppt", "Slide 1 / 100");
+	}
+	
 	public void save(String file, final String openIndicator) {
 		boolean alienFormat = file.matches(".*\\.(doc|xls|ppt|docx|xlsx|pptx)$");
 		final int openIndicatorIndex = file.matches(".*\\.(odp|ppt|pptx)$") ? 4 : 0;
 		final int saveIndicatorIndex = file.matches(".*\\.(odt|doc|docx)$") ? 5 : file.matches(".*\\.(ods|xls|xlsx)$") ? 4 : 2;
-		app.stop();
 		String picture = prepareData("image/red_64x64.bmp");
-		for (int i = 0; i < repeat; i++) {
+		for (i = 0; i < repeat; i++) {
 			String dir = "temp/file" + i;
 			getFile(dir).mkdirs();
 			app.start();
@@ -368,7 +404,7 @@ public class Benchmark {
 			}.waitForTrue("", 120, 1);
 			sleep(2);
 			insertPicture(picture);
-			sleep(3);
+			sleep(5);
 			assertEquals("File is modified", "*", statusBar.getItemText(saveIndicatorIndex));
 			app.dispatch(".uno:Save");
 			if (alienFormat) {
@@ -391,9 +427,10 @@ public class Benchmark {
 				
 			}.waitForTrue("", 120, INTERVAL);
 			long end = System.currentTimeMillis();
-			addRecord(i, start, end);
+			addRecord(start, end);
 			close();
 			app.stop();
-		}	
+		}
+		
 	}
 }

Modified: incubator/ooo/branches/buildsys/test/testgui/source/testlib/gui/UIMap.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testgui/source/testlib/gui/UIMap.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testgui/source/testlib/gui/UIMap.java (original)
+++ incubator/ooo/branches/buildsys/test/testgui/source/testlib/gui/UIMap.java Fri Oct 12 21:29:36 2012
@@ -56,7 +56,7 @@ public class UIMap {
 	
 	static {
 		aoo.setAutomationPort(OpenOffice.DEFAULT_AUTOMATION_PORT);
-		aoo.addArgs("-norestore", "-quickstart=no");
+		aoo.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
 		aoo.addRegistryModifications("<item oor:path=\"/org.openoffice.Office.Common/Misc\"><prop oor:name=\"UseSystemFileDialog\" oor:op=\"fuse\"><value>false</value></prop></item>",
 				"<item oor:path=\"/org.openoffice.Office.Common/Security/Scripting\"><prop oor:name=\"MacroSecurityLevel\" oor:op=\"fuse\"><value>0</value></prop></item>");
 	}
@@ -538,6 +538,27 @@ public class UIMap {
 	public static final VclDialog runMacroDlg = dialog("CUI_HID_SELECTOR_DIALOG");
 	public static final VclTreeListBox runMacroDlgCategories = tree("CUI_HID_SELECTOR_CATEGORIES");
 	public static final VclTreeListBox runMacroDlgCommands = tree("CUI_HID_SELECTOR_COMMANDS");
+	public static final VclButton optionUseOOdialog = button("cui:CheckBox:OFA_TP_MISC:CB_FILEDLG");
 	
 	public static final VclButton standardBarSave = button(".uno:Save");
+
+	public static final VclControl swFormatParagragh = control("CUI_HID_FORMAT_PARAGRAPH_STD");
+
+	public static final VclButton sdAddAnimation = button("SD_HID_SD_CUSTOMANIMATIONPANE_PB_ADD_EFFECT");
+
+	public static final VclListBox sdEntranceAnimationTab = listbox("sd:ListBox:RID_TP_CUSTOMANIMATION_ENTRANCE:LB_EFFECTS");
+
+	public static final VclControl sdAnimationList = control("SD_HID_SD_CUSTOMANIMATIONPANE_CT_CUSTOM_ANIMATION_LIST");
+
+	public static final VclWindow sdCurrentMastersList = window("SD_HID_SD_CURRENT_MASTERS");
+
+	public static final VclButton swInsertLineButtonOnToolbar = button(".uno:Line");
+
+	public static final VclToolBox swDrawingToolbar = toolbox(".HelpId:drawbar");
+
+	public static final VclListBox scPrintAreaType = listbox("sc:ListBox:RID_SCDLG_AREAS:LB_PRINTAREA");
+
+	public static final VclEditBox scPrintArea = editbox("sc:Edit:RID_SCDLG_AREAS:ED_PRINTAREA");
+
+	public static final VclEditBox scFormatCode = editbox("cui:Edit:RID_SVXPAGE_NUMBERFORMAT:ED_FORMAT");
 }

Modified: incubator/ooo/branches/buildsys/test/testuno/source/org/openoffice/test/uno/UnoApp.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testuno/source/org/openoffice/test/uno/UnoApp.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testuno/source/org/openoffice/test/uno/UnoApp.java (original)
+++ incubator/ooo/branches/buildsys/test/testuno/source/org/openoffice/test/uno/UnoApp.java Fri Oct 12 21:29:36 2012
@@ -66,6 +66,7 @@ public class UnoApp {
 	
 	static {
 		defaultOpenOffice = new OpenOffice();
+		defaultOpenOffice.addArgs("-nofirststartwizard", "-norestore", "-quickstart=no");
 		defaultOpenOffice.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
 	}
 	

Modified: incubator/ooo/branches/buildsys/test/testuno/source/pvt/uno/Conversion.java
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/buildsys/test/testuno/source/pvt/uno/Conversion.java?rev=1397728&r1=1397727&r2=1397728&view=diff
==============================================================================
--- incubator/ooo/branches/buildsys/test/testuno/source/pvt/uno/Conversion.java (original)
+++ incubator/ooo/branches/buildsys/test/testuno/source/pvt/uno/Conversion.java Fri Oct 12 21:29:36 2012
@@ -40,6 +40,7 @@ import org.openoffice.test.common.FilePr
 import org.openoffice.test.common.FileProvider.FileRepos;
 import org.openoffice.test.common.FileUtil;
 import org.openoffice.test.common.Logger;
+import org.openoffice.test.common.Testspace;
 import org.openoffice.test.uno.UnoApp;
 
 import com.sun.star.beans.PropertyValue;
@@ -56,7 +57,7 @@ public class Conversion {
 	public Logger log = Logger.getLogger(this);
 
 	@FileRepos
-	public static String repos = System.getProperty("conversion.repos", getDataPath("conversion_pvt"));
+	public static String repos = System.getProperty("conversion.repos", getDataPath("uno"));
 	@FileFilter
 	public static String filter = System.getProperty("conversion.filter", 
 			  "-f .*(doc|dot|odt|ott)$ writer_pdf_Export pdf " 
@@ -73,22 +74,27 @@ public class Conversion {
 	public static int repeat = Integer.parseInt(System.getProperty("conversion.repeat", "8"));
 	
 	public static String clean = System.getProperty("conversion.clean", "file");
+	
+	public static int nLevelInfo = Integer.parseInt(System.getProperty("conversion.limitationcheck", "0"));	// Level info: starts from 1, 0 means no need for limitation check
 
+	public static long nSleep = Long.parseLong(System.getProperty("conversion.sleep", "0"));	// Sleep before loadComponentFromURL and storeToURL
+	
 	private static OpenOffice aoo = new OpenOffice();
 	
 	private static UnoApp app = null;
 	
 	private static DataSheet result;
 	
-	private static int counter = 0;
+	private static int counter = -1;
 	
 	@BeforeClass
 	public static void beforeClass() throws Exception {
 		aoo.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
-		aoo.addArgs("-invisible", "-conversionmode", "-hidemenu");
+		aoo.addArgs("-invisible", "-conversionmode", "-hidemenu", "-nofirststartwizard");
 	    app = new UnoApp(aoo);
-		result = new DataSheet(getFile("output/pvt_uno_conversion.xml"));
-		result.addRow("data", "File","Scenario","File Size","Time Consumed After Closing","Time Consumed After Saving","Time Consumed After Loading");
+	    Testspace.prepareDataFile("limit_cfg.ini", aoo.getHome().toString()+"/program");	// Move limitation check file to installation dir
+		result = new DataSheet(getFile("output/" + Conversion.class.getName()+ ".xml"));
+		result.addRow("data", "File","Scenario", "No", "Time Consumed After Closing","Time Consumed After Saving","Time Consumed After Loading", "File Size", "Exported File Size");
 	}
 	
 	@AfterClass
@@ -136,7 +142,7 @@ public class Conversion {
 	
 	@After
 	public void after() throws Exception{
-		result.addRow("data", sourceFileId, scenario, sourceFile.length(), closeTime, saveTime, loadTime);
+		result.addRow("data", sourceFileId, scenario, counter % repeat , closeTime, saveTime, loadTime, sourceFile.length(), targetFile.length());
 		log.info("Result [After Closing: " + closeTime + "] [After Saving: " + saveTime + "] [After Loading: " + loadTime + "]");
 		if (closeTime < 0) {
 			app.close();
@@ -151,25 +157,41 @@ public class Conversion {
 		p.Value= value;
 		return p;
 	}
+
 	
-	@Test(timeout=10 * 60000)
+	@Test(timeout=5 * 60000)
 	public void testConversion() throws Exception {
-		// convert
-		long start = System.currentTimeMillis();
-		XComponent doc = app.loadDocumentFromURL(sourceFileUrl, 
-				propertyValue("Hidden", true),
-				propertyValue("ReadOnly", true),
-				propertyValue("AsyncMode", false),
-				propertyValue("MacroExecutionMode", MacroExecMode.NEVER_EXECUTE));
-
-		loadTime = System.currentTimeMillis() - start;
-		app.saveDocumentToURL(doc, targetFileUrl, 
-				propertyValue( "FilterName", targetFilterName),
-				propertyValue( "Overwrite", true));
-		saveTime = System.currentTimeMillis() - start;
-		XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, doc);
-		xCloseable.close(true);
-		closeTime = System.currentTimeMillis() - start;
+		try {
+			if (nSleep > 0)
+				Thread.sleep(nSleep);
+			long start = System.currentTimeMillis();
+			XComponent doc = app.loadDocumentFromURL(sourceFileUrl, 
+					propertyValue("Hidden", true),
+					propertyValue("ReadOnly", true),
+					propertyValue("AsyncMode", false),
+					propertyValue("MacroExecutionMode", MacroExecMode.NEVER_EXECUTE),
+					propertyValue("LimitationCheckLevel", nLevelInfo));
+	
+			loadTime = System.currentTimeMillis() - start;
+			
+			if (nSleep > 0)
+				Thread.sleep(nSleep);
+			app.saveDocumentToURL(doc, targetFileUrl, 
+					propertyValue( "FilterName", targetFilterName),
+					propertyValue( "Overwrite", true));
+			saveTime = System.currentTimeMillis() - start - nSleep;
+			XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, doc);
+			xCloseable.close(true);
+			closeTime = System.currentTimeMillis() - start - nSleep;
+		} catch (com.sun.star.task.ErrorCodeIOException e){
+			int errCode = e.ErrCode;
+			if( 296 == errCode ) {
+				loadTime = -2;
+				saveTime = -2;
+				closeTime = -2;
+			}
+			
+			throw e;
+		}
 	}
-
 }