@@ -584,7 +584,7 @@ class TableBlock final : public Block {
584584 table.cells .clear ();
585585 for (auto line : lines) {
586586 // find all cells in this line
587- auto row = new OwnedArray<Cell>();
587+ auto const row = new OwnedArray<Cell>();
588588 while (line.containsAnyOf (" ^|" )) {
589589 bool const isHeader = line.startsWith (" ^" );
590590 line = line.substring (1 ); // remove left delimiter
@@ -676,7 +676,7 @@ class TableBlock final : public Block {
676676 // Override the mouse event methods to forward them to the parent Viewport
677677 void mouseDown (MouseEvent const & e) override
678678 {
679- if (auto parent = findParentComponentOfClass<Viewport>()) {
679+ if (auto const parent = findParentComponentOfClass<Viewport>()) {
680680 MouseEvent const ep = MouseEvent (e.source , e.position , e.mods , e.pressure , e.orientation , e.rotation , e.tiltX , e.tiltY , parent, e.originalComponent , e.eventTime , e.mouseDownPosition , e.mouseDownTime , e.getNumberOfClicks (), e.mouseWasDraggedSinceMouseDown ());
681681 parent->mouseDown (ep);
682682 }
@@ -1126,18 +1126,18 @@ class MarkupDisplayComponent final : public Component {
11261126 b->parseMarkup (clines, font);
11271127 content.addAndMakeVisible (b);
11281128 blocks.add (b);
1129- } else if (ListItem::isListItem (line)) { // if we find a list item...
1130- auto * b = new ListItem (urlHandler); // ...create a new object...
1131- b->setColours (&colours); // ...set its colour palette...
1132- if (Block::containsLink (line)) { // ...and, if there's a link...
1133- line = b->consumeLink (line); // ...preprocess line...
1129+ } else if (ListItem::isListItem (line)) { // if we find a list item...
1130+ auto * b = new ListItem (urlHandler); // ...create a new object...
1131+ b->setColours (&colours); // ...set its colour palette...
1132+ if (Block::containsLink (line)) { // ...and, if there's a link...
1133+ line = b->consumeLink (line); // ...preprocess line...
11341134 }
11351135 b->parseItemMarkup (line, font, indentPerSpace, labelGap); // ...parse it...
11361136 content.addAndMakeVisible (b); // ...add the object to content component...
11371137 blocks.add (b); // ...and the block list...
11381138 li++; // ...and go to next line.
11391139 } else if (AdmonitionBlock::isAdmonitionLine (line)) { // if we find an admonition...
1140- auto * b = new AdmonitionBlock (urlHandler); // ...create a new object...
1140+ auto * b = new AdmonitionBlock (urlHandler); // ...create a new object...
11411141 b->setColours (&colours); // ...set its colour palette...
11421142 if (Block::containsLink (line)) { // ...and, if there's a link...
11431143 line = b->consumeLink (line); // ...preprocess line...
@@ -1147,7 +1147,7 @@ class MarkupDisplayComponent final : public Component {
11471147 blocks.add (b); // ...and the block list...
11481148 li++; // ...and go to next line.
11491149 } else if (ImageBlock::isImageLine (line)) { // if we find an image...
1150- auto * b = new ImageBlock (urlHandler); // ...create a new object...
1150+ auto * b = new ImageBlock (urlHandler); // ...create a new object...
11511151 if (Block::containsLink (line)) { // ...and, if there's a link...
11521152 line = b->consumeLink (line); // ...preprocess line...
11531153 }
@@ -1156,7 +1156,7 @@ class MarkupDisplayComponent final : public Component {
11561156 blocks.add (b); // ...and the block list...
11571157 li++; // ...and go to next line.
11581158 } else if (ImageBlock::isHTMLImageLine (line)) { // if we find an image...
1159- auto * b = new ImageBlock (urlHandler); // ...create a new object...
1159+ auto * b = new ImageBlock (urlHandler); // ...create a new object...
11601160 if (Block::containsLink (line)) { // ...and, if there's a link...
11611161 line = b->consumeLink (line); // ...preprocess line...
11621162 }
@@ -1165,7 +1165,7 @@ class MarkupDisplayComponent final : public Component {
11651165 blocks.add (b); // ...and the block list...
11661166 li++; // ...and go to next line.
11671167 } else if (TableBlock::isTableLine (line)) { // if we find a table...
1168- auto * b = new TableBlock (urlHandler); // ...create a new object...
1168+ auto * b = new TableBlock (urlHandler); // ...create a new object...
11691169 b->setColours (&colours); // ...set its colour palette...
11701170 b->setBGColours (tableBG, tableBGHeader); // ...its background colours...
11711171 b->setMargins (tableMargin, tableGap, margin); // ...and its margins.
@@ -1174,19 +1174,19 @@ class MarkupDisplayComponent final : public Component {
11741174 tlines.add (line); // ...add it to table lines...
11751175 line = lines[++li]; // ...and read next line.
11761176 }
1177- b->parseMarkup (tlines, font); // ...parse the collected lines...
1178- content.addAndMakeVisible (b); // ...add the object to content component...
1179- blocks.add (b); // ...and the block list.
1180- } else if (Block::containsLink (line)) { // ...if we got here and there's a link...
1177+ b->parseMarkup (tlines, font); // ...parse the collected lines...
1178+ content.addAndMakeVisible (b); // ...add the object to content component...
1179+ blocks.add (b); // ...and the block list.
1180+ } else if (Block::containsLink (line)) { // ...if we got here and there's a link...
11811181 auto * b = new TextBlock (urlHandler); // ...set up a new text block object...
1182- b->setColours (&colours); // ...set its colours...
1183- line = b->consumeLink (line); // ...preprocess line...
1184- b->parseMarkup (line, font); // ...parse markup...
1185- content.addAndMakeVisible (b); // ...add the object to content component...
1186- blocks.add (b); // ...and the block list...
1187- li++; // ...and go to next line.
1188- } else { // otherwise we assume that we have a text block
1189- StringArray blines; // set up text block lines
1182+ b->setColours (&colours); // ...set its colours...
1183+ line = b->consumeLink (line); // ...preprocess line...
1184+ b->parseMarkup (line, font); // ...parse markup...
1185+ content.addAndMakeVisible (b); // ...add the object to content component...
1186+ blocks.add (b); // ...and the block list...
1187+ li++; // ...and go to next line.
1188+ } else { // otherwise we assume that we have a text block
1189+ StringArray blines; // set up text block lines
11901190 bool blockEnd = false ;
11911191 while (!ListItem::isListItem (line) && // while line is not part of a list...
11921192 !TableBlock::isTableLine (line) && // ...nor a table...
@@ -1200,10 +1200,10 @@ class MarkupDisplayComponent final : public Component {
12001200 blockEnd &= line.isNotEmpty (); // ...and finish shouldEndBloc...
12011201 }
12021202 auto * b = new TextBlock (urlHandler); // set up a new text block object...
1203- b->setColours (&colours); // ...set its colours...
1204- b->parseMarkup (blines, font); // ...parse markup...
1205- content.addAndMakeVisible (b); // ...add the object to content component...
1206- blocks.add (b); // ...and the block list.
1203+ b->setColours (&colours); // ...set its colours...
1204+ b->parseMarkup (blines, font); // ...parse markup...
1205+ content.addAndMakeVisible (b); // ...add the object to content component...
1206+ blocks.add (b); // ...and the block list.
12071207 }
12081208 }
12091209
0 commit comments