Remove deadcode that was originally destined to compute RAM derivs

--- src/omxRAMExpectation.cpp
+++ src/omxRAMExpectation.cpp
@@ -23,24 +23,8 @@

 	omxMatrix *cov, *means; // observed covariance and means
 	omxMatrix *A, *S, *F, *M, *I;
-	omxMatrix *C, *EF, *ZM, *U, *V, *W, *X, *Y, *Z, *Ax, *P, *bCB, *ZSBC, *Mns, *lilI, *eCov, *beCov;
-    omxMatrix *dA, *dS, *dM, *b, *D, *paramVec;
-    // For gradients
-    omxMatrix ***eqnOuts;
-    omxMatrix **dAdts, **dSdts, **dMdts;
-
-    // Each vector keeps track of the number
-    // of non-zero elements in the
-    // corresponding dXdts matrix.
-    int *dAdtsCount, *dSdtsCount, *dMdtsCount;
-
-    int *dAdtsRowCache, *dAdtsColCache;
-    int *dSdtsRowCache, *dSdtsColCache;
-    int *dMdtsRowCache, *dMdtsColCache;
-
-    omxMatrix *tempVec, *bigSum, *lilSum;
-
-    int *pNums, nParam; // For Fast Gradient/Hessian Computation
+	omxMatrix *X, *Y, *Z, *Ax;
+
 	int numIters;
 	double logDetObserved;
 	double n;
@@ -49,96 +33,10 @@

 } omxRAMExpectation;

-static void calculateRAMGradientComponents(omxExpectation* oo, omxMatrix**, omxMatrix**, int*);
-static void sliceCrossUpdate(omxMatrix* A, omxMatrix* B, int row, int col, omxMatrix* result);
 static void omxCalculateRAMCovarianceAndMeans(omxMatrix* A, omxMatrix* S, omxMatrix* F,
     omxMatrix* M, omxMatrix* Cov, omxMatrix* Means, int numIters, omxMatrix* I,
     omxMatrix* Z, omxMatrix* Y, omxMatrix* X, omxMatrix* Ax);
-static void fastRAMGradientML(omxExpectation* oo, omxFitFunction* off, double* result);
 static omxMatrix* omxGetRAMExpectationComponent(omxExpectation* ox, const char* component);
-
-// Speedup Helper
-static void ADB(omxMatrix** A, omxMatrix** B, int numArgs, omxMatrix** D, int *Dcounts,
-        int *DrowCache, int *DcolCache, int matNum, std::vector< omxFreeVar* > &varList,
-        int* pNums, int nParam, omxMatrix*** result) {
-    // Computes Matrix %*% params %*% Matrix in O(K^2) time.  Based on von Oertzen & Brick, in prep.
-    // Also populates the matrices called D if it appears.
-    // Minimal Rf_error checking.
-    if(OMX_DEBUG_ALGEBRA) mxLog("Beginning ADB."); //:::DEBUG:::
-
-    omxFreeVar *var;
-    int paramNo;
-
-    for(int param = 0; param < nParam; param++) {
-        if(pNums != NULL) {
-            paramNo = pNums[param];
-        } else {
-            paramNo = param;
-        }
-        var = varList[paramNo];
-
-        // Set D
-        if(D != NULL) {
-            int nonzero = 0;
-            omxMatrix *thisD = D[param];
-            memset(thisD->data, 0, sizeof(double) * thisD->cols * thisD->rows);
-            // Honestly, this should be calculated only once.
-            for(size_t varLoc = 0; varLoc < var->locations.size(); varLoc++) {
-                if(~var->locations[varLoc].matrix == matNum) {
-			int row = var->locations[varLoc].row;
-			int col = var->locations[varLoc].col;
-			omxSetMatrixElement(thisD, row, col, 1.0);
-			if (DrowCache != NULL) DrowCache[param] = row;
-			if (DcolCache != NULL) DcolCache[param] = col;
-			nonzero++;
-                }
-            }
-            Dcounts[param] = nonzero;
-        }
-        for(int eqn = 0; eqn < numArgs; eqn++) {
-            omxMatrix* thisResult = result[eqn][param];
-            memset(thisResult->data, 0, sizeof(double) * thisResult->cols * thisResult->rows);
-            for(size_t varLoc = 0; varLoc < var->locations.size(); varLoc++) {
-                if(~var->locations[varLoc].matrix == matNum) {
-                    sliceCrossUpdate(A[eqn], B[eqn],
-				     var->locations[varLoc].row,
-				     var->locations[varLoc].col, thisResult);
-                }
-            }
-        }
-    }
-}
-
-static void sliceCrossUpdate(omxMatrix* A, omxMatrix* B, int row, int col, omxMatrix* result) {
-    // Performs outer multiply of column col of A by row row of B.
-    // Adds product to beta * result.
-    int nrow = A->rows;
-    int ncol = B->cols;
-    int resultrows = result->rows;
-    int brows = B->rows;
-
-    if (A->colMajor && B->colMajor && result->colMajor) {
-        int aoffset = row * nrow;
-        double* Adata = A->data;
-        double* Bdata = B->data;
-        double* resdata = result->data;
-
-        for(int k = 0; k < ncol; k++) {
-            int offset = k * resultrows;
-            double factor = Bdata[k * brows + col];
-            for(int j = 0; j < nrow; j++) {
-                resdata[offset + j] += Adata[aoffset + j] * factor;
-            }
-        }
-    } else {
-        for(int k = 0; k < ncol; k++) {
-            for(int j = 0; j < nrow; j++) {
-                omxAccumulateMatrixElement(result, j, k,
-                    omxMatrixElement(A, j, row) * omxMatrixElement(B, col, k));
-            }
-        }
-    }
-}

 static void omxCallRAMExpectation(omxExpectation* oo, const char *, const char *) {
     if(OMX_DEBUG) { mxLog("RAM Expectation calculating."); }
@@ -163,45 +61,14 @@
 	omxFreeMatrix(argStruct->cov);

 	if(argStruct->means != NULL) {
-		omxFreeMatrix(argStruct->dM);
-		omxFreeMatrix(argStruct->ZM);
-		omxFreeMatrix(argStruct->bCB);
-		omxFreeMatrix(argStruct->b);
-		omxFreeMatrix(argStruct->tempVec);
-		omxFreeMatrix(argStruct->bigSum);
-		omxFreeMatrix(argStruct->lilSum);
-		omxFreeMatrix(argStruct->beCov);
 		omxFreeMatrix(argStruct->means);
 	}

-	int nParam = argStruct->nParam;
-	if(nParam >= 0) {
-		for(int j = 0; j < nParam; j++) {
-			omxFreeMatrix(argStruct->dAdts[j]);
-			omxFreeMatrix(argStruct->dSdts[j]);
-			omxFreeMatrix(argStruct->dMdts[j]);
-			omxFreeMatrix(argStruct->eqnOuts[0][j]);
-		}
-		omxFreeMatrix(argStruct->paramVec);
-	}
-
-	omxFreeMatrix(argStruct->dA);
-	omxFreeMatrix(argStruct->dS);
-
 	omxFreeMatrix(argStruct->I);
-	omxFreeMatrix(argStruct->lilI);
 	omxFreeMatrix(argStruct->X);
 	omxFreeMatrix(argStruct->Y);
 	omxFreeMatrix(argStruct->Z);
 	omxFreeMatrix(argStruct->Ax);
-
-	omxFreeMatrix(argStruct->W);
-	omxFreeMatrix(argStruct->U);
-	omxFreeMatrix(argStruct->EF);
-	omxFreeMatrix(argStruct->V);
-	omxFreeMatrix(argStruct->ZSBC);
-	omxFreeMatrix(argStruct->C);
-	omxFreeMatrix(argStruct->eCov);

 }

@@ -271,17 +138,6 @@
 		return; // We're not populating anything, so why bother running the calculation?
 	}

-	// if(   (Cov->rows != Cov->cols)  || (A->rows  != A->cols)  // Conformance check
-	// 	|| (X->rows  != Cov->cols)  || (X->cols  != A->rows)
-	// 	|| (Y->rows  != Cov->cols)  || (Y->cols  != A->rows)
-	// 	|| (Ax->rows != Cov->cols)  || (Ax->cols != A->rows)
-	// 	|| (I->rows  != Cov->cols)  || (I->cols  != Cov->rows)
-	// 	|| (Y->rows  != Cov->cols)  || (Y->cols  != A->rows)
-	// 	|| (M->cols  != Cov->cols)  || (M->rows  != 1)
-	// 	|| (Means->rows != 1)       || (Means->cols != Cov->cols) ) {
-	// 		Rf_error("INTERNAL ERROR: Incorrectly sized matrices being passed to omxRAMExpectation Calculation.\n Please report this to the OpenMx development team.");
-	// }
-
 	omxShallowInverse(NULL, numIters, A, Z, Ax, I );

 	/* Cov = FZSZ'F' */
@@ -339,7 +195,6 @@
 	/* Identity Matrix, Size Of A */
 	if(OMX_DEBUG) { mxLog("Generating I."); }
 	RAMexp->I = omxNewIdentityMatrix(RAMexp->A->rows, currentState);
