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/fde/css/fde_csssyntax.h" | 7 #include "xfa/fde/css/fde_csssyntax.h" |
8 | 8 |
9 #include "xfa/fde/css/fde_cssdatatable.h" | 9 #include "xfa/fde/css/fde_cssdatatable.h" |
10 #include "xfa/fgas/crt/fgas_codepage.h" | 10 #include "xfa/fgas/crt/fgas_codepage.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 break; | 328 break; |
329 case FDE_CSSSYNTAXMODE_Charset: | 329 case FDE_CSSSYNTAXMODE_Charset: |
330 if (wch == ';') { | 330 if (wch == ';') { |
331 m_TextPlane.MoveNext(); | 331 m_TextPlane.MoveNext(); |
332 SwitchMode(FDE_CSSSYNTAXMODE_RuleSet); | 332 SwitchMode(FDE_CSSSYNTAXMODE_RuleSet); |
333 if (IsCharsetEnabled()) { | 333 if (IsCharsetEnabled()) { |
334 DisableCharset(); | 334 DisableCharset(); |
335 if (m_iTextDatLen > 0) { | 335 if (m_iTextDatLen > 0) { |
336 if (m_pStream != NULL) { | 336 if (m_pStream != NULL) { |
337 uint16_t wCodePage = FX_GetCodePageFormStringW( | 337 uint16_t wCodePage = FX_GetCodePageFromStringW( |
338 m_TextData.GetBuffer(), m_iTextDatLen); | 338 m_TextData.GetBuffer(), m_iTextDatLen); |
339 if (wCodePage < 0xFFFF && | 339 if (wCodePage < 0xFFFF && |
340 m_pStream->GetCodePage() != wCodePage) { | 340 m_pStream->GetCodePage() != wCodePage) { |
341 m_pStream->SetCodePage(wCodePage); | 341 m_pStream->SetCodePage(wCodePage); |
342 } | 342 } |
343 } | 343 } |
344 return FDE_CSSSYNTAXSTATUS_Charset; | 344 return FDE_CSSSYNTAXSTATUS_Charset; |
345 } | 345 } |
346 } | 346 } |
347 } else { | 347 } else { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (iLength > m_iDatLen - iStart) { | 475 if (iLength > m_iDatLen - iStart) { |
476 iLength = m_iDatLen - iStart; | 476 iLength = m_iDatLen - iStart; |
477 } | 477 } |
478 if (iLength < 0) { | 478 if (iLength < 0) { |
479 iLength = 0; | 479 iLength = 0; |
480 } else { | 480 } else { |
481 FXSYS_memmove(m_pBuffer, m_pBuffer + iStart, iLength * sizeof(FX_WCHAR)); | 481 FXSYS_memmove(m_pBuffer, m_pBuffer + iStart, iLength * sizeof(FX_WCHAR)); |
482 } | 482 } |
483 m_iDatLen = iLength; | 483 m_iDatLen = iLength; |
484 } | 484 } |
OLD | NEW |