mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 340543 - Use IsEmpty() rather than Length() == 0 or !Length() in nsSVGCairoGlyphGeometry. r+sr=tor
This commit is contained in:
parent
f300860e44
commit
1dbfc65b62
@ -152,17 +152,10 @@ nsSVGCairoGlyphGeometry::Render(nsSVGGlyphFrame *aSource,
|
||||
nsAutoString text;
|
||||
aSource->GetCharacterData(text);
|
||||
|
||||
if (!text.Length()) {
|
||||
if (text.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoArrayPtr<nsSVGCharacterPosition> cp;
|
||||
|
||||
nsresult rv = aSource->GetCharacterPosition(getter_Transfers(cp));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
cairo_t *ctx = cairoCanvas->GetContext();
|
||||
|
||||
/* get the metrics */
|
||||
nsCOMPtr<nsISVGCairoGlyphMetrics> metrics;
|
||||
{
|
||||
@ -175,6 +168,13 @@ nsSVGCairoGlyphGeometry::Render(nsSVGGlyphFrame *aSource,
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoArrayPtr<nsSVGCharacterPosition> cp;
|
||||
|
||||
nsresult rv = aSource->GetCharacterPosition(getter_Transfers(cp));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
cairo_t *ctx = cairoCanvas->GetContext();
|
||||
|
||||
PRUint16 renderMode;
|
||||
cairo_matrix_t matrix;
|
||||
canvas->GetRenderMode(&renderMode);
|
||||
@ -251,6 +251,13 @@ nsSVGCairoGlyphGeometry::GetCoveredRegion(nsSVGGlyphFrame *aSource,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoString text;
|
||||
aSource->GetCharacterData(text);
|
||||
|
||||
if (text.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* get the metrics */
|
||||
nsCOMPtr<nsISVGCairoGlyphMetrics> metrics;
|
||||
{
|
||||
@ -268,12 +275,6 @@ nsSVGCairoGlyphGeometry::GetCoveredRegion(nsSVGGlyphFrame *aSource,
|
||||
nsresult rv = aSource->GetCharacterPosition(getter_Transfers(cp));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoString text;
|
||||
aSource->GetCharacterData(text);
|
||||
|
||||
if (text.Length() == 0)
|
||||
return NS_OK;
|
||||
|
||||
cairo_t *ctx = cairo_create(gSVGCairoDummySurface);
|
||||
|
||||
rv = GetGlobalTransform(aSource, ctx, nsnull);
|
||||
@ -359,7 +360,7 @@ nsSVGCairoGlyphGeometry::ContainsPoint(nsSVGGlyphFrame *aSource,
|
||||
nsAutoString text;
|
||||
aSource->GetCharacterData(text);
|
||||
|
||||
if (!text.Length()) {
|
||||
if (text.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -471,7 +472,7 @@ nsSVGCairoGlyphGeometry::GetBoundingBox(nsSVGGlyphFrame *aSource,
|
||||
nsAutoString text;
|
||||
aSource->GetCharacterData(text);
|
||||
|
||||
if (!text.Length()) {
|
||||
if (text.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user