-	RAMexp->lilI = omxNewIdentityMatrix(RAMexp->F->rows, currentState);

 	if(OMX_DEBUG) { mxLog("Processing expansion iteration depth."); }
 	{ScopedProtect p1(slotValue, R_do_slot(rObj, Rf_install("depth")));
@@ -359,37 +214,11 @@

 	RAMexp->Z = 	omxInitMatrix(k, k, TRUE, currentState);
 	RAMexp->Ax = 	omxInitMatrix(k, k, TRUE, currentState);
-	RAMexp->W = 	omxInitMatrix(k, k, TRUE, currentState);
-	RAMexp->U = 	omxInitMatrix(l, k, TRUE, currentState);
+	RAMexp->Ax->rownames = RAMexp->S->rownames;
+	RAMexp->Ax->colnames = RAMexp->S->colnames;
 	RAMexp->Y = 	omxInitMatrix(l, k, TRUE, currentState);
 	RAMexp->X = 	omxInitMatrix(l, k, TRUE, currentState);
-	RAMexp->EF= 	omxInitMatrix(k, l, TRUE, currentState);
-	RAMexp->V = 	omxInitMatrix(l, k, TRUE, currentState);
-	RAMexp->ZSBC = 	omxInitMatrix(k, l, TRUE, currentState);
-	RAMexp->C = 	omxInitMatrix(l, l, TRUE, currentState);
-
-	if(omxIsMatrix(RAMexp->A)) {
-		RAMexp->dA = omxInitMatrix(k, k, TRUE, currentState);
-	} else {
-		RAMexp->dA = NULL;
-	}
-	if(omxIsMatrix(RAMexp->S)) {
-		RAMexp->dS = omxInitMatrix(k, k, TRUE, currentState);
-	} else {
-		RAMexp->dS = NULL;
-	}
-	if(RAMexp->M != NULL) {
-		RAMexp->dM = 	omxInitMatrix(1, k, TRUE, currentState);
-		RAMexp->ZM = 	omxInitMatrix(k, 1, TRUE, currentState);
-		RAMexp->bCB = 	omxInitMatrix(k, 1, TRUE, currentState);
-		RAMexp->b = 	omxInitMatrix(l, 1, TRUE, currentState);
-		RAMexp->tempVec = 	omxInitMatrix(k, 1, TRUE, currentState);
-		RAMexp->bigSum = 	omxInitMatrix(k, 1, TRUE, currentState);
-		RAMexp->lilSum = 	omxInitMatrix(l, 1, TRUE, currentState);
-		RAMexp->beCov = 	omxInitMatrix(l, 1, TRUE, currentState);
-		RAMexp->Mns = 	NULL;
-    }
-
+
 	RAMexp->cov = 		omxInitMatrix(l, l, TRUE, currentState);

 	if(RAMexp->M != NULL) {
@@ -397,630 +226,6 @@
 	} else {
 	    RAMexp->means  = 	NULL;
     }
-
-    // Derivative space:
-	RAMexp->eqnOuts = NULL;
-	RAMexp->dAdts = NULL;
-	RAMexp->dSdts = NULL;
-	RAMexp->dMdts = NULL;
-	RAMexp->paramVec = NULL;
-	RAMexp->D =     NULL;
-	RAMexp->pNums = NULL;
-	RAMexp->nParam = -1;
-	RAMexp->eCov=       omxInitMatrix(l, l, TRUE, currentState);
-
-}
-
-/*
- * fastRAMGradientML
- * 			Calculates the derivatives of the likelihood for a RAM model.
- * Locations of free parameters are extracted from the omxExpecation's state object.
- *
- * params:
- * omxMatrix *A, *S, *F 	: matrices as specified in the RAM model.  MxM, MxM, and NxM
- * omxMatrix *M				: vector containing model implied means. 1xM
- * omxMatrix *Cov			: On output: model-implied manifest covariance.  NxN.
- * omxMatrix *Means			: On output: model-implied manifest means.  1xN.
- * int numIterations		: Precomputed number of iterations of taylor series expansion.
- * omxMatrix *I				: Identity matrix.  If left NULL, will be populated.  MxM.
- * omxMatrix *Z				: On output: Computed (I-A)^-1. MxM.
- * omxMatrix *Y, *X, *Ax	: Space for computation. NxM, NxM, MxM.  On exit, populated.
- */
-
-static void fastRAMGradientML(omxExpectation* oo, omxFitFunction* off, double* result) {
-
-    // This calculation is based on von Oertzen and Brick, in prep.
-    //
-    // Steps:
-    // 1) (Re) Calculate current A, S, F, M, and Z (where Z = (I-A)^-1)
-    // 2) cov = current Expected Covariance (fxf)
-    // 3) eCov = cov^(-1) (fxf) *
-    // 4) ZS = Z S  (axa) *
-    // 5) B = F Z   (fxa) *
-    // 6) C = I - eCov D, where D is the observed covariance matrix (fxf) *
-    // 7) BC = B^T C (axf) *
-    // 8) ZSB = ZS (B^T) *
-    // 8) ZSBC = ZS BC (axf) *
-    // 9) eCovB = cov^(-1) B (fxa) *
-    // For Means:
-        // 10) Means = BM (fx1) *
-        // 11) b = Means - d, where d is the observed means matrix (fx1)
-        // 12) beCov = b cov^(-1) (1xf) *
-        // 13) beCovB = b cov^(-1) B (1xa) *
-
-
-    // 14) For each location in locations: (Note: parallelize, gradients here!)
-    //      1A) Calculate dA/dt and dS/dt by substituting 1s into empty matrices
-    //      1B) eqnList = 2 * ADB(eCovB, dAdt, ZSBC)
-    //      1C) eqnList2 = ADB(eCovB, dSdt, BC)  // Preferably, build
-    //      2) sum = eqnList1 + eqnList2
-    //      If Means:
-    //          3) sumVec = beCovB dAdt ZS
-    //          4) sumVec += beCovB ZS dAdt
-    //          5) sumVec += beCovB dSdt
-    //          6) sumVec *= B^T
-    //          7) sumVec += 2 * B dAdt Means
-    //          8) sumVec += 2 * B dMdt
-    //          9) sum += sumVec beCov
-
-    //  Right.  All the * elements are saved for hessian computation.
-
-    if(OMX_DEBUG) {mxLog("Calculating fast RAM/ML gradient."); }
-
-    omxRAMExpectation* oro = (omxRAMExpectation*)(oo->argStruct);
-                                    // Size reference: A is axa, F is fxa
-    omxMatrix* A = oro->A;          // axa
-    omxMatrix* S = oro->S;          // axa
-    omxMatrix* F = oro->F;          // fxa
-    omxMatrix* M = oro->M;          // 1xa
-    omxMatrix* Z = oro->Z;          // axa
-
-    omxMatrix* cov = oro->cov;      // fxf
-    omxMatrix* means = oro->means;  // fx1
-    omxMatrix* eCov = oro->eCov;    // fxf
-
-	omxMatrix* ZS = oro->Ax;        // axa
-
-    omxMatrix* B = oro->X;          // fxa
-    omxMatrix* C = oro->C;          // fxf
-    omxMatrix* BC = oro->EF;        // fxa
-    omxMatrix* ZSBC = oro->ZSBC;    // fxa
-    omxMatrix* eCovB = oro->U;      // fxa
-
-    omxMatrix* ZM = oro->ZM;        // 1xa
-    omxMatrix* beCov = oro->beCov;  // 1xf
-    omxMatrix* bCB = oro->bCB;      // 1xa
-    omxMatrix* b = oro->b;          // 1xa
-
-    omxMatrix** dAdts = oro->dAdts;
-    omxMatrix** dSdts = oro->dSdts;
-    omxMatrix** dMdts = oro->dMdts;
-
-    int* dAdtsCount = oro->dAdtsCount;
-    int* dSdtsCount = oro->dSdtsCount;
-    int* dMdtsCount = oro->dMdtsCount;
-
-    int* dAdtsRowCache = oro->dAdtsRowCache;
-    int* dAdtsColCache = oro->dAdtsColCache;
-    int* dSdtsRowCache = oro->dSdtsRowCache;
-    int* dSdtsColCache = oro->dSdtsColCache;
-    int* dMdtsRowCache = oro->dMdtsRowCache;
-    int* dMdtsColCache = oro->dMdtsColCache;
-
-    omxMatrix*** eqnOuts = oro->eqnOuts;
-
-    omxMatrix* tempVec = oro->tempVec;
-    omxMatrix* bigSum  = oro->bigSum;
-    omxMatrix* lilSum  = oro->lilSum;
-    omxMatrix* D = oro->D;
-    omxMatrix* Mns = oro->Mns;
-
-    omxMatrix* lilI = oro->lilI;
-    omxMatrix* paramVec = oro->paramVec;
-
-    double n = oro->n;
-
-    int* pNums = oro->pNums;
-    int nParam = oro->nParam;
-    std::vector< omxFreeVar* > &varList = oo->freeVarGroup->vars;
-
-    int Amat = A->matrixNumber;
-    int Smat = S->matrixNumber;
-    int Mmat = 0;
-    double oned = 1.0, minusoned = -1.0;
-    int onei = 1;
-    int info;
-    char u = 'U';
-    if(M != NULL) Mmat = M->matrixNumber;
-
-    FreeVarGroup *freeVarGroup = oo->freeVarGroup;
-
-    omxMatrix *eqnList1[1], *eqnList2[1];
-
-    if(nParam < 0) {
-        nParam = 0;
-        size_t nTotalParams = freeVarGroup->vars.size();
-        if(OMX_DEBUG) { mxLog("Planning Memory for Fast Gradient Calculation: Using %d params.", nParam); }
-	Eigen::VectorXi calc(nTotalParams);
-        // Work out the set of parameters for which we can calculate gradients
-        // TODO: Potential speedup by splitting this to calculate dA, dS, and dM separately
-        for(size_t parm = 0; parm < nTotalParams; parm++) {
-            omxFreeVar *ofv = freeVarGroup->vars[parm];
-            calc[parm] = 0;
-            for(size_t loc = 0; loc < ofv->locations.size(); loc++) {
-                int varMat = ~(ofv->locations[loc].matrix);
-                if(varMat == Amat || varMat == Smat || (M != NULL && varMat == Mmat)) {
-                    calc[parm] = 1;
-                } else {
-                    calc[parm] = 0;
-                    break;
-                }
-            }
-            if(calc[parm]) {
-                nParam++;
-            }
-        }
-        oro->nParam = nParam;
-        pNums = (int*)R_alloc(nParam, sizeof(int));
-
-        int nextFree = 0;
-        // Populate pNums with numbers of the parameters to calculate
-        for(size_t parm = 0; parm < nTotalParams && nextFree < nParam; parm++) {
-            if(calc[parm]) {
-                pNums[nextFree] = parm;
-                nextFree++;
-
-            }
-        }
-        oro->pNums = pNums;
-
-        oro->dAdts = (omxMatrix**) R_alloc(nParam, sizeof(omxMatrix*));
-        oro->dSdts = (omxMatrix**) R_alloc(nParam, sizeof(omxMatrix*));
-        oro->dMdts = (omxMatrix**) R_alloc(nParam, sizeof(omxMatrix*));
-        oro->dAdtsCount = (int*) R_alloc(nParam, sizeof(int));
-        oro->dSdtsCount = (int*) R_alloc(nParam, sizeof(int));
-        oro->dMdtsCount = (int*) R_alloc(nParam, sizeof(int));
-
-        oro->dAdtsRowCache = (int*) R_alloc(nParam, sizeof(int));
-        oro->dAdtsColCache = (int*) R_alloc(nParam, sizeof(int));
-        oro->dSdtsRowCache = (int*) R_alloc(nParam, sizeof(int));
-        oro->dSdtsColCache = (int*) R_alloc(nParam, sizeof(int));
-        oro->dMdtsRowCache = (int*) R_alloc(nParam, sizeof(int));
-        oro->dMdtsColCache = (int*) R_alloc(nParam, sizeof(int));
-
-        oro->eqnOuts = (omxMatrix***) R_alloc(1, sizeof(omxMatrix**));
-        oro->eqnOuts[0] = (omxMatrix**) R_alloc(nParam, sizeof(omxMatrix*));
-
-        int a = A->rows;
-        omxState* currentState = oo->currentState;
-        for(int i = 0; i < nParam; i++) {
-            oro->dAdts[i] = omxInitMatrix(a, a, TRUE, currentState);
-            oro->dSdts[i] = omxInitMatrix(a, a, TRUE, currentState);
-            oro->dMdts[i] = omxInitMatrix(1, a, TRUE, currentState);
-
-            oro->eqnOuts[0][i] = omxInitMatrix(a, a, TRUE, currentState);
-        }
-        oro->paramVec = omxInitMatrix(nParam, 1, TRUE, currentState);
-        paramVec = oro->paramVec;
-        dAdts = oro->dAdts;
-        dSdts = oro->dSdts;
-        dMdts = oro->dMdts;
-        dAdtsCount = oro->dAdtsCount;
-        dSdtsCount = oro->dSdtsCount;
-        dMdtsCount = oro->dMdtsCount;
-
-        dAdtsRowCache = oro->dAdtsRowCache;
-        dAdtsColCache = oro->dAdtsColCache;
-        dSdtsRowCache = oro->dSdtsRowCache;
-        dSdtsColCache = oro->dSdtsColCache;
-        dMdtsRowCache = oro->dMdtsRowCache;
-        dMdtsColCache = oro->dMdtsColCache;
-
-        eqnOuts = oro->eqnOuts;
-    }
-
-    Eigen::VectorXd covInfluence(nParam);
-    Eigen::VectorXd meanInfluence(nParam);
-
-    // 1) (Re) Calculate current A, S, F, M, and Z (where Z = (I-A)^-1)
-    // 2) cov = current Expected Covariance (fxf)
-    // Theoretically, we should calculate current fit function values
-    // But we can safely assume this has already been done
-    // That assumption may no longer be valid in FIML.
-
-    // 3) eCov = cov^(-1) (fxf)
-    omxCopyMatrix(eCov, cov);				// But expected cov is destroyed in inversion
-
-    F77_CALL(dpotrf)(&u, &(eCov->cols), eCov->data, &(eCov->cols), &info);
-
-    if(OMX_DEBUG_ALGEBRA) { mxLog("Info on LU Decomp: %d", info);}
-    if(info > 0) {
-	    char *errstr = (char*) calloc(250, sizeof(char));
-        sprintf(errstr, "Expected covariance matrix is non-positive-definite");
-        strncat(errstr, ".\n", 3);
-        omxRaiseError(errstr);                        // Raise Rf_error
-        free(errstr);
-        return;                                                                     // Leave output untouched
-    }
-
-    F77_CALL(dpotri)(&u, &(eCov->rows), eCov->data, &(eCov->cols), &info);
-    if(info > 0) {
-	    char *errstr = (char*) calloc(250, sizeof(char));
-        sprintf(errstr, "Expected covariance matrix is not invertible");
-        strncat(errstr, ".\n", 3);
-        omxRaiseError(errstr);                        // Raise Rf_error
-        free(errstr);
-        return;
-    }
-
-    // 4) ZS = Z S  (axa) *
-    omxDSYMM(FALSE, 1.0, S, Z, 0.0, ZS);
-    omxDGEMM(FALSE, FALSE, 1.0, Z, S, 0.0, ZS);
-
-    // 5) B = F Z   (fxa) *
-    omxDGEMM(FALSE, FALSE, 1.0, F, Z, 0.0, B);
-
-    // 6) C = I - eCov D, where D is the observed covariance matrix (fxf)
-    omxCopyMatrix(C, lilI);
-    omxDSYMM(TRUE, -1.0, eCov, D, 1.0, C);
-
-
-    // 7) BC = B^T C (axf) *
-    omxDGEMM(TRUE, FALSE, 1.0, B, C, 0.0, BC);
-
-    // 8) ZSBC = ZS BC (axf) *
-    omxDGEMM(FALSE, FALSE, 1.0, ZS, BC, 0.0, ZSBC);
-
-    // 9) eCovB = cov^(-1) B (fxa) *
-    omxDSYMM(TRUE, 1.0, eCov, B, 0.0, eCovB);
-
-    if(M != NULL) {
-        // 10) Means = BM (fx1) *
-        // This is calculated during expectation computation.
-        // 11) b = Means - d, where d is the observed means matrix (fx1)
-
-        omxCopyMatrix(b, Mns);
-    	F77_CALL(daxpy)(&(means->cols), &minusoned, means->data, &onei, b->data, &onei);
-
-        // 11) beCov = b cov^(-1) (1xf) *
-        omxDSYMV(1.0, eCov, b, 0.0, beCov);
-
-        // 12) beCovB = b cov^(-1) B (1xa) *
-        omxDGEMV(TRUE, 1.0, eCovB, b, 0.0, bCB);
-
-        // 13) ZM = Z %*% M (1xa)
-        omxDGEMV(FALSE, 1.0, Z, M, 0.0, ZM);
-    }
-
-    // 14) For each location in locations:
-    //      1A) Calculate dA/dt, dS/dt, and dM/dt by substituting 1s into empty matrices
-    //      1B) 1 = 2 * ADB(eCovB, dAdt, ZSBC)
-
-    eqnList1[0] = eCovB;
-    eqnList2[0] = ZSBC;
-    ADB(eqnList1, eqnList2, 1, dAdts, dAdtsCount, dAdtsRowCache, dAdtsColCache,
-        Amat, varList, pNums, nParam, eqnOuts);
-    omxMatrixTrace(eqnOuts[0], nParam, paramVec);
-
-    for(int i = 0; i < nParam; i++)
-        covInfluence[i] = 2 * omxVectorElement(paramVec, i);
-
-
-    //      1C) eqnList2 = ADB(eCovB, dSdt, BC)
-    eqnList1[0] = eCovB;
-    eqnList2[0] = BC;
-    ADB(eqnList1, eqnList2, 1, dSdts, dSdtsCount, dSdtsRowCache, dSdtsColCache,
-        Smat, varList, pNums, nParam, eqnOuts);
-    omxMatrixTrace(eqnOuts[0], nParam, paramVec);
-
-    //      2) sum = eqnList1 + eqnList2
-    F77_CALL(daxpy)(&nParam, &oned, paramVec->data, &onei, covInfluence.data(), &onei);
-
-    //      If Means:
-    if(M != NULL) {
-
-        //      Just populate dMdts
-        ADB(NULL, NULL, 0, dMdts, dMdtsCount, dMdtsRowCache, dMdtsColCache,
-            Mmat, varList, pNums, nParam, NULL);
-
-        //  This needs to be done one-per-param.
-        //  Parallelize here.
-        for(int pNum = 0; pNum < nParam; pNum++) {
-
-            switch(dAdtsCount[pNum]) {
-                case 0:
-                    switch(dSdtsCount[pNum]) {
-                        case 0:
-                            memset(bigSum->data, 0, sizeof(double) * bigSum->rows);
-                            break;
-                        case 1:
-                        {
-                            int rowCache = dSdtsRowCache[pNum];
-                            int colCache = dSdtsColCache[pNum];
-                            memset(bigSum->data, 0, sizeof(double) * bigSum->rows);
-                            bigSum->data[colCache] = bCB->data[rowCache];
-                            break;
-                        }
-                        default:
-                            // 5) sumVec = beCovB dSdt (1xa)
-                            omxDGEMV(TRUE, 1.0, dSdts[pNum], bCB, 0.0, bigSum);
-                    }
-                    break;
-                case 1:
-                {
-                    int rowCache = dAdtsRowCache[pNum];
-                    int colCache = dAdtsColCache[pNum];
-                    double value = bCB->data[rowCache];
-
-                    int len = bCB->rows;
-                    int nrow = ZS->rows;
-                    int ncol = ZS->cols;
-
-                    if (ZS->colMajor)
-                        for(int offset = 0; offset < len; offset++)
-                            bigSum->data[offset] = ZS->data[offset * nrow + colCache] * value;
-                    else
-                        for(int offset = 0; offset < len; offset++)
-                            bigSum->data[offset] = ZS->data[colCache * ncol + offset] * value;
-
-                    // Term with dSigma/dTheta
-                    //          4) sumVec += beCovB ZS dAdt (1xa)
-                    omxDGEMV(TRUE, 1.0, ZS, bCB, 0.0, tempVec);
-                    bigSum->data[colCache] += tempVec->data[rowCache];
-
-                    if (dSdtsCount[pNum]) {
-                        //  5) sumVec = beCovB dSdt (1xa)
-                        omxDGEMV(TRUE, 1.0, dSdts[pNum], bCB, 1.0, bigSum);
-                    }
-                    break;
-                }
-                default:
-                    //          3) sumVec = beCovB dAdt ZS (1xa)
-                    omxDGEMV(TRUE, 1.0, dAdts[pNum], bCB, 0.0, tempVec);
-                    omxDGEMV(TRUE, 1.0, ZS, tempVec, 0.0, bigSum);
-                    // Term with dSigma/dTheta
-                    //          4) sumVec += beCovB ZS dAdt (1xa)
-                    omxDGEMV(TRUE, 1.0, ZS, bCB, 0.0, tempVec);
-                    omxDGEMV(TRUE, 1.0, dAdts[pNum], tempVec, 1.0, bigSum);
-                    if (dSdtsCount[pNum]) {
-                        //  5) sumVec = beCovB dSdt (1xa)
-                        omxDGEMV(TRUE, 1.0, dSdts[pNum], bCB, 1.0, bigSum);
-                    }
-            }
-
-            //          6) sumVec *= B^T --> 1xf
-            omxDGEMV(FALSE, 1.0, B, bigSum, 0.0, lilSum);
-
-            // Factorizing dMudt
-            //          7) sumVec += 2 * B dAdt ZM (1xa)
-            //              Note: in the paper, expected manifest means are Bm
-            switch(dAdtsCount[pNum]) {
-                case 0:
-                    break;
-                case 1:
-                {
-                    int rowCache = dAdtsRowCache[pNum];
-                    int colCache = dAdtsColCache[pNum];
-                    double value = ZM->data[colCache];
-
-                    int len = B->rows;
-                    int nrow = B->rows;
-                    int ncol = B->cols;
-
-                    if (B->colMajor)
-                        for(int offset = 0; offset < len; offset++)
-                            lilSum->data[offset] += 2.0 * B->data[rowCache * nrow + offset] * value;
-                    else
-                        for(int offset = 0; offset < len; offset++)
-                            lilSum->data[offset] += 2.0 * B->data[offset * ncol + rowCache] * value;
-
-                    break;
-                }
-                default:
-                    omxDGEMV(FALSE, 1.0, dAdts[pNum], ZM, 0.0, tempVec);
-                    omxDGEMV(FALSE, 2.0, B, tempVec, 1.0, lilSum); // :::DEBUG:::<-- Save B %*% tempVec
-            }
-
-            //          8) sumVec += 2 * B dMdt (1xf)
-            switch(dMdtsCount[pNum]) {
-                case 0:
-                    break;
-                case 1:
-                {
-                    int moffset, boffset, nrow;
-
-                    moffset = dMdtsColCache[pNum];
-                    nrow = B->rows;
-                    boffset = moffset * nrow;
-
-                    for(int row = 0; row < nrow; row++)
-                        lilSum->data[row] += 2.0 * B->data[boffset + row];
-
-                    break;
-                }
-                default:
-                    omxDGEMV(FALSE, 2.0, B, dMdts[pNum], 1.0, lilSum); // :::DEBUG::: <-- Save B %*% dM
-            }
-
-            //          9) sum = sumVec beCov (1x1)
-            int len = lilSum->rows * lilSum->cols;
-            meanInfluence[pNum] = F77_CALL(ddot)(&len, lilSum->data, &onei, beCov->data, &onei);
-        }
-
-    } else {
-        for(int i = 0; i < nParam; i++)
-            meanInfluence[i] = 0;
-    }
-
-    for(int pNum = 0; pNum < nParam; pNum++) {
-        int nextP = pNums[pNum]; // Original varList parameter number
-        result[pNum] = (covInfluence[pNum] * (n-1)) - (meanInfluence[pNum] * n);
-        if(OMX_DEBUG) {
-            mxLog("Revised calculation for Gradient value %d: Cov: %3.9f, Mean: %3.9f, total: %3.9f",
-                nextP, covInfluence[pNum], meanInfluence[pNum], result[pNum]);
-        }
-    }
-
-    // Phew.
-
-}
-
-static void omxAddOwnTranspose(omxMatrix** matlist, int numArgs, omxMatrix* result) {
-    omxMatrix* M = *matlist;
-
-    if(M->rows != M->cols || M->rows != result->cols || result->rows != result->cols) {
-        char *errstr = (char*) calloc(250, sizeof(char));
-        sprintf(errstr, "A + A^T attempted on asymmetric matrix.\n");
-        omxRaiseError(errstr);
-        free(errstr);
-		return;
-    }
-
-    double total;
-
-    for(int i = 0; i < result->rows; i++) {
-        for(int j = 0; j < i; j++) {
-            total = omxMatrixElement(M, i, j);
-            total += omxMatrixElement(M, j, i);
-            omxSetMatrixElement(result, i, j, total);
-            omxSetMatrixElement(result, j, i, total);
-        }
-        omxSetMatrixElement(result, i, i, 2 * omxMatrixElement(M, i, i));
-    }
-}
-
-static void calculateRAMGradientComponents(omxExpectation* oo, omxMatrix** dSigmas, omxMatrix** dMus, int* status) {
-
-    // Steps:
-    // 1) (Re) Calculate current A, S, F, and Z (where Z = (I-A)^-1)
-    // 2) E = Z S Z^T
-    // 3) B = F Z
-    // 4) For each location in locations:
-    //      1) Calculate dA/dt, dS/dt, and dM/dt by substituting 1s into empty matrices
-    //      2) C = B dAdt E F^T
-    //      3) dSigma/dT = C + C^T + B dS/dT B^T
-    //      4) dM/dT = B dA/dT Z b + B dM/dT
-
-    omxRAMExpectation* oro = (omxRAMExpectation*)(oo->argStruct);
-                                // Size reference: A is axa, F is fxf
-    omxMatrix* A = oro->A;      // axa
-    omxMatrix* S = oro->S;      // axa
-    omxMatrix* F = oro->F;      // fxf
-    omxMatrix* Z = oro->Z;      // axa
-    // omxMatrix* I = oro->I;      // axa
-    omxMatrix* M = oro->M;      // 1xf
-    omxMatrix* B = oro->X;      // fxa
-    omxMatrix* U = oro->U;      // fxa
-    omxMatrix* EF = oro->EF;    // fxa
-    omxMatrix* ZM = oro->ZM;    // 1xf
-    omxMatrix* V = oro->V;      // fxa
-    omxMatrix* W = oro->W;      // axa
-	omxMatrix* E = oro->Ax;     // axa
-
-    omxMatrix* dA = oro->dA;
-    omxMatrix* dS = oro->dS;
-    omxMatrix* dM = oro->dM;
-
-    // int numIters = oro->numIters;
-    int Amat = A->matrixNumber;
-    int Smat = S->matrixNumber;
-    int Mmat = 0;
-    if(M != NULL) Mmat = M->matrixNumber;
-
-    std::vector< omxFreeVar* > &varList = oo->freeVarGroup->vars;
-    size_t nLocs = varList.size();
-
-    // Assumed.
-    // if(omxNeedsUpdate(Z)) {
-    //     // (Re)Calculate current A, S, F, and Z
-    //     omxCalculateRAMCovarianceAndMeans(A, S, F, M, cov, means, numIters, I, Z, oro->Y, B, Ax);
-    // }
-
-    // TODO: Handle repeated-call cases.
-    // E = Z S (Z^T)
-    omxDGEMM(FALSE, FALSE, 1.0, Z, S, 0.0, W);
-    omxDGEMM(FALSE, TRUE, 1.0, W, Z, 0.0, E);
-
-    //EF = E F^T
-    omxDGEMM(FALSE, TRUE, 1.0, E, F, 0.0, EF);
-
-    // B = F Z
-    omxDGEMM(FALSE, FALSE, 1.0, F, Z, 0.0, B);
-
-    // ZM = ZM
-    if(M != NULL)
-        omxDGEMV(FALSE, 1.0, Z, M, 0.0, ZM);
-
-    // Step through free params
-    // Note: This should be parallelized at the next level up.
-    //  This function itself should serially perform one computation for each location
-    //  given in the sequence.  Always write to the appropriate location so that writes
-    //  can be shared across thread-level parallelism.
-
-    for(size_t param = 0; param < nLocs; param++) {
-        //  Repeated from above.  For each parameter:
-        //      1) Calculate dA/dt, dS/dt, and dM/dt by substituting 1s into empty matrices
-
-        omxFreeVar *var = varList[param];
-
-        // Zero dA, dS, and dM.  // TODO: speed
-        for( int k = 0; k < dA->cols; k++) {
-            for( int j = 0; j < dA->rows; j++) {
-                omxSetMatrixElement(dA, j, k, 0.0);
-                omxSetMatrixElement(dS, j, k, 0.0);
-            }
-            if(M != NULL) omxSetMatrixElement(dM, 0, k, 0.0);
-        }
-        status[param] = 0;
-
-        // Create dA, dS, and dM mats for each Free Parameter
-        for(size_t varLoc = 0; varLoc < var->locations.size(); varLoc++) {
-            int varMat = ~var->locations[varLoc].matrix; // Matrices are numbered from ~0 to ~N
-	    int row = var->locations[varLoc].row;
-	    int col = var->locations[varLoc].col;
-            if(varMat == Amat) {
-                omxSetMatrixElement(dA, row, col, 1);
-            } else if(varMat == Smat) {
-                omxSetMatrixElement(dS, row, col, 1);
-            } else if(varMat == Mmat && M != NULL) {
-                omxSetMatrixElement(dM, row, col, 1);
-            } else {
-                // This parameter has some outside effect
-                // We cannot directly estimate its effects on the likelihood
-                // For now, skip.
-                // TODO: Find a way to deal with these situations
-                status[param] = -1;
-                if(OMX_DEBUG) { mxLog("Skipping parameter %d because %dth element has outside influence %d. Looking for %d, %d, or %d.", (int) param, (int) varLoc, varMat, Amat, Smat, Mmat);}
-                break;
-            }
-        }
-
-        if(status[param] < 0) {
-            continue;  // Skip this one.
-        }
-
-        omxMatrix* C = dSigmas[param];
-        omxMatrix* dMu = dMus[param];
-
-        //      2) C = B dAdt EF
-        omxDGEMM(FALSE, FALSE, 1.0, B, dA, 0.0, U);
-        omxDGEMM(FALSE, FALSE, 1.0, U, EF, 0.0, C);
-
-        // Note: U is saved here for calculation of M, below.
-        //      3) dSigma/dT = C + C^T + B dS/dT B^T
-        omxAddOwnTranspose(&C, 0, C);
-        omxDGEMM(FALSE, FALSE, 1.0, B, dS, 0.0, V);
-        omxDGEMM(FALSE, TRUE,  1.0, V, B, 1.0, C);
-
-        if(M != NULL) {
-            //      4) dM/dT = B dA/dT Z M + B dM/dT
-            omxDGEMV(FALSE, 1.0, U, ZM, 0.0, dMu);
-            omxDGEMV(FALSE, 1.0, B, dM, 1.0, dMu);
-
-        }
-
-    }
-
 }

 static omxMatrix* omxGetRAMExpectationComponent(omxExpectation* ox, const char* component) {


Added support for OSG_OPTIMIZER="OFF"

Added support for OSG_OPTIMIZER="OFF"

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@3177 16af8721-9629-0410-8352-f15c8da7e697

--- src/osgUtil/Optimizer.cpp
+++ src/osgUtil/Optimizer.cpp
@@ -57,7 +57,7 @@
     _permissableOptimizationsMap.clear();
 }

-static osg::ApplicationUsageProxy Optimizer_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_OPTIMIZER \"<type> [<type>]\"","DEFAULT | FLATTEN_STATIC_TRANSFORMS | REMOVE_REDUNDANT_NODES | COMBINE_ADJACENT_LODS | SHARE_DUPLICATE_STATE | MERGE_GEOMETRY | SPATIALIZE_GROUPS  | COPY_SHARED_NODES  | TRISTRIP_GEOMETRY | OPTIMIZE_TEXTURE_SETTINGS");
+static osg::ApplicationUsageProxy Optimizer_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_OPTIMIZER \"<type> [<type>]\"","OFF | DEFAULT | FLATTEN_STATIC_TRANSFORMS | REMOVE_REDUNDANT_NODES | COMBINE_ADJACENT_LODS | SHARE_DUPLICATE_STATE | MERGE_GEOMETRY | SPATIALIZE_GROUPS  | COPY_SHARED_NODES  | TRISTRIP_GEOMETRY | OPTIMIZE_TEXTURE_SETTINGS");

 void Optimizer::optimize(osg::Node* node)
 {
@@ -68,6 +68,8 @@
     {
         std::string str(env);

+
+        if(str.find("OFF")!=std::string::npos) options = 0;

         if(str.find("~DEFAULT")!=std::string::npos) options ^= DEFAULT_OPTIMIZATIONS;
         else if(str.find("DEFAULT")!=std::string::npos) options |= DEFAULT_OPTIMIZATIONS;


Do not use passert if the evaluation of the subject triggers abortion.

    * src/parser/parser-impl.cc: Here.

--- src/parser/parser-impl.cc
+++ src/parser/parser-impl.cc
@@ -44,7 +44,12 @@
   {
     TIMER_PUSH("parse");
     // Set up result_.
-    passert(*result_, !result_.get());
+
+    // FIXME: This check will evaluate (void)*result_ in NDEBUG,
+    // entailing an abortion since result_ == 0. Passert should
+    // probably be fixed.
+    // passert(*result_, !result_.get());
+
     result_.reset(new ParseResult);

     // Set up scanner.


SDL_PATH_DSP seems to be used only in oss. Use AUDIODEV instead

--- src/platform/SDLMedia.cxx
+++ src/platform/SDLMedia.cxx
@@ -238,7 +238,7 @@
 // Setting Audio Device
 void	SDLMedia::setDevice(std::string deviceName) {
   static char envAssign[256];
-  std::string envVar = "SDL_PATH_DSP=" + deviceName;
+  std::string envVar = "AUDIODEV=" + deviceName;
   strncpy(envAssign, envVar.c_str(), 255);
   envAssign[255]     = '\0';
   putenv(envAssign);
@@ -287,12 +287,12 @@

 void SDLMedia::audioDriver(std::string& driverName)
 {
-  char driver[128] = "SDL: audio not available";
+  char driver[128];
   char *result = SDL_AudioDriverName(driver, sizeof(driver));
   if (result)
     driverName = driver;
   else
-    driverName = "SDL: audio not available";
+    driverName = "audio not available";
 }

 #endif //HAVE_SDL


Fixed FX Node memory leak.

Fixed FX Node memory leak.

svn path=/trunk/libavg/; revision=6575

--- src/player/RasterNode.cpp
+++ src/player/RasterNode.cpp
@@ -125,6 +125,11 @@
     }
     m_pFBO = FBOPtr();
     m_pImagingProjection = ImagingProjectionPtr();
+    if (bKill) {
+        m_pFXNode = FXNodePtr();
+    } else {
+        m_pFXNode->disconnect();
+    }
     AreaNode::disconnect(bKill);
 }


Fixed Pango deprecation warnings.

Fixed Pango deprecation warnings.

svn path=/trunk/libavg/; revision=8160

--- src/player/TextEngine.cpp
+++ src/player/TextEngine.cpp
@@ -87,7 +87,11 @@
         pango_ft2_font_map_set_default_substitute(m_pFontMap, text_subst_func_nohint,
                 0, 0);
     }
+#if PANGO_VERSION > PANGO_VERSION_ENCODE(1,22,0)
+    m_pPangoContext = pango_font_map_create_context(PANGO_FONT_MAP(m_pFontMap));
+#else
     m_pPangoContext = pango_ft2_font_map_create_context(m_pFontMap);
+#endif

     pango_context_set_language(m_pPangoContext,
             pango_language_from_string ("en_US"));


curl: global_init now throws an exception instead of returning the error code

--- src/plugins/curl/curl.cpp
+++ src/plugins/curl/curl.cpp
@@ -36,8 +36,12 @@
 using namespace flusspferd;

 namespace {
-  long global_init(long flags) {
-    return curl_global_init(flags);
+  void global_init(long flags) {
+    CURLcode ret = curl_global_init(flags);
+		if(ret != 0) {
+			throw flusspferd::exception(std::string("curl_global_init: ") +
+																	curl_easy_strerror(ret));
+		}
   }

   FLUSSPFERD_CLASS_DESCRIPTION


improve dump contract's docu

improve dump contract's docu

--- src/plugins/dump/dump.cpp
+++ src/plugins/dump/dump.cpp
@@ -226,13 +226,13 @@
 				KEY_BINARY,
 				KEY_VALUE, &unserialize, KEY_END),
 			keyNew ("system/elektra/modules/dump/infos",
-				KEY_VALUE, "All information you want to know", KEY_END),
+				KEY_VALUE, "Dumps into a format tailored to KeySet semantics", KEY_END),
 			keyNew ("system/elektra/modules/dump/infos/author",
 				KEY_VALUE, "Markus Raab <elektra@markus-raab.org>", KEY_END),
 			keyNew ("system/elektra/modules/dump/infos/licence",
 				KEY_VALUE, "BSD", KEY_END),
 			keyNew ("system/elektra/modules/dump/infos/description",
-				KEY_VALUE, "Dumps complete Elektra Semantics", KEY_END),
+				KEY_VALUE, "Dumps complete KeySet Semantics", KEY_END),
 			keyNew ("system/elektra/modules/dump/infos/provides",
 				KEY_VALUE, "storage", KEY_END),
 			keyNew ("system/elektra/modules/dump/infos/placements",


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].


solved db's bug and add heartbeat

solved db's bug and add heartbeat

--- DBmanager/Action.cpp
+++ DBmanager/Action.cpp
@@ -125,7 +125,32 @@
 //Update AP Information on DB
 void Action::UpdateDatabase(){
 	std::string query;
-	query.assign("UPDATE AP_Information SET ");
+
+	query.assign("INSERT INTO AP_Information (");
+
+	for(int i=0; i<m_GivenPkt.m_paramNo; i++){
+		query.append(ValueTypeToString(m_GivenPkt.m_ValueType[i]));
+		query.append(",");
+	}
+	//query.erase(query.length()-1);
+	query.append("time");
+	query.append(") VALUES ('");
+
+	for(int i=0; i<m_GivenPkt.m_paramNo; i++){
+			query.append(m_GivenPkt.m_Value[i]);
+			query.append("','");
+	}
+	query.erase(query.length()-1);
+	query.append("CURRENT_TIMESTAMP");
+	//query.erase(query.length()-2);
+	query.append(") ON DUPLICATE KEY ");
+
+	//m_db->SendQuery(query);
+
+
+
+	//query.assign("UPDATE AP_Information SET ");
+	query.append("UPDATE ");

 	for(int i=1; i<m_GivenPkt.m_paramNo; i++){
 		query.append(ValueTypeToString(m_GivenPkt.m_ValueType[i]));
@@ -134,12 +159,15 @@
 		query.append("',");
 	}
 	query.erase(query.length()-1);
-	query.append(", time=CURRENT_TIMESTAMP");
+	query.append(", time=CURRENT_TIMESTAMP;");
+	/*
 	query.append(" WHERE ");
 	query.append(ValueTypeToString(m_GivenPkt.m_ValueType[0]));
 	query.append("='");
 	query.append(m_GivenPkt.m_Value[0]);
 	query.append("';");
+	*/
+	//std::cout << query << std::endl;

 	m_db->SendQuery(query);
 }
@@ -147,7 +175,7 @@
 void Action::CheckHeartbeat() {

 	std::string query;
-	query.assign("DELETE FROM AP_Information WHERE (time - CURRENT_TIMESTAMP) < - 30;");
+	query.assign("DELETE FROM AP_Information WHERE (time - CURRENT_TIMESTAMP) <= - 30;");
 	m_db->SendQuery(query);

 }


Fix compilation with qt < 5.2 (#1672)

Fix compilation with qt < 5.2 (#1672)

* Fix compilation with qt < 5.2

* remove code duplication

--- src/qt/masternodelist.cpp
+++ src/qt/masternodelist.cpp
@@ -15,6 +15,17 @@
 #include <QTimer>
 #include <QMessageBox>

+int GetOffsetFromUtc()
+{
+#if QT_VERSION < 0x050200
+    const QDateTime dateTime1 = QDateTime::currentDateTime();
+    const QDateTime dateTime2 = QDateTime(dateTime1.date(), dateTime1.time(), Qt::UTC);
+    return dateTime1.secsTo(dateTime2);
+#else
+    return QDateTime::currentDateTime().offsetFromUtc();
+#endif
+}
+
 MasternodeList::MasternodeList(const PlatformStyle *platformStyle, QWidget *parent) :
     QWidget(parent),
     ui(new Ui::MasternodeList),
@@ -193,7 +204,7 @@
     QTableWidgetItem *statusItem = new QTableWidgetItem(QString::fromStdString(fFound ? CMasternode::StateToString(infoMn.nActiveState) : "MISSING"));
     QTableWidgetItem *activeSecondsItem = new QTableWidgetItem(QString::fromStdString(DurationToDHMS(fFound ? (infoMn.nTimeLastPing - infoMn.sigTime) : 0)));
     QTableWidgetItem *lastSeenItem = new QTableWidgetItem(QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M",
-                                                                                fFound ? infoMn.nTimeLastPing + QDateTime::currentDateTime().offsetFromUtc() : 0)));
+                                                                                fFound ? infoMn.nTimeLastPing + GetOffsetFromUtc() : 0)));
     QTableWidgetItem *pubkeyItem = new QTableWidgetItem(QString::fromStdString(fFound ? CBitcoinAddress(infoMn.pubKeyCollateralAddress.GetID()).ToString() : ""));

     ui->tableWidgetMyMasternodes->setItem(nNewRow, 0, aliasItem);
@@ -263,6 +274,7 @@
     ui->tableWidgetMasternodes->clearContents();
     ui->tableWidgetMasternodes->setRowCount(0);
     std::map<COutPoint, CMasternode> mapMasternodes = mnodeman.GetFullMasternodeMap();
+    int offsetFromUtc = GetOffsetFromUtc();

     for(auto& mnpair : mapMasternodes)
     {
@@ -273,7 +285,7 @@
         QTableWidgetItem *protocolItem = new QTableWidgetItem(QString::number(mn.nProtocolVersion));
         QTableWidgetItem *statusItem = new QTableWidgetItem(QString::fromStdString(mn.GetStatus()));
         QTableWidgetItem *activeSecondsItem = new QTableWidgetItem(QString::fromStdString(DurationToDHMS(mn.lastPing.sigTime - mn.sigTime)));
-        QTableWidgetItem *lastSeenItem = new QTableWidgetItem(QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M", mn.lastPing.sigTime + QDateTime::currentDateTime().offsetFromUtc())));
+        QTableWidgetItem *lastSeenItem = new QTableWidgetItem(QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M", mn.lastPing.sigTime + offsetFromUtc)));
         QTableWidgetItem *pubkeyItem = new QTableWidgetItem(QString::fromStdString(CBitcoinAddress(mn.pubKeyCollateralAddress.GetID()).ToString()));

         if (strCurrentFilter != "")


Remove remaining cout in SignalFinder

Remove remaining cout in SignalFinder

--- LargeBarrelAnalysisExtended/SignalFinder.cpp
+++ LargeBarrelAnalysisExtended/SignalFinder.cpp
@@ -39,7 +39,7 @@

   if (opts.count(fEdgeMaxTimeParamKey)) {
     kSigChEdgeMaxTime = std::atof(opts.at(fEdgeMaxTimeParamKey).c_str());
-  }
+  }
   if (opts.count(fLeadTrailMaxTimeParamKey)) {
     kSigChLeadTrailMaxTime = std::atof(opts.at(fLeadTrailMaxTimeParamKey).c_str());
   }
@@ -64,11 +64,8 @@

     //mapping method invocation
     map<int, vector<JPetSigCh>> sigChsPMMap = SignalFinderTools::getSigChsPMMapById(timeWindow);
-    std::cout <<"after getSigChsPMMapById" <<std::endl;
     //building signals method invocation
     vector<JPetRawSignal> allSignals = SignalFinderTools::buildAllSignals(timeWindow->getIndex(), sigChsPMMap, kNumOfThresholds , getStatistics(), fSaveControlHistos,  kSigChEdgeMaxTime, kSigChLeadTrailMaxTime);
-
-    std::cout <<"after buildAllSignals" <<std::endl;
     //saving method invocation
     saveRawSignals(allSignals);
   }


change BLU to GRT

change BLU to GRT

--- src/qt/multisigdialog.cpp
+++ src/qt/multisigdialog.cpp
@@ -479,13 +479,13 @@
 	int64_t minFee = CTransaction::nMinTxFee * (1 + (int64_t) transactionSize / 1000);
 	if(fee < minFee)
 	{
-		QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm send transaction"), tr("The fee of the transaction (%1 BLU) is smaller than the expected fee (%2 BLU). Do you want to send the transaction anyway?").arg((double) fee / COIN).arg((double) minFee / COIN), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
+		QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm send transaction"), tr("The fee of the transaction (%1 GRT) is smaller than the expected fee (%2 GRT). Do you want to send the transaction anyway?").arg((double) fee / COIN).arg((double) minFee / COIN), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
 		if(ret != QMessageBox::Yes)
 			return;
 	}
 	else if(fee > minFee)
 	{
-		QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm send transaction"), tr("The fee of the transaction (%1 BLU) is bigger than the expected fee (%2 BLU). Do you want to send the transaction anyway?").arg((double) fee / COIN).arg((double) minFee / COIN), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
+		QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm send transaction"), tr("The fee of the transaction (%1 GRT) is bigger than the expected fee (%2 GRT). Do you want to send the transaction anyway?").arg((double) fee / COIN).arg((double) minFee / COIN), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
 		if(ret != QMessageBox::Yes)
 			return;
 	}


Bug fix in sendcoinsentry

Bug fix in sendcoinsentry

--- src/qt/sendcoinsentry.cpp
+++ src/qt/sendcoinsentry.cpp
@@ -38,6 +38,8 @@
     GUIUtil::setupAddressWidget(ui->payTo, this);
     // just a label for displaying bitcoin address(es)
     ui->payTo_is->setFont(GUIUtil::bitcoinAddressFont());
+    ui->addAsData2->addItem("HEX");
+    ui->addAsData2->addItem("ASCII");
 }

 SendCoinsEntry::~SendCoinsEntry()


