mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 960822 - Follow-up: use StringBeginsWith instead of Truncate+EqualsLiteral. r=dholbert
This commit is contained in:
parent
fced1aaae0
commit
24ebbd1ca4
@ -2036,12 +2036,8 @@ nsPrintEngine::UpdateSelectionAndShrinkPrintObject(nsPrintObject* aPO,
|
||||
// Limit the shrink-to-fit scaling for some text-ish type of documents.
|
||||
nsAutoString contentType;
|
||||
aPO->mPresShell->GetDocument()->GetContentType(contentType);
|
||||
bool applyLimit = contentType.EqualsLiteral("application/xhtml+xml");
|
||||
if (contentType.Length() > 5) {
|
||||
contentType.Truncate(5);
|
||||
}
|
||||
applyLimit = applyLimit || contentType.EqualsLiteral("text/");
|
||||
if (applyLimit) {
|
||||
if (contentType.EqualsLiteral("application/xhtml+xml") ||
|
||||
StringBeginsWith(contentType, NS_LITERAL_STRING("text/"))) {
|
||||
int32_t limitPercent =
|
||||
Preferences::GetInt("print.shrink-to-fit.scale-limit-percent", 20);
|
||||
limitPercent = std::max(0, limitPercent);
|
||||
|
Loading…
Reference in New Issue
Block a user