From e7a264bb907fbac63d7c4d4a75d3749e68e684d5 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 10 Feb 2020 22:36:36 -0500 Subject: [PATCH] Remove non-empty exception specifications, which have been deprecated for nearly ten years now --- src/dialogxml/widgets/button.cpp | 22 +++++++++++----------- src/dialogxml/widgets/button.hpp | 22 +++++++++++----------- src/dialogxml/widgets/control.cpp | 4 ++-- src/dialogxml/widgets/control.hpp | 12 ++++++------ src/dialogxml/widgets/field.cpp | 8 ++++---- src/dialogxml/widgets/field.hpp | 8 ++++---- src/dialogxml/widgets/message.cpp | 8 ++++---- src/dialogxml/widgets/message.hpp | 8 ++++---- src/dialogxml/widgets/pict.cpp | 8 ++++---- src/dialogxml/widgets/pict.hpp | 8 ++++---- src/dialogxml/widgets/scrollbar.cpp | 8 ++++---- src/dialogxml/widgets/scrollbar.hpp | 8 ++++---- src/dialogxml/widgets/scrollpane.cpp | 8 ++++---- src/dialogxml/widgets/scrollpane.hpp | 8 ++++---- src/dialogxml/widgets/stack.cpp | 8 ++++---- src/dialogxml/widgets/stack.hpp | 8 ++++---- 16 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/dialogxml/widgets/button.cpp b/src/dialogxml/widgets/button.cpp index 0b030e77d..3a8c35f3a 100644 --- a/src/dialogxml/widgets/button.cpp +++ b/src/dialogxml/widgets/button.cpp @@ -90,23 +90,23 @@ void cButton::draw(){ } } -void cButton::setFormat(eFormat prop, short val) throw(xUnsupportedProp){ +void cButton::setFormat(eFormat prop, short val){ if(prop == TXT_WRAP) wrapLabel = val; else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val); else throw xUnsupportedProp(prop); } -short cButton::getFormat(eFormat prop) throw(xUnsupportedProp){ +short cButton::getFormat(eFormat prop){ if(prop == TXT_WRAP) return wrapLabel; else if(prop == TXT_FRAMESTYLE) return frameStyle; else throw xUnsupportedProp(prop); } -void cButton::setColour(sf::Color clr) throw(xUnsupportedProp) { +void cButton::setColour(sf::Color clr) { textClr = clr; } -sf::Color cButton::getColour() throw(xUnsupportedProp) { +sf::Color cButton::getColour() { return textClr; } @@ -348,14 +348,14 @@ void cLed::callHandler(event_fcn::type onClick, cDialog& me, std::str } } -void cLed::setFormat(eFormat prop, short val) throw(xUnsupportedProp){ +void cLed::setFormat(eFormat prop, short val){ if(prop == TXT_FONT) textFont = (eFont) val; else if(prop == TXT_SIZE) textSize = val; else if(prop == TXT_WRAP) wrapLabel = val; else throw xUnsupportedProp(prop); } -short cLed::getFormat(eFormat prop) throw(xUnsupportedProp){ +short cLed::getFormat(eFormat prop){ if(prop == TXT_FONT) return textFont; else if(prop == TXT_SIZE) return textSize; else if(prop == TXT_WRAP) return wrapLabel; @@ -600,7 +600,7 @@ void cLedGroup::callHandler(event_fcn::type onClick, cDialog& me, std return; } -void cLedGroup::attachFocusHandler(std::function f) throw(xHandlerNotSupported) { +void cLedGroup::attachFocusHandler(std::function f) { if(!f) { attachEventHandler(nullptr); return; @@ -627,23 +627,23 @@ void cLedGroup::hide(std::string id){ choices[id]->hide(); } -void cLedGroup::setFormat(eFormat prop, short val) throw(xUnsupportedProp) { +void cLedGroup::setFormat(eFormat prop, short val) { if(prop == TXT_FRAME) drawFramed = val; else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val); else throw xUnsupportedProp(prop); } -short cLedGroup::getFormat(eFormat prop) throw(xUnsupportedProp) { +short cLedGroup::getFormat(eFormat prop) { if(prop == TXT_FRAME) return drawFramed; else if(prop == TXT_FRAMESTYLE) return frameStyle; throw xUnsupportedProp(prop); } -void cLedGroup::setColour(sf::Color) throw(xUnsupportedProp) { +void cLedGroup::setColour(sf::Color) { // TODO: Colour is not supported } -sf::Color cLedGroup::getColour() throw(xUnsupportedProp) { +sf::Color cLedGroup::getColour() { // TODO: Colour is not supported return sf::Color(); } diff --git a/src/dialogxml/widgets/button.hpp b/src/dialogxml/widgets/button.hpp index 252ab7a33..66eab34c4 100644 --- a/src/dialogxml/widgets/button.hpp +++ b/src/dialogxml/widgets/button.hpp @@ -51,10 +51,10 @@ public: /// @copydoc cDialog::init() static void init(); std::string parse(ticpp::Element& who, std::string fname); - void setFormat(eFormat prop, short val) throw(xUnsupportedProp); - short getFormat(eFormat prop) throw(xUnsupportedProp); - void setColour(sf::Color clr) throw(xUnsupportedProp); - sf::Color getColour() throw(xUnsupportedProp); + void setFormat(eFormat prop, short val); + short getFormat(eFormat prop); + void setColour(sf::Color clr); + sf::Color getColour(); /// Set the type of this button. /// @param newType The desired button type. void setBtnType(eBtnType newType); @@ -115,8 +115,8 @@ public: /// @return true to indicate the event should continue. static bool noAction(cDialog&,std::string,eKeyMod) {return true;} std::string parse(ticpp::Element& who, std::string fname) override; - void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override; - short getFormat(eFormat prop) throw(xUnsupportedProp) override; + void setFormat(eFormat prop, short val) override; + short getFormat(eFormat prop) override; storage_t store() override; void restore(storage_t to) override; /// Create a new LED button. @@ -176,7 +176,7 @@ class cLedGroup : public cContainer { cLedGroup(cLedGroup& other) = delete; public: /// @deprecated in favour of @ref attachEventHandler - void attachFocusHandler(std::function f) throw(xHandlerNotSupported) override; + void attachFocusHandler(std::function f) override; std::string parse(ticpp::Element& who, std::string fname) override; /// @copydoc cControl::attachClickHandler() /// @@ -210,10 +210,10 @@ public: /// Show one of the choices in this group. /// @param id The unique key of the choice. void show(std::string id); - void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override; - short getFormat(eFormat prop) throw(xUnsupportedProp) override; - void setColour(sf::Color clr) throw(xUnsupportedProp) override; - sf::Color getColour() throw(xUnsupportedProp) override; + void setFormat(eFormat prop, short val) override; + short getFormat(eFormat prop) override; + void setColour(sf::Color clr) override; + sf::Color getColour() override; /// Create a new LED group. /// @param parent The parent dialog. explicit cLedGroup(cDialog& parent); diff --git a/src/dialogxml/widgets/control.cpp b/src/dialogxml/widgets/control.cpp index efbdf1c99..07a380949 100644 --- a/src/dialogxml/widgets/control.cpp +++ b/src/dialogxml/widgets/control.cpp @@ -277,7 +277,7 @@ cControl::cControl(eControlType t, cDialog& p) : parent(&p), inWindow(&p.win), t cControl::cControl(eControlType t, sf::RenderWindow& p) : parent(nullptr), inWindow(&p), type(t), visible(true), key({false, 0, mod_none}), frameStyle(FRM_INSET) {} -void cControl::attachClickHandler(std::function f) throw(xHandlerNotSupported) { +void cControl::attachClickHandler(std::function f) { if(!f) { attachEventHandler(nullptr); return; @@ -287,7 +287,7 @@ void cControl::attachClickHandler(std::function f) throw(xHandlerNotSupported) { +void cControl::attachFocusHandler(std::function f) { if(!f) { attachEventHandler(nullptr); attachEventHandler(nullptr); diff --git a/src/dialogxml/widgets/control.hpp b/src/dialogxml/widgets/control.hpp index 9eaaa0c51..2fa53c8e3 100644 --- a/src/dialogxml/widgets/control.hpp +++ b/src/dialogxml/widgets/control.hpp @@ -129,7 +129,7 @@ public: /// /// A click handler must be able to accept three parameters: a reference to the containing dialog, the unique key of the /// clicked item, and a representation of any modifier keys that are currently held. - virtual void attachClickHandler(std::function f) throw(xHandlerNotSupported); + virtual void attachClickHandler(std::function f); /// Attach a focus handler to this control. /// @param f The focus handler to attach. /// @throw xHandlerNotSupported if this control does not support focus handlers. Most controls do not support focus handlers. @@ -140,7 +140,7 @@ public: /// clicked item, and a boolean indicating whether focus is being lost or gained; a value of true indicates that /// focus is being lost, while false indicates it's being gained. Most handlers will only need to act when the /// third parameter is true. If the handler returns false, the focus change is cancelled. - virtual void attachFocusHandler(std::function f) throw(xHandlerNotSupported); + virtual void attachFocusHandler(std::function f); /// Trigger an event on this control. /// @tparam t The type of event to trigger. /// @tparam Params Additional parameters, depending on the event type. @@ -216,20 +216,20 @@ public: /// @param prop The parameter to set. /// @param val The desired value of the parameter. /// @throw xUnsupportedProp if this control doesn't support the given parameter. - virtual void setFormat(eFormat prop, short val) throw(xUnsupportedProp) = 0; + virtual void setFormat(eFormat prop, short val) = 0; /// Get one of the control's formatting parameters. /// @param prop The parameter to retrieve. /// @return The value of the parameter. /// @throw xUnsupportedProp if this control doesn't support the given parameter. - virtual short getFormat(eFormat prop) throw(xUnsupportedProp) = 0; + virtual short getFormat(eFormat prop) = 0; /// Set the control's colour (usually text colour). /// @param clr The desired colour. /// @throw xUnsupportedProp if this control does not support colour. - virtual void setColour(sf::Color clr) throw(xUnsupportedProp) = 0; + virtual void setColour(sf::Color clr) = 0; /// Get the control's colour. /// @return The current colour. /// @throw xUnsupportedProp if this control does not support colour. - virtual sf::Color getColour() throw(xUnsupportedProp) = 0; + virtual sf::Color getColour() = 0; /// Check if the control is clickable. /// @return true if it's clickable. /// @note This does not indicate whether the control supports click handlers. diff --git a/src/dialogxml/widgets/field.cpp b/src/dialogxml/widgets/field.cpp index 60bfc2d3c..88aae4f9e 100644 --- a/src/dialogxml/widgets/field.cpp +++ b/src/dialogxml/widgets/field.cpp @@ -165,19 +165,19 @@ bool cTextField::handleClick(location clickLoc) { return true; } -void cTextField::setFormat(eFormat prop, short) throw(xUnsupportedProp){ +void cTextField::setFormat(eFormat prop, short){ throw xUnsupportedProp(prop); } -short cTextField::getFormat(eFormat prop) throw(xUnsupportedProp){ +short cTextField::getFormat(eFormat prop){ throw xUnsupportedProp(prop); } -void cTextField::setColour(sf::Color clr) throw(xUnsupportedProp) { +void cTextField::setColour(sf::Color clr) { color = clr; } -sf::Color cTextField::getColour() throw(xUnsupportedProp) { +sf::Color cTextField::getColour() { return color; } diff --git a/src/dialogxml/widgets/field.hpp b/src/dialogxml/widgets/field.hpp index 26b31797f..1fd562ea4 100644 --- a/src/dialogxml/widgets/field.hpp +++ b/src/dialogxml/widgets/field.hpp @@ -42,9 +42,9 @@ public: return {EVT_FOCUS, EVT_DEFOCUS}; } bool handleClick(location where) override; - void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override; - short getFormat(eFormat prop) throw(xUnsupportedProp) override; - void setColour(sf::Color clr) throw(xUnsupportedProp) override; + void setFormat(eFormat prop, short val) override; + short getFormat(eFormat prop) override; + void setColour(sf::Color clr) override; void setText(std::string to) override; storage_t store() override; void restore(storage_t to) override; @@ -54,7 +54,7 @@ public: /// Set the input type of the field. /// @param newType The new input type. void setInputType(eFldType newType); - sf::Color getColour() throw(xUnsupportedProp) override; + sf::Color getColour() override; /// Create a new editable text field. /// @param parent The parent dialog. explicit cTextField(cDialog& parent); diff --git a/src/dialogxml/widgets/message.cpp b/src/dialogxml/widgets/message.cpp index 2005c35d4..558352ff1 100644 --- a/src/dialogxml/widgets/message.cpp +++ b/src/dialogxml/widgets/message.cpp @@ -12,11 +12,11 @@ extern sf::Texture bg_gworld; -void cTextMsg::setColour(sf::Color clr) throw(xUnsupportedProp) { +void cTextMsg::setColour(sf::Color clr) { color = clr; } -void cTextMsg::setFormat(eFormat prop, short val) throw(xUnsupportedProp){ +void cTextMsg::setFormat(eFormat prop, short val){ switch(prop){ case TXT_FRAME: drawFramed = val; @@ -38,11 +38,11 @@ void cTextMsg::setFormat(eFormat prop, short val) throw(xUnsupportedProp){ } } -sf::Color cTextMsg::getColour() throw(xUnsupportedProp) { +sf::Color cTextMsg::getColour() { return color; } -short cTextMsg::getFormat(eFormat prop) throw(xUnsupportedProp){ +short cTextMsg::getFormat(eFormat prop){ switch(prop){ case TXT_FRAME: return drawFramed; diff --git a/src/dialogxml/widgets/message.hpp b/src/dialogxml/widgets/message.hpp index 0d142b163..931759c48 100644 --- a/src/dialogxml/widgets/message.hpp +++ b/src/dialogxml/widgets/message.hpp @@ -23,10 +23,10 @@ class cTextMsg : public cControl { public: std::string parse(ticpp::Element& who, std::string fname); - void setFormat(eFormat prop, short val) throw(xUnsupportedProp); - short getFormat(eFormat prop) throw(xUnsupportedProp); - void setColour(sf::Color clr) throw(xUnsupportedProp); - sf::Color getColour() throw(xUnsupportedProp); + void setFormat(eFormat prop, short val); + short getFormat(eFormat prop); + void setColour(sf::Color clr); + sf::Color getColour(); /// Create a new text message. /// @param parent The parent dialog. explicit cTextMsg(cDialog& parent); diff --git a/src/dialogxml/widgets/pict.cpp b/src/dialogxml/widgets/pict.cpp index fb9edcd10..84f416627 100644 --- a/src/dialogxml/widgets/pict.cpp +++ b/src/dialogxml/widgets/pict.cpp @@ -75,25 +75,25 @@ std::map& cPict::drawPict(){ return f; } -void cPict::setFormat(eFormat prop, short val) throw(xUnsupportedProp){ +void cPict::setFormat(eFormat prop, short val){ if(prop == TXT_FRAME) drawFramed = val; else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val); else if(prop == TXT_WRAP) drawScaled = !val; else throw xUnsupportedProp(prop); } -short cPict::getFormat(eFormat prop) throw(xUnsupportedProp){ +short cPict::getFormat(eFormat prop){ if(prop == TXT_FRAME) return drawFramed; else if(prop == TXT_FRAMESTYLE) return frameStyle; else if(prop == TXT_WRAP) return !drawScaled; else throw xUnsupportedProp(prop); } -void cPict::setColour(sf::Color) throw(xUnsupportedProp) { +void cPict::setColour(sf::Color) { // TODO: Colour is not supported } -sf::Color cPict::getColour() throw(xUnsupportedProp) { +sf::Color cPict::getColour() { // TODO: Colour is not supported return sf::Color(); } diff --git a/src/dialogxml/widgets/pict.hpp b/src/dialogxml/widgets/pict.hpp index 44bf1f402..57c69dcf4 100644 --- a/src/dialogxml/widgets/pict.hpp +++ b/src/dialogxml/widgets/pict.hpp @@ -26,10 +26,10 @@ public: /// @copydoc cDialog::init() static void init(); std::string parse(ticpp::Element& who, std::string fname); - void setFormat(eFormat prop, short val) throw(xUnsupportedProp); - short getFormat(eFormat prop) throw(xUnsupportedProp); - void setColour(sf::Color clr) throw(xUnsupportedProp); - sf::Color getColour() throw(xUnsupportedProp); + void setFormat(eFormat prop, short val); + short getFormat(eFormat prop); + void setColour(sf::Color clr); + sf::Color getColour(); storage_t store(); void restore(storage_t to); /// @copydoc setPict(pic_num_t) diff --git a/src/dialogxml/widgets/scrollbar.cpp b/src/dialogxml/widgets/scrollbar.cpp index 367587d9f..aa1be4922 100644 --- a/src/dialogxml/widgets/scrollbar.cpp +++ b/src/dialogxml/widgets/scrollbar.cpp @@ -353,19 +353,19 @@ bool cScrollbar::handleClick(location where) { return clicked; } -void cScrollbar::setFormat(eFormat prop, short) throw(xUnsupportedProp) { +void cScrollbar::setFormat(eFormat prop, short) { throw xUnsupportedProp(prop); } -short cScrollbar::getFormat(eFormat prop) throw(xUnsupportedProp) { +short cScrollbar::getFormat(eFormat prop) { throw xUnsupportedProp(prop); } -void cScrollbar::setColour(sf::Color) throw(xUnsupportedProp) { +void cScrollbar::setColour(sf::Color) { // TODO: Colour is unsupported } -sf::Color cScrollbar::getColour() throw(xUnsupportedProp) { +sf::Color cScrollbar::getColour() { // TODO: Colour is unsupported return sf::Color(); } diff --git a/src/dialogxml/widgets/scrollbar.hpp b/src/dialogxml/widgets/scrollbar.hpp index a897399b5..23c9c7f92 100644 --- a/src/dialogxml/widgets/scrollbar.hpp +++ b/src/dialogxml/widgets/scrollbar.hpp @@ -72,10 +72,10 @@ public: /// @param parent The parent dialog. explicit cScrollbar(cDialog& parent); bool handleClick(location where); - void setFormat(eFormat prop, short val) throw(xUnsupportedProp); - short getFormat(eFormat prop) throw(xUnsupportedProp); - void setColour(sf::Color clr) throw(xUnsupportedProp); - sf::Color getColour() throw(xUnsupportedProp); + void setFormat(eFormat prop, short val); + short getFormat(eFormat prop); + void setColour(sf::Color clr); + sf::Color getColour(); storage_t store(); void restore(storage_t to); bool isClickable(); diff --git a/src/dialogxml/widgets/scrollpane.cpp b/src/dialogxml/widgets/scrollpane.cpp index ad5e17e19..3786861ee 100644 --- a/src/dialogxml/widgets/scrollpane.cpp +++ b/src/dialogxml/widgets/scrollpane.cpp @@ -70,23 +70,23 @@ void cScrollPane::recalcRect() { frame.right += scrollFrame.width(); } -void cScrollPane::setFormat(eFormat prop, short val) throw(xUnsupportedProp) { +void cScrollPane::setFormat(eFormat prop, short val) { if(prop == TXT_FRAME) framed = val; else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val); else throw xUnsupportedProp(prop); } -short cScrollPane::getFormat(eFormat prop) throw(xUnsupportedProp) { +short cScrollPane::getFormat(eFormat prop) { if(prop == TXT_FRAME) return framed; else if(prop == TXT_FRAMESTYLE) return frameStyle; else throw xUnsupportedProp(prop); } -void cScrollPane::setColour(sf::Color) throw(xUnsupportedProp) { +void cScrollPane::setColour(sf::Color) { // TODO: Colour is not supported } -sf::Color cScrollPane::getColour() throw(xUnsupportedProp) { +sf::Color cScrollPane::getColour() { // TODO: Colour is not supported return sf::Color(); } diff --git a/src/dialogxml/widgets/scrollpane.hpp b/src/dialogxml/widgets/scrollpane.hpp index 5ea1699d2..faad0e518 100644 --- a/src/dialogxml/widgets/scrollpane.hpp +++ b/src/dialogxml/widgets/scrollpane.hpp @@ -25,10 +25,10 @@ public: explicit cScrollPane(cDialog& parent); std::string parse(ticpp::Element& who, std::string fname) override; bool handleClick(location where) override; - void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override; - short getFormat(eFormat prop) throw(xUnsupportedProp) override; - void setColour(sf::Color clr) throw(xUnsupportedProp) override; - sf::Color getColour() throw(xUnsupportedProp) override; + void setFormat(eFormat prop, short val) override; + short getFormat(eFormat prop) override; + void setColour(sf::Color clr) override; + sf::Color getColour() override; bool hasChild(std::string id) override; cControl& getChild(std::string id) override; storage_t store() override; diff --git a/src/dialogxml/widgets/stack.cpp b/src/dialogxml/widgets/stack.cpp index 059cb3819..5bc601716 100644 --- a/src/dialogxml/widgets/stack.cpp +++ b/src/dialogxml/widgets/stack.cpp @@ -32,23 +32,23 @@ void cContainer::callHandler(event_fcn::type onClick, cDialog& me, st getChild(which_clicked).triggerClickHandler(me, which_clicked, mods); } -void cStack::setFormat(eFormat prop, short val) throw(xUnsupportedProp) { +void cStack::setFormat(eFormat prop, short val) { if(prop == TXT_FRAME) drawFramed = val; else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val); else throw xUnsupportedProp(prop); } -short cStack::getFormat(eFormat prop) throw(xUnsupportedProp) { +short cStack::getFormat(eFormat prop) { if(prop == TXT_FRAME) return drawFramed; else if(prop == TXT_FRAMESTYLE) return frameStyle; throw xUnsupportedProp(prop); } -void cStack::setColour(sf::Color) throw(xUnsupportedProp) { +void cStack::setColour(sf::Color) { // TODO: Colour is not supported } -sf::Color cStack::getColour() throw(xUnsupportedProp) { +sf::Color cStack::getColour() { // TODO: Colour is not supported return sf::Color(); } diff --git a/src/dialogxml/widgets/stack.hpp b/src/dialogxml/widgets/stack.hpp index 886e9e1f4..640eb74fe 100644 --- a/src/dialogxml/widgets/stack.hpp +++ b/src/dialogxml/widgets/stack.hpp @@ -39,10 +39,10 @@ class cStack : public cContainer { bool drawFramed = false; public: std::string parse(ticpp::Element& who, std::string fname) override; - void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override; - short getFormat(eFormat prop) throw(xUnsupportedProp) override; - void setColour(sf::Color clr) throw(xUnsupportedProp) override; - sf::Color getColour() throw(xUnsupportedProp) override; + void setFormat(eFormat prop, short val) override; + short getFormat(eFormat prop) override; + void setColour(sf::Color clr) override; + sf::Color getColour() override; bool isClickable() override; bool isFocusable() override; bool isScrollable() override;