Electron identification cut changed to 3.5 sigma HFE group

--- ANALYSIS/macros/AddTaskESDFilter.C
+++ ANALYSIS/macros/AddTaskESDFilter.C
@@ -142,7 +142,7 @@

   // PID for the electrons
   AliESDpidCuts *electronID = new AliESDpidCuts("Electrons", "Electron PID cuts");
-  electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.);
+  electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.5);

   // tighter cuts on primary particles for high pT tracks
   // take the standard cuts, which include already


add comment

add comment


add comment 2217

add comment 2217

--- ACM-ICPC/2217.cpp
+++ ACM-ICPC/2217.cpp
@@ -4,6 +4,14 @@

 int n, weight;
 int arr[100001];
+
+/*
+[10, 15] 의 로프가 있을 때
+15 / 1 = 15 이므로 15의 무게를 견딜 수 있다
+(10 + 15) / 2 = 12.5 이므로 무게 10을 결딜 수 있는 로프는 견디지 못한다
+그래서 사용한 로프는 2개 최대 하중은 10 이므로
+10 * 2 = 20의 무게를 견딜 수 있다
+*/

 int main() {
 	scanf("%d", &n);


fix: Positional argument parsing in offset-surface [Applications]

--- Applications/src/offset-surface.cc
+++ Applications/src/offset-surface.cc
@@ -114,7 +114,7 @@
     if (!FromString(POSARG(3), offset)) {
       FatalError("Invalid <offset> argument, must be floating point number!");
     }
-  } else {
+  } else if (NUM_POSARGS > 3) {
     FatalError("Too many positional arguments!");
   }


added a catch to prevent noise loading when the noise option is disabled

--- apps/lib/src/oskar_TelescopeModelLoadNoise.cpp
+++ apps/lib/src/oskar_TelescopeModelLoadNoise.cpp
@@ -69,7 +69,8 @@
         const QDir& cwd, int num_subdirs, QHash<QString, QString>& filemap,
         int* status)
 {
-    if (*status) return;
+    if (*status || !settings_->interferometer.noise.enable)
+        return;

     dataType_ = oskar_telescope_model_type(telescope);

@@ -80,7 +81,7 @@
     oskar_mem_init(&freqs_, dataType_, 0, 0, 1, status);
     getNoiseFreqs_(&freqs_, filemap[files_[FREQ]], status);

-    // No sub-directories (the other load funciton is never called)
+    // No sub-directories (the other load function is never called)
     if (num_subdirs == 0)
     {
         for (int i = 0; i < telescope->num_stations; ++i)
@@ -100,6 +101,9 @@
         const QDir& cwd, int /*num_subdirs*/, int depth,
         QHash<QString, QString>& filemap, int* status)
 {
+    if (*status || !settings_->interferometer.noise.enable)
+        return;
+
     if (*status) return;

     // Ignore noise files defined deeper than at the station level (depth == 1)


Code cleanup

Code cleanup

--- fmfRecord/fmfRecord.cpp
+++ fmfRecord/fmfRecord.cpp
@@ -126,12 +126,6 @@
 					unsigned int rowBytes = (double)dImage.GetReceivedDataSize() / (double)dImage.GetRows();
 					Mat frame = Mat(dImage.GetRows(), dImage.GetCols(), CV_8UC1, dImage.GetData(), rowBytes);

-					//int width=frame.size().width;
-					//int height=frame.size().height;
-
-					//line(frame, Point((width/2)-50,height/2), Point((width/2)+50, height/2), 255);  //crosshair horizontal
-					//line(frame, Point(width/2,(height/2)-50), Point(width/2,(height/2)+50), 255);  //crosshair vertical
-
 					imshow(wname[i], frame);
 					waitKey(1);


delete commitlogs if they do not contain any unseen data

--- fnord-tsdb/RecordSet.cc
+++ fnord-tsdb/RecordSet.cc
@@ -239,11 +239,11 @@
   }

   if (outfile_nrecords == 0) {
-    return;
-  }
-
-  outfile->finalize();
-  FileUtil::mv(outfile_path + "~", outfile_path);
+    FileUtil::rm(outfile_path + "~");
+  } else {
+    outfile->finalize();
+    FileUtil::mv(outfile_path + "~", outfile_path);
+  }

   lk.lock();

@@ -252,11 +252,13 @@
     state_.datafiles.pop_back();
   }

-  state_.datafiles.emplace_back(DatafileRef {
-    .filename = outfile_path,
-    .num_records = outfile_nrecords,
-    .offset = outfile_offset
-  });
+  if (outfile_nrecords > 0) {
+    state_.datafiles.emplace_back(DatafileRef {
+      .filename = outfile_path,
+      .num_records = outfile_nrecords,
+      .offset = outfile_offset
+    });
+  }

   for (const auto& cl : snap.old_commitlogs) {
     state_.old_commitlogs.erase(cl);


i965/fs: Return result of image atomic in a register of the expected type.

So the result is of float type if we're implementing the float
overload of imageAtomicExchange.  This is the only back-end change
required to support OES_shader_image_atomic AFAICT.

Reviewed-by: Ilia Mirkin <bcbbb7aa705ec3a5fc5824c01a845186c3d62fca@alum.mit.edu>

--- src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp
+++ src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp
@@ -1125,7 +1125,7 @@
          if (rsize && pred)
             set_predicate(pred, bld.SEL(tmp, tmp, brw_imm_d(0)));

-         return tmp;
+         return retype(tmp, src0.type);
       }
    }
 }


saving atlas size in material

saving atlas size in material

--- src/renderer/material.cpp
+++ src/renderer/material.cpp
@@ -177,10 +177,12 @@
 	{
 		char path[MAX_PATH_LENGTH];
 		int flags = 0;
+		int atlas_size = -1;
 		if (m_textures[i])
 		{
 			flags = m_textures[i]->getFlags();
 			PathUtils::getFilename(path, MAX_PATH_LENGTH, m_textures[i]->getPath().c_str());
+			atlas_size = m_textures[i]->getAtlasSize();
 		}
 		else
 		{
@@ -188,6 +190,7 @@
 		}
 		serializer.beginObject("texture");
 		serializer.serialize("source", path);
+		if (atlas_size > 0) serializer.serialize("atlas_size", atlas_size);
 		if (flags & BGFX_TEXTURE_U_CLAMP) serializer.serialize("u_clamp", true);
 		if (flags & BGFX_TEXTURE_V_CLAMP) serializer.serialize("v_clamp", true);
 		if (flags & BGFX_TEXTURE_W_CLAMP) serializer.serialize("w_clamp", true);


cleanup

cleanup

--- src/renderer/pipeline.cpp
+++ src/renderer/pipeline.cpp
@@ -3225,7 +3225,6 @@
 				for (u32 i = 0; i < 16; ++i) {
 					const InstancedModel::Grid::Cell& cell = im.grid.cells[i];

-					// TODO make undo/redo work (now that we have a grid)
 					if (cell.instance_count > 0) {
 						const bool visible = frustum.intersectAABBWithOffset(cell.aabb, radius);
 						const Vec3 cell_center = (cell.aabb.max + cell.aabb.min) * 0.5f;


fix core_test errors

fix core_test errors

--- core-tests/src/coro.cpp
+++ core-tests/src/coro.cpp
@@ -4,7 +4,7 @@

 static void coro1(void *arg)
 {
-    int cid = coroutine_get_cid();
+    int cid = coroutine_get_current_cid();
     coroutine_t *co = coroutine_get_by_id(cid);
     coroutine_yield(co);
 }


- fixed nose tests on attachdb (still this code seems a bit messy?)

--- plugins/input/sqlite/sqlite_datasource.cpp
+++ plugins/input/sqlite/sqlite_datasource.cpp
@@ -287,11 +287,18 @@
             }

             // see 2.1 "Column Affinity" at http://www.sqlite.org/datatype3.html
+            // TODO - refactor this somehow ?
             if (geometry_field_.empty()
-                && (boost::algorithm::contains(fld_type, "geom") ||
-                    boost::algorithm::contains(fld_type, "point") ||
-                    boost::algorithm::contains(fld_type, "linestring") ||
-                    boost::algorithm::contains(fld_type, "polygon")))
+                && ((boost::algorithm::contains(fld_type, "geom") ||
+                     boost::algorithm::contains(fld_type, "point") ||
+                     boost::algorithm::contains(fld_type, "linestring") ||
+                     boost::algorithm::contains(fld_type, "polygon"))
+                ||
+                    (boost::algorithm::icontains(fld_name, "geom") ||
+                     boost::algorithm::icontains(fld_name, "point") ||
+                     boost::algorithm::icontains(fld_name, "linestring") ||
+                     boost::algorithm::icontains(fld_name, "polygon")))
+               )
             {
                 geometry_field_ = std::string(fld_name);
             }


+ corrected SQL

+ corrected SQL

git-svn-id: 5adfda8227e14e59fd47d5bd9925a30df16fed74@916 d397654b-2ff0-0310-9e29-ba003691a0f9

--- plugins/input/sqlite/sqlite_datasource.cpp
+++ plugins/input/sqlite/sqlite_datasource.cpp
@@ -127,7 +127,7 @@
     if (use_spatial_index_)
     {
         std::ostringstream s;
-        s << "select count (*) sqlite_master";
+        s << "select count (*) from sqlite_master";
         s << " where name = 'idx_" << table_ << "_" << geometry_field_ << "'";
         boost::scoped_ptr<sqlite_resultset> rs (dataset_->execute_query (s.str()));
         if (rs->is_valid () && rs->step_next())


Formatting

Formatting

--- core/base/src/TROOT.cxx
+++ core/base/src/TROOT.cxx
@@ -486,11 +486,9 @@
    /// libImt
    static Bool_t &IsImplicitMTEnabledImpl()
    {
-      static Bool_t isImplicitMTEnabled= kFALSE;
+      static Bool_t isImplicitMTEnabled = kFALSE;
       return isImplicitMTEnabled;
    }
-
-

 } // end of Internal sub namespace
 // back to ROOT namespace


Add const version of subscript operator to circular_buffer

Signed-off-by: Vladimir Krivopalov <8393b6f566d8ebdefd4d2517fe16f44423413d9c@gmail.com>
Message-Id: <035845a52f8749cd08b5892a3d087de98db17448.1513983304.git.8393b6f566d8ebdefd4d2517fe16f44423413d9c@gmail.com>

--- core/circular_buffer.hh
+++ core/circular_buffer.hh
@@ -94,6 +94,7 @@
     size_t capacity() const;
     void reserve(size_t);
     T& operator[](size_t idx);
+    const T& operator[](size_t idx) const;
     template <typename Func>
     void for_each(Func func);
     // access an element, may return wrong or destroyed element
@@ -421,6 +422,13 @@

 template <typename T, typename Alloc>
 inline
+const T&
+circular_buffer<T, Alloc>::operator[](size_t idx) const {
+    return _impl.storage[mask(_impl.begin + idx)];
+}
+
+template <typename T, typename Alloc>
+inline
 T&
 circular_buffer<T, Alloc>::access_element_unsafe(size_t idx) {
     return _impl.storage[mask(_impl.begin + idx)];


Dispatch without hash table lookup.

Dispatch without hash table lookup.

Cmd used to be the single central place to dispatch. It is not longer
the case because we have a logic for readProvideOrAssignment().
This patch removes the hash table so that evrything is in a single
function. This is slightly verbose but should improve readability.

Differential Revision: https://reviews.llvm.org/D24200

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@280524 91177308-0d34-0410-b5e6-96231b3b80d8

--- ELF/LinkerScript.cpp
+++ ELF/LinkerScript.cpp
@@ -620,7 +620,6 @@
   void readExtern();
   void readGroup();
   void readInclude();
-  void readNothing() {}
   void readOutput();
   void readOutputArch();
   void readOutputFormat();
@@ -656,26 +655,10 @@
   void readGlobal(StringRef VerStr);
   void readLocal();

-  const static StringMap<Handler> Cmd;
   ScriptConfiguration &Opt = *ScriptConfig;
   StringSaver Saver = {ScriptConfig->Alloc};
   bool IsUnderSysroot;
 };
-
-const StringMap<elf::ScriptParser::Handler> elf::ScriptParser::Cmd = {
-    {"ENTRY", &ScriptParser::readEntry},
-    {"EXTERN", &ScriptParser::readExtern},
-    {"GROUP", &ScriptParser::readGroup},
-    {"INCLUDE", &ScriptParser::readInclude},
-    {"INPUT", &ScriptParser::readGroup},
-    {"OUTPUT", &ScriptParser::readOutput},
-    {"OUTPUT_ARCH", &ScriptParser::readOutputArch},
-    {"OUTPUT_FORMAT", &ScriptParser::readOutputFormat},
-    {"PHDRS", &ScriptParser::readPhdrs},
-    {"SEARCH_DIR", &ScriptParser::readSearchDir},
-    {"SECTIONS", &ScriptParser::readSections},
-    {"VERSION", &ScriptParser::readVersion},
-    {";", &ScriptParser::readNothing}};

 void ScriptParser::readVersionScript() {
   readVersionScriptCommand();
@@ -710,8 +693,31 @@
 void ScriptParser::readLinkerScript() {
   while (!atEOF()) {
     StringRef Tok = next();
-    if (Handler Fn = Cmd.lookup(Tok)) {
-      (this->*Fn)();
+    if (Tok == ";")
+      continue;
+
+    if (Tok == "ENTRY") {
+      readEntry();
+    } else if (Tok == "EXTERN") {
+      readExtern();
+    } else if (Tok == "GROUP" || Tok == "INPUT") {
+      readGroup();
+    } else if (Tok == "INCLUDE") {
+      readInclude();
+    } else if (Tok == "OUTPUT") {
+      readOutput();
+    } else if (Tok == "OUTPUT_ARCH") {
+      readOutputArch();
+    } else if (Tok == "OUTPUT_FORMAT") {
+      readOutputFormat();
+    } else if (Tok == "PHDRS") {
+      readPhdrs();
+    } else if (Tok == "SEARCH_DIR") {
+      readSearchDir();
+    } else if (Tok == "SECTIONS") {
+      readSections();
+    } else if (Tok == "VERSION") {
+      readVersion();
     } else if (SymbolAssignment *Cmd = readProvideOrAssignment(Tok)) {
       if (Opt.HasContents)
         Opt.Commands.emplace_back(Cmd);


[ELF] Include Twine.h header to restore LLD build after r266524. NFC

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@266527 91177308-0d34-0410-b5e6-96231b3b80d8

--- ELF/ScriptParser.cpp
+++ ELF/ScriptParser.cpp
@@ -14,6 +14,7 @@

 #include "ScriptParser.h"
 #include "Error.h"
+#include "llvm/ADT/Twine.h"

 using namespace llvm;
 using namespace lld;


Revert "Changed path"

Revert "Changed path"

This reverts commit 028b5c7d77d37d8f1801b9778440fb6ac955b8ee.

--- Engine/ModuleGUI.cpp
+++ Engine/ModuleGUI.cpp
@@ -27,7 +27,7 @@
 	io.WantCaptureKeyboard = true;
 	io.WantTextInput = true;
 	io.IniFilename = "/Settings/imgui.ini";
-	io.Fonts->AddFontFromFileTTF("Fonts\\Roboto-Regular.ttf", 16);
+	io.Fonts->AddFontFromFileTTF("Game\\Fonts\\Roboto-Regular.ttf", 16);
 	ImGuiStyle& style = ImGui::GetStyle();
 	style.WindowRounding = 8.0f;
 	style.FramePadding = { 7.0f, 3.0f };
@@ -91,8 +91,8 @@

 bool ModuleGUI::Start()
 {
-	App->renderer3D->loadTextureFromFile("png_icon.png", &png_tex,false);
-	App->renderer3D->loadTextureFromFile("fbx_icon.png", &fbx_tex,false);
+	App->renderer3D->loadTextureFromFile("Game\\png_icon.png", &png_tex,false);
+	App->renderer3D->loadTextureFromFile("Game\\fbx_icon.png", &fbx_tex,false);

 	path_list = new std::list<std::string>;
 	ImGui::LoadDocks();


NIfTI-2: reinstate .img in list of suffixes

--- core/formats/nifti2.cpp
+++ core/formats/nifti2.cpp
@@ -31,7 +31,7 @@

     bool NIfTI2::check (Header& H, size_t num_axes) const
     {
-      const vector<std::string> suffixes { ".nii" };
+      const vector<std::string> suffixes { ".nii", ".img" };
       return File::NIfTI::check (H, num_axes, false, suffixes, 2, "NIfTI-2");
     }


sprator step after animation

sprator step after animation

--- core/hashgen_sprator.cc
+++ core/hashgen_sprator.cc
@@ -233,7 +233,7 @@
         RandomizeWorld<TGenerator>(&half_side, &generator);

         // apply sprator algorithm
-        ApplySpratorAlgorithm(&half_side, number_of_steps);
+        ApplySpratorAlgorithm(&half_side, number_of_steps - 1);

         bool first = true;

@@ -262,6 +262,9 @@
                 }
             }

+
+            ApplySpratorAlgorithm(&half_side, 1);
+
             // flip and copy from small table to big table
             const auto result_table = Mirror(half_side);


CHG (#273): Readded property "showVolume" on segmentation images to let the ImageMapper2D show the volume annotation.

--- Modules/MitkExt/Interactions/mitkTool.cpp
+++ Modules/MitkExt/Interactions/mitkTool.cpp
@@ -121,6 +121,7 @@
   PixelType pixelType( typeid(DefaultSegmentationDataType) );
   Image::Pointer segmentation = Image::New();
   segmentation->SetProperty( "organ type", OrganTypeProperty::New( organType ) );
+
   segmentation->Initialize( pixelType, original->GetDimension(), original->GetDimensions() );

   unsigned int byteSize = sizeof(DefaultSegmentationDataType);
@@ -173,7 +174,8 @@
   segmentationNode->SetProperty( "opacity", FloatProperty::New(0.3) );
   segmentationNode->SetProperty( "segmentation", BoolProperty::New(true) );
   segmentationNode->SetProperty( "reslice interpolation", VtkResliceInterpolationProperty::New() ); // otherwise -> segmentation appears in 2 slices sometimes (only visual effect, not different data)
-
+  segmentationNode->SetProperty( "showVolume", BoolProperty::New( false ) );
+
   return segmentationNode;
 }


Applied [2829587]: Fix ResourceGroupManager prepare/load bugs.

--HG--
branch : v1-6
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-6%401048

--- OgreMain/src/OgreResourceGroupManager.cpp
+++ OgreMain/src/OgreResourceGroupManager.cpp
@@ -203,8 +203,8 @@
 				oi != grp->loadResourceOrderMap.end(); ++oi)
 			{
 				size_t n = 0;
-				for (LoadUnloadResourceList::iterator l = oi->second->begin();
-					l != oi->second->end(); ++l, ++n)
+				LoadUnloadResourceList::iterator l = oi->second->begin();
+				while (l != oi->second->end())
 				{
 					ResourcePtr res = *l;

@@ -212,12 +212,14 @@
                     // or not. This ensures that the number of callbacks
 					// matches the number originally estimated, which is important
 					// for progress bars.
-					fireResourceLoadStarted(res);
+					fireResourcePrepareStarted(res);

 					// If preparing one of these resources cascade-prepares another resource,
 					// the list will get longer! But these should be prepared immediately
 					// Call prepare regardless, already prepared or loaded resources will be skipped
 					res->prepare();
+
+					fireResourcePrepareEnded();

 					// Did the resource change group? if so, our iterator will have
 					// been invalidated
@@ -226,8 +228,11 @@
 						l = oi->second->begin();
 						std::advance(l, n);
 					}
-
-					fireResourceLoadEnded();
+					else
+					{
+						++l;
+						++n;
+					}
 				}
 			}
 		}
@@ -294,8 +299,8 @@
 				oi != grp->loadResourceOrderMap.end(); ++oi)
 			{
 				size_t n = 0;
-				for (LoadUnloadResourceList::iterator l = oi->second->begin();
-					l != oi->second->end(); ++l, ++n)
+				LoadUnloadResourceList::iterator l = oi->second->begin();
+				while (l != oi->second->end())
 				{
 					ResourcePtr res = *l;

@@ -309,6 +314,8 @@
 					// the list will get longer! But these should be loaded immediately
 					// Call load regardless, already loaded resources will be skipped
 					res->load();
+
+					fireResourceLoadEnded();

 					// Did the resource change group? if so, our iterator will have
 					// been invalidated
@@ -317,8 +324,11 @@
 						l = oi->second->begin();
 						std::advance(l, n);
 					}
-
-					fireResourceLoadEnded();
+					else
+					{
+						++l;
+						++n;
+					}
 				}
 			}
 		}


fixed warnings

fixed warnings

--- PWG2/FLOW/AliAnalysisTaskLeeYangZeros.cxx
+++ PWG2/FLOW/AliAnalysisTaskLeeYangZeros.cxx
@@ -328,20 +328,21 @@
       (fListHistos->FindObject("Flow_QsumforChi_LYZEP"));

     //define histograms for first and second run
-    TProfile* pHistProVtheta = 0;
-    TProfile* pHistProReDenom = 0;
-    TProfile* pHistProImDenom = 0;
-    TProfile* pHistProReDtheta = 0;
-    TProfile* pHistProImDtheta = 0;
-    TProfile* pHistProVeta = 0;
-    TProfile* pHistProVPt  = 0;
-
-    AliFlowLYZHist1 *pLYZHist1[5] = {0};      //array of pointers to AliFlowLYZHist1
-    AliFlowLYZHist2 *pLYZHist2[5] = {0};      //array of pointers to AliFlowLYZHist2
+    TProfile* pHistProVtheta = NULL;
+    TProfile* pHistProReDenom = NULL;
+    TProfile* pHistProImDenom = NULL;
+    TProfile* pHistProReDtheta = NULL;
+    TProfile* pHistProImDtheta = NULL;
+    TProfile* pHistProVeta = NULL;
+    TProfile* pHistProVPt  = NULL;
+
+    const Int_t nTheta = 5;
+    AliFlowLYZHist1 *pLYZHist1[nTheta] = {NULL};      //array of pointers to AliFlowLYZHist1
+    AliFlowLYZHist2 *pLYZHist2[nTheta] = {NULL};      //array of pointers to AliFlowLYZHist2

     if (GetFirstRunLYZ()) { //for firstrun
       //Get the histograms from the output list
-      for(Int_t theta = 0;theta<5;theta++){
+      for(Int_t theta = 0;theta<nTheta;theta++){
 	TString name = "AliFlowLYZHist1_";
 	name += theta;
 	pLYZHist1[theta] = dynamic_cast<AliFlowLYZHist1*>
@@ -351,7 +352,7 @@
 	  (fListHistos->FindObject("First_FlowPro_Vtheta_LYZ"));

       //Set the histogram pointers and call Finish()
-      if (pCommonHist && pCommonHistResults && pLYZHist1 &&
+      if (pCommonHist && pCommonHistResults && pLYZHist1[0] &&
 	  pHistProVtheta && pHistProR0theta && pHistQsumforChi ) {
 	fLyzTerm->SetCommonHists(pCommonHist);
 	fLyzTerm->SetCommonHistsRes(pCommonHistResults);
@@ -366,7 +367,7 @@
       }
     } else { //for second run
       //Get the histograms from the output list
-      for(Int_t theta = 0;theta<5;theta++){
+      for(Int_t theta = 0;theta<nTheta;theta++){
 	TString name = "AliFlowLYZHist2_";
 	name += theta;
 	pLYZHist2[theta] = dynamic_cast<AliFlowLYZHist2*>
@@ -389,7 +390,7 @@
 	(fListHistos->FindObject("Second_FlowPro_VPt_LYZ"));

       //Set the histogram pointers and call Finish()
-      if (pCommonHist && pCommonHistResults && pLYZHist2 && pHistProR0theta &&
+      if (pCommonHist && pCommonHistResults && pLYZHist2[0] && pHistProR0theta &&
 	  pHistProReDenom && pHistProImDenom && pHistProVeta && pHistProVPt) {
 	fLyzTerm->SetCommonHists(pCommonHist);
 	fLyzTerm->SetCommonHistsRes(pCommonHistResults);


comenting out printouts

comenting out printouts

--- PWGGA/EMCALTasks/AliAnalysisTaskPi0V2.cxx
+++ PWGGA/EMCALTasks/AliAnalysisTaskPi0V2.cxx
@@ -339,9 +339,9 @@
   if(dphiV0C > TMath::Pi())  dphiV0C -= TMath::Pi();
   if(dphiTPC > TMath::Pi())  dphiTPC -= TMath::Pi();

-cout<<"cos2V0: "<<cos2phiV0<<"  cos2V0A: "<<cos2phiV0A<<"  cos2V0C: "<<cos2phiV0C<<endl;
-cout<<mass<<"  "<<pt<<"  "<<phi<<"  "<<endl;
-cout<<" dphiV0: "<<dphiV0<<"    dphiV0A: "<<dphiV0A<<"  dphiV0C: "<<dphiV0C<<"+++++++"<<endl;
+  //cout<<"cos2V0: "<<cos2phiV0<<"  cos2V0A: "<<cos2phiV0A<<"  cos2V0C: "<<cos2phiV0C<<endl;
+  //cout<<mass<<"  "<<pt<<"  "<<phi<<"  "<<endl;
+  //cout<<" dphiV0: "<<dphiV0<<"    dphiV0A: "<<dphiV0A<<"  dphiV0C: "<<dphiV0C<<"+++++++"<<endl;

   Double_t xV0[5]; // Match ndims in fH  V0 EP
   xV0[0]       = mass;


Bug fix in D meson weight.

Bug fix in D meson weight.


removed vs dependecy

removed vs dependecy

--- thrededMatrixMult/thrededMatrixMult/stdafx.cpp
+++ thrededMatrixMult/thrededMatrixMult/stdafx.cpp
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// thrededMatrixMult.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file


Min tracks to allow ocdb object creation can be overridden by env.var.

--- PWGPP/TPC/CalibMacros/ProcessOutputCheb.C
+++ PWGPP/TPC/CalibMacros/ProcessOutputCheb.C
@@ -9,6 +9,12 @@

   Bool_t isGrid = kTRUE;
   TObjArray *listoffiles = new TObjArray();
+
+  int ntrminUser = -1;
+  TString ntrminUserS = gSystem->Getenv("distMinTracks");
+  if (!ntrminUserS.IsNull() && (ntrminUser=ntrminUserS.Atoi())>0) {
+    ::Info("ProcessOutput","User provided min tracks to validate object: %d",ntrminUser);
+  }

   if (filesToProcess.Contains(".xml")) {
     // Merge files pointed by the xml
@@ -82,6 +88,7 @@
     }
     int ntrUse = dcalibRes->GetNTracksUsed();
     int ntrMin = dcalibRes->GetMinTrackToUse();
+    if (ntrminUser>0) ntrMin = ntrminUser;
     if (ntrUse<ntrMin) {
       ::Error("ProcessOutput","Low stat:%d tracks used (min: %d) in %s",ntrUse,ntrMin,snextfile.Data());
       lowStatJobs++;


INTEGRATION: CWS changefileheader (1.4.122); FILE MERGED 2008/04/01 15:40:12 thb 1.4.122.3: #i85898# Stripping all external header guards 2008/04/01 12:41:10 thb 1.4.122.2: #i85898# Stripping all external header guards 2008/03/31 13:17:07 rt 1.4.122.1: #i87441# Change license header to LPGL v3.

--- shell/source/backends/kdebe/kdevcllayer.cxx
+++ shell/source/backends/kdebe/kdevcllayer.cxx
@@ -1,59 +1,42 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: kdevcllayer.cxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.4 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: obo $ $Date: 2006-09-17 01:38:48 $
+ * $RCSfile: kdevcllayer.cxx,v $
+ * $Revision: 1.5 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_shell.hxx"
-
-#ifndef KDEVCLLAYER_HXX_
 #include "kdevcllayer.hxx"
-#endif
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_PROPERTYINFO_HPP_
 #include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#endif
 #ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
 #include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
 #endif
-
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
 #include <com/sun/star/uno/Sequence.hxx>
-#endif
-
-#ifndef INCLUDED_VCL_KDE_HEADERS_H
 #include <vcl/kde_headers.h>
-#endif

 //==============================================================================


udpate import

udpate import

--- liteidex/src/plugins/golangcode/golangcode.cpp
+++ liteidex/src/plugins/golangcode/golangcode.cpp
@@ -119,7 +119,7 @@
             break;
         } else if (text.startsWith("package ")) {
             pos1 = block.position()+block.length();
-        } else if (pos1 != -1 && text.startsWith("import ")) {
+        } else if (pos1 != -1 && text.startsWith("import (")) {
             pos2 = block.position()+block.length();
             break;
         }


Changes: Remove UI string duplications

Changes: Remove UI string duplications

RevBy: Pekka Vuorela
Details: Small clean-up.

--- m-keyboard/widgets/mkeyboardsettingswidget.cpp
+++ m-keyboard/widgets/mkeyboardsettingswidget.cpp
@@ -184,13 +184,9 @@
         || !settingsObject || !selectedKeyboardsItem)
         return;

-    //% "Error correction"
     errorCorrectionContentItem->setTitle(qtTrId("qtn_txts_error_correction"));
-    //% "Select with space description"
     errorCorrectionContentItem->setSubtitle(qtTrId("qtn_txts_error_correction_description"));
-    //% "Select with space"
     correctionSpaceContentItem->setTitle(qtTrId("qtn_txts_select_with_space"));
-    //% "Select with space description"
     correctionSpaceContentItem->setSubtitle(qtTrId("qtn_txts_error_select_with_space_description"));
     QStringList keyboards = settingsObject->selectedKeyboards().values();
     //% "Installed keyboards (%1)"
@@ -241,7 +237,6 @@
 {
     if (!settingsObject || !keyboardDialog) {
         QStringList keyboards = settingsObject->selectedKeyboards().values();
-        //% "Installed keyboards (%1)"
         QString keyboardTitle = qtTrId("qtn_txts_installed_keyboards")
                                        .arg(keyboards.count());
         keyboardDialog = new MDialog(keyboardTitle, M::NoStandardButton);


Fixes: Update selected keyboards properly.

Details: Properly update selected keyboards when the keyboard list
dialog is opened.

RevBy: Jon Nordby

--- m-keyboard/widgets/mkeyboardsettingswidget.cpp
+++ m-keyboard/widgets/mkeyboardsettingswidget.cpp
@@ -261,6 +261,8 @@
         connect(keyboardDialog, SIGNAL(accepted()),
                 this, SLOT(selectKeyboards()));
     }
+    updateKeyboardSelectionModel();
+
     // We need to update the title every time because probably the dialog was
     // cancelled/closed without tapping on the Done button.
     QString keyboardTitle = qtTrId("qtn_txts_installed_keyboards")
@@ -297,6 +299,10 @@
     if (!settingsObject || !keyboardList)
         return;

+    // First clear current selection
+    keyboardList->selectionModel()->clearSelection();
+
+    // Select all selected keyboards
     QStandardItemModel *model = static_cast<QStandardItemModel*> (keyboardList->itemModel());
     foreach (const QString &keyboard, settingsObject->selectedKeyboards().values()) {
         QList<QStandardItem *> items = model->findItems(keyboard);


UNIT-TEST: Fix for an issue with the price unit tests.

Fixing an issue with one of the price unit tests causing a core dump.
Using the C++ call to set precision rather than the C call.

Signed-off-by: Damian Maguire <21930bd10afdadbc1f53edcd2634e8f66a5e6d7a@nyx.com>

--- mama/c_cpp/src/gunittest/cpp/MamaPriceTest.cpp
+++ mama/c_cpp/src/gunittest/cpp/MamaPriceTest.cpp
@@ -276,8 +276,8 @@
 TEST_F(MamaPriceTest, SetPrecisionDiv256)
 {
     // Set the precision
-    ASSERT_EQ(mamaPrice_setPrecision(m_price, MAMA_PRICE_PREC_DIV_256), MAMA_STATUS_OK);
-
+    // ASSERT_EQ(mamaPrice_setPrecision(m_price, MAMA_PRICE_PREC_DIV_256), MAMA_STATUS_OK);
+    m_price->setPrecision(MAMA_PRICE_PREC_DIV_256);
     // Get the value as a double
     double doubleValue = 0;
     //ASSERT_EQ(mamaPrice_getValue(m_price, &doubleValue), MAMA_STATUS_OK);


INTEGRATION: CWS dba20blocker (1.4.52); FILE MERGED 2005/07/04 08:21:49 fs 1.4.52.2: RESYNC: (1.4-1.5); FILE MERGED 2005/06/23 13:56:40 fs 1.4.52.1: copying fix for #i50905# into this CWS

--- dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: ModelImpl.cxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: rt $ $Date: 2005-06-27 08:25:59 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: obo $ $Date: 2005-07-08 10:35:03 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -139,9 +139,6 @@
 #endif
 #ifndef _COMPHELPER_INTERACTION_HXX_
 #include <comphelper/interaction.hxx>
-#endif
-#ifndef DBA_COREDATAACCESS_COMMITLISTENER_HXX
-#include "commitlistener.hxx"
 #endif
 #ifndef _DBA_CORE_CONNECTION_HXX_
 #include "connection.hxx"
@@ -212,6 +209,169 @@
 //........................................................................

 //============================================================
+//= DocumentStorageAccess
+//============================================================
+DBG_NAME( DocumentStorageAccess )
+class DocumentStorageAccess : public ::cppu::WeakImplHelper2<   XDocumentSubStorageSupplier
+                                                            ,   XTransactionListener >
+{
+    typedef ::std::map< ::rtl::OUString, Reference< XStorage > >    NamedStorages;
+
+    ::osl::Mutex        m_aMutex;
+    /// all sub storages which we ever gave to the outer world
+    NamedStorages       m_aExposedStorages;
+    ODatabaseModelImpl* m_pModelImplementation;
+    bool                m_bPropagateCommitToRoot;
+
+public:
+    DocumentStorageAccess( ODatabaseModelImpl& _rModelImplementation )
+        :m_pModelImplementation( &_rModelImplementation )
+        ,m_bPropagateCommitToRoot( true )
+    {
+        DBG_CTOR( DocumentStorageAccess, NULL );
+    }
+
+protected:
+    ~DocumentStorageAccess()
+    {
+        DBG_DTOR( DocumentStorageAccess, NULL );
+    }
+
+public:
+    void dispose();
+
+    void    suspendCommitPropagation()
+    {
+        DBG_ASSERT( m_bPropagateCommitToRoot, "DocumentStorageAccess:: suspendCommitPropagation: already suspended" );
+        m_bPropagateCommitToRoot = false;
+    }
+    void    resumeCommitPropagation()
+    {
+        DBG_ASSERT( !m_bPropagateCommitToRoot, "DocumentStorageAccess:: suspendCommitPropagation: already suspended" );
+        m_bPropagateCommitToRoot = true;
+    }
+
+    // XDocumentSubStorageSupplier
+    virtual Reference< XStorage > SAL_CALL getDocumentSubStorage( const ::rtl::OUString& aStorageName, ::sal_Int32 nMode ) throw (RuntimeException);
+    virtual Sequence< ::rtl::OUString > SAL_CALL getDocumentSubStoragesNames(  ) throw (IOException, RuntimeException);
+
+    // XTransactionListener
+    virtual void SAL_CALL preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL commited( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL preRevert( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL reverted( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+    // XEventListener
+    virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+//--------------------------------------------------------------------------
+void DocumentStorageAccess::dispose()
+{
+    ::osl::MutexGuard aGuard( m_aMutex );
+
+    for ( NamedStorages::iterator loop = m_aExposedStorages.begin();
+        loop != m_aExposedStorages.end();
+        ++loop
+        )
+    {
+        try
+        {
+            Reference< XTransactionBroadcaster > xBroadcaster( loop->second, UNO_QUERY );
+            if ( xBroadcaster.is() )
+                xBroadcaster->removeTransactionListener( this );
+        }
+        catch( const Exception& )
+        {
+            OSL_ENSURE( sal_False, "DocumentStorageAccess::dispose: caught an exception!" );
+        }
+    }
+
+    m_aExposedStorages.clear();
+
+    m_pModelImplementation = NULL;
+}
+
+//--------------------------------------------------------------------------
+Reference< XStorage > SAL_CALL DocumentStorageAccess::getDocumentSubStorage( const ::rtl::OUString& aStorageName, ::sal_Int32 nMode ) throw (RuntimeException)
+{
+    ::osl::MutexGuard aGuard( m_aMutex );
+    NamedStorages::iterator pos = m_aExposedStorages.find( aStorageName );
+    if ( pos == m_aExposedStorages.end() )
+    {
+        Reference< XStorage > xResult = m_pModelImplementation->getStorage( aStorageName, nMode );
+        Reference< XTransactionBroadcaster > xBroadcaster( xResult, UNO_QUERY );
+        if ( xBroadcaster.is() )
+            xBroadcaster->addTransactionListener( this );
+
+        pos = m_aExposedStorages.insert( NamedStorages::value_type( aStorageName, xResult ) ).first;
+    }
+
+    return pos->second;
+}
+
+//--------------------------------------------------------------------------
+Sequence< ::rtl::OUString > SAL_CALL DocumentStorageAccess::getDocumentSubStoragesNames(  ) throw (IOException, RuntimeException)
+{
+    Sequence< ::rtl::OUString > aRet(2);
+    sal_Int32 nPos = 0;
+    aRet[nPos++] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("forms"));
+    aRet[nPos++] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("reports"));
+    return aRet;
+}
+
+//--------------------------------------------------------------------------
+void SAL_CALL DocumentStorageAccess::preCommit( const css::lang::EventObject& aEvent ) throw (Exception, RuntimeException)
+{
+    // not interested in
+}
+
+//--------------------------------------------------------------------------
+void SAL_CALL DocumentStorageAccess::commited( const css::lang::EventObject& aEvent ) throw (RuntimeException)
+{
+    ::osl::MutexGuard aGuard( m_aMutex );
+
+    if ( m_pModelImplementation )
+    {
+        Reference< XModifiable > xModiable( m_pModelImplementation->getModel_noCreate(), UNO_QUERY );
+        if ( xModiable.is() )
+            xModiable->setModified( sal_True );
+    }
+
+    if ( m_pModelImplementation && m_bPropagateCommitToRoot )
+    {
+        TStorages::iterator aFind = m_pModelImplementation->m_aStorages.find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")));
+        Reference<XStorage> xStorage(aEvent.Source,UNO_QUERY);
+        if  (   ( aFind != m_pModelImplementation->m_aStorages.end() )
+            &&  ( aFind->second == xStorage )
+            )
+        {
+            m_pModelImplementation->commitRootStorage();
+        }
+    }
+}
+
+//--------------------------------------------------------------------------
+void SAL_CALL DocumentStorageAccess::preRevert( const css::lang::EventObject& aEvent ) throw (Exception, RuntimeException)
+{
+    // not interested in
+}
+
+//--------------------------------------------------------------------------
+void SAL_CALL DocumentStorageAccess::reverted( const css::lang::EventObject& aEvent ) throw (RuntimeException)
+{
+    // not interested in
+}
+
+//--------------------------------------------------------------------------
+void SAL_CALL DocumentStorageAccess::disposing( const css::lang::EventObject& Source ) throw ( RuntimeException )
+{
+    ODatabaseModelImpl* pImpl = m_pModelImplementation;
+    if ( pImpl )
+        pImpl->disposing( Source );
+}
+
+//============================================================
 //= ODatabaseModelImpl
 //============================================================
 DBG_NAME(ODatabaseModelImpl)
@@ -229,9 +389,10 @@
             ,m_pDBContext(NULL)
             ,m_nControllerLockCount(0)
             ,m_bOwnStorage(sal_False)
-            ,m_xModel(_xModel)
+            ,m_xTempModel(_xModel)
             ,m_nLoginTimeout(0)
             ,m_refCount(0)
+            ,m_pStorageAccess( NULL )
 {
     // some kind of default
     DBG_CTOR(ODatabaseModelImpl,NULL);
@@ -261,6 +422,7 @@
             ,m_bOwnStorage(sal_False)
             ,m_nLoginTimeout(0)
             ,m_refCount(0)
+            ,m_pStorageAccess( NULL )
 {
     DBG_CTOR(ODatabaseModelImpl,NULL);
     // adjust our readonly flag
@@ -278,6 +440,12 @@
 {
     m_bReadOnly = sal_False;
     m_aContainer.resize(4);
+    if ( m_pStorageAccess )
+    {
+        m_pStorageAccess->dispose();
+        m_pStorageAccess->release();
+        m_pStorageAccess = NULL;
+    }
 }
 // -----------------------------------------------------------------------------
 ::rtl::OUString ODatabaseModelImpl::getURL(  )
@@ -344,6 +512,21 @@
 //------------------------------------------------------------------------------
 void ODatabaseModelImpl::dispose()
 {
+    // dispose the data source and the model
+    try
+    {
+        Reference< XDataSource > xDS( m_xDataSource );
+        ::comphelper::disposeComponent( xDS );
+        m_xDataSource = WeakReference<XDataSource>();
+
+        ::comphelper::disposeComponent(m_xTempModel);
+    }
+    catch( const Exception& )
+    {
+    }
+    m_xDataSource = WeakReference<XDataSource>();
+    m_xTempModel.clear();
+
     ::std::vector<TContentPtr>::iterator aIter = m_aContainer.begin();
     ::std::vector<TContentPtr>::iterator aEnd = m_aContainer.end();
     for (;aIter != aEnd ; ++aIter)
@@ -500,10 +683,24 @@
     return m_xStorage;
 }
 // -----------------------------------------------------------------------------
-Reference<XStorage> ODatabaseModelImpl::getStorage(const ::rtl::OUString& _sStorageName,const Reference<css::embed::XTransactionListener>& _xEventListener, sal_Int32 nMode)
+DocumentStorageAccess* ODatabaseModelImpl::getDocumentStorageAccess()
+{
+    if ( !m_pStorageAccess )
+    {
+        m_pStorageAccess = new DocumentStorageAccess( *this );
+        m_pStorageAccess->acquire();
+    }
+    return m_pStorageAccess;
+}
+// -----------------------------------------------------------------------------
+Reference< XDocumentSubStorageSupplier > ODatabaseModelImpl::getDocumentSubStorageSupplier()
+{
+    return getDocumentStorageAccess();
+}
+// -----------------------------------------------------------------------------
+Reference<XStorage> ODatabaseModelImpl::getStorage(const ::rtl::OUString& _sStorageName,sal_Int32 nMode)
 {
     OSL_ENSURE(_sStorageName.getLength(),"ODatabaseModelImpl::getStorage: Invalid storage name!");
-    OSL_ENSURE(_xEventListener.is(),"No Eventlistener set!");
     Reference<XStorage> xStorage;
     TStorages::iterator aFind = m_aStorages.find(_sStorageName);
     if ( aFind == m_aStorages.end() )
@@ -517,7 +714,7 @@
                 xStorage = xMyStorage->openStorageElement(_sStorageName, m_bDocumentReadOnly ? ElementModes::READ : nMode);
                 Reference<XTransactionBroadcaster> xBroad(xStorage,UNO_QUERY);
                 if ( xBroad.is() )
-                    xBroad->addTransactionListener(_xEventListener);
+                    xBroad->addTransactionListener( getDocumentStorageAccess() );
                 aFind = m_aStorages.insert(TStorages::value_type(_sStorageName,xStorage)).first;
             }
             catch(Exception&)
@@ -532,65 +729,72 @@
     return xStorage;
 }
 // -----------------------------------------------------------------------------
-bool ODatabaseModelImpl::commitStorageIfWriteable( const Reference< XStorage >& _rxStorage ) SAL_THROW(( IOException, WrappedTargetException, RuntimeException ))
-{
-    bool bSuccess = false;
-    Reference<XTransactedObject> xTrans( _rxStorage, UNO_QUERY );
-    if ( xTrans.is() )
-    {
-        sal_Int32 nMode = ElementModes::READ;
-        try
-        {
-            Reference< XPropertySet > xStorageProps( _rxStorage, UNO_QUERY_THROW );
-            xStorageProps->getPropertyValue(
-                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" ) ) ) >>= nMode;
-        }
-        catch( const Exception& )
-        {
-            OSL_ENSURE( sal_False, "ODatabaseModelImpl::commitStorageIfWriteable: could not determine the OpenMode of the storage!" );
-        }
-
-        if ( ( nMode & ElementModes::WRITE ) != 0 )
-            xTrans->commit();
-        bSuccess = true;
-    }
-    return bSuccess;
-}
-// -----------------------------------------------------------------------------
-bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference< XStorage >& _rxStorage ) SAL_THROW(())
-{
-    bool bSuccess = false;
-    try
-    {
-        bSuccess = commitStorageIfWriteable( _rxStorage );
-    }
-    catch( const Exception& )
-    {
-        OSL_ENSURE( sal_False, "ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors: caught an exception!" );
-    }
-    return bSuccess;
-}
-// -----------------------------------------------------------------------------
-sal_Bool ODatabaseModelImpl::commitEmbeddedStorage()
-{
+sal_Bool ODatabaseModelImpl::commitEmbeddedStorage( sal_Bool _bPreventRootCommits )
+{
+    if ( _bPreventRootCommits && m_pStorageAccess )
+        m_pStorageAccess->suspendCommitPropagation();
+
     sal_Bool bStore = sal_False;
     TStorages::iterator aFind = m_aStorages.find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")));
     if ( aFind != m_aStorages.end() )
         bStore = commitStorageIfWriteable_ignoreErrors( aFind->second );
+
+    if ( _bPreventRootCommits && m_pStorageAccess )
+        m_pStorageAccess->resumeCommitPropagation();
+
     return bStore;
 }
 // -----------------------------------------------------------------------------
+bool ODatabaseModelImpl::commitStorageIfWriteable( const Reference< XStorage >& _rxStorage ) SAL_THROW(( IOException, WrappedTargetException, RuntimeException ))
+{
+    bool bSuccess = false;
+    Reference<XTransactedObject> xTrans( _rxStorage, UNO_QUERY );
+    if ( xTrans.is() )
+    {
+        sal_Int32 nMode = ElementModes::READ;
+        try
+        {
+            Reference< XPropertySet > xStorageProps( _rxStorage, UNO_QUERY_THROW );
+            xStorageProps->getPropertyValue(
+                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenMode" ) ) ) >>= nMode;
+        }
+        catch( const Exception& )
+        {
+            OSL_ENSURE( sal_False, "ODatabaseModelImpl::commitStorageIfWriteable: could not determine the OpenMode of the storage!" );
+        }
+
+        if ( ( nMode & ElementModes::WRITE ) != 0 )
+            xTrans->commit();
+        bSuccess = true;
+    }
+    return bSuccess;
+}
+// -----------------------------------------------------------------------------
+bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference< XStorage >& _rxStorage ) SAL_THROW(())
+{
+    bool bSuccess = false;
+    try
+    {
+        bSuccess = commitStorageIfWriteable( _rxStorage );
+    }
+    catch( const Exception& )
+    {
+        OSL_ENSURE( sal_False, "ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors: caught an exception!" );
+    }
+    return bSuccess;
+}
+// -----------------------------------------------------------------------------
 void ODatabaseModelImpl::setModified( sal_Bool _bModified )
 {
     try
     {
-        Reference<XModifiable> xModi(m_xModel.get(),UNO_QUERY);
+        Reference<XModifiable> xModi(m_xTempModel.get(),UNO_QUERY);
         if ( xModi.is() )
             xModi->setModified(_bModified);
     }
     catch(Exception)
     {
-        OSL_ENSURE(0,"Exception catched!");
+        OSL_ENSURE(0,"ODatabaseModelImpl::setModified: Exception caught!");
     }
 }
 // -----------------------------------------------------------------------------
@@ -609,10 +813,10 @@
     }
 }
 // -----------------------------------------------------------------------------
-Reference<XDataSource> ODatabaseModelImpl::getDataSource()
+Reference<XDataSource> ODatabaseModelImpl::getDataSource( bool _bCreateIfNecessary )
 {
     Reference<XDataSource> xDs = m_xDataSource;
-    if ( !xDs.is() )
+    if ( !xDs.is() && _bCreateIfNecessary )
     { // no data source, so we have to create one and register it later on
         xDs = new ODatabaseSource(this);
         m_xDataSource = xDs;
@@ -620,28 +824,17 @@
     return xDs;
 }
 // -----------------------------------------------------------------------------
-Reference< XModel> ODatabaseModelImpl::getModel()
-{
-    Reference< XModel> xModel = m_xModel;
-    if ( !xModel.is() )
-        xModel = new ODatabaseDocument(this);
-    return xModel;
-}
-// -----------------------------------------------------------------------------
-void ODatabaseModelImpl::clear()
-{
-    try
-    {
-        Reference< XComponent > xComp(m_xDataSource.get(), UNO_QUERY);
-        m_xDataSource = WeakReference<XDataSource>();
-        if ( xComp.is() )
-            xComp->dispose();
-        ::comphelper::disposeComponent(m_xModel);
-    }
-    catch(Exception&)
-    {
-        m_xModel = NULL;
-    }
+Reference< XModel> ODatabaseModelImpl::getModel_noCreate()
+{
+    return m_xTempModel;
+}
+// -----------------------------------------------------------------------------
+Reference< XModel> ODatabaseModelImpl::createNewModel_deliverOwnership()
+{
+    OSL_PRECOND( !m_xTempModel.is(), "ODatabaseModelImpl::getModel_noCreate: not to be called if there already is a model!" );
+    if ( !m_xTempModel.is() )
+        m_xTempModel = ODatabaseDocument::createDatabaseDocument( this, ODatabaseDocument::FactoryAccess() );
+    return m_xTempModel;
 }
 // -----------------------------------------------------------------------------
 oslInterlockedCount SAL_CALL ODatabaseModelImpl::acquire()
@@ -653,7 +846,7 @@
 {
     if ( osl_decrementInterlockedCount(&m_refCount) == 0 )
     {
-        clear();
+        acquire();  // prevent multiple releases
         dispose();
         m_pDBContext->deregisterPrivate(m_sRealFileURL);
         delete this;


INTEGRATION: CWS dba201d (1.5.2); FILE MERGED 2005/10/07 06:24:04 fs 1.5.2.2: remove the unused implementation of XComponent / supersede DisconnectContentHolder by calling dispose -> no leaking instances anymore 2005/10/06 14:09:26 fs 1.5.2.1: #i52649# when dispatching a close request, keep our m_pContentHolder alive. Else, the EmbeddedObject implementations strangely crash

--- dbaccess/source/core/dataaccess/intercept.cxx
+++ dbaccess/source/core/dataaccess/intercept.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: intercept.cxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: hr $ $Date: 2005-09-23 12:06:53 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: rt $ $Date: 2005-10-24 08:29:26 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -80,55 +80,23 @@
 #define DISPATCH_RELOAD     5
 // the OSL_ENSURE in CTOR has to be changed too, when adding new defines

-void OInterceptor::DisconnectContentHolder()
-{
-    osl::MutexGuard aGuard( m_aMutex );
-    m_pContentHolder = NULL;
-}
-
-void SAL_CALL
-OInterceptor::addEventListener(
-    const Reference< com::sun::star::lang::XEventListener >& Listener )
-    throw( RuntimeException )
-{
-    osl::MutexGuard aGuard( m_aMutex );
-
-    if ( ! m_pDisposeEventListeners )
-        m_pDisposeEventListeners =
-            new cppu::OInterfaceContainerHelper( m_aMutex );
-
-    m_pDisposeEventListeners->addInterface( Listener );
-}
-
-
-void SAL_CALL
-OInterceptor::removeEventListener(
-    const Reference< com::sun::star::lang::XEventListener >& Listener )
-    throw( RuntimeException )
-{
-    osl::MutexGuard aGuard( m_aMutex );
-
-    if ( m_pDisposeEventListeners )
-        m_pDisposeEventListeners->removeInterface( Listener );
-}
-
-
 void SAL_CALL OInterceptor::dispose()
     throw( RuntimeException )
 {
-    EventObject aEvt;
-    aEvt.Source = static_cast< XDispatch* >( this );
+    EventObject aEvt( *this );

     osl::MutexGuard aGuard(m_aMutex);

     if ( m_pDisposeEventListeners && m_pDisposeEventListeners->getLength() )
         m_pDisposeEventListeners->disposeAndClear( aEvt );

-    if(m_pStatCL)
+    if ( m_pStatCL )
         m_pStatCL->disposeAndClear( aEvt );

-    m_xSlaveDispatchProvider = 0;
-    m_xMasterDispatchProvider = 0;
+    m_xSlaveDispatchProvider.clear();
+    m_xMasterDispatchProvider.clear();
+
+    m_pContentHolder = NULL;
 }

@@ -227,6 +195,7 @@
                     if ( xEvtB.is() )
                         xEvtB->removeEventListener(this);

+                    Reference< XInterface > xKeepContentHolderAlive( *m_pContentHolder );
                     xDispatch->dispatch( _URL, Arguments );
                 }
             }


INTEGRATION: CWS dba30d (1.5.30); FILE MERGED 2008/05/29 11:11:03 oj 1.5.30.1: #i89835# dispatch asyncron

--- dbaccess/source/core/dataaccess/intercept.hxx
+++ dbaccess/source/core/dataaccess/intercept.hxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: intercept.hxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -55,7 +55,7 @@
 #ifndef _DBA_COREDATAACCESS_DOCUMENTDEFINITION_HXX_
 #include "documentdefinition.hxx"
 #endif
-
+#include <vcl/svapp.hxx>

 namespace dbaccess
 {
@@ -66,6 +66,7 @@
                                                        ::com::sun::star::frame::XDispatch,
                                                     ::com::sun::star::document::XEventListener>
 {
+    DECL_LINK( OnDispatch, void* _aURL  );
 protected:
     virtual ~OInterceptor();
 public:


INTEGRATION: CWS dba30d (1.6.30); FILE MERGED 2008/05/29 11:25:58 fs 1.6.30.1: during #i80943#: refactoring: IController now passed around as reference, not as pointer

--- dbaccess/source/ui/inc/RelationDesignView.hxx
+++ dbaccess/source/ui/inc/RelationDesignView.hxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: RelationDesignView.hxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -58,7 +58,7 @@
     class ORelationDesignView : public OJoinDesignView
     {
     public:
-        ORelationDesignView(Window* pParent, ORelationController* _pController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+        ORelationDesignView(Window* pParent, ORelationController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
         virtual ~ORelationDesignView();

         // set the statement for representation


Add clarification comments.

Add clarification comments.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@156350 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Commands/CommandObjectBreakpoint.cpp
+++ source/Commands/CommandObjectBreakpoint.cpp
@@ -74,6 +74,8 @@
 {
 }

+// If an additional option set beyond LLDB_OPTION_SET_10 is added, make sure to
+// update the numbers passed to LLDB_OPT_SET_FROM_TO(...) appropriately.
 #define LLDB_OPT_FILE ( LLDB_OPT_SET_FROM_TO(1, 9) & ~LLDB_OPT_SET_2 )
 #define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM_TO(1, 10) & ~LLDB_OPT_SET_10 )