/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * 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 . */ #include #include #include #include QtVirtualDevice::QtVirtualDevice(double fScale) : m_fScale(fScale) { } SalGraphics* QtVirtualDevice::AcquireGraphics() { assert(m_pImage); QtGraphics* pGraphics = new QtGraphics(m_pImage.get()); m_aGraphics.push_back(pGraphics); return pGraphics; } void QtVirtualDevice::ReleaseGraphics(SalGraphics* pGraphics) { std::erase(m_aGraphics, dynamic_cast(pGraphics)); delete pGraphics; } bool QtVirtualDevice::SetSize(tools::Long nNewDX, tools::Long nNewDY) { return SetSizeUsingBuffer(nNewDX, nNewDY, nullptr); } bool QtVirtualDevice::SetSizeUsingBuffer(tools::Long nNewDX, tools::Long nNewDY, sal_uInt8* pBuffer) { if (nNewDX == 0) nNewDX = 1; if (nNewDY == 0) nNewDY = 1; if (m_pImage && m_aFrameSize.width() == nNewDX && m_aFrameSize.height() == nNewDY) return true; m_aFrameSize = QSize(nNewDX, nNewDY); nNewDX *= m_fScale; nNewDY *= m_fScale; if (pBuffer) m_pImage.reset(new QImage(pBuffer, nNewDX, nNewDY, Qt_DefaultFormat32)); else m_pImage.reset(new QImage(nNewDX, nNewDY, Qt_DefaultFormat32)); m_pImage->fill(Qt::transparent); m_pImage->setDevicePixelRatio(m_fScale); // update device in existing graphics for (auto pQtGraph : m_aGraphics) pQtGraph->ChangeQImage(m_pImage.get()); return true; } tools::Long QtVirtualDevice::GetWidth() const { return m_pImage ? m_aFrameSize.width() : 0; } tools::Long QtVirtualDevice::GetHeight() const { return m_pImage ? m_aFrameSize.height() : 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ ong.cn:88/cgit/lo/core/commit/?id=4e7a0270c6efc371433c3c77772ca062d6747fe8'/> 4e7a0270c6efc371433c3c77772ca062d6747fe8 Change-Id: I803788650dda6947a62724fd936b4ed733efbd58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162390 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I803788650dda6947a62724fd936b4ed733efbd58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162390
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
cid#1545913 Big parameter passed by value 2023-09-29T12:14:25+00:00 Caolán McNamara caolan.mcnamara@collabora.com 2023-09-29T08:21:16+00:00 1ca97423ab6980a6f6d85c2ca52e400c56baa1e1 Change-Id: I5fd72f80a01808f9c24dae7ab6e79391fc9603da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157400 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5fd72f80a01808f9c24dae7ab6e79391fc9603da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157400
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
cid#1538304 Big parameter passed by value 2023-07-23T09:54:08+00:00 Caolán McNamara caolan.mcnamara@collabora.com 2023-07-22T19:27:25+00:00 a7181c0b3898d32bae0deaf12ebcadd3de30a50e and cid#1538309 Big parameter passed by value Change-Id: I6c3f86c3c57f561b71809d0193ab663d2f92a4b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154794 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
and

cid#1538309 Big parameter passed by value

Change-Id: I6c3f86c3c57f561b71809d0193ab663d2f92a4b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154794
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
cid#1532449 Big parameter passed by value 2023-07-05T09:20:45+00:00 Caolán McNamara caolan.mcnamara@collabora.com 2023-06-25T13:57:58+00:00 c5f726420ac7906d9c425bfa4958a5702d55bbd8 Change-Id: Iad69437b2349bda6729395a4e2bd876a1a6c968e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153563 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Iad69437b2349bda6729395a4e2bd876a1a6c968e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153563
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Add frozen library support - for compile-time dict, set support 2023-06-17T10:31:07+00:00 Tomaž Vajngerl tomaz.vajngerl@collabora.co.uk 2022-07-16T10:17:20+00:00 472fec1b45db7cad7d9e87426a6e8c216174f9f7 Change-Id: I8fa02569ba02048cc3ef02b349aafba1c0cbebb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153173 Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp> Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Change-Id: I8fa02569ba02048cc3ef02b349aafba1c0cbebb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153173
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>