Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp

Issue 1526103002: Shrink SVGPreserveAspectRatio::valueAsString (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android warning. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp
index 063f20c325f275817a7cb2ee7a8b78e6b49198aa..86a00ecb36c1d5961243beb12112c4b4995bca82 100644
--- a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp
@@ -331,53 +331,60 @@ AffineTransform SVGPreserveAspectRatio::getCTM(float logicalX, float logicalY, f
String SVGPreserveAspectRatio::valueAsString() const
{
- String alignType;
+ StringBuilder builder;
+ const char* alignString = "";
switch (m_align) {
case SVG_PRESERVEASPECTRATIO_NONE:
- alignType = "none";
+ alignString = "none";
break;
case SVG_PRESERVEASPECTRATIO_XMINYMIN:
- alignType = "xMinYMin";
+ alignString = "xMinYMin";
break;
case SVG_PRESERVEASPECTRATIO_XMIDYMIN:
- alignType = "xMidYMin";
+ alignString = "xMidYMin";
break;
case SVG_PRESERVEASPECTRATIO_XMAXYMIN:
- alignType = "xMaxYMin";
+ alignString = "xMaxYMin";
break;
case SVG_PRESERVEASPECTRATIO_XMINYMID:
- alignType = "xMinYMid";
+ alignString = "xMinYMid";
break;
case SVG_PRESERVEASPECTRATIO_XMIDYMID:
- alignType = "xMidYMid";
+ alignString = "xMidYMid";
break;
case SVG_PRESERVEASPECTRATIO_XMAXYMID:
- alignType = "xMaxYMid";
+ alignString = "xMaxYMid";
break;
case SVG_PRESERVEASPECTRATIO_XMINYMAX:
- alignType = "xMinYMax";
+ alignString = "xMinYMax";
break;
case SVG_PRESERVEASPECTRATIO_XMIDYMAX:
- alignType = "xMidYMax";
+ alignString = "xMidYMax";
break;
case SVG_PRESERVEASPECTRATIO_XMAXYMAX:
- alignType = "xMaxYMax";
+ alignString = "xMaxYMax";
break;
case SVG_PRESERVEASPECTRATIO_UNKNOWN:
- alignType = "unknown";
+ alignString = "unknown";
break;
- };
+ }
+ builder.append(alignString);
+ const char* meetOrSliceString = "";
switch (m_meetOrSlice) {
default:
case SVG_MEETORSLICE_UNKNOWN:
- return alignType;
+ break;
case SVG_MEETORSLICE_MEET:
- return alignType + " meet";
+ meetOrSliceString = " meet";
+ break;
case SVG_MEETORSLICE_SLICE:
- return alignType + " slice";
+ meetOrSliceString = " slice";
+ break;
}
+ builder.append(meetOrSliceString);
+ return builder.toString();
}
void SVGPreserveAspectRatio::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698