mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2024-12-27 08:42:48 +01:00
Use Windows color profiles
This commit is contained in:
parent
f7d7902aa9
commit
fc44fc1658
@ -29,6 +29,14 @@
|
||||
#include <lcms2_plugin.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define NOMINMAX
|
||||
#include <Windows.h>
|
||||
#include <Icm.h>
|
||||
#pragma comment(lib, "Mscms")
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace pdf
|
||||
@ -1723,11 +1731,19 @@ PDFColorProfileIdentifiers PDFCMSManager::getExternalProfilesImpl() const
|
||||
PDFColorProfileIdentifiers result;
|
||||
|
||||
QStringList directories(m_settings.profileDirectory);
|
||||
QDir applicationDirectory(QApplication::applicationDirPath());
|
||||
if (applicationDirectory.cd("colorprofiles"))
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
std::array<WCHAR, _MAX_PATH> buffer = { };
|
||||
DWORD bufferSize = DWORD(buffer.size() * sizeof(WCHAR));
|
||||
if (GetColorDirectoryW(NULL, buffer.data(), &bufferSize))
|
||||
{
|
||||
directories << applicationDirectory.absolutePath();
|
||||
const DWORD charactersWithNull = bufferSize / sizeof(WCHAR);
|
||||
const DWORD charactersWithoutNull = bufferSize > 0 ? charactersWithNull - 1 : 0;
|
||||
|
||||
QString directory = QString::fromWCharArray(buffer.data(), int(charactersWithoutNull));
|
||||
directories << QDir::fromNativeSeparators(directory);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (const QString& directory : directories)
|
||||
{
|
||||
|
@ -79,8 +79,22 @@ PDFOperationResult PDFDocumentManipulator::assemble(const AssembledPages& pages)
|
||||
// manipulating a single document).
|
||||
if (!m_flags.testFlag(SingleDocument))
|
||||
{
|
||||
PDFInteger lastDocumentIndex = pages.front().documentIndex;
|
||||
std::vector<size_t> documentPartPageCounts = { 0 };
|
||||
|
||||
for (const AssembledPage& page : pages)
|
||||
{
|
||||
if (page.documentIndex == lastDocumentIndex)
|
||||
{
|
||||
++documentPartPageCounts.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
documentPartPageCounts.push_back(1);
|
||||
lastDocumentIndex = page.documentIndex;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<size_t> documentPartPageCounts;
|
||||
documentBuilder.createDocumentParts(documentPartPageCounts);
|
||||
}
|
||||
|
||||
|
@ -2107,7 +2107,6 @@ void PDFProgramController::onActionDeveloperCreateInstaller()
|
||||
// CoreLib package
|
||||
addStartMenuShortcut("pdf4qt_framework", "maintenancetool", tr("PDF4QT Maintenance Tool"));
|
||||
addComponentMeta("pdf4qt_framework", tr("Framework (Core libraries)"), tr("Framework libraries and other data files required to run all other programs."), pdf::PDF_LIBRARY_VERSION, "pdf4qt_framework", true, true, true);
|
||||
addDirectoryContent("pdf4qt_framework", "colorprofiles");
|
||||
addDirectoryContent("pdf4qt_framework", "iconengines");
|
||||
addDirectoryContent("pdf4qt_framework", "imageformats");
|
||||
addDirectoryContent("pdf4qt_framework", "platforms");
|
||||
|
Loading…
Reference in New Issue
Block a user