Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_stockfontarray.cpp
Go to the documentation of this file.
1
// Copyright 2017 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"core/fpdfapi/font/cfx_stockfontarray.h"
8
9
#
include
<
iterator
>
10
#
include
<
utility
>
11
12
#
include
"core/fpdfapi/font/cpdf_font.h"
13
#
include
"core/fpdfapi/parser/cpdf_dictionary.h"
14
#
include
"third_party/base/check_op.h"
15
16
CFX_StockFontArray
::
CFX_StockFontArray
() =
default
;
17
18
CFX_StockFontArray
::~
CFX_StockFontArray
() {
19
for
(size_t i = 0; i < std::size(m_StockFonts); ++i) {
20
if
(m_StockFonts[i]) {
21
// Ensure m_StockFonts[i]'s dict is cleared before releasing what
22
// may be the last reference to it.
23
RetainPtr
<CPDF_Dictionary> destroy =
24
m_StockFonts[i]->GetMutableFontDict();
25
m_StockFonts[i]->ClearFontDict();
26
}
27
}
28
}
29
30
RetainPtr
<
CPDF_Font
>
CFX_StockFontArray
::
GetFont
(
31
CFX_FontMapper
::
StandardFont
index)
const
{
32
CHECK_LT(index, std::size(m_StockFonts));
33
return
m_StockFonts[index];
34
}
35
36
void
CFX_StockFontArray
::
SetFont
(
CFX_FontMapper
::
StandardFont
index,
37
RetainPtr
<
CPDF_Font
> pFont) {
38
if
(index < std::size(m_StockFonts))
39
m_StockFonts[index] = std::move(pFont);
40
}
CFX_FontMapper
Definition
cfx_fontmapper.h:30
CFX_FontMapper::StandardFont
StandardFont
Definition
cfx_fontmapper.h:32
CFX_StockFontArray
Definition
cfx_stockfontarray.h:15
CFX_StockFontArray::~CFX_StockFontArray
~CFX_StockFontArray()
Definition
cfx_stockfontarray.cpp:18
CFX_StockFontArray::CFX_StockFontArray
CFX_StockFontArray()
CFX_StockFontArray::SetFont
void SetFont(CFX_FontMapper::StandardFont index, RetainPtr< CPDF_Font > pFont)
Definition
cfx_stockfontarray.cpp:36
CFX_StockFontArray::GetFont
RetainPtr< CPDF_Font > GetFont(CFX_FontMapper::StandardFont index) const
Definition
cfx_stockfontarray.cpp:30
CPDF_Font
Definition
cpdf_font.h:38
fxcrt::RetainPtr
Definition
retain_ptr.h:29
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfapi
font
cfx_stockfontarray.cpp
Generated on Thu Nov 14 2024 00:55:10 for Qt by
1.12.0