OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/parser/xfa_utils.h" | 7 #include "xfa/fxfa/parser/xfa_utils.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fde/xml/fde_xml_imp.h" | 10 #include "xfa/fde/xml/fde_xml_imp.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode, | 189 void XFA_GetPlainTextFromRichText(CFDE_XMLNode* pXMLNode, |
190 CFX_WideString& wsPlainText) { | 190 CFX_WideString& wsPlainText) { |
191 if (pXMLNode == NULL) { | 191 if (pXMLNode == NULL) { |
192 return; | 192 return; |
193 } | 193 } |
194 switch (pXMLNode->GetType()) { | 194 switch (pXMLNode->GetType()) { |
195 case FDE_XMLNODE_Element: { | 195 case FDE_XMLNODE_Element: { |
196 CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); | 196 CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); |
197 CFX_WideString wsTag; | 197 CFX_WideString wsTag; |
198 pXMLElement->GetLocalTagName(wsTag); | 198 pXMLElement->GetLocalTagName(wsTag); |
199 uint32_t uTag = | 199 uint32_t uTag = FX_HashCode_GetW(wsTag.AsStringC(), true); |
200 FX_HashCode_String_GetW(wsTag.c_str(), wsTag.GetLength(), TRUE); | |
201 if (uTag == 0x0001f714) { | 200 if (uTag == 0x0001f714) { |
202 wsPlainText += L"\n"; | 201 wsPlainText += L"\n"; |
203 } else if (uTag == 0x00000070) { | 202 } else if (uTag == 0x00000070) { |
204 if (!wsPlainText.IsEmpty()) { | 203 if (!wsPlainText.IsEmpty()) { |
205 wsPlainText += L"\n"; | 204 wsPlainText += L"\n"; |
206 } | 205 } |
207 } else if (uTag == 0xa48ac63) { | 206 } else if (uTag == 0xa48ac63) { |
208 if (!wsPlainText.IsEmpty() && | 207 if (!wsPlainText.IsEmpty() && |
209 wsPlainText[wsPlainText.GetLength() - 1] != '\n') { | 208 wsPlainText[wsPlainText.GetLength() - 1] != '\n') { |
210 wsPlainText += L"\n"; | 209 wsPlainText += L"\n"; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal) { | 363 FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal) { |
365 CFX_WideString wsValue = CFX_WideString::FromUTF8(szStringVal); | 364 CFX_WideString wsValue = CFX_WideString::FromUTF8(szStringVal); |
366 return XFA_WideStringToDouble(wsValue); | 365 return XFA_WideStringToDouble(wsValue); |
367 } | 366 } |
368 | 367 |
369 int32_t XFA_MapRotation(int32_t nRotation) { | 368 int32_t XFA_MapRotation(int32_t nRotation) { |
370 nRotation = nRotation % 360; | 369 nRotation = nRotation % 360; |
371 nRotation = nRotation < 0 ? nRotation + 360 : nRotation; | 370 nRotation = nRotation < 0 ? nRotation + 360 : nRotation; |
372 return nRotation; | 371 return nRotation; |
373 } | 372 } |
OLD | NEW |