1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #include <pdf/ResourceDict.hxx>
17 void appendResourceMap(OStringBuffer
& rBuf
, const char* pPrefix
,
18 std::map
<OString
, sal_Int32
> const& rList
)
26 for (auto const& item
: rList
)
28 if (!item
.first
.isEmpty() && item
.second
> 0)
31 rBuf
.append(item
.first
);
33 rBuf
.append(item
.second
);
35 if (((++ni
) & 7) == 0)
43 void ResourceDict::append(OStringBuffer
& rBuf
, sal_Int32 nFontDictObject
)
45 rBuf
.append("<</Font ");
46 rBuf
.append(nFontDictObject
);
47 rBuf
.append(" 0 R\n");
48 appendResourceMap(rBuf
, "XObject", m_aXObjects
);
49 appendResourceMap(rBuf
, "ExtGState", m_aExtGStates
);
50 appendResourceMap(rBuf
, "Shading", m_aShadings
);
51 appendResourceMap(rBuf
, "Pattern", m_aPatterns
);
52 rBuf
.append("/ProcSet[/PDF/Text");
53 if (!m_aXObjects
.empty())
54 rBuf
.append("/ImageC/ImageI/ImageB");
55 rBuf
.append("]\n>>\n");
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */