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

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

Issue 1857713003: Rename GetCStr and GetPtr to match CFX_ByteString (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 8 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
« no previous file with comments | « xfa/fde/css/fde_csscache.cpp ('k') | xfa/fee/fde_txtedtengine.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_cssstyleselector.h" 7 #include "xfa/fde/css/fde_cssstyleselector.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 if (pos != NULL) { 430 if (pos != NULL) {
431 if (m_pInlineStyleStore == NULL) { 431 if (m_pInlineStyleStore == NULL) {
432 m_pInlineStyleStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 2048, 0); 432 m_pInlineStyleStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 2048, 0);
433 } 433 }
434 CFDE_CSSDeclaration* pDecl = NULL; 434 CFDE_CSSDeclaration* pDecl = NULL;
435 CFX_WideStringC wsAttri, wsValue; 435 CFX_WideStringC wsAttri, wsValue;
436 uint32_t dwAttriHash; 436 uint32_t dwAttriHash;
437 do { 437 do {
438 pTag->GetNextAttribute(pos, wsAttri, wsValue); 438 pTag->GetNextAttribute(pos, wsAttri, wsValue);
439 dwAttriHash = 439 dwAttriHash =
440 FX_HashCode_String_GetW(wsAttri.GetPtr(), wsAttri.GetLength(), TRUE); 440 FX_HashCode_String_GetW(wsAttri.raw_str(), wsAttri.GetLength(), TRUE);
441 static const uint32_t s_dwStyleHash = 441 static const uint32_t s_dwStyleHash =
442 FX_HashCode_String_GetW(L"style", 5, TRUE); 442 FX_HashCode_String_GetW(L"style", 5, TRUE);
443 static const uint32_t s_dwAlignHash = 443 static const uint32_t s_dwAlignHash =
444 FX_HashCode_String_GetW(L"align", 5, TRUE); 444 FX_HashCode_String_GetW(L"align", 5, TRUE);
445 if (dwAttriHash == s_dwStyleHash) { 445 if (dwAttriHash == s_dwStyleHash) {
446 if (pDecl == NULL) { 446 if (pDecl == NULL) {
447 pDecl = FXTARGET_NewWith(m_pInlineStyleStore) CFDE_CSSDeclaration; 447 pDecl = FXTARGET_NewWith(m_pInlineStyleStore) CFDE_CSSDeclaration;
448 } 448 }
449 AppendInlineStyle(pDecl, wsValue.GetPtr(), wsValue.GetLength()); 449 AppendInlineStyle(pDecl, wsValue.raw_str(), wsValue.GetLength());
450 } else if (dwAttriHash == s_dwAlignHash) { 450 } else if (dwAttriHash == s_dwAlignHash) {
451 if (pDecl == NULL) { 451 if (pDecl == NULL) {
452 pDecl = FXTARGET_NewWith(m_pInlineStyleStore) CFDE_CSSDeclaration; 452 pDecl = FXTARGET_NewWith(m_pInlineStyleStore) CFDE_CSSDeclaration;
453 } 453 }
454 FDE_CSSPROPERTYARGS args; 454 FDE_CSSPROPERTYARGS args;
455 args.pStringCache = NULL; 455 args.pStringCache = NULL;
456 args.pStaticStore = m_pInlineStyleStore; 456 args.pStaticStore = m_pInlineStyleStore;
457 args.pProperty = FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY_TextAlign); 457 args.pProperty = FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY_TextAlign);
458 pDecl->AddProperty(&args, wsValue.GetPtr(), wsValue.GetLength()); 458 pDecl->AddProperty(&args, wsValue.raw_str(), wsValue.GetLength());
459 } 459 }
460 } while (pos != NULL); 460 } while (pos != NULL);
461 if (pDecl != NULL) { 461 if (pDecl != NULL) {
462 CFDE_CSSDeclarationArray decls; 462 CFDE_CSSDeclarationArray decls;
463 decls.SetSize(iDeclCount + 1); 463 decls.SetSize(iDeclCount + 1);
464 IFDE_CSSDeclaration** ppInline = decls.GetData(); 464 IFDE_CSSDeclaration** ppInline = decls.GetData();
465 FXSYS_memcpy(ppInline, ppDeclArray, 465 FXSYS_memcpy(ppInline, ppDeclArray,
466 iDeclCount * sizeof(IFDE_CSSDeclaration*)); 466 iDeclCount * sizeof(IFDE_CSSDeclaration*));
467 ppInline[iDeclCount++] = pDecl; 467 ppInline[iDeclCount++] = pDecl;
468 ApplyDeclarations(TRUE, (const IFDE_CSSDeclaration**)ppInline, iDeclCount, 468 ApplyDeclarations(TRUE, (const IFDE_CSSDeclaration**)ppInline, iDeclCount,
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 return FDE_CSSTEXTTRANSFORM_LowerCase; 1785 return FDE_CSSTEXTTRANSFORM_LowerCase;
1786 default: 1786 default:
1787 return FDE_CSSTEXTTRANSFORM_None; 1787 return FDE_CSSTEXTTRANSFORM_None;
1788 } 1788 }
1789 } 1789 }
1790 FDE_CSSFONTVARIANT CFDE_CSSStyleSelector::ToFontVariant( 1790 FDE_CSSFONTVARIANT CFDE_CSSStyleSelector::ToFontVariant(
1791 FDE_CSSPROPERTYVALUE eValue) { 1791 FDE_CSSPROPERTYVALUE eValue) {
1792 return eValue == FDE_CSSPROPERTYVALUE_SmallCaps ? FDE_CSSFONTVARIANT_SmallCaps 1792 return eValue == FDE_CSSPROPERTYVALUE_SmallCaps ? FDE_CSSFONTVARIANT_SmallCaps
1793 : FDE_CSSFONTVARIANT_Normal; 1793 : FDE_CSSFONTVARIANT_Normal;
1794 } 1794 }
OLDNEW
« no previous file with comments | « xfa/fde/css/fde_csscache.cpp ('k') | xfa/fee/fde_txtedtengine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698