Skip to content

Commit

Permalink
Correction de bug : à la création d'une feuille d'exercices lors du
Browse files Browse the repository at this point in the history
remplacement des métadonnées dans le fichier LaTeX.
  • Loading branch information
Skade86 committed Apr 4, 2015
1 parent 28d6cb4 commit 122f720
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build_number
Original file line number Diff line number Diff line change
@@ -1 +1 @@
812
818
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD 812
#define BUILD 818
9 changes: 6 additions & 3 deletions sources/exosheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,18 @@ QString ExoSheet::replaceMeta(QString path,QString str)
while(index!=-1)
{
index = str.indexOf("%@",fromIndex);
QMessageBox::warning(0, QObject::tr("Error"),QObject::tr("index : %1").arg(index));
if (index==-1) return str;
toIndex = str.indexOf("@",index+2);
if (toIndex==-1) return str;
text = str.mid(index+2,toIndex-index-2).trimmed();
// QMessageBox::warning(0, QObject::tr("Error"),QObject::tr("index : %1\ntoIndex : %2\ntext : %3").arg(index).arg(toIndex).arg(text));
QMessageBox::warning(0, QObject::tr("Error"),QObject::tr("index : %1\ntoIndex : %2\ntext : %3").arg(index).arg(toIndex).arg(text));
newText = domHandler->getExoMeta(path,text);
// QMessageBox::warning(0, QObject::tr("Error"),QObject::tr("newText : %1").arg(newText));
int lenOld=QString("%@"+text+"@").size();
int lenNew=newText.size();
str.replace("%@"+text+"@",newText);
fromIndex=toIndex;
fromIndex=toIndex+lenNew-lenOld;

}
return str;
}
Expand Down

0 comments on commit 122f720

Please sign in to comment.