/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// Note that we cannot try to get DeviceInfo from the current frame here, // because there might not be a current frame yet
mxDefaultOutputDevice = Application::GetDefaultDevice();
maDeviceInfo = mxDefaultOutputDevice->GetDeviceInfo(); // 100 000 is 1 meter in MM100. // various unit tests rely on these values being exactly this and not the "true" values
Size aDefault = mxDefaultOutputDevice->LogicToPixel(Size(100000, 100000), MapMode(MapUnit::Map100thMM));
maDeviceInfo.PixelPerMeterX = aDefault.Width();
maDeviceInfo.PixelPerMeterY = aDefault.Height();
mfPixelPerHmmX = maDeviceInfo.PixelPerMeterX / 100000.0;
mfPixelPerHmmY = maDeviceInfo.PixelPerMeterY / 100000.0;
}
GraphicHelper::~GraphicHelper()
{
}
// System colors and predefined colors ----------------------------------------
sal_Int16 GraphicHelper::getDefaultChartAreaLineWidth()
{ // this value is what MSO 2016 writes fixing incomplete MSO 2010 documents (0.75 pt in emu) return 9525;
}
// Device info and device dependent unit conversion ---------------------------
SAL_WARN_IF(!mxGraphicMapper.is(), "oox", "GraphicHelper::importEmbeddedGraphic - graphic mapper not available");
xGraphic = mxGraphicMapper->findGraphic(rStreamName); if (!xGraphic.is())
{ // Lazy-loading doesn't work with cropped TIFF images, because in case of Lazy-load TIFF images // we are using MapUnit::MapPixel, but in case of cropped images we are using MapUnit::Map100thMM // and the crop values are relative to original bitmap size. auto xStream = mxStorage->openInputStream(rStreamName);
xGraphic = importGraphic(xStream, pExtHeader, !rStreamName.endsWith(".tiff")); if (xGraphic.is())
mxGraphicMapper->putGraphic(rStreamName, xGraphic);
}
} return xGraphic;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.