? sc/sc.vpj
Index: sc/source/core/tool/interpr1.cxx
===================================================================
RCS file: /cvs/sc/sc/source/core/tool/interpr1.cxx,v
retrieving revision 1.51
diff -u -r1.51 interpr1.cxx
--- sc/source/core/tool/interpr1.cxx	27 Sep 2007 13:53:45 -0000	1.51
+++ sc/source/core/tool/interpr1.cxx	12 Nov 2007 15:59:08 -0000
@@ -2768,6 +2768,8 @@
 	double nVal = 0.0;
 	ScAddress aAdr;
 	ScRange aRange;
+	bool bEmptyCells = FALSE;
+	
 	for (short i = 0; i < nParamCount; i++)
 	{
 		switch (GetStackType())
@@ -2794,6 +2796,8 @@
 					if ( nMin > 0.0 )
 						nMin = 0.0;
 				}
+				else if ( pCell && pCell->GetStringData().Len() == 0 )
+					bEmptyCells = TRUE;
 			}
 			break;
 			case svDoubleRef :
@@ -2813,6 +2817,8 @@
 					}
 					SetError(nErr);
 				}
+				else
+					bEmptyCells = TRUE;
 			}
 			break;
 			case svMatrix :
@@ -2848,6 +2854,8 @@
 									if ( nMin > 0.0 )
 										nMin = 0.0;
 								}
+								else if ( pMat->IsEmpty(nMatCol,nMatRow) )
+									bEmptyCells = TRUE;
 							}
 						 }
 					}
@@ -2872,7 +2880,12 @@
 		}
 	}
 	if (nMin == SC_DOUBLE_MAXVALUE)
-		SetIllegalArgument();
+	{
+		if (bEmptyCells)
+			PushDouble(0.0);
+		else
+			SetIllegalArgument();
+	}
 	else
 		PushDouble(nMin);
 }
@@ -2888,6 +2901,8 @@
 	double nVal = 0.0;
 	ScAddress aAdr;
 	ScRange aRange;
+	bool bEmptyCells = FALSE;
+	
 	for (short i = 0; i < nParamCount; i++)
 	{
 		switch (GetStackType())
@@ -2914,6 +2929,8 @@
 					if ( nMax < 0.0 )
 						nMax = 0.0;
 				}
+				else if ( pCell && pCell->GetStringData().Len() == 0 )
+					bEmptyCells = TRUE;
 			}
 			break;
 			case svDoubleRef :
@@ -2933,6 +2950,8 @@
 					}
 					SetError(nErr);
 				}
+				else
+					bEmptyCells = TRUE;
 			}
 			break;
 			case svMatrix :
@@ -2968,6 +2987,8 @@
 									if ( nMax < 0.0 )
 										nMax = 0.0;
 								}
+								else if ( pMat->IsEmpty(nMatCol,nMatRow) )
+									bEmptyCells = TRUE;
 							}
 						}
 					}
@@ -2992,7 +3013,12 @@
 		}
 	}
 	if (nMax == -SC_DOUBLE_MAXVALUE)
-		SetIllegalArgument();
+	{
+		if (bEmptyCells)
+			PushDouble(0.0);
+		else
+			SetIllegalArgument();
+	}
 	else
 		PushDouble(nMax);
 }
