[sword-svn] r3780 - in trunk: include src/mgr

scribe at crosswire.org scribe at crosswire.org
Fri Aug 21 15:49:12 EDT 2020


Author: scribe
Date: 2020-08-21 15:49:12 -0400 (Fri, 21 Aug 2020)
New Revision: 3780

Modified:
   trunk/include/markupfiltmgr.h
   trunk/src/mgr/markupfiltmgr.cpp
Log:
cleaned up normailzation of markupFilterMgr


Modified: trunk/include/markupfiltmgr.h
===================================================================
--- trunk/include/markupfiltmgr.h	2020-08-15 17:03:16 UTC (rev 3779)
+++ trunk/include/markupfiltmgr.h	2020-08-21 19:49:12 UTC (rev 3780)
@@ -32,6 +32,7 @@
 * you want to use.
 */
 class SWDLLEXPORT MarkupFilterMgr : public EncodingFilterMgr {
+
 protected:
 	SWFilter* fromthml;
 	SWFilter* fromgbf;
@@ -46,6 +47,7 @@
 
 	void createFilters(char markup);
 public:
+
 	/** Constructor of SWMarkupMgr.
 	 *
 	 * @param encoding The desired encoding.
@@ -60,12 +62,25 @@
 
 	/** Markup sets/gets the markup after initialization
 	 * 
-	 * @param m The new markup or FMT_UNKNOWN if you just want to get the current markup.
+	 * DEPRECATED: use setMarkup / getMarkup
+	 *
+	 * @param m The new markup
 	 * @return The current (possibly changed) markup format.
 	 */
-	void setMarkup(char m = FMT_UNKNOWN);
+	SWDEPRECATED char Markup(char m = FMT_UNKNOWN) { if (m != FMT_UNKNOWN) setMarkup(m); return getMarkup(); }
+
+	/** getMarkup gets the markup after initialization
+	 * 
+	 * @return The current markup format.
+	 */
 	char getMarkup() const { return markup; }
 
+	/** setMarkup sets the markup after initialization
+	 * 
+	 * @param m The new markup
+	 */
+	void setMarkup(char m);
+
 	/**
 	 * Adds the render filters which are defined in "section" to the SWModule object "module".
 	 * @param module To this module the render filter(s) are added

Modified: trunk/src/mgr/markupfiltmgr.cpp
===================================================================
--- trunk/src/mgr/markupfiltmgr.cpp	2020-08-15 17:03:16 UTC (rev 3779)
+++ trunk/src/mgr/markupfiltmgr.cpp	2020-08-21 19:49:12 UTC (rev 3780)
@@ -100,6 +100,7 @@
  * RET: markup
  */
 void MarkupFilterMgr::setMarkup(char mark) {
+	if (mark && mark != markup) {
 		markup = mark;
 		ModMap::const_iterator module;
 
@@ -200,6 +201,7 @@
 		delete oldplain;
 		delete oldosis;
 		delete oldtei;
+	}
 }
 
 



More information about the sword-cvs mailing list