You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/01/11 06:49:29 UTC

[royale-asjs] 08/10: eliminate warnings from Closure Compiler

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 14509349f5b466df8591a9729793b8aa7ed9fb7a
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Jan 10 13:34:36 2019 -0800

    eliminate warnings from Closure Compiler
---
 .../src/main/royale/spark/components/RichText.as   | 10 ++++----
 .../royale/textLayout/compose/TextFlowLine.as      |  1 +
 .../textLayout/container/ContainerController.as    |  6 +++--
 .../conversion/BaseTextLayoutExporter.as           |  4 +++-
 .../textLayout/conversion/TextLayoutImporter.as    |  4 +++-
 .../royale/textLayout/elements/LeadingUtils.as     |  2 ++
 .../royale/textLayout/elements/TableElement.as     |  4 +++-
 .../royale/textLayout/elements/TableLeafElement.as |  5 +++-
 .../events/FlowElementMouseEventManager.as         | 28 +++++++++++-----------
 9 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as
index c3a982c..21974ab 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichText.as
@@ -960,17 +960,17 @@ public class RichText extends TextBase implements IStyleClient
         // We might not have a valid _textFlow for two reasons:
         // either because the 'text' was set (which is the state
         // after construction) or because the 'content' was set.
+        /*
         if (!_textFlow)
         {
-            /*
             if (_content != null)
                 _textFlow = createTextFlowFromContent(_content);
             else
                 _textFlow = staticPlainTextImporter.importToFlow(_text);
             
             lastGeneration = _textFlow ? _textFlow.generation : 0;
-            */
         }
+        */
         /*
         _textFlow.addEventListener(DamageEvent.DAMAGE,
                                    textFlow_damageHandler);
@@ -1347,11 +1347,11 @@ public class RichText extends TextBase implements IStyleClient
         }
         else if (factory is TextFlowTextLineFactory)
         {
-            if (_textFlow && _textFlow.flowComposer)
-            {
+            // if (_textFlow && _textFlow.flowComposer)
+            // {
                 //_textFlow.flowComposer.swfContext = 
                 //    ISWFContext(embeddedFontContext);
-            }
+            // }
             
             //staticTextFlowFactory.swfContext = ISWFContext(embeddedFontContext);
             staticTextFlowFactory.createTextLines(addTextLine, _textFlow);
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/compose/TextFlowLine.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/compose/TextFlowLine.as
index d9c78b1..c9caa77 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/compose/TextFlowLine.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/compose/TextFlowLine.as
@@ -1749,6 +1749,7 @@ package org.apache.royale.textLayout.compose
 		}
 
 		/** @private 
+         * @suppress {uselessCode}
 		 * 
 		 * ? Get a list of rects of the characters in the given textline? Used to show selection? JF 
 		 */
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/container/ContainerController.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/container/ContainerController.as
index 88ab9ff..11451b7 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/container/ContainerController.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/container/ContainerController.as
@@ -4589,12 +4589,14 @@ package org.apache.royale.textLayout.container
 				var xpos:int = horizontalScrollPosition + xOrigin;
 				var ypos:int = verticalScrollPosition;
 				//Fix bug 2869747 textFlow.flowComposer.getControllerAt(0)
-				if(!_hasScrollRect)
+                CONFIG::debug { 
+                if(!_hasScrollRect)
 				{
 //TODO scrollRect
 //						_container.scrollRect = null;
-						CONFIG::debug { Debugging.traceFTECall(null,_container,"clearContainerScrollRect()"); }
+						Debugging.traceFTECall(null,_container,"clearContainerScrollRect()");
 				}
+                }
 				
 				if (textLength == 0 || xpos == 0 && ypos == 0 && _contentLeft >= xOrigin && _contentTop >= 0 && contentRight <= compositionRight && contentBottom <= compositionBottom)
 				{
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/BaseTextLayoutExporter.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/BaseTextLayoutExporter.as
index 0af6da1..78979d0 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/BaseTextLayoutExporter.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/BaseTextLayoutExporter.as
@@ -465,12 +465,14 @@ package org.apache.royale.textLayout.conversion
 		{
 			var output:XMLList = exportContainerFormattedElement(exporter, textFlow);
 			
+            /*
 			if (exporter.config.whiteSpaceCollapse) {
 				// TextLayout will use PRESERVE on output
 //TODO @
 				// output.@[TextLayoutFormat.whiteSpaceCollapseProperty.name] = exporter.config.whiteSpaceCollapse;
 			}
-			
+			*/
+            
 			// TextLayout adds version information
 			output.@version = TextLayoutVersion.getVersionString(TextLayoutVersion.CURRENT_VERSION);
 						
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/TextLayoutImporter.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/TextLayoutImporter.as
index c43b0b3..78013da 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/TextLayoutImporter.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/conversion/TextLayoutImporter.as
@@ -733,13 +733,15 @@ package org.apache.royale.textLayout.conversion
 			paragraph.backgroundColor = 0xFF0000;
 			paragraph.addChild(span);
 			
+            /*
 			if (editable) {
 				//textFlowContent.interactionManager = new EditManager(new UndoManager);
 			}
 			else if (selectable) {
 				//textFlowContent.interactionManager = new SelectionManager();
 			}
-			
+			*/
+            
 			textFlowContent.addChild(paragraph);
 			
 			return textFlowContent;
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/LeadingUtils.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/LeadingUtils.as
index b640bbb..51e586f 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/LeadingUtils.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/LeadingUtils.as
@@ -45,6 +45,7 @@ package org.apache.royale.textLayout.elements
 				case LeadingModel.IDEOGRAPHIC_CENTER_DOWN:
 					return org.apache.royale.text.engine.TextBaseline.IDEOGRAPHIC_CENTER;
 			}
+            return null; // makes closure compiler 20181210 happy
 		}
 
 		/** @private */
