Bug 1087982, part 2 - Get rid of the pass-char-by-value variant of nsRenderingContext::GetWidth. r=jfkthame

This commit is contained in:
Jonathan Watt 2014-10-24 11:00:22 +01:00
parent fc52fab94a
commit de3b204a75
3 changed files with 2 additions and 13 deletions

View File

@ -93,16 +93,6 @@ nsRenderingContext::GetMaxChunkLength()
return std::min(mFontMetrics->GetMaxStringLength(), MAX_GFX_TEXT_BUF_SIZE);
}
nscoord
nsRenderingContext::GetWidth(char aC)
{
if (aC == ' ') {
return mFontMetrics->SpaceWidth();
}
return GetWidth(&aC, 1);
}
nscoord
nsRenderingContext::GetWidth(char16_t aC)
{

View File

@ -47,7 +47,6 @@ public:
void SetTextRunRTL(bool aIsRTL);
nscoord GetWidth(char aC);
nscoord GetWidth(char16_t aC);
nscoord GetWidth(const nsString& aString);
nscoord GetWidth(const char* aString);

View File

@ -1015,8 +1015,8 @@ nsImageFrame::MeasureString(const char16_t* aString,
nsRenderingContext& aContext)
{
nscoord totalWidth = 0;
aContext.SetTextRunRTL(false);
nscoord spaceWidth = aContext.GetWidth(' ');
aContext.FontMetrics()->SetTextRunRTL(false);
nscoord spaceWidth = aContext.FontMetrics()->SpaceWidth();
aMaxFit = 0;
while (aLength > 0) {