GCC Code Coverage Report


Directory: ./
File: tmp_project/PhoenixTex2Html/src/PLatexObj/updateNextPrev.cpp
Date: 2025-03-24 18:12:43
Exec Total Coverage
Lines: 19 19 100.0%
Branches: 12 13 92.3%

Line Branch Exec Source
1 /***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5 ****************************************/
6
7
8 #include "updateNextPrev.h"
9
10 ///Update the next and previous section for the menu
11 /** @param[out] outputMode : output mode of the html backend
12 * @param[out] obj : PLatexObj to be updated
13 * @param[out] lastSec : last section
14 */
15 12500 void updateNextPrev(POutoutMode & outputMode, PLatexObj & obj, PLatexObj* & lastSec){
16
2/2
✓ Branch 1 taken 12038 times.
✓ Branch 2 taken 462 times.
12500 if(!isSection(obj)){return;}
17
1/2
✓ Branch 0 taken 462 times.
✗ Branch 1 not taken.
462 if(lastSec != NULL){
18 462 PLatexMenu & prevMenu = obj.getPrevSec(); //Prev menu before obj is given by lastSec
19 462 prevMenu.setLink(lastSec->getLink());
20
21 // prevMenu.setText(lastSec->getName());
22
1/1
✓ Branch 2 taken 462 times.
462 prevMenu.setText(getSectionTitle(outputMode, *lastSec));
23
24 462 PLatexMenu & nextMenu = lastSec->getNextSec(); //Next menu after lastSec is given by obj
25 462 nextMenu.setLink(obj.getLink());
26
27 // nextMenu.setText(obj.getName());
28
1/1
✓ Branch 2 taken 462 times.
462 nextMenu.setText(getSectionTitle(outputMode, obj));
29 }
30
31 462 lastSec = &obj;
32
33 462 PVecLatexObj & vecObj = obj.getVecContent();
34
2/2
✓ Branch 4 taken 5287 times.
✓ Branch 5 taken 462 times.
5749 for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
35
1/1
✓ Branch 2 taken 5287 times.
5287 updateNextPrev(outputMode, *it, lastSec);
36 }
37 }
38
39 ///Update the next and previous section for the menu
40 /** @param[out] outputMode : output mode of the html backend
41 * @param[out] obj : PLatexObj to be updated
42 */
43 127 void updateNextPrev(POutoutMode & outputMode, PLatexObj & obj){
44 127 PLatexObj* lastSec = &obj;
45
1/1
✓ Branch 1 taken 127 times.
127 PVecLatexObj & vecObj = obj.getVecContent();
46
2/2
✓ Branch 4 taken 7213 times.
✓ Branch 5 taken 127 times.
7340 for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
47
1/1
✓ Branch 2 taken 7213 times.
7213 updateNextPrev(outputMode, *it, lastSec);
48 }
49 127 }
50
51
52
53