@@ -67,6 +68,7 @@ package org.apache.royale.textLayout.elements
 				case LeadingModel.IDEOGRAPHIC_CENTER_DOWN:
 					return false;
 			}
+            return true; // makes closure compiler 20181210 happy
 		}
 	}
 }
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableElement.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableElement.as
index 0c9b240..374fbc5 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableElement.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableElement.as
@@ -93,6 +93,7 @@ package org.apache.royale.textLayout.elements {
 		/** @private if its in a numbered list expand the damage to all list items - causes the numbers to be regenerated */
 		public override function modelChanged(changeType:String, elem:IFlowElement, changeStart:int, changeLen:int, needNormalize:Boolean = true, bumpGeneration:Boolean = true):void
 		{
+            /*
 			if (changeType==ModelChange.ELEMENT_ADDED) {
 				
 			}
@@ -101,7 +102,7 @@ package org.apache.royale.textLayout.elements {
 					
 				}
 			}
-			
+			*/
 			super.modelChanged(changeType,elem,changeStart,changeLen,needNormalize,bumpGeneration);
 		}
 		
@@ -750,6 +751,7 @@ package org.apache.royale.textLayout.elements {
 		}
 		
 		/**
+         * @suppress {uselessCode}
 		 * Sets the row and column indices of the cells in the table to match their logical position as described by the table columns and rows
 		 * @royaleignorecoercion org.apache.royale.textLayout.elements.ITableCellElement
 		 **/
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableLeafElement.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableLeafElement.as
index 0e661d1..2f2d983 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableLeafElement.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/elements/TableLeafElement.as
@@ -39,7 +39,10 @@ package org.apache.royale.textLayout.elements {
 			return "TableLeafElement";
 		}
 
-		/** @private */
+		/** 
+         * @suppress {uselessCode}
+         * @private 
+         */
 		override public function createContentElement():void
 		{
 			// not sure if this makes sense...
diff --git a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/events/FlowElementMouseEventManager.as b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/events/FlowElementMouseEventManager.as
index 21f715f..9d4b4cd 100644
--- a/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/events/FlowElementMouseEventManager.as
+++ b/frameworks/projects/TLF/src/main/royale/org/apache/royale/textLayout/events/FlowElementMouseEventManager.as
@@ -223,8 +223,8 @@ package org.apache.royale.textLayout.events
 			var obj:Object;
 			
 			var elements:Array = [];
-			if (textFlow.interactiveObjectCount != 0 && startPos != endPos)	// check for empty container
-			{
+			// if (textFlow.interactiveObjectCount != 0 && startPos != endPos)	// check for empty container
+			// {
 //TODO commenting this out until we figure out what to do with interactive objects
 				// //New algorithm here to improve performance when there are link elements 
 				// var uniqueDictionary:ObjectMap = container.interactiveObjects;
@@ -249,19 +249,19 @@ package org.apache.royale.textLayout.events
 					
 				// }
 				
-				CONFIG::debug
-				{
-					if (elements.length)
-					{
-						for each (var elem:IFlowElement in elements)
-						{
+				// CONFIG::debug
+				// {
+					// if (elements.length)
+					// {
+						// for each (var elem:IFlowElement in elements)
+						// {
 							// trace(startPos,endPos,elem.defaultTypeName,elem.getAbsoluteStart(),elem.textLength);
-							assert(elem.getAbsoluteStart() < endPos,"updateHitTests bad absoluteStart");
-							assert(elem.getAbsoluteStart()+elem.textLength >= startPos,"updateHitTests bad absoluteEnd"); 
-						}
-					}
-				}
-			}
+							// assert(elem.getAbsoluteStart() < endPos,"updateHitTests bad absoluteStart");
+							// assert(elem.getAbsoluteStart()+elem.textLength >= startPos,"updateHitTests bad absoluteEnd"); 
+						// }
+					// }
+				// }
+			// }
 			
 			var newHitRects:Object;
 			var rectCount:int = 0;