diff --git a/Makefile b/Makefile index 78c48d6e..6425137f 100644 --- a/Makefile +++ b/Makefile @@ -245,14 +245,14 @@ OBJEXT = o PACKAGE = magicseteditor PACKAGE_BUGREPORT = twanvl@users.sourceforge.net PACKAGE_NAME = magicseteditor -PACKAGE_STRING = magicseteditor 0.3.0 +PACKAGE_STRING = magicseteditor 0.3.3 PACKAGE_TARNAME = magicseteditor -PACKAGE_VERSION = 0.3.0 +PACKAGE_VERSION = 0.3.3 PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/bash STRIP = -VERSION = 0.3.0 +VERSION = 0.3.3 WX_CFLAGS = -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread WX_CFLAGS_ONLY = -pthread WX_CONFIG_PATH = /usr/bin/wx-config diff --git a/configure.ac b/configure.ac index b264c028..cac54f58 100644 --- a/configure.ac +++ b/configure.ac @@ -6,11 +6,10 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(magicseteditor, 0.3.0, twanvl@users.sourceforge.net) +AC_INIT(magicseteditor, 0.3.3, twanvl@users.sourceforge.net) AC_CONFIG_SRCDIR([src/main.cpp]) # TODO: Actually use the config header AC_CONFIG_HEADER([src/config.h]) -CXXFLAGS = [-g3 -O0 ] AM_INIT_AUTOMAKE([-Wall foreign]) diff --git a/src/gui/control/graph.cpp b/src/gui/control/graph.cpp index 128c732b..dc6ec290 100644 --- a/src/gui/control/graph.cpp +++ b/src/gui/control/graph.cpp @@ -199,8 +199,8 @@ RealRect bar_graph_bar(const RealRect& rect, int group, int group_count, int sta double width = width_space / 5 * 4; double space = width_space / 5; double step_height = rect.height / max; // multiplier for bar height - int top = rect.bottom() - start * step_height; - int bottom = rect.bottom() - end * step_height; + int top = (int)(rect.bottom() - start * step_height); + int bottom = (int)(rect.bottom() - end * step_height); if (bottom < top) swap(top,bottom); bottom += 1; return RealRect( @@ -215,7 +215,7 @@ int find_bar_graph_column(double width, double x, int count) { double width_space = width / count; // including spacing double space = width_space / 5; // Find column in which the point could be located - int col = floor(x / width_space); + int col = (int)floor(x / width_space); if (col < 0 || col >= count) return -1; // not a column double in_col = x - col * width_space; if (in_col < space / 2) return -1; // left @@ -322,7 +322,7 @@ bool BarGraph2D::findItem(const RealPoint& pos, const RealRect& rect, vector max_value) return false; // find row int row = -1; @@ -460,8 +460,8 @@ bool ScatterGraph::findItem(const RealPoint& pos, const RealRect& rect, vector= (int)axis1.groups.size()) return false; if (row < 0 || row >= (int)axis2.groups.size()) return false; // done @@ -583,7 +583,7 @@ int GraphLegend::findItem(const RealPoint& pos, const RealRect& rect) const { RealPoint mypos = align_in_rect(alignment, size, rect); RealPoint pos2(pos.x - mypos.x, pos.y - mypos.y); if (pos2.x < 0 || pos2.y < 0 || pos2.x >= size.width || pos2.y >= size.height) return -1; - int col = floor((pos2.y-1) / item_size.height); + int col = (int) floor((pos2.y-1) / item_size.height); if (col < 0 || col >= (int)axis_data().groups.size()) return -1; return reverse ? (int)axis_data().groups.size() - col - 1 : col; } @@ -673,10 +673,10 @@ int GraphLabelAxis::findItem(const RealPoint& pos, const RealRect& rect) const { GraphAxis& axis = axis_data(); int col; if (direction == HORIZONTAL) { - col = floor((pos.x - rect.x) / rect.width * axis.groups.size()); + col = (int) floor((pos.x - rect.x) / rect.width * axis.groups.size()); if (pos.y < rect.bottom()) return -1; } else { - col = floor((rect.bottom() - pos.y) / rect.height * axis.groups.size()); + col = (int) floor((rect.bottom() - pos.y) / rect.height * axis.groups.size()); if (pos.x > rect.left()) return -1; } if (col < 0 || col >= (int)axis.groups.size()) return -1; @@ -693,7 +693,7 @@ void GraphValueAxis::draw(RotatedDC& dc, int current, DrawLayer layer) const { GraphAxis& axis = axis_data(); double step_height = rect.height / axis.max; // height of a single value dc.SetFont(*wxNORMAL_FONT); - int label_step = ceil(max(1.0, (dc.GetCharHeight()) / step_height)); // values per labeled line + int label_step = (int) ceil(max(1.0, (dc.GetCharHeight()) / step_height)); // values per labeled line // Colors Color bg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); Color fg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); @@ -710,7 +710,7 @@ void GraphValueAxis::draw(RotatedDC& dc, int current, DrawLayer layer) const { dc.SetPen(fg); } // draw line - int y = rect.bottom() - i * step_height; + int y = (int) (rect.bottom() - i * step_height); dc.DrawLine(RealPoint(rect.left() - 2, y), RealPoint(rect.right(), y)); // draw label, aligned middle right if (! ((i < highlight && i + label_step > highlight) || diff --git a/src/gui/control/graph.hpp b/src/gui/control/graph.hpp index ceac2e28..4590acfb 100644 --- a/src/gui/control/graph.hpp +++ b/src/gui/control/graph.hpp @@ -277,9 +277,9 @@ class GraphWithMargins : public Graph { virtual bool findItem(const RealPoint& pos, const RealRect& rect, vector& out) const; virtual void setData(const GraphDataP& d); private: + const GraphP graph; double margin_left, margin_top, margin_right, margin_bottom; bool upside_down; // put the coordinate system upside down, since graphs are usually bottom-to-top - const GraphP graph; }; /// A display containing multiple graphs diff --git a/src/gui/control/item_list.hpp b/src/gui/control/item_list.hpp index 3a2ad903..50946d96 100644 --- a/src/gui/control/item_list.hpp +++ b/src/gui/control/item_list.hpp @@ -87,8 +87,8 @@ class ItemList : public wxListView { // --------------------------------------------------- : Data VoidP selected_item; ///< The currently selected item long selected_item_pos; ///< Position of the selected item in the sorted_list, or -1 if no card is selected - bool sort_ascending; ///< Sort order long sort_by_column; ///< Column to use for sorting, or -1 if not sorted + bool sort_ascending; ///< Sort order vector sorted_list; ///< Sorted list of items, can be considered a map: pos->item private: diff --git a/src/gui/control/keyword_list.cpp b/src/gui/control/keyword_list.cpp index e5792927..2625173d 100644 --- a/src/gui/control/keyword_list.cpp +++ b/src/gui/control/keyword_list.cpp @@ -165,12 +165,25 @@ bool KeywordList::compareItems(void* a, void* b) const { String KeywordList::OnGetItemText (long pos, long col) const { const Keyword& kw = *getKeyword(pos); + String formatted; + wxChar c; switch(col) { case 0: return kw.keyword; case 1: return match_string(kw); case 2: return kw.mode; case 3: return _("?"); - case 4: return kw.reminder.getUnparsed(); + case 4: + formatted.Clear(); + for (size_t i = 0; i < kw.reminder.getUnparsed().Len(); ++i) { + c = kw.reminder.getUnparsed().GetChar(i); + if (isSpace(c)) { + formatted.Trim(); + formatted += ' '; + } + else + formatted += c; + } + return formatted; default: return wxEmptyString; } } diff --git a/src/gui/control/native_look_editor.cpp b/src/gui/control/native_look_editor.cpp index cd0af335..5cad392f 100644 --- a/src/gui/control/native_look_editor.cpp +++ b/src/gui/control/native_look_editor.cpp @@ -71,8 +71,8 @@ void NativeLookEditor::resizeViewers() { if (e) e->determineSize(); y += s->height + vspace; } - SetVirtualSize(w,y); - SetScrollbar(wxVERTICAL, 0, h, y); + SetVirtualSize(w, (int)y); + SetScrollbar(wxVERTICAL, 0, h, (int) y); if (y >= h) { // Doesn't fit vertically, add scrollbar and resize /* diff --git a/src/gui/set/cards_panel.cpp b/src/gui/set/cards_panel.cpp index 0cd694a4..53802644 100644 --- a/src/gui/set/cards_panel.cpp +++ b/src/gui/set/cards_panel.cpp @@ -262,9 +262,9 @@ bool CardsPanel::wantsToHandle(const Action&, bool undone) const { bool CardsPanel::canCut() const { CUT_COPY_PASTE(canCut, return) } bool CardsPanel::canCopy() const { CUT_COPY_PASTE(canCopy, return) } bool CardsPanel::canPaste() const { CUT_COPY_PASTE(canPaste, return) } -void CardsPanel::doCut() { CUT_COPY_PASTE(doCut, ;) } -void CardsPanel::doCopy() { CUT_COPY_PASTE(doCopy, ;) } -void CardsPanel::doPaste() { CUT_COPY_PASTE(doPaste, ;) } +void CardsPanel::doCut() { CUT_COPY_PASTE(doCut, return (void)) } +void CardsPanel::doCopy() { CUT_COPY_PASTE(doCopy, return (void)) } +void CardsPanel::doPaste() { CUT_COPY_PASTE(doPaste, return (void)) } // ----------------------------------------------------------------------------- : Searching diff --git a/src/gui/set/keywords_panel.cpp b/src/gui/set/keywords_panel.cpp index 0b199ca7..fdb3902d 100644 --- a/src/gui/set/keywords_panel.cpp +++ b/src/gui/set/keywords_panel.cpp @@ -238,12 +238,12 @@ String KeywordsPanel::runRefScript(int find_i) { else if (id == ID_RULES && rules ->IsEnabled()) { return rules ->op(); } \ else { return false; } -bool KeywordsPanel::canCopy() const { CUT_COPY_PASTE(canCopy, return, false) } -bool KeywordsPanel::canCut() const { CUT_COPY_PASTE(canCut, return, !list->getKeyword() || list->getKeyword()->fixed) } -bool KeywordsPanel::canPaste() const { CUT_COPY_PASTE(canPaste, return, !list->getKeyword() || list->getKeyword()->fixed) } -void KeywordsPanel::doCopy() { CUT_COPY_PASTE(doCopy, ;, false) } -void KeywordsPanel::doCut() { CUT_COPY_PASTE(doCut, ;, !list->getKeyword() || list->getKeyword()->fixed) } -void KeywordsPanel::doPaste() { CUT_COPY_PASTE(doPaste, ;, !list->getKeyword() || list->getKeyword()->fixed) } +bool KeywordsPanel::canCopy() const { CUT_COPY_PASTE(canCopy, return, false) } +bool KeywordsPanel::canCut() const { CUT_COPY_PASTE(canCut, return, !list->getKeyword() || list->getKeyword()->fixed) } +bool KeywordsPanel::canPaste() const { CUT_COPY_PASTE(canPaste, return, !list->getKeyword() || list->getKeyword()->fixed) } +void KeywordsPanel::doCopy() { CUT_COPY_PASTE(doCopy, return (void), false) } +void KeywordsPanel::doCut() { CUT_COPY_PASTE(doCut, return (void), !list->getKeyword() || list->getKeyword()->fixed) } +void KeywordsPanel::doPaste() { CUT_COPY_PASTE(doPaste, return (void), !list->getKeyword() || list->getKeyword()->fixed) } // ----------------------------------------------------------------------------- : Events diff --git a/src/gui/symbol/control.cpp b/src/gui/symbol/control.cpp index 94b4ed21..2e2ccd10 100644 --- a/src/gui/symbol/control.cpp +++ b/src/gui/symbol/control.cpp @@ -152,7 +152,7 @@ void SymbolControl::draw(DC& dc) { wxSize s = dc.GetSize(); double lines = settings.symbol_grid_size; for (int i = 0 ; i <= lines ; ++i) { - int x = floor(rotation.trS(i/lines-0.0001)); + int x = (int) floor(rotation.trS(i/lines-0.0001)); //dc.SetPen(Color(0, i%5 == 0 ? 64 : 31, 0)); //dc.SetPen(Color(i%5 == 0 ? 64 : 31, 0, 0)); dc.SetLogicalFunction(wxAND); diff --git a/src/gui/value/multiple_choice.cpp b/src/gui/value/multiple_choice.cpp index cff97951..0d2001b9 100644 --- a/src/gui/value/multiple_choice.cpp +++ b/src/gui/value/multiple_choice.cpp @@ -96,7 +96,7 @@ void MultipleChoiceValueEditor::determineSize(bool force_fit) { bool MultipleChoiceValueEditor::onLeftDown(const RealPoint& pos, wxMouseEvent& ev) { // find item under cursor if (style().render_style & RENDER_CHECKLIST) { - int id = (pos.y - style().top) / item_height; + int id = (int)((pos.y - style().top) / item_height); int end = field().choices->lastId(); if (id >= 0 && id < end) { toggle(id); diff --git a/src/gui/value/text.cpp b/src/gui/value/text.cpp index d8d7ddb3..06917ac2 100644 --- a/src/gui/value/text.cpp +++ b/src/gui/value/text.cpp @@ -734,7 +734,7 @@ void TextValueEditor::determineSize(bool force_fit) { int sbw = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); RealPoint pos = rot.tr(style().getPos()); scrollbar->SetSize( - (int)pos.x + rot.trS(style().width) + 1 - sbw, + (int)(pos.x + rot.trS(style().width) + 1 - sbw), (int)pos.y - 1, (int)sbw, (int)rot.trS(style().height) + 2); diff --git a/src/render/text/compound.cpp b/src/render/text/compound.cpp index bb3c9950..69be2e5d 100644 --- a/src/render/text/compound.cpp +++ b/src/render/text/compound.cpp @@ -52,4 +52,4 @@ void ErrorTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, c } // Draw the contents CompoundTextElement::draw(dc, scale, rect, xs, what, start, end); -} \ No newline at end of file +} diff --git a/src/util/index_map.hpp b/src/util/index_map.hpp index 9b90db30..4dd14bb1 100644 --- a/src/util/index_map.hpp +++ b/src/util/index_map.hpp @@ -39,6 +39,7 @@ class IndexMap : private vector { using vector::const_reference; using vector::begin; using vector::end; + using vector::clear; using vector::at; // for using numeric indices directly /// Initialize this map with default values given a list of keys