Issue 1437 attachment: pdfium-1437.patch (2.1 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/core/fxcrt/css/cfx_cssstyleselector.cpp b/core/fxcrt/css/cfx_cssstyleselector.cpp
index f6b48bd..5c021b2 100644
--- a/core/fxcrt/css/cfx_cssstyleselector.cpp
+++ b/core/fxcrt/css/cfx_cssstyleselector.cpp
@@ -144,7 +144,6 @@ void CFX_CSSStyleSelector::AppendInlineStyle(CFX_CSSDeclaration* pDecl,

auto pSyntax = pdfium::MakeUnique<CFX_CSSSyntaxParser>(
style.c_str(), style.GetLength(), 32, true);
- int32_t iLen2 = 0;
const CFX_CSSData::Property* property = nullptr;
WideString wsName;
while (1) {
@@ -155,12 +154,12 @@ void CFX_CSSStyleSelector::AppendInlineStyle(CFX_CSSDeclaration* pDecl,
if (!property)
wsName = WideString(strValue);
} else if (eStatus == CFX_CSSSyntaxStatus::PropertyValue) {
- if (property || iLen2 > 0) {
+ if (property || !wsName.IsEmpty()) {
WideStringView strValue = pSyntax->GetCurrentString();
if (!strValue.IsEmpty()) {
if (property)
pDecl->AddProperty(property, strValue);
- else if (iLen2 > 0)
+ else
pDecl->AddProperty(wsName, WideString(strValue));
}
}
diff --git a/core/fxcrt/css/cfx_cssstylesheet.cpp b/core/fxcrt/css/cfx_cssstylesheet.cpp
index c7300fb..bf592bc 100644
--- a/core/fxcrt/css/cfx_cssstylesheet.cpp
+++ b/core/fxcrt/css/cfx_cssstylesheet.cpp
@@ -61,7 +61,6 @@ CFX_CSSSyntaxStatus CFX_CSSStyleSheet::LoadStyleRule(
std::vector<std::unique_ptr<CFX_CSSSelector>> selectors;

CFX_CSSStyleRule* pStyleRule = nullptr;
- int32_t iValueLen = 0;
const CFX_CSSData::Property* property = nullptr;
WideString wsName;
while (1) {
@@ -81,10 +80,10 @@ CFX_CSSSyntaxStatus CFX_CSSStyleSheet::LoadStyleRule(
break;
}
case CFX_CSSSyntaxStatus::PropertyValue: {
- if (property || iValueLen > 0) {
+ if (property || !wsName.IsEmpty()) {
WideStringView strValue = pSyntax->GetCurrentString();
- auto* decl = pStyleRule->GetDeclaration();
if (!strValue.IsEmpty()) {
+ auto* decl = pStyleRule->GetDeclaration();
if (property) {
decl->AddProperty(property, strValue);
} else {