Commits

Anonymous committed 0d84fd3

calcishmakkica: merge fixes

Comments (0)

Files changed (7)

formula/source/ui/dlg/parawin.cxx

 		}
 		else
 		{
-		    USHORT nFix = nArgs - PAIRED_VAR_ARGS;
-			USHORT nPos;
+		    sal_uInt16 nFix = nArgs - PAIRED_VAR_ARGS;
+			sal_uInt16 nPos;
 			if ( nArg < nFix )
 			    nPos = nArg;
 			else
 			    nPos = nFix + ( (nArg-nFix) % 2);
-            USHORT nRealArg = (nPos < aVisibleArgMapping.size() ?
+            sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ?
                     aVisibleArgMapping[nPos] : aVisibleArgMapping.back());
 			aArgDesc  = pFuncDesc->getParameterDescription(nRealArg);
 			aArgName  = pFuncDesc->getParameterName(nRealArg);
 	}
 	else
 	{
-	    USHORT nFix = nArgs - PAIRED_VAR_ARGS;
-	    USHORT nPos;
+	    sal_uInt16 nFix = nArgs - PAIRED_VAR_ARGS;
+	    sal_uInt16 nPos;
 			if ( nArg < nFix )
 			    nPos = nArg;
 			else
 			    nPos = nFix + ( (nArg-nFix) % 2);
-        USHORT nRealArg = (nPos < aVisibleArgMapping.size() ?
+        sal_uInt16 nRealArg = (nPos < aVisibleArgMapping.size() ?
                 aVisibleArgMapping[nPos] : aVisibleArgMapping.back());
 		SetArgNameFont( i,
                 (nArg > (nFix+1) || pFuncDesc->isParameterOptional(nRealArg)) ?
 #define HID_FUNC_WENN                                           "SC_HID_FUNC_WENN"
 #define HID_FUNC_ODER                                           "SC_HID_FUNC_ODER"
 #define HID_FUNC_UND                                            "SC_HID_FUNC_UND"
+#define HID_FUNC_XOR                                            "SC_HID_FUNC_XOR"
 
 #define HID_FUNC_ABS                                            "SC_HID_FUNC_ABS"
 #define HID_FUNC_POTENZ                                         "SC_HID_FUNC_POTENZ"
 #define HID_FUNC_PRODUKT                                        "SC_HID_FUNC_PRODUKT"
 #define HID_FUNC_SUMMEWENN                                      "SC_HID_FUNC_SUMMEWENN"
 #define HID_FUNC_ZAEHLENWENN                                    "SC_HID_FUNC_ZAEHLENWENN"
+#define HID_FUNC_AVERAGEIF                                      "SC_HID_FUNC_AVERAGEIF"
+#define HID_FUNC_SUMIFS                                         "SC_HID_FUNC_SUMIFS"
+#define HID_FUNC_COUNTIFS                                       "SC_HID_FUNC_COUNTIFS"
+#define HID_FUNC_AVERAGEIFS                                     "SC_HID_FUNC_AVERAGEIFS"
 #define HID_FUNC_WURZEL                                         "SC_HID_FUNC_WURZEL"
 #define HID_FUNC_ZUFALLSZAHL                                    "SC_HID_FUNC_ZUFALLSZAHL"
 #define HID_FUNC_ISTGERADE                                      "SC_HID_FUNC_ISTGERADE"

sc/source/core/data/global.cxx

         }
         else
         {
-            USHORT nFix = nArgCount - PAIRED_VAR_ARGS;
-            for ( USHORT nArg = 0; nArg < nFix; nArg++ )
+            sal_uInt16 nFix = nArgCount - PAIRED_VAR_ARGS;
+            for ( sal_uInt16 nArg = 0; nArg < nFix; nArg++ )
             {
                 if (!pDefArgFlags[nArg].bSuppress)
                 {

sc/source/core/inc/parclass.hxx

         const static size_t nMaxParams = 7;
 
         Type        nParam[nMaxParams];
-        BYTE        nRepeatLast;
+        sal_uInt8   nRepeatLast;
     };
 
     // SUNWS7 needs a forward declared friend, otherwise members of the outer
     struct RunData
     {
         CommonData  aData;
-        sal_uInt8        nMinParams;         // fix or minimum, or repeat start
+        sal_uInt8   nMinParams;         // fix or minimum, or repeat start
         bool        bHasForceArray;
     };
 

sc/source/core/tool/interpr1.cxx

     short nParamCount = GetByte();
     if ( MustHaveParamCountMin( nParamCount, 1 ) )
     {
-        BOOL bHaveValue = FALSE;
-        short nRes = FALSE;
+        bool bHaveValue = false;
+        short nRes = 0;
         size_t nRefInList = 0;
         while( nParamCount-- > 0)
         {
                 switch ( GetStackType() )
                 {
                     case svDouble :
-                        bHaveValue = TRUE;
+                        bHaveValue = true;
                         nRes ^= ( PopDouble() != 0.0 );
                         break;
                     case svString :
                                 ScBaseCell* pCell = GetCell( aAdr );
                                 if ( HasCellValueData( pCell ) )
                                 {
-                                    bHaveValue = TRUE;
+                                    bHaveValue = true;
                                     nRes ^= ( GetCellValue( aAdr, pCell ) != 0.0 );
                                 }
                                 /* TODO: set error? Excel doesn't have XOR, but 
                             if ( !nGlobalError )
                             {
                                 double fVal;
-                                USHORT nErr = 0;
+                                sal_uInt16 nErr = 0;
                                 ScValueIterator aValIter( pDok, aRange );
                                 if ( aValIter.GetFirst( fVal, nErr ) )
                                 {
-                                    bHaveValue = TRUE;
+                                    bHaveValue = true;
                                     do
                                     {
                                         nRes ^= ( fVal != 0.0 );
                         break;
                     case svMatrix:
                         {
-                            bHaveValue = TRUE;
+                            bHaveValue = true;
                             ScMatrixRef pMat = GetMatrix();
                             if ( pMat )
                             {
-                                bHaveValue = TRUE;
+                                bHaveValue = true;
                                 double fVal = pMat->Xor();
-                                USHORT nErr = GetDoubleErrorValue( fVal );
+                                sal_uInt16 nErr = GetDoubleErrorValue( fVal );
                                 if ( nErr )
                                 {
                                     SetError( nErr );
-                                    nRes = FALSE;
+                                    nRes = 0;
                                 }
                                 else
                                     nRes ^= (fVal != 0.0);
                 Pop();
         }
         if ( bHaveValue )
-            PushInt( nRes );
+            PushInt( nRes ? 1 : 0 );
         else
             PushNoValue();
     }
 
 double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc )
 {
-    BYTE nParamCount = GetByte();
+    sal_uInt8 nParamCount = GetByte();
     if ( MustHaveParamCount( nParamCount, 2, 3 ) )
     {
         SCCOL nCol3 = 0;
         double fMem = 0.0;
         double fRes = 0.0;
         double fCount = 0.0;
-        BOOL bNull = TRUE;
+        bool bNull = true;
         short nParam = 1;
         size_t nRefInList = 0;
         while (nParam-- > 0)
                                         ++fCount;
                                         if ( bNull && fVal != 0.0 )
                                         {
-                                            bNull = FALSE;
+                                            bNull = false;
                                             fMem = fVal;
                                         }
                                         else
                                         ++fCount;
                                         if ( bNull && fVal != 0.0 )
                                         {
-                                            bNull = FALSE;
+                                            bNull = false;
                                             fMem = fVal;
                                         }
                                         else
                                     ++fCount;
                                     if ( bNull && fVal != 0.0 )
                                     {
-                                        bNull = FALSE;
+                                        bNull = false;
                                         fMem = fVal;
                                     }
                                     else
                                     ++fCount;
                                     if ( bNull && fVal != 0.0 )
                                     {
-                                        bNull = FALSE;
+                                        bNull = false;
                                         fMem = fVal;
                                     }
                                     else
                 rParam.nRow2       = nRow2;
 
                 ScQueryEntry& rEntry = rParam.GetEntry(0);
-                rEntry.bDoQuery = TRUE;
+                rEntry.bDoQuery = true;
                 if (!bIsString)
                 {
-                    rEntry.bQueryByString = FALSE;
+                    rEntry.bQueryByString = false;
                     rEntry.nVal = fVal;
                     rEntry.eOp = SC_EQUAL;
                 }
                 }
                 else
                 {
-                    ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE);
+                    ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false);
                     // Entry.nField im Iterator bei Spaltenwechsel weiterschalten
-                    aCellIter.SetAdvanceQueryParamEntryField( TRUE );
+                    aCellIter.SetAdvanceQueryParamEntryField( true );
                     if ( aCellIter.GetFirst() )
                     {
                         do
 
 double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc )
 {
-    BYTE nParamCount = GetByte();
-    BYTE nQueryCount = nParamCount / 2;
+    sal_uInt8 nParamCount = GetByte();
+    sal_uInt8 nQueryCount = nParamCount / 2;
 
     bool bCheck;
     if ( eFunc == ifCOUNTIFS )
                 }
                 else
                 {
-                    ScQueryCellIterator aCellIter(pDok, nTab1, rParam, FALSE);
+                    ScQueryCellIterator aCellIter(pDok, nTab1, rParam, false);
                     // Increment Entry.nField in iterator when switching to next column.
-                    aCellIter.SetAdvanceQueryParamEntryField( TRUE );
+                    aCellIter.SetAdvanceQueryParamEntryField( true );
                     if ( aCellIter.GetFirst() )
                     {
                         do

sc/source/core/tool/parclass.cxx

     }
     if ( 0 <= (short)eOp && eOp <= SC_OPCODE_LAST_OPCODE_ID )
     {
-        BYTE nRepeat;
+        sal_uInt8 nRepeat;
         Type eType;
         if ( nParameter < CommonData::nMaxParams )
             eType = pData[eOp].aData.nParam[nParameter];
         {
             // The usual case is 1 repeated parameter, we don't need to 
             // calculate that on each call.
-            USHORT nParam = (nRepeat > 1 ?
+            sal_uInt16 nParam = (nRepeat > 1 ?
                     (pData[eOp].nMinParams -
                      ((nParameter - pData[eOp].nMinParams) % nRepeat)) :
                     pData[eOp].nMinParams);

sc/source/ui/formdlg/dwfunctr.cxx

 					    nFix = nArgs - VAR_ARGS + 1;
 					else
 					    nFix = nArgs;
-							nArg < nFix && !pDesc->pDefArgFlags[nArg].bOptional; nArg++ )
+                    for (sal_uInt16 nArg = 1;
+                            nArg < nFix && !pDesc->pDefArgFlags[nArg].bOptional; nArg++ )
 					{
                         if (!pDesc->pDefArgFlags[nArg].bSuppress)
                         {