summaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass
diff options
context:
space:
mode:
authorHaijian Wang <haijian@vaadin.com>2013-02-12 11:54:10 +0200
committerHaijian Wang <haijian@vaadin.com>2013-02-12 11:54:10 +0200
commit28cb23f111782a2335a9eec47f93633e064d068d (patch)
treec707fd0c87a2eea887f81ff7dcf864e93553da41 /theme-compiler/src/com/vaadin/sass
parent03e620287b910e6f3f0d03c369f2eaa9a6d15346 (diff)
downloadvaadin-framework-28cb23f111782a2335a9eec47f93633e064d068d.tar.gz
vaadin-framework-28cb23f111782a2335a9eec47f93633e064d068d.zip
Referencing multiple params in multiple lines inside mixin (Ticket
#10987) Change-Id: I3d97849afac763a9774cee254778e068f94a23e0
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass')
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
index 3527a77642..ae097537b9 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
@@ -28,6 +28,7 @@ import java.io.Serializable;
import org.w3c.css.sac.LexicalUnit;
import com.vaadin.sass.internal.util.ColorUtil;
+import com.vaadin.sass.internal.util.DeepCopy;
/**
* @version $Revision: 1.3 $
@@ -380,23 +381,26 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
}
public void replaceValue(LexicalUnitImpl another) {
- type = another.getLexicalUnitType();
- i = another.getIntegerValue();
- f = another.getFloatValue();
- s = another.getStringValue();
- fname = another.getFunctionName();
- prev = another.getPreviousLexicalUnit();
- dimension = another.getDimension();
- sdimension = another.getSdimension();
- params = another.getParameters();
-
- LexicalUnitImpl finalNextInAnother = another;
+ // shouldn't modify 'another' directly, should only modify its copy.
+ LexicalUnitImpl deepCopyAnother = (LexicalUnitImpl) DeepCopy
+ .copy(another);
+ type = deepCopyAnother.getLexicalUnitType();
+ i = deepCopyAnother.getIntegerValue();
+ f = deepCopyAnother.getFloatValue();
+ s = deepCopyAnother.getStringValue();
+ fname = deepCopyAnother.getFunctionName();
+ prev = deepCopyAnother.getPreviousLexicalUnit();
+ dimension = deepCopyAnother.getDimension();
+ sdimension = deepCopyAnother.getSdimension();
+ params = deepCopyAnother.getParameters();
+
+ LexicalUnitImpl finalNextInAnother = deepCopyAnother;
while (finalNextInAnother.getNextLexicalUnit() != null) {
finalNextInAnother = finalNextInAnother.getNextLexicalUnit();
}
finalNextInAnother.setNextLexicalUnit(next);
- next = another.next;
+ next = deepCopyAnother.next;
}
public void setParameters(LexicalUnitImpl params) {
@@ -617,8 +621,7 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
@Override
public LexicalUnitImpl clone() {
- LexicalUnitImpl cloned = new LexicalUnitImpl(type, line, column,
- (LexicalUnitImpl) prev);
+ LexicalUnitImpl cloned = new LexicalUnitImpl(type, line, column, prev);
cloned.replaceValue(this);
return cloned;
}
@@ -636,8 +639,9 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
return i;
} else if (f != -1) {
return f;
- } else
+ } else {
return null;
+ }
}
public void setFunctionName(String functionName) {