Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: xfa/fde/css/fde_cssdatatable.cpp

Issue 1992033002: fgas/ code cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_cssdatatable.h" 7 #include "xfa/fde/css/fde_cssdatatable.h"
8 8
9 #include "core/fxcrt/include/fx_ext.h" 9 #include "core/fxcrt/include/fx_ext.h"
10 #include "xfa/fgas/crt/fgas_algorithm.h" 10 #include "xfa/fgas/crt/fgas_algorithm.h"
11 #include "xfa/fgas/crt/fgas_codepage.h" 11 #include "xfa/fgas/crt/fgas_codepage.h"
12 #include "xfa/fgas/crt/fgas_system.h" 12 #include "xfa/fgas/crt/fgas_system.h"
13 13
14 namespace {
15
16 const uint8_t g_FXHex2DecMap[256] = {
Tom Sepez 2016/05/18 22:01:21 seems like a lot of wasted space. In particular w
dsinclair 2016/05/19 14:24:44 Removed completely, we already have a FXSYS_toHexD
17 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
19 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0,
20 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12,
22 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
23 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
24 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
25 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
26 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
27 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
28 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
30 };
31
32 uint8_t FX_Hex2Dec(uint8_t hexHigh, uint8_t hexLow) {
33 return (g_FXHex2DecMap[hexHigh] << 4) + g_FXHex2DecMap[hexLow];
34 }
35
36 } // namespace
37
14 FX_BOOL FDE_CSSLengthToFloat(const FDE_CSSLENGTH& len, 38 FX_BOOL FDE_CSSLengthToFloat(const FDE_CSSLENGTH& len,
15 FX_FLOAT fPercentBase, 39 FX_FLOAT fPercentBase,
16 FX_FLOAT& fResult) { 40 FX_FLOAT& fResult) {
17 switch (len.GetUnit()) { 41 switch (len.GetUnit()) {
18 case FDE_CSSLENGTHUNIT_Point: 42 case FDE_CSSLENGTHUNIT_Point:
19 fResult = len.GetValue(); 43 fResult = len.GetValue();
20 return TRUE; 44 return TRUE;
21 case FDE_CSSLENGTHUNIT_Percent: 45 case FDE_CSSLENGTHUNIT_Percent:
22 fResult = len.GetValue() * fPercentBase; 46 fResult = len.GetValue() * fPercentBase;
23 return TRUE; 47 return TRUE;
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 } 904 }
881 while (iBracketCount > 0 && m_pCur < m_pEnd) { 905 while (iBracketCount > 0 && m_pCur < m_pEnd) {
882 if (*m_pCur == ')') { 906 if (*m_pCur == ')') {
883 iBracketCount--; 907 iBracketCount--;
884 } 908 }
885 m_pCur++; 909 m_pCur++;
886 } 910 }
887 } 911 }
888 return m_pCur - pStart; 912 return m_pCur - pStart;
889 } 913 }
OLDNEW
« no previous file with comments | « xfa.gyp ('k') | xfa/fde/css/fde_csssyntax.cpp » ('j') | xfa/fgas/crt/fgas_algorithm.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698