| 52 |
|
continue; |
| 53 |
|
} |
| 54 |
|
|
| 55 |
< |
elements[j].text()=QString(Util::toQString(elements[j].text().as_string()) + " " + newValuesList[k]).toLatin1().constData(); // If it doesn't exists yet let's add it |
| 55 |
> |
elements[j].text()=QString(Util::toQString(elements[j].text().as_string()) + " " + newValuesList[k]).toUtf8().constData(); // If it doesn't exists yet let's add it |
| 56 |
|
} |
| 57 |
|
} |
| 58 |
|
|
| 98 |
|
|
| 99 |
|
if(elementChanged){ // If curr element changed update the XML |
| 100 |
|
currValuesList.removeAll(""); // remove all files flagged to deletion |
| 101 |
< |
elements[j].text()=currValuesList.join(' ').toLatin1().constData(); |
| 101 |
> |
elements[j].text()=currValuesList.join(' ').toUtf8().constData(); |
| 102 |
|
elementChanged=false; |
| 103 |
|
} |
| 104 |
|
} |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
if(elementChanged){ // If curr element changed update the XML |
| 143 |
< |
elements[j].text()=currValuesList.join(" ").toLatin1().constData(); |
| 143 |
> |
elements[j].text()=currValuesList.join(" ").toUtf8().constData(); |
| 144 |
|
} |
| 145 |
|
elementChanged=false; |
| 146 |
|
} |
| 173 |
|
// Let's start the override |
| 174 |
|
for(int j=0; j<elements.size(); j++){ |
| 175 |
|
if(valuePositions!=""){ |
| 176 |
< |
elements[j].text()=replaceSpecificPositions(value, Util::toQString(elements[j].text().as_string()),valuePositions).toLatin1().constData(); |
| 176 |
> |
elements[j].text()=replaceSpecificPositions(value, Util::toQString(elements[j].text().as_string()),valuePositions).toUtf8().constData(); |
| 177 |
|
} |
| 178 |
|
else{ |
| 179 |
< |
elements[j].text()=value.toLatin1().constData(); |
| 179 |
> |
elements[j].text()=value.toUtf8().constData(); |
| 180 |
|
} |
| 181 |
|
} |
| 182 |
|
|
| 214 |
|
lastXmlValue=MultiDimVar(Util::toQString(elements[0].text().as_string())); // the lastXmlValue will begin to be the first one of the node |
| 215 |
|
currXmlValue=MultiDimVar(Util::toQString(elements[1].text().as_string())); // the currXmlValue will begin to be the second one of the node |
| 216 |
|
newXmlValue=MultiDimVar::sub(lastXmlValue, MultiDimVar(diffBetweenOldAndNewValue)); |
| 217 |
< |
elements[0].text() = newXmlValue.toString().toLatin1().constData(); // update the first eblement with the new one already |
| 217 |
> |
elements[0].text() = newXmlValue.toString().toUtf8().constData(); // update the first eblement with the new one already |
| 218 |
|
} |
| 219 |
|
|
| 220 |
|
// Let's start the node update |
| 221 |
|
for(int j=1; j<elements.size()-1; j++){ // We start in 1 because the 0 is already saved in lastXmlValue // -1 because we will also work with the next one in the current |
| 222 |
|
|
| 223 |
|
newXmlValue=MultiDimVar::sum(newXmlValue,MultiDimVar::sub(currXmlValue,lastXmlValue)); |
| 224 |
< |
elements[j].text() = newXmlValue.toString().toLatin1().constData(); // update element with the new value |
| 224 |
> |
elements[j].text() = newXmlValue.toString().toUtf8().constData(); // update element with the new value |
| 225 |
|
lastXmlValue=currXmlValue; |
| 226 |
|
currXmlValue=MultiDimVar(Util::toQString(elements[j+1].text().as_string())); |
| 227 |
|
|
| 229 |
|
|
| 230 |
|
// To update too last element (avoid out of bound because i+1) |
| 231 |
|
newXmlValue=MultiDimVar::sum(newXmlValue,MultiDimVar::sub(currXmlValue,lastXmlValue)); |
| 232 |
< |
elements[elements.size()-1].text() = newXmlValue.toString().toLatin1().constData(); // update element with the new value |
| 232 |
> |
elements[elements.size()-1].text() = newXmlValue.toString().toUtf8().constData(); // update element with the new value |
| 233 |
|
|
| 234 |
|
UtilXmlTools::saveXmlFile(this->filesToProcess[i],this->document, "update-elements"); |
| 235 |
|
} |
| 263 |
|
|
| 264 |
|
// Override the tree with the inverted order |
| 265 |
|
for(int j=0; j<elements.size(); j++){ |
| 266 |
< |
elements[j].text()= invertedElements[j].toLatin1().constData(); |
| 266 |
> |
elements[j].text()= invertedElements[j].toUtf8().constData(); |
| 267 |
|
} |
| 268 |
|
|
| 269 |
|
UtilXmlTools::saveXmlFile(this->filesToProcess[i],this->document, "invert-elements"); |