Skip to content

Commit 4b27fa4

Browse files
authored
Remove std prefix (#773)
* Remove std prefix for vector * Remove std prefix for string
1 parent 36158d9 commit 4b27fa4

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

src/cell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ struct Cell {
528528
: sys->defaultmaxcolwidth;
529529
}
530530

531-
void CollectCells(std::vector<Cell *> &itercells, bool recurse = true) {
531+
void CollectCells(vector<Cell *> &itercells, bool recurse = true) {
532532
itercells.push_back(this);
533533
if (grid && recurse) grid->CollectCells(itercells);
534534
}

src/document.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#endif
44

55
struct UndoItem {
6-
std::vector<Selection> path;
7-
std::vector<Selection> selpath;
6+
vector<Selection> path;
7+
vector<Selection> selpath;
88
Selection sel;
99
unique_ptr<Cell> clone;
1010
size_t estimated_size {0};
@@ -32,9 +32,9 @@ struct Document {
3232
int laststylebits;
3333
int initialzoomlevel {0};
3434
Cell *curdrawroot; // for use during Render() calls
35-
std::vector<unique_ptr<UndoItem>> undolist;
36-
std::vector<unique_ptr<UndoItem>> redolist;
37-
std::vector<Selection> drawpath;
35+
vector<unique_ptr<UndoItem>> undolist;
36+
vector<unique_ptr<UndoItem>> redolist;
37+
vector<Selection> drawpath;
3838
int pathscalebias {0};
3939
wxString filename {L""};
4040
long lastmodsinceautosave {0};
@@ -85,7 +85,7 @@ struct Document {
8585
int editfilter {0};
8686
wxDateTime lastmodificationtime;
8787
std::set<wxString> tags;
88-
std::vector<Cell *> itercells;
88+
vector<Cell *> itercells;
8989

9090
#define loopcellsin(par, c) \
9191
CollectCells(par); \
@@ -1654,7 +1654,7 @@ struct Document {
16541654
case A_MINISIZE: {
16551655
selected.g->cell->AddUndo(this);
16561656
CollectCellsSel(false);
1657-
std::vector<Cell *> outer;
1657+
vector<Cell *> outer;
16581658
outer.insert(outer.end(), itercells.begin(), itercells.end());
16591659
for (Cell *o : outer) {
16601660
if (o->grid) {
@@ -2105,7 +2105,7 @@ struct Document {
21052105
if (bdo.GetBitmap().GetRefData() != wxNullBitmap.GetRefData()) {
21062106
c->AddUndo(this);
21072107
wxImage im = bdo.GetBitmap().ConvertToImage();
2108-
std::vector<uint8_t> idv = ConvertWxImageToBuffer(im, wxBITMAP_TYPE_PNG);
2108+
vector<uint8_t> idv = ConvertWxImageToBuffer(im, wxBITMAP_TYPE_PNG);
21092109
SetImageBM(c, std::move(idv), sys->frame->FromDIP(1.0));
21102110
c->Reset();
21112111
Refresh();
@@ -2136,7 +2136,7 @@ struct Document {
21362136
}
21372137
}
21382138

2139-
void CreatePath(Cell *c, std::vector<Selection> &path) {
2139+
void CreatePath(Cell *c, vector<Selection> &path) {
21402140
path.clear();
21412141
while (c->parent) {
21422142
const Selection &s = c->parent->grid->FindCell(c);
@@ -2146,7 +2146,7 @@ struct Document {
21462146
}
21472147
}
21482148

2149-
Cell *WalkPath(std::vector<Selection> &path) {
2149+
Cell *WalkPath(vector<Selection> &path) {
21502150
Cell *c = rootgrid;
21512151
loopvrev(i, path) {
21522152
Selection &s = path[i];
@@ -2204,10 +2204,10 @@ struct Document {
22042204
undolistsizeatfullsave -= items_culled; // Allowed to go < 0
22052205
}
22062206

2207-
void Undo(wxDC &dc, std::vector<unique_ptr<UndoItem>> &fromlist,
2208-
std::vector<unique_ptr<UndoItem>> &tolist, bool redo = false) {
2207+
void Undo(wxDC &dc, vector<unique_ptr<UndoItem>> &fromlist,
2208+
vector<unique_ptr<UndoItem>> &tolist, bool redo = false) {
22092209
Selection beforesel = selected;
2210-
std::vector<Selection> beforepath;
2210+
vector<Selection> beforepath;
22112211
if (beforesel.g) CreatePath(beforesel.g->cell, beforepath);
22122212
unique_ptr<UndoItem> ui = std::move(fromlist.back());
22132213
fromlist.pop_back();
@@ -2247,15 +2247,15 @@ struct Document {
22472247
selected.g->ColorChange(this, which, col, selected);
22482248
}
22492249

2250-
void SetImageBM(Cell *c, std::vector<uint8_t> &&idv, double sc) {
2250+
void SetImageBM(Cell *c, vector<uint8_t> &&idv, double sc) {
22512251
c->text.image = sys->imagelist[sys->AddImageToList(sc, std::move(idv), 'I')].get();
22522252
}
22532253

22542254
bool LoadImageIntoCell(const wxString &fn, Cell *c, double sc) {
22552255
if (fn.empty()) return false;
22562256
wxImage im;
22572257
if (!im.LoadFile(fn)) return false;
2258-
std::vector<uint8_t> idv = ConvertWxImageToBuffer(im, wxBITMAP_TYPE_PNG);
2258+
vector<uint8_t> idv = ConvertWxImageToBuffer(im, wxBITMAP_TYPE_PNG);
22592259
SetImageBM(c, std::move(idv), sc);
22602260
c->Reset();
22612261
return true;

src/evaluator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct Evaluator {
142142
if (g->xs == 1 || g->ys == 1) {
143143
return op->runl(g);
144144
} else {
145-
std::vector<unique_ptr<Grid>> gs;
145+
vector<unique_ptr<Grid>> gs;
146146
g->Split(gs, vert);
147147
g = new Grid(vert ? gs.size() : 1, vert ? 1 : gs.size());
148148
auto c = make_unique<Cell>(nullptr, left.get(), CT_DATA, g);

src/grid.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ struct Grid {
55
// subcells
66
Cell **cells;
77
// widths for each column
8-
std::vector<int> colwidths;
8+
vector<int> colwidths;
99
// xsize, ysize
1010
int xs;
1111
int ys;
@@ -864,7 +864,7 @@ struct Grid {
864864
return acc;
865865
}
866866

867-
void Split(std::vector<unique_ptr<Grid>> &gs, bool vert) {
867+
void Split(vector<unique_ptr<Grid>> &gs, bool vert) {
868868
loop(i, vert ? xs : ys) gs.push_back(make_unique<Grid>(vert ? 1 : xs, vert ? ys : 1));
869869
foreachcell(c) {
870870
Grid *g = gs[vert ? x : y].get();
@@ -1095,8 +1095,8 @@ struct Grid {
10951095
}
10961096
}
10971097

1098-
void CollectCells(std::vector<Cell *> &itercells) { foreachcell(c) c->CollectCells(itercells); }
1099-
void CollectCellsSel(std::vector<Cell *> &itercells, const Selection &s, bool recurse) {
1098+
void CollectCells(vector<Cell *> &itercells) { foreachcell(c) c->CollectCells(itercells); }
1099+
void CollectCellsSel(vector<Cell *> &itercells, const Selection &s, bool recurse) {
11001100
foreachcellinsel(c, s) c->CollectCells(itercells, recurse);
11011101
}
11021102

src/myframe.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct MyFrame : wxFrame {
1414
bool fromclosebox {true};
1515
bool watcherwaitingforuser {false};
1616
bool darkmode {wxSystemSettings::GetAppearance().IsDark()};
17-
std::vector<std::string> scripts_in_menu;
17+
vector<string> scripts_in_menu;
1818
wxToolBar *tb {nullptr};
1919
wxColour toolbgcol {0xD8C7BC};
2020
wxTextCtrl *filter {nullptr};
@@ -607,7 +607,7 @@ struct MyFrame : wxFrame {
607607
}
608608
MyAppend(scriptmenu, A_SCRIPT + sidx, ms);
609609
auto ss = fn.utf8_str();
610-
scripts_in_menu.push_back(std::string(ss.data(), ss.length()));
610+
scripts_in_menu.push_back(string(ss.data(), ss.length()));
611611
sf = wxFindNextFile();
612612
sidx++;
613613
}

src/system.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ struct System {
6767
Evaluator ev;
6868
wxString clipboardcopy;
6969
unique_ptr<Cell> cellclipboard;
70-
std::vector<unique_ptr<Image>> imagelist;
71-
std::vector<int> loadimageids;
70+
vector<unique_ptr<Image>> imagelist;
71+
vector<int> loadimageids;
7272
uchar versionlastloaded {0};
7373
wxLongLong fakelasteditonload;
7474
wxPen pen_tinytext {wxColour(0x808080ul)};
@@ -513,8 +513,8 @@ struct System {
513513
return _(L"File load error.");
514514
}
515515

516-
int GetXMLNodes(wxXmlNode *n, std::vector<wxXmlNode *> &ns,
517-
std::vector<wxXmlAttribute *> *ps = nullptr, bool attributestoo = false) {
516+
int GetXMLNodes(wxXmlNode *n, vector<wxXmlNode *> &ns, vector<wxXmlAttribute *> *ps = nullptr,
517+
bool attributestoo = false) {
518518
for (wxXmlNode *child = n->GetChildren(); child; child = child->GetNext()) {
519519
if (child->GetType() == wxXML_ELEMENT_NODE) ns.push_back(child);
520520
}
@@ -543,8 +543,8 @@ struct System {
543543
c->celltype = wxAtoi(n->GetAttribute(L"type", L"0"));
544544
}
545545

546-
std::vector<wxXmlNode *> ns;
547-
std::vector<wxXmlAttribute *> ps;
546+
vector<wxXmlNode *> ns;
547+
vector<wxXmlAttribute *> ps;
548548
int numrows = GetXMLNodes(n, ns, &ps, attributestoo);
549549
if (!numrows) return;
550550

@@ -561,7 +561,7 @@ struct System {
561561
if (allrow) {
562562
int desiredxs;
563563
loopv(i, ns) {
564-
std::vector<wxXmlNode *> ins;
564+
vector<wxXmlNode *> ins;
565565
int xs = GetXMLNodes(ns[i], ins);
566566
if (!i) {
567567
desiredxs = xs ? xs : 1;

0 commit comments

Comments
 (0)