Rebased ref, commits from common ancestor: commit d68c5a6b874ba4c431e6319301e7bcc8d19f1135 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Thu Apr 23 21:59:32 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:44:37 2020 +0200
Graphic: cleanup private, public declarations, remove friend Friend GraphicObject doesn't seem to be needed anymore. Change-Id: I629ddaabf0c1802e986af42b457cd6322d2fd04d diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index b304cfb7ac97..17fdd6336e2d 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -83,15 +83,12 @@ class Image; class VCL_DLLPUBLIC Graphic { private: - std::shared_ptr<ImpGraphic> mxImpGraphic; + SAL_DLLPRIVATE void ImplTestRefCount(); public: - - SAL_DLLPRIVATE void ImplTestRefCount(); SAL_DLLPRIVATE ImpGraphic* ImplGetImpGraphic() const { return mxImpGraphic.get(); } -public: Graphic(); Graphic( const GraphicExternalLink& rGraphicLink ); Graphic( const Graphic& rGraphic ); @@ -180,16 +177,11 @@ public: OString getUniqueID() const; -public: - std::shared_ptr<GraphicReader>& GetReaderContext(); void SetReaderContext( const std::shared_ptr<GraphicReader> &pReader ); void SetDummyContext(bool value); bool IsDummyContext() const; -private: - friend class GraphicObject; -public: void SetGfxLink(const std::shared_ptr<GfxLink>& rGfxLink); std::shared_ptr<GfxLink> GetSharedGfxLink() const; GfxLink GetGfxLink() const; @@ -200,8 +192,6 @@ public: friend VCL_DLLPUBLIC void WriteGraphic(SvStream& rOStream, const Graphic& rGraphic); friend VCL_DLLPUBLIC void ReadGraphic(SvStream& rIStream, Graphic& rGraphic); -public: - const std::shared_ptr<VectorGraphicData>& getVectorGraphicData() const; /// Get the page number of the multi-page source this Graphic is rendered from. commit 72bb0c90b6b6820cf2ba987bf6aba0b9e17ffc13 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Thu Apr 23 16:22:26 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:44:37 2020 +0200 vcl: add tests for GraphicNativeMetadata Test the rotation in JPEG metadata is what we expect. Change-Id: I5ee2d646a5257d5695c51f37fb6fe795dcb9af50 diff --git a/include/vcl/GraphicNativeMetadata.hxx b/include/vcl/GraphicNativeMetadata.hxx index 318fb724bf25..3dbd7ff8a7d2 100644 --- a/include/vcl/GraphicNativeMetadata.hxx +++ b/include/vcl/GraphicNativeMetadata.hxx @@ -20,6 +20,7 @@ #pragma once #include <vcl/graph.hxx> +#include <tools/stream.hxx> class VCL_DLLPUBLIC GraphicNativeMetadata final { @@ -30,6 +31,9 @@ public: ~GraphicNativeMetadata(); bool read(Graphic const& rGraphic); + bool read(SvStream& rStream); + + // counter-clock-wise rotation in permille sal_uInt16 getRotation() const { return mRotation; } }; diff --git a/vcl/CppunitTest_vcl_graphic_test.mk b/vcl/CppunitTest_vcl_graphic_test.mk index 63dea32f9757..7b042f84d7da 100644 --- a/vcl/CppunitTest_vcl_graphic_test.mk +++ b/vcl/CppunitTest_vcl_graphic_test.mk @@ -13,6 +13,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,vcl_graphic_test, \ vcl/qa/cppunit/GraphicTest \ vcl/qa/cppunit/GraphicDescriptorTest \ vcl/qa/cppunit/GraphicFormatDetectorTest \ + vcl/qa/cppunit/GraphicNativeMetadataTest \ )) $(eval $(call gb_CppunitTest_use_externals,vcl_graphic_test,\ diff --git a/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx b/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx new file mode 100644 index 000000000000..4fde27f53354 --- /dev/null +++ b/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx @@ -0,0 +1,101 @@ +/* -*- 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/. + */ + +#include <cppunit/TestAssert.h> +#include <cppunit/extensions/HelperMacros.h> +#include <unotest/bootstrapfixturebase.hxx> + +#include <vcl/GraphicNativeMetadata.hxx> +#include <vcl/graphicfilter.hxx> +#include <tools/stream.hxx> + +using namespace css; + +namespace +{ +class GraphicNativeMetadataTest : public test::BootstrapFixtureBase +{ + OUString getFullUrl(const OUString& sFileName) + { + return m_directories.getURLFromSrc("/vcl/qa/cppunit/data/") + sFileName; + } + + void testReadFromGraphic(); + void testExifRotationJpeg(); + + CPPUNIT_TEST_SUITE(GraphicNativeMetadataTest); + CPPUNIT_TEST(testReadFromGraphic); + CPPUNIT_TEST(testExifRotationJpeg); + CPPUNIT_TEST_SUITE_END(); +}; + +void GraphicNativeMetadataTest::testReadFromGraphic() +{ + SvFileStream aFileStream(getFullUrl("Exif1_180.jpg"), StreamMode::READ); + GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); + + // don't load the grpahic, but try to get the metadata + Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aFileStream); + + { + GraphicNativeMetadata aMetadata; + aMetadata.read(aFileStream); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1800), aMetadata.getRotation()); + // just the metadata shouldn't make the graphic available + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); + } + + // now load, and it should still work the same + { + aGraphic.makeAvailable(); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + + GraphicNativeMetadata aMetadata; + aMetadata.read(aFileStream); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1800), aMetadata.getRotation()); + } +} + +void GraphicNativeMetadataTest::testExifRotationJpeg() +{ + { + // No rotation in metadata + SvFileStream aFileStream(getFullUrl("Exif1.jpg"), StreamMode::READ); + GraphicNativeMetadata aMetadata; + aMetadata.read(aFileStream); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), aMetadata.getRotation()); + } + { + // Rotation 90 degree clock-wise = 270 degree counter-clock-wise + SvFileStream aFileStream(getFullUrl("Exif1_090CW.jpg"), StreamMode::READ); + GraphicNativeMetadata aMetadata; + aMetadata.read(aFileStream); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2700), aMetadata.getRotation()); + } + { + // Rotation 180 degree + SvFileStream aFileStream(getFullUrl("Exif1_180.jpg"), StreamMode::READ); + GraphicNativeMetadata aMetadata; + aMetadata.read(aFileStream); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1800), aMetadata.getRotation()); + } + { + // Rotation 270 degree clock-wise = 90 degree counter-clock-wise + SvFileStream aFileStream(getFullUrl("Exif1_270CW.jpg"), StreamMode::READ); + GraphicNativeMetadata aMetadata; + aMetadata.read(aFileStream); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(900), aMetadata.getRotation()); + } +} + +} // anonymous namespace + +CPPUNIT_TEST_SUITE_REGISTRATION(GraphicNativeMetadataTest); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qa/cppunit/data/Exif1.jpg b/vcl/qa/cppunit/data/Exif1.jpg new file mode 100644 index 000000000000..e2aace2daafb Binary files /dev/null and b/vcl/qa/cppunit/data/Exif1.jpg differ diff --git a/vcl/qa/cppunit/data/Exif1_090CW.jpg b/vcl/qa/cppunit/data/Exif1_090CW.jpg new file mode 100644 index 000000000000..dd13dba4c9e0 Binary files /dev/null and b/vcl/qa/cppunit/data/Exif1_090CW.jpg differ diff --git a/vcl/qa/cppunit/data/Exif1_180.jpg b/vcl/qa/cppunit/data/Exif1_180.jpg new file mode 100644 index 000000000000..ba4dfc3796a9 Binary files /dev/null and b/vcl/qa/cppunit/data/Exif1_180.jpg differ diff --git a/vcl/qa/cppunit/data/Exif1_270CW.jpg b/vcl/qa/cppunit/data/Exif1_270CW.jpg new file mode 100644 index 000000000000..7f7cdfb909bb Binary files /dev/null and b/vcl/qa/cppunit/data/Exif1_270CW.jpg differ diff --git a/vcl/source/filter/GraphicNativeMetadata.cxx b/vcl/source/filter/GraphicNativeMetadata.cxx index 132a51a52391..6eb60cd67374 100644 --- a/vcl/source/filter/GraphicNativeMetadata.cxx +++ b/vcl/source/filter/GraphicNativeMetadata.cxx @@ -18,10 +18,7 @@ */ #include <vcl/GraphicNativeMetadata.hxx> - #include <vcl/gfxlink.hxx> -#include <tools/stream.hxx> - #include "jpeg/Exif.hxx" #include <memory> @@ -47,8 +44,15 @@ bool GraphicNativeMetadata::read(Graphic const& rGraphic) memcpy(aBuffer.get(), aLink.GetData(), aDataSize); SvMemoryStream aMemoryStream(aBuffer.get(), aDataSize, StreamMode::READ); + read(aMemoryStream); + + return true; +} + +bool GraphicNativeMetadata::read(SvStream& rStream) +{ Exif aExif; - aExif.read(aMemoryStream); + aExif.read(rStream); mRotation = aExif.getRotation(); return true; commit b67daef1e1bc40bb829b0af67f3fba8118a6425a Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed Apr 22 19:52:19 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:44:37 2020 +0200 ImpGraphic: rename ImplCreateSwapInfo and simplify ImplCreateSwapInfo changed to createSwapInfo. Flatten the code body Change-Id: I5865373d0b7f3cc717a9600bcf6fd198e8320e35 diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 24112ca03dbe..749a5b82a12e 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -116,7 +116,7 @@ private: return mpGraphicID->getIDString(); } - void ImplCreateSwapInfo(); + void createSwapInfo(); void ImplClearGraphics(); void ImplClear(); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 1b0797889525..6cace1f79d79 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -384,18 +384,18 @@ const std::shared_ptr<VectorGraphicData>& ImpGraphic::getVectorGraphicData() con return maVectorGraphicData; } -void ImpGraphic::ImplCreateSwapInfo() +void ImpGraphic::createSwapInfo() { - if (!isSwappedOut()) - { - maSwapInfo.maPrefMapMode = ImplGetPrefMapMode(); - maSwapInfo.maPrefSize = ImplGetPrefSize(); - maSwapInfo.mbIsAnimated = ImplIsAnimated(); - maSwapInfo.mbIsEPS = ImplIsEPS(); - maSwapInfo.mbIsTransparent = ImplIsTransparent(); - maSwapInfo.mbIsAlpha = ImplIsAlpha(); - maSwapInfo.mnAnimationLoopCount = ImplGetAnimationLoopCount(); - } + if (isSwappedOut()) + return; + + maSwapInfo.maPrefMapMode = ImplGetPrefMapMode(); + maSwapInfo.maPrefSize = ImplGetPrefSize(); + maSwapInfo.mbIsAnimated = ImplIsAnimated(); + maSwapInfo.mbIsEPS = ImplIsEPS(); + maSwapInfo.mbIsTransparent = ImplIsTransparent(); + maSwapInfo.mbIsAlpha = ImplIsAlpha(); + maSwapInfo.mnAnimationLoopCount = ImplGetAnimationLoopCount(); } void ImpGraphic::ImplClearGraphics() @@ -1387,12 +1387,13 @@ bool ImpGraphic::swapOut() // Check if writing was successfull if (bResult) { - // We have swapped out, so can clean memory - mbSwapOut = true; - mpSwapFile = std::move(pSwapFile); - ImplCreateSwapInfo(); + // We have swapped out, so can clean memory and prepare swap info + createSwapInfo(); ImplClearGraphics(); + mpSwapFile = std::move(pSwapFile); + mbSwapOut = true; + // Signal to manager that we have swapped out vcl::graphic::Manager::get().swappedOut(this); } commit ed13b94b1b73c84b788756e7b6550bf58539fff2 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed Apr 22 19:21:22 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:44:37 2020 +0200 ImpGraphic: move content of swapOutToStream into swapOut Change-Id: Iec0227b1e1ceebda961e158315ea5e56c2d33204 diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 6ba07295f9a3..24112ca03dbe 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -177,7 +177,6 @@ private: bool ImplWriteEmbedded( SvStream& rOStream ); bool swapInFromStream(SvStream* pIStm); - bool swapOutToStream(SvStream* pOStm); bool ImplIsDummyContext() const { return mbDummyContext; } void ImplSetLink( const std::shared_ptr<GfxLink>& ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 4a3e26946678..1b0797889525 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1356,59 +1356,50 @@ bool ImpGraphic::swapOut() if (isSwappedOut()) return false; + // Create a temp filename for the swap file utl::TempFile aTempFile; const INetURLObject aTempFileURL(aTempFile.GetURL()); + // Create a swap file std::shared_ptr<ImpSwapFile> pSwapFile(new ImpSwapFile(aTempFileURL, getOriginURL()), o3tl::default_delete<ImpSwapFile>()); - std::unique_ptr<SvStream> xOutputStream = pSwapFile->openOutputStream(); + bool bResult = false; - if (!xOutputStream) - return false; + // Open a stream to write the swap file to + { + std::unique_ptr<SvStream> xOutputStream = pSwapFile->openOutputStream(); - xOutputStream->SetVersion(SOFFICE_FILEFORMAT_50); - xOutputStream->SetCompressMode(SvStreamCompressFlags::NATIVE); + if (!xOutputStream) + return false; - bool bResult = swapOutToStream(xOutputStream.get()); + // Write to stream + xOutputStream->SetVersion(SOFFICE_FILEFORMAT_50); + xOutputStream->SetCompressMode(SvStreamCompressFlags::NATIVE); + xOutputStream->SetBufferSize(GRAPHIC_STREAMBUFSIZE); - xOutputStream.reset(); + if (!xOutputStream->GetError() && ImplWriteEmbedded(*xOutputStream)) + { + xOutputStream->Flush(); + bResult = !xOutputStream->GetError(); + } + } + // Check if writing was successfull if (bResult) { - mpSwapFile = pSwapFile; + // We have swapped out, so can clean memory + mbSwapOut = true; + mpSwapFile = std::move(pSwapFile); + ImplCreateSwapInfo(); + ImplClearGraphics(); + + // Signal to manager that we have swapped out vcl::graphic::Manager::get().swappedOut(this); } return bResult; } -bool ImpGraphic::swapOutToStream(SvStream* xOStm) -{ - if( !xOStm ) - { - SAL_WARN("vcl.gdi", "Graphic SwapOut: No stream for swap out!"); - return false; - } - - xOStm->SetBufferSize( GRAPHIC_STREAMBUFSIZE ); - - bool bRet = false; - - if( !xOStm->GetError() && ImplWriteEmbedded( *xOStm ) ) - { - xOStm->Flush(); - - if( !xOStm->GetError() ) - { - ImplCreateSwapInfo(); - ImplClearGraphics(); - bRet = mbSwapOut = true; - } - } - - return bRet; -} - bool ImpGraphic::ensureAvailable() const { auto pThis = const_cast<ImpGraphic*>(this); commit cce8980526e5a83d26820ad9e07408fc98fd6a79 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed Apr 22 10:03:16 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:44:37 2020 +0200 ImpGraphic: move filename handling from swapout to ImpSwapFile Change-Id: I30930f61385e31e7754d6653ff2eecfea61ce4e1 diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 610d98b9528c..4a3e26946678 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -74,8 +74,8 @@ private: OUString maOriginURL; public: - ImpSwapFile(INetURLObject const & aSwapURL, OUString const & rOriginURL) - : maSwapURL(aSwapURL) + ImpSwapFile(INetURLObject const & rSwapURL, OUString const & rOriginURL) + : maSwapURL(rSwapURL) , maOriginURL(rOriginURL) { } @@ -85,8 +85,33 @@ public: utl::UCBContentHelper::Kill(maSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } - INetURLObject getSwapURL() { return maSwapURL; } + INetURLObject getSwapURL() + { + return maSwapURL; + } + + OUString getSwapURLString() + { + return maSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); + } + OUString const & getOriginURL() { return maOriginURL; } + + std::unique_ptr<SvStream> openOutputStream() + { + OUString sSwapURL = getSwapURLString(); + if (!sSwapURL.isEmpty()) + { + try + { + return utl::UcbStreamHelper::CreateStream(sSwapURL, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); + } + catch (const css::uno::Exception&) + { + } + } + return std::unique_ptr<SvStream>(); + } }; OUString ImpGraphic::getSwapFileURL() @@ -1333,39 +1358,26 @@ bool ImpGraphic::swapOut() utl::TempFile aTempFile; const INetURLObject aTempFileURL(aTempFile.GetURL()); - OUString sTempFileURLString = aTempFileURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); - if (sTempFileURLString.isEmpty()) - return false; - std::unique_ptr<SvStream> xOutputStream; + std::shared_ptr<ImpSwapFile> pSwapFile(new ImpSwapFile(aTempFileURL, getOriginURL()), o3tl::default_delete<ImpSwapFile>()); - try - { - xOutputStream = utl::UcbStreamHelper::CreateStream(sTempFileURLString, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); - } - catch (const css::uno::Exception&) - { - } + std::unique_ptr<SvStream> xOutputStream = pSwapFile->openOutputStream(); if (!xOutputStream) return false; + xOutputStream->SetVersion(SOFFICE_FILEFORMAT_50); xOutputStream->SetCompressMode(SvStreamCompressFlags::NATIVE); bool bResult = swapOutToStream(xOutputStream.get()); - if (bResult) - { - mpSwapFile.reset(new ImpSwapFile(aTempFileURL, getOriginURL()), o3tl::default_delete<ImpSwapFile>()); - } - else - { - xOutputStream.reset(); - utl::UCBContentHelper::Kill(sTempFileURLString); - } + xOutputStream.reset(); if (bResult) + { + mpSwapFile = pSwapFile; vcl::graphic::Manager::get().swappedOut(this); + } return bResult; } commit 4aa40a1a3d4e8911284d6744c1bb536a0e1c97e1 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon Apr 20 22:29:04 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:44:37 2020 +0200 ImpGraphic: clean-up and simplify swapOut() Change-Id: I3e578c3172fcea341a218798843cd750971a5af1 diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 9eb42fec39e8..610d98b9528c 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1328,44 +1328,46 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) bool ImpGraphic::swapOut() { - - if( isSwappedOut() ) + if (isSwappedOut()) return false; - ::utl::TempFile aTempFile; - const INetURLObject aTmpURL( aTempFile.GetURL() ); + utl::TempFile aTempFile; + const INetURLObject aTempFileURL(aTempFile.GetURL()); + OUString sTempFileURLString = aTempFileURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); - if( aTmpURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ).isEmpty() ) + if (sTempFileURLString.isEmpty()) return false; + std::unique_ptr<SvStream> xOutputStream; - std::unique_ptr<SvStream> xOStm; try { - xOStm = ::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ); + xOutputStream = utl::UcbStreamHelper::CreateStream(sTempFileURLString, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); } - catch( const css::uno::Exception& ) + catch (const css::uno::Exception&) { } - if( !xOStm ) + + if (!xOutputStream) return false; + xOutputStream->SetVersion(SOFFICE_FILEFORMAT_50); + xOutputStream->SetCompressMode(SvStreamCompressFlags::NATIVE); - xOStm->SetVersion( SOFFICE_FILEFORMAT_50 ); - xOStm->SetCompressMode( SvStreamCompressFlags::NATIVE ); + bool bResult = swapOutToStream(xOutputStream.get()); - bool bRet = swapOutToStream( xOStm.get() ); - if( bRet ) + if (bResult) { - mpSwapFile.reset(new ImpSwapFile(aTmpURL, getOriginURL()), o3tl::default_delete<ImpSwapFile>()); + mpSwapFile.reset(new ImpSwapFile(aTempFileURL, getOriginURL()), o3tl::default_delete<ImpSwapFile>()); } else { - xOStm.reset(); - utl::UCBContentHelper::Kill(aTmpURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); + xOutputStream.reset(); + utl::UCBContentHelper::Kill(sTempFileURLString); } - if (bRet) + if (bResult) vcl::graphic::Manager::get().swappedOut(this); - return bRet; + + return bResult; } bool ImpGraphic::swapOutToStream(SvStream* xOStm) commit a63aeeb21dc8f13acbd398c26254bf42753d9bc7 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed Apr 1 13:00:25 2020 +0200 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:42:22 2020 +0200 Add OutputDevice::drawPrimitive2D to OutputDevice Change-Id: Ifc22eca62df72bddd247ba097054f34756520614 diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index e4430b2415f3..44aa8f821dae 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -49,6 +49,8 @@ #include <com/sun/star/drawing/LineCap.hpp> #include <com/sun/star/uno/Reference.h> +#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> + #include <memory> #include <vector> @@ -1955,6 +1957,9 @@ public: ///@} + bool drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D); + + /** @name Native Widget Rendering functions These all just call through to the private mpGraphics functions of the same name. diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index cb59e378fb89..6d5b09ae4592 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -80,6 +80,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\ basegfx \ comphelper \ cppuhelper \ + drawinglayercore \ i18nlangtag \ i18nutil \ $(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \ diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 0dcdd84a5d0a..52f31234caa3 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -713,4 +713,9 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, return bDrawn; } +bool OutputDevice::drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D) +{ + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 455119b5f884589784e9fdad784ec971d52c8217 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Mar 7 14:33:43 2020 +0100 Commit: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> CommitDate: Sun Apr 26 21:42:22 2020 +0200 Separate core drawinglayer func. into drawinglayercore library This separates the drawinglayer core functionallity into a separate library, to keep a strict separation what is backend dependent and what is not. More strict separation can be done at a later date. This will make it possible to push part of drawinglayer (part of processor2d) directly into VCL. Change-Id: Ibc26580067e50bf20d7cdd37fa0e44eb10200878 diff --git a/Repository.mk b/Repository.mk index 4479ed901e23..78b146096bdd 100644 --- a/Repository.mk +++ b/Repository.mk @@ -350,6 +350,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ $(call gb_Helper_optional,SCRIPTING,dlgprov) \ $(if $(filter WNT,$(OS)),directx9canvas) \ $(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \ + drawinglayercore \ drawinglayer \ editeng \ $(if $(filter WNT,$(OS)),emser) \ diff --git a/drawinglayer/CppunitTest_drawinglayer_border.mk b/drawinglayer/CppunitTest_drawinglayer_border.mk index fa2f715590cd..e00006c18dba 100644 --- a/drawinglayer/CppunitTest_drawinglayer_border.mk +++ b/drawinglayer/CppunitTest_drawinglayer_border.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,drawinglayer_border, \ sal \ salhelper \ drawinglayer \ + drawinglayercore \ vcl \ test \ tl \ diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk index 2a0f1030a789..46f21f56b6b6 100644 --- a/drawinglayer/Library_drawinglayer.mk +++ b/drawinglayer/Library_drawinglayer.mk @@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_externals,drawinglayer,\ )) $(eval $(call gb_Library_use_libraries,drawinglayer,\ + drawinglayercore \ basegfx \ canvastools \ comphelper \ @@ -67,11 +68,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/attribute/sdrsceneattribute3d \ drawinglayer/source/attribute/sdrshadowattribute \ drawinglayer/source/attribute/strokeattribute \ - drawinglayer/source/geometry/viewinformation2d \ drawinglayer/source/geometry/viewinformation3d \ drawinglayer/source/primitive2d/animatedprimitive2d \ drawinglayer/source/primitive2d/backgroundcolorprimitive2d \ - drawinglayer/source/primitive2d/baseprimitive2d \ drawinglayer/source/primitive2d/bitmapprimitive2d \ drawinglayer/source/primitive2d/borderlineprimitive2d \ drawinglayer/source/primitive2d/controlprimitive2d \ @@ -111,7 +110,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \ drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \ drawinglayer/source/primitive2d/primitivetools2d \ - drawinglayer/source/primitive2d/Primitive2DContainer \ drawinglayer/source/primitive2d/sceneprimitive2d \ drawinglayer/source/primitive2d/sdrdecompositiontools2d \ drawinglayer/source/primitive2d/shadowprimitive2d \ @@ -126,7 +124,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/primitive2d/textlineprimitive2d \ drawinglayer/source/primitive2d/textprimitive2d \ drawinglayer/source/primitive2d/textstrikeoutprimitive2d \ - drawinglayer/source/primitive2d/Tools \ drawinglayer/source/primitive2d/transformprimitive2d \ drawinglayer/source/primitive2d/transparenceprimitive2d \ drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \ diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk new file mode 100644 index 000000000000..f1643d27014d --- /dev/null +++ b/drawinglayer/Library_drawinglayercore.mk @@ -0,0 +1,49 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_Library_Library,drawinglayercore)) + +$(eval $(call gb_Library_set_include,drawinglayercore,\ + $$(INCLUDE) \ + -I$(SRCDIR)/drawinglayer/inc \ +)) + +$(eval $(call gb_Library_add_defs,drawinglayercore,\ + -DDRAWINGLAYERCORE_DLLIMPLEMENTATION \ +)) + +$(eval $(call gb_Library_set_precompiled_header,drawinglayercore,drawinglayer/inc/pch/precompiled_drawinglayercore)) + +$(eval $(call gb_Library_use_sdk_api,drawinglayercore)) + +$(eval $(call gb_Library_use_externals,drawinglayercore,\ + boost_headers \ + libxml2 \ +)) + +$(eval $(call gb_Library_use_libraries,drawinglayercore,\ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + i18nlangtag \ + sal \ + salhelper \ + svl \ + tl \ +)) + +$(eval $(call gb_Library_add_exception_objects,drawinglayercore,\ + drawinglayer/source/primitive2d/baseprimitive2d \ + drawinglayer/source/primitive2d/Primitive2DContainer \ + drawinglayer/source/primitive2d/Tools \ + drawinglayer/source/geometry/viewinformation2d \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/drawinglayer/Module_drawinglayer.mk b/drawinglayer/Module_drawinglayer.mk index 6d329e95c60a..687cd9c2671f 100644 --- a/drawinglayer/Module_drawinglayer.mk +++ b/drawinglayer/Module_drawinglayer.mk @@ -10,6 +10,7 @@ $(eval $(call gb_Module_Module,drawinglayer)) $(eval $(call gb_Module_add_targets,drawinglayer,\ + Library_drawinglayercore \ Library_drawinglayer \ )) diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx index 9aaf7bace296..d60954dab588 100644 --- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx +++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx @@ -93,7 +93,6 @@ #include <basegfx/range/basicrange.hxx> #include <basegfx/tuple/b2dtuple.hxx> #include <basegfx/tuple/b3dtuple.hxx> -#include <basegfx/utils/canvastools.hxx> #include <basegfx/vector/b2dvector.hxx> #include <basegfx/vector/b2enums.hxx> #include <basegfx/vector/b2ivector.hxx> @@ -105,7 +104,7 @@ #include <com/sun/star/drawing/TextureMode.hpp> #include <com/sun/star/drawing/TextureProjectionMode.hpp> #include <com/sun/star/graphic/XPrimitive3D.hpp> -#include <com/sun/star/util/XAccounting.hpp> +#include <com/sun/star/uno/Reference.hxx> #include <comphelper/comphelperdllapi.h> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> @@ -139,7 +138,6 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/geometry/viewinformation2d.hxx> #include <drawinglayer/geometry/viewinformation3d.hxx> -#include <drawinglayer/primitive2d/CommonTypes.hxx> #include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx> @@ -147,9 +145,6 @@ #include <drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx> -#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> -#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx> -#include <drawinglayer/primitive2d/Tools.hxx> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx new file mode 100644 index 000000000000..4a8c23ea8e65 --- /dev/null +++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx @@ -0,0 +1,12 @@ +/* -*- 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/. + */ + +#include "precompiled_drawinglayercore.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx new file mode 100644 index 000000000000..4cc5ca4612c9 --- /dev/null +++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx @@ -0,0 +1,46 @@ +/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2020-03-07 12:37:18 using: + ./bin/update_pch drawinglayer drawinglayercore --cutoff=4 --exclude:system --exclude:module --exclude:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./drawinglayer/inc/pch/precompiled_drawinglayercore.hxx "make drawinglayer.build" --find-conflicts +*/ + +#if PCH_LEVEL >= 1 +#include <ostream> +#include <vector> +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#include <osl/diagnose.h> +#include <osl/interlck.h> +#include <sal/config.h> +#include <sal/types.h> +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#include <basegfx/basegfxdllapi.h> +#include <basegfx/point/b2dpoint.hxx> +#include <basegfx/range/b2drange.hxx> +#include <basegfx/range/basicrange.hxx> +#include <basegfx/tuple/b2dtuple.hxx> +#include <basegfx/utils/canvastools.hxx> +#include <basegfx/vector/b2dvector.hxx> +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#include <drawinglayer/geometry/viewinformation2d.hxx> +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/emfio/CppunitTest_emfio_emf_test.mk b/emfio/CppunitTest_emfio_emf_test.mk index 123e4b3549bd..2679c0a604d9 100644 --- a/emfio/CppunitTest_emfio_emf_test.mk +++ b/emfio/CppunitTest_emfio_emf_test.mk @@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_sdk_api,emfio_emf)) $(eval $(call gb_CppunitTest_use_libraries,emfio_emf,\ basegfx \ drawinglayer \ + drawinglayercore \ cppu \ cppuhelper \ comphelper \ diff --git a/emfio/Library_emfio.mk b/emfio/Library_emfio.mk index 52fde14885b3..89add50b781a 100644 --- a/emfio/Library_emfio.mk +++ b/emfio/Library_emfio.mk @@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_sdk_api,emfio)) $(eval $(call gb_Library_use_libraries,emfio,\ basegfx \ + drawinglayercore \ drawinglayer \ cppu \ cppuhelper \ diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk index 21318aa1fd03..1f0caf11758c 100644 --- a/filter/Library_svgfilter.mk +++ b/filter/Library_svgfilter.mk @@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,svgfilter,\ sax \ salhelper \ comphelper \ + drawinglayercore \ drawinglayer \ basegfx \ cppuhelper \ diff --git a/include/drawinglayer/drawinglayerdllapi.h b/include/drawinglayer/drawinglayerdllapi.h index 0b3983504919..36a0d8abfea2 100644 --- a/include/drawinglayer/drawinglayerdllapi.h +++ b/include/drawinglayer/drawinglayerdllapi.h @@ -19,6 +19,12 @@ #endif #define DRAWINGLAYER_DLLPRIVATE SAL_DLLPRIVATE +#if defined(DRAWINGLAYERCORE_DLLIMPLEMENTATION) +#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx index 95be29a72bda..06b17248d213 100644 --- a/include/drawinglayer/geometry/viewinformation2d.hxx +++ b/include/drawinglayer/geometry/viewinformation2d.hxx @@ -63,7 +63,7 @@ namespace drawinglayer::geometry It is an implementation to support the sequence of PropertyValues used in a css::graphic::XPrimitive2D for C++ implementations working with those */ -class DRAWINGLAYER_DLLPUBLIC ViewInformation2D +class DRAWINGLAYERCORE_DLLPUBLIC ViewInformation2D { public: typedef o3tl::cow_wrapper<ImpViewInformation2D, o3tl::ThreadSafeRefCountingPolicy> ImplType; diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx index cca3a0a91485..c096e9a8cc2f 100644 --- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx +++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx @@ -34,7 +34,7 @@ class ViewInformation2D; namespace drawinglayer::primitive2d { -class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer +class SAL_WARN_UNUSED DRAWINGLAYERCORE_DLLPUBLIC Primitive2DContainer : public std::deque<Primitive2DReference>, public Primitive2DDecompositionVisitor { diff --git a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx index dfe04b32a320..e174d1e0878d 100644 --- a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx +++ b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx @@ -27,7 +27,7 @@ namespace drawinglayer::primitive2d class Primitive2DContainer; // Visitor class for walking a tree of Primitive2DReference -class DRAWINGLAYER_DLLPUBLIC Primitive2DDecompositionVisitor +class DRAWINGLAYERCORE_DLLPUBLIC Primitive2DDecompositionVisitor { public: virtual void append(const Primitive2DReference&) = 0; diff --git a/include/drawinglayer/primitive2d/Tools.hxx b/include/drawinglayer/primitive2d/Tools.hxx index fbb6f5717c01..1c30565c8c1b 100644 --- a/include/drawinglayer/primitive2d/Tools.hxx +++ b/include/drawinglayer/primitive2d/Tools.hxx @@ -31,16 +31,16 @@ class ViewInformation2D; namespace drawinglayer::primitive2d { /// get B2DRange from a given Primitive2DReference -basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DReference( +basegfx::B2DRange DRAWINGLAYERCORE_DLLPUBLIC getB2DRangeFromPrimitive2DReference( const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation); /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D) and using compare operator */ -bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA, - const Primitive2DReference& rB); +bool DRAWINGLAYERCORE_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA, + const Primitive2DReference& rB); -OUString DRAWINGLAYER_DLLPUBLIC idToString(sal_uInt32 nId); +OUString DRAWINGLAYERCORE_DLLPUBLIC idToString(sal_uInt32 nId); } // end of namespace drawinglayer::primitive2d diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx index 5e1a96429ff3..8818cdd0bcde 100644 --- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -121,8 +121,8 @@ typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAc for view-independent primitives which are defined by not using ViewInformation2D in their get2DDecomposition/getB2DRange implementations. */ -class DRAWINGLAYER_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex, - public BasePrimitive2DImplBase +class DRAWINGLAYERCORE_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex, + public BasePrimitive2DImplBase { BasePrimitive2D(const BasePrimitive2D&) = delete; BasePrimitive2D& operator=(const BasePrimitive2D&) = delete; @@ -200,7 +200,7 @@ public: to identify if a new decomposition is needed at the next call (f) return maBuffered2DDecomposition */ -class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D +class DRAWINGLAYERCORE_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D { private: /// a sequence used for buffering the last create2DDecomposition() result diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk index 8943de7ab4c3..60fb6676dab9 100644 --- a/sc/CppunitTest_sc_ucalc.mk +++ b/sc/CppunitTest_sc_ucalc.mk @@ -49,6 +49,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \ cppuhelper \ dbtools \ drawinglayer \ + drawinglayercore \ editeng \ for \ forui \ diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 997b14c0add9..b540b27c9834 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -70,6 +70,7 @@ $(eval $(call gb_Library_use_libraries,sc,\ cppu \ cppuhelper \ dbtools \ + drawinglayercore \ drawinglayer \ editeng \ for \ diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk index 93426dfc3a55..63f143978231 100644 --- a/sd/CppunitTest_sd_uimpress.mk +++ b/sd/CppunitTest_sd_uimpress.mk @@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\ cppu \ cppuhelper \ drawinglayer \ + drawinglayercore \ editeng \ i18nlangtag \ i18nutil \ diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 43b168be8d8c..24520633e77f 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -74,6 +74,7 @@ $(eval $(call gb_Library_use_libraries,sd,\ cppcanvas \ cppu \ cppuhelper \ + drawinglayercore \ drawinglayer \ editeng \ i18nlangtag \ diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 2b07ae78f5aa..b0d9724d6111 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,sfx,\ comphelper \ cppu \ cppuhelper \ + drawinglayercore \ drawinglayer \ fwe \ i18nlangtag \ diff --git a/svgio/CppunitTest_svgio.mk b/svgio/CppunitTest_svgio.mk index c6f4db91fc60..24fb7a39af32 100644 --- a/svgio/CppunitTest_svgio.mk +++ b/svgio/CppunitTest_svgio.mk @@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_library_objects,svgio,\ $(eval $(call gb_CppunitTest_use_libraries,svgio,\ basegfx \ drawinglayer \ + drawinglayercore \ cppu \ cppuhelper \ comphelper \ diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk index 449c17f61196..7ef1aeb19513 100644 --- a/svgio/Library_svgio.mk +++ b/svgio/Library_svgio.mk @@ -33,6 +33,7 @@ $(eval $(call gb_Library_use_sdk_api,svgio)) $(eval $(call gb_Library_use_libraries,svgio,\ basegfx \ + drawinglayercore \ drawinglayer \ comphelper \ cppu \ diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk index 92feb45d6578..c78b8d7769eb 100644 --- a/svx/CppunitTest_svx_unit.mk +++ b/svx/CppunitTest_svx_unit.mk @@ -35,6 +35,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \ $(eval $(call gb_CppunitTest_use_libraries,svx_unit, \ basegfx \ drawinglayer \ + drawinglayercore \ sal \ sfx \ svxcore \ diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index d3eff20b6769..9ccba33a748c 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,svx,\ crashreport) \ $(call gb_Helper_optional,DBCONNECTIVITY, \ dbtools) \ + drawinglayercore \ drawinglayer \ editeng \ fwe \ diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 80fcdae920f3..fdf5f0165249 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -57,6 +57,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\ cppu \ $(call gb_Helper_optional,DBCONNECTIVITY, \ dbtools) \ + drawinglayercore \ drawinglayer \ editeng \ fwe \ diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk index 6b9ffa4ba683..a881587735e4 100644 --- a/sw/CppunitTest_sw_uwriter.mk +++ b/sw/CppunitTest_sw_uwriter.mk @@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \ $(call gb_Helper_optional,DBCONNECTIVITY, \ dbtools) \ drawinglayer \ + drawinglayercore \ editeng \ i18nlangtag \ i18nutil \ diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index b6d75fd890bf..d99c59a58a4b 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_libraries,sw,\ cppuhelper \ $(call gb_Helper_optional,DBCONNECTIVITY, \ dbtools) \ + drawinglayercore \ drawinglayer \ editeng \ i18nlangtag \ diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk index 99f1dd20ae3d..4c09d1cc4bda 100644 --- a/sw/Library_swui.mk +++ b/sw/Library_swui.mk @@ -75,6 +75,7 @@ $(eval $(call gb_Library_use_libraries,swui,\ ucbhelper \ utl \ vcl \ + drawinglayercore \ drawinglayer \ )) commit 218ad66010fdba3c28564e2038876b6822752243 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sun Apr 26 12:07:19 2020 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Apr 26 21:38:58 2020 +0200 vcl: When exporing PDF, write the correct page of embedded PDF We can display PDF as an graphic in the document, where the PDF is treated as a vector graphic and rendered with Pdfium. When in that case we export the document as PDF, we can insert the original PDF page as an reference XObject. This workes fine, however the PDF as an graphic also contains the page number, which page should be rendered. This was not taken into account in the PDF export - it was hardcored to first page. This extends the support so it reads the page index from the graphic, and sets the correct PDF page. Change-Id: I15188ee495f9b3fcc3aa7df6f4bad4fa09903c6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92924 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9a8a93076d2e..cb7f4cc17027 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8613,7 +8613,9 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit) return; } - filter::PDFObjectElement* pPage = aPages[0]; + size_t nPageIndex = rEmit.m_nPDFPageIndex >= 0 ? rEmit.m_nPDFPageIndex : 0; + + filter::PDFObjectElement* pPage = aPages[nPageIndex]; if (!pPage) { SAL_WARN("vcl.pdfwriter", "PDFWriterImpl::writeReferenceXObject: no page"); @@ -9205,7 +9207,10 @@ void PDFWriterImpl::createEmbeddedFile(const Graphic& rGraphic, ReferenceXObject rEmit.m_nEmbeddedObject = m_aEmbeddedFiles.back().m_nObject; } else + { + rEmit.m_nPDFPageIndex = rGraphic.getVectorGraphicData()->getPageIndex(); rEmit.m_aPDFData = *pPDFData; + } rEmit.m_nFormObject = createObject(); rEmit.m_aPixelSize = rGraphic.GetPrefSize(); diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 71de229f2c41..e775fc92a4af 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -188,11 +188,13 @@ struct ReferenceXObjectEmit Size m_aPixelSize; /// PDF data from the graphic object, if not writing a reference XObject. std::vector<sal_Int8> m_aPDFData; + sal_Int32 m_nPDFPageIndex; ReferenceXObjectEmit() : m_nFormObject(0), m_nEmbeddedObject(0), - m_nBitmapObject(0) + m_nBitmapObject(0), + m_nPDFPageIndex(-1) { } commit c78a95124877387abf85a8637f50c1bfce24c22e Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon Apr 20 22:17:01 2020 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Apr 26 21:38:07 2020 +0200 ImpGraphic: encapsulate members of ImpSwapFile Change-Id: I882d30f2f27149c865160b3fa68fa974701cea71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92921 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 0653c82d4bae..6ba07295f9a3 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -43,7 +43,7 @@ struct ImpSwapInfo class OutputDevice; class GfxLink; -struct ImpSwapFile; +class ImpSwapFile; class GraphicConversionParameters; class ImpGraphic; diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index d4634f1c58ca..9eb42fec39e8 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -67,21 +67,32 @@ constexpr sal_uInt32 constPdfMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') << using namespace com::sun::star; -struct ImpSwapFile +class ImpSwapFile { - INetURLObject aSwapURL; +private: + INetURLObject maSwapURL; OUString maOriginURL; +public: + ImpSwapFile(INetURLObject const & aSwapURL, OUString const & rOriginURL) + : maSwapURL(aSwapURL) + , maOriginURL(rOriginURL) + { + } + ~ImpSwapFile() COVERITY_NOEXCEPT_FALSE { - utl::UCBContentHelper::Kill(aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); + utl::UCBContentHelper::Kill(maSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } + + INetURLObject getSwapURL() { return maSwapURL; } + OUString const & getOriginURL() { return maOriginURL; } }; OUString ImpGraphic::getSwapFileURL() { if (mpSwapFile) - return mpSwapFile->aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); + return mpSwapFile->getSwapURL().GetMainURL(INetURLObject::DecodeMechanism::NONE); return OUString(); } @@ -1344,9 +1355,7 @@ bool ImpGraphic::swapOut() bool bRet = swapOutToStream( xOStm.get() ); if( bRet ) { - mpSwapFile.reset(new ImpSwapFile, o3tl::default_delete<ImpSwapFile>()); - mpSwapFile->aSwapURL = aTmpURL; - mpSwapFile->maOriginURL = getOriginURL(); + mpSwapFile.reset(new ImpSwapFile(aTmpURL, getOriginURL()), o3tl::default_delete<ImpSwapFile>()); } else { @@ -1436,7 +1445,7 @@ bool ImpGraphic::swapIn() OUString aSwapURL; if( mpSwapFile ) - aSwapURL = mpSwapFile->aSwapURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); + aSwapURL = mpSwapFile->getSwapURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ); if( !aSwapURL.isEmpty() ) { @@ -1457,7 +1466,7 @@ bool ImpGraphic::swapIn() bRet = swapInFromStream(xIStm.get()); xIStm.reset(); if (mpSwapFile) - setOriginURL(mpSwapFile->maOriginURL); + setOriginURL(mpSwapFile->getOriginURL()); mpSwapFile.reset(); } } commit a1b2799c839df3014c24fde337511c3f91e9c5ab Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Sun Apr 26 19:56:42 2020 +0100 Commit: Gerrit Code Review <ger...@gerrit.libreoffice.org> CommitDate: Sun Apr 26 20:56:42 2020 +0200 Update git submodules * Update helpcontent2 from branch 'master' to dacce1ab09a52f8eecee9a0651069934eb91054b - Highlight dialog objects in text Change-Id: I9a0a65988a79602bf1e43006f2266bb8ab1471ab Reviewed-on: https://gerrit.libreoffice.org/c/help/+/92778 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/helpcontent2 b/helpcontent2 index 45df710ed2b8..dacce1ab09a5 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 45df710ed2b840dd15c34f9a24767a50a7454861 +Subproject commit dacce1ab09a52f8eecee9a0651069934eb91054b commit 4211485b827b2fd846056b8d178ceb1eaaaa5eda Author: Andrea Gelmini <andrea.gelm...@gelma.net> AuthorDate: Sun Apr 26 20:55:51 2020 +0200 Commit: Gerrit Code Review <ger...@gerrit.libreoffice.org> CommitDate: Sun Apr 26 20:55:51 2020 +0200 Update git submodules * Update helpcontent2 from branch 'master' to 45df710ed2b840dd15c34f9a24767a50a7454861 - Fix typo Change-Id: I5b1e5f3abbd6543c0c6fc2b2051c5f9922b379e8 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/92911 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/helpcontent2 b/helpcontent2 index f3f616cc45f8..45df710ed2b8 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit f3f616cc45f80a7ad27286fdb8933b686c00f229 +Subproject commit 45df710ed2b840dd15c34f9a24767a50a7454861 commit 287e39d363012788bf1f5bdb94fdebd370e8763d Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Apr 25 12:06:53 2020 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Apr 26 20:06:49 2020 +0200 Test swapping of Graphic Change-Id: I895002aa31380d2b5bc2593e66080f3fc94034e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92920 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/vcl/CppunitTest_vcl_graphic_test.mk b/vcl/CppunitTest_vcl_graphic_test.mk index fd5c7aeb039b..63dea32f9757 100644 --- a/vcl/CppunitTest_vcl_graphic_test.mk +++ b/vcl/CppunitTest_vcl_graphic_test.mk @@ -39,19 +39,9 @@ $(eval $(call gb_CppunitTest_use_libraries,vcl_graphic_test, \ )) $(eval $(call gb_CppunitTest_use_sdk_api,vcl_graphic_test)) - $(eval $(call gb_CppunitTest_use_ure,vcl_graphic_test)) $(eval $(call gb_CppunitTest_use_vcl,vcl_graphic_test)) - -$(eval $(call gb_CppunitTest_use_components,vcl_graphic_test,\ - configmgr/source/configmgr \ - i18npool/util/i18npool \ - ucb/source/core/ucb1 \ - unotools/util/utl \ - emfio/emfio \ - drawinglayer/drawinglayer \ -)) - +$(eval $(call gb_CppunitTest_use_rdb,vcl_graphic_test,services)) $(eval $(call gb_CppunitTest_use_configuration,vcl_graphic_test)) # we need to explicitly depend on Library_gie because it's dynamically loaded for .gif diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index adddaca92499..0653c82d4bae 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_VCL_INC_IMPGRAPH_HXX #define INCLUDED_VCL_INC_IMPGRAPH_HXX +#include <vcl/dllapi.h> #include <vcl/GraphicExternalLink.hxx> #include <vcl/gdimtf.hxx> #include <vcl/graph.hxx> @@ -46,7 +47,7 @@ struct ImpSwapFile; class GraphicConversionParameters; class ImpGraphic; -class ImpGraphic final +class VCL_DLLPUBLIC ImpGraphic final { friend class Graphic; friend class GraphicID; @@ -175,14 +176,9 @@ private: bool ImplReadEmbedded( SvStream& rIStream ); bool ImplWriteEmbedded( SvStream& rOStream ); - bool swapIn(); bool swapInFromStream(SvStream* pIStm); - - bool swapOut(); bool swapOutToStream(SvStream* pOStm); - bool isSwappedOut() const { return mbSwapOut;} - bool ImplIsDummyContext() const { return mbDummyContext; } void ImplSetLink( const std::shared_ptr<GfxLink>& ); std::shared_ptr<GfxLink> ImplGetSharedGfxLink() const; @@ -206,6 +202,12 @@ private: bool loadPrepared(); sal_Int32 getPageNumber() const; + +public: + bool swapIn(); + bool swapOut(); + bool isSwappedOut() const { return mbSwapOut; } + OUString getSwapFileURL(); }; #endif // INCLUDED_VCL_INC_IMPGRAPH_HXX diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx index e67ba6ff7ee7..d040f8837cd0 100644 --- a/vcl/qa/cppunit/GraphicTest.cxx +++ b/vcl/qa/cppunit/GraphicTest.cxx @@ -19,6 +19,11 @@ #include <vcl/graphicfilter.hxx> #include <tools/stream.hxx> #include <unotest/directories.hxx> +#include <comphelper/DirectoryHelper.hxx> +#include <comphelper/hash.hxx> +#include <unotools/ucbstreamhelper.hxx> + +#include <impgraph.hxx> using namespace css; @@ -31,6 +36,8 @@ class GraphicTest : public CppUnit::TestFixture void testUnloadedGraphicWmf(); void testUnloadedGraphicAlpha(); void testUnloadedGraphicSizeUnit(); + void testSwapping(); + void testSwappingVectorGraphic(); CPPUNIT_TEST_SUITE(GraphicTest); CPPUNIT_TEST(testUnloadedGraphic); @@ -38,6 +45,8 @@ class GraphicTest : public CppUnit::TestFixture CPPUNIT_TEST(testUnloadedGraphicWmf); CPPUNIT_TEST(testUnloadedGraphicAlpha); CPPUNIT_TEST(testUnloadedGraphicSizeUnit); + CPPUNIT_TEST(testSwapping); + CPPUNIT_TEST(testSwappingVectorGraphic); CPPUNIT_TEST_SUITE_END(); }; @@ -82,6 +91,71 @@ Graphic makeUnloadedGraphic(OUString const& sType, bool alpha = false) return rGraphicFilter.ImportUnloadedGraphic(aStream); } +std::string toHexString(const std::vector<unsigned char>& a) +{ + std::stringstream aStrm; + for (auto& i : a) + { + aStrm << std::setw(2) << std::setfill('0') << std::hex << static_cast<int>(i); + } + + return aStrm.str(); +} + +std::unique_ptr<SvStream> createStream(OUString const& rSwapFileURL) +{ + std::unique_ptr<SvStream> xStream; + + try + { + xStream = ::utl::UcbStreamHelper::CreateStream( + rSwapFileURL, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); + } + catch (const css::uno::Exception&) + { + } + + return xStream; +} + +std::vector<unsigned char> calculateHash(std::unique_ptr<SvStream>& rStream) +{ + comphelper::Hash aHashEngine(comphelper::HashType::SHA1); + const sal_uInt32 nSize(rStream->remainingSize()); + std::vector<sal_uInt8> aData(nSize); + aHashEngine.update(aData.data(), nSize); + return aHashEngine.finalize(); +} + +bool checkBitmap(Graphic& rGraphic) +{ + bool bResult = true; + + Bitmap aBitmap(rGraphic.GetBitmapEx().GetBitmap()); + { + Bitmap::ScopedReadAccess pReadAccess(aBitmap); + for (long y = 0; y < rGraphic.GetSizePixel().Height(); y++) + { + for (long x = 0; x < rGraphic.GetSizePixel().Width(); x++) + { + if (pReadAccess->HasPalette()) + { + sal_uInt32 nIndex = pReadAccess->GetPixelIndex(y, x); + Color aColor = pReadAccess->GetPaletteColor(nIndex); + bResult &= (aColor == Color(0xff, 0x00, 0x00)); + } + else + { + Color aColor = pReadAccess->GetPixel(y, x); + bResult &= (aColor == Color(0xff, 0x00, 0x00)); + } + } + } + } + + return bResult; +} + char const DATA_DIRECTORY[] = "/vcl/qa/cppunit/data/"; void GraphicTest::testUnloadedGraphic() @@ -114,6 +188,14 @@ void GraphicTest::testUnloadedGraphic() CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); CPPUNIT_ASSERT(aGraphic.GetSizeBytes() > 0); CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + + //check Type + aGraphic = makeUnloadedGraphic("png"); + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); + CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.makeAvailable()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); } void GraphicTest::testUnloadedGraphicLoading() @@ -131,29 +213,9 @@ void GraphicTest::testUnloadedGraphicLoading() CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); CPPUNIT_ASSERT(aGraphic.GetSizeBytes() > 0); CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); - Bitmap aBitmap(aGraphic.GetBitmapEx().GetBitmap()); - { - Bitmap::ScopedReadAccess pReadAccess(aBitmap); - for (long y = 0; y < aGraphic.GetSizePixel().Height(); y++) - { - for (long x = 0; x < aGraphic.GetSizePixel().Width(); x++) - { - if (pReadAccess->HasPalette()) - { - Color aColor - = pReadAccess->GetPaletteColor(pReadAccess->GetPixelIndex(y, x)); - CPPUNIT_ASSERT_EQUAL(OUString("ff0000"), aColor.AsRGBHexString()); - } - else - { - Color aColor = pReadAccess->GetPixel(y, x); - if (sFormat != "jpg") - CPPUNIT_ASSERT_EQUAL(OUString("ff0000"), aColor.AsRGBHexString()); - } - } - } - } + if (sFormat != "jpg") + CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); } } @@ -216,6 +278,136 @@ void GraphicTest::testUnloadedGraphicSizeUnit() CPPUNIT_ASSERT_EQUAL(Size(400, 363), aGraphic.GetPrefSize()); } +void GraphicTest::testSwapping() +{ + // Prepare Graphic from a PNG image first + Graphic aGraphic = makeUnloadedGraphic("png"); + + CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.makeAvailable()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + + CPPUNIT_ASSERT_EQUAL(120L, aGraphic.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(100L, aGraphic.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(BitmapChecksum(0xF5331397837B58EB), aGraphic.GetChecksum()); + + CPPUNIT_ASSERT_EQUAL(sal_uInt32(319), aGraphic.GetGfxLink().GetDataSize()); + + // We loaded the Graphic and made it available + CPPUNIT_ASSERT_EQUAL(false, aGraphic.ImplGetImpGraphic()->isSwappedOut()); + // Get the declared byte size of the graphic + sal_uLong rByteSize = aGraphic.GetSizeBytes(); + OUString rSwapFileURL = aGraphic.ImplGetImpGraphic()->getSwapFileURL(); + CPPUNIT_ASSERT_EQUAL(true, rSwapFileURL.isEmpty()); + + // Swapping out + CPPUNIT_ASSERT_EQUAL(true, aGraphic.ImplGetImpGraphic()->swapOut()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.ImplGetImpGraphic()->isSwappedOut()); + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); + + // Byte size doesn't change when we swapped out + CPPUNIT_ASSERT_EQUAL(rByteSize, aGraphic.GetSizeBytes()); + + // Let's check the swap file + rSwapFileURL = aGraphic.ImplGetImpGraphic()->getSwapFileURL(); + CPPUNIT_ASSERT_EQUAL(true, comphelper::DirectoryHelper::fileExists(rSwapFileURL)); + + { // Check the swap file content + std::unique_ptr<SvStream> xStream = createStream(rSwapFileURL); + CPPUNIT_ASSERT_EQUAL(true, bool(xStream)); + + // Check size of the stream + CPPUNIT_ASSERT_EQUAL(sal_uInt64(445), xStream->remainingSize()); + + std::vector<unsigned char> aHash = calculateHash(xStream); + CPPUNIT_ASSERT_EQUAL(std::string("304f17d9c56e79b95f6c337dab88709d4f9b61f0"), + toHexString(aHash)); + } + + // Let's swap in + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.makeAvailable()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + CPPUNIT_ASSERT_EQUAL(false, aGraphic.ImplGetImpGraphic()->isSwappedOut()); + + CPPUNIT_ASSERT_EQUAL(BitmapChecksum(0xF5331397837B58EB), aGraphic.GetChecksum()); + + // File shouldn't be available anymore + CPPUNIT_ASSERT_EQUAL(false, comphelper::DirectoryHelper::fileExists(rSwapFileURL)); + + // Check the bitmap + CPPUNIT_ASSERT_EQUAL(120L, aGraphic.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(100L, aGraphic.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); + CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); +} + +void GraphicTest::testSwappingVectorGraphic() +{ + test::Directories aDirectories; + OUString aURL = aDirectories.getURLFromSrc(DATA_DIRECTORY) + "SimpleExample.svg"; + SvFileStream aStream(aURL, StreamMode::READ); + GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); + Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream); + + CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); + + // Load the vector graphic + CPPUNIT_ASSERT_EQUAL(true, bool(aGraphic.getVectorGraphicData())); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(223), + aGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(223), aGraphic.GetGfxLink().GetDataSize()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + + BitmapChecksum aBitmapChecksumBeforeSwapping = aGraphic.GetBitmapEx().GetChecksum(); + + CPPUNIT_ASSERT_EQUAL(false, aGraphic.ImplGetImpGraphic()->isSwappedOut()); + + // Get the declared byte size of the graphic + sal_uLong rByteSize = aGraphic.GetSizeBytes(); + CPPUNIT_ASSERT_EQUAL(sal_uLong(223), rByteSize); + OUString rSwapFileURL = aGraphic.ImplGetImpGraphic()->getSwapFileURL(); + CPPUNIT_ASSERT_EQUAL(true, rSwapFileURL.isEmpty()); + + // Swapping out + CPPUNIT_ASSERT_EQUAL(true, aGraphic.ImplGetImpGraphic()->swapOut()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.ImplGetImpGraphic()->isSwappedOut()); + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); + + // Byte size doesn't change when we swapped out + // TODO: In case we don't trigger GetBitmapEx (above) the size is 0 + CPPUNIT_ASSERT_EQUAL(rByteSize, aGraphic.GetSizeBytes()); + + // Let's check the swap file + rSwapFileURL = aGraphic.ImplGetImpGraphic()->getSwapFileURL(); + CPPUNIT_ASSERT_EQUAL(true, comphelper::DirectoryHelper::fileExists(rSwapFileURL)); + + { // Check the swap file content + std::unique_ptr<SvStream> xStream = createStream(rSwapFileURL); + CPPUNIT_ASSERT_EQUAL(true, bool(xStream)); + + // Check size of the stream + CPPUNIT_ASSERT_EQUAL(sal_uInt64(349), xStream->remainingSize()); + + std::vector<unsigned char> aHash = calculateHash(xStream); + CPPUNIT_ASSERT_EQUAL(std::string("88b4c1c359e3cf7be005fbb46c93ffa6de9dcf4a"), + toHexString(aHash)); + } + + // Let's swap in + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.makeAvailable()); + CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable()); + CPPUNIT_ASSERT_EQUAL(false, aGraphic.ImplGetImpGraphic()->isSwappedOut()); + + CPPUNIT_ASSERT_EQUAL(aBitmapChecksumBeforeSwapping, aGraphic.GetBitmapEx().GetChecksum()); + + // File shouldn't be available anymore + CPPUNIT_ASSERT_EQUAL(false, comphelper::DirectoryHelper::fileExists(rSwapFileURL)); +} + } // namespace CPPUNIT_TEST_SUITE_REGISTRATION(GraphicTest); diff --git a/vcl/qa/cppunit/data/SimpleExample.svg b/vcl/qa/cppunit/data/SimpleExample.svg new file mode 100644 index 000000000000..6890b5456cdf --- /dev/null +++ b/vcl/qa/cppunit/data/SimpleExample.svg @@ -0,0 +1,4 @@ +<svg width="50" height="50" version="1.1" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"> + <rect x="0" y="0" width="50" height="50" fill="#aaaaaa"/> + <rect x="5" y="5" width="40" height="40" fill="#ff44aa"/> +</svg> diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 02f8189bd81c..d4634f1c58ca 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -78,6 +78,13 @@ struct ImpSwapFile } }; +OUString ImpGraphic::getSwapFileURL() +{ + if (mpSwapFile) + return mpSwapFile->aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); + return OUString(); +} + ImpGraphic::ImpGraphic() : meType ( GraphicType::NONE ), mnSizeBytes ( 0 ), commit 53695ce10253f5d029063e6c7afffdf1799ceec4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Apr 26 14:47:37 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Apr 26 16:36:35 2020 +0200 fix make screenshot breakage Change-Id: Ieb2a4ee7475de2f3f0b6de6c1f3a5c305805131f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92932 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/svtools/qa/unit/svtools-dialogs-test.cxx b/svtools/qa/unit/svtools-dialogs-test.cxx index f710217ea7fd..be79168bb051 100644 --- a/svtools/qa/unit/svtools-dialogs-test.cxx +++ b/svtools/qa/unit/svtools-dialogs-test.cxx @@ -12,7 +12,6 @@ #include <vcl/abstdlg.hxx> #include <vcl/scheduler.hxx> #include <vcl/wrkwin.hxx> -#include <uitest/uiobject.hxx> #include <svtools/valueset.hxx> using namespace ::com::sun::star; @@ -34,11 +33,9 @@ public: // try to open a dialog void openAnyDialog(); - void testValueSetControl(); CPPUNIT_TEST_SUITE(SvtoolsDialogsTest); CPPUNIT_TEST(openAnyDialog); - CPPUNIT_TEST(testValueSetControl); CPPUNIT_TEST_SUITE_END(); }; @@ -62,35 +59,6 @@ void SvtoolsDialogsTest::openAnyDialog() processDialogBatchFile("svtools/qa/unit/data/svtools-dialogs-test.txt"); } -void SvtoolsDialogsTest::testValueSetControl() -{ - VclPtr<WorkWindow> pWorkWindow = VclPtr<WorkWindow>::Create(nullptr, WB_APP | WB_STDWORK); - VclPtr<ValueSet> pValueSet = VclPtr<ValueSet>::Create(pWorkWindow, WB_ITEMBORDER); - pValueSet->InsertItem(100, 0); - pValueSet->InsertItem(200, 1); - pValueSet->InsertItem(300, 2); - pValueSet->Show(); - pWorkWindow->Show(); - Scheduler::ProcessEventsToIdle(); - - CPPUNIT_ASSERT(pValueSet->IsEnabled()); - CPPUNIT_ASSERT(pValueSet->IsReallyVisible()); - CPPUNIT_ASSERT_EQUAL(false, pValueSet->IsItemSelected(300)); - { - std::unique_ptr<UIObject> pUIObject = pValueSet->GetUITestFactory()(pValueSet.get()); - CPPUNIT_ASSERT(pUIObject); - - StringMap aMap; - aMap["POS"] = "300"; - - pUIObject->execute("SELECT", aMap); - } - CPPUNIT_ASSERT_EQUAL(true, pValueSet->IsItemSelected(300)); - - pValueSet->disposeOnce(); - pWorkWindow->disposeOnce(); -} - CPPUNIT_TEST_SUITE_REGISTRATION(SvtoolsDialogsTest); CPPUNIT_PLUGIN_IMPLEMENT(); commit 415dd9825f45f412b4d547113ede77f07eac448e Author: Andrea Gelmini <andrea.gelm...@gelma.net> AuthorDate: Sun Apr 26 13:51:56 2020 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Apr 26 16:35:23 2020 +0200 Fix typo Change-Id: I12743733a35d00b5d99495b584bdb85de0175196 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92928 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index ef032087e4ac..83cab0b6c083 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -3100,7 +3100,7 @@ void SdImportTest::testTdf119187() CPPUNIT_ASSERT(pObj); const sdr::properties::BaseProperties & rProperties = pObj->GetProperties(); - // chcek text vertical alignment + // check text vertical alignment const SdrTextVertAdjustItem& rSdrTextVertAdjustItem = rProperties.GetItem(SDRATTR_TEXT_VERTADJUST); const SdrTextVertAdjust eTVA = rSdrTextVertAdjustItem.GetValue(); CPPUNIT_ASSERT_EQUAL(SDRTEXTVERTADJUST_TOP, eTVA); commit 0203092b072e4b420d21b98fb5deba4e1e089774 Author: Andrea Gelmini <andrea.gelm...@gelma.net> AuthorDate: Sun Apr 26 13:32:48 2020 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Apr 26 16:35:06 2020 +0200 Fix typo in code Change-Id: I79939bbaea5730fa0c3d714103e0b1976edd2e49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92926 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index e9d2f2e7b900..19c55794b3d8 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -184,15 +184,15 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( rFilter.getGraphicHelper() )); } -static void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfProperyValues ) +static void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfPropertyValues ) { - if (!rPropSet.hasProperty(PROP_CharInteropGrabBag) || aVectorOfProperyValues.empty()) + if (!rPropSet.hasProperty(PROP_CharInteropGrabBag) || aVectorOfPropertyValues.empty()) return; Sequence<PropertyValue> aGrabBag; Any aAnyGrabBag = rPropSet.getAnyProperty(PROP_CharInteropGrabBag); aAnyGrabBag >>= aGrabBag; - rPropSet.setAnyProperty(PROP_CharInteropGrabBag, makeAny(comphelper::concatSequences(aGrabBag, aVectorOfProperyValues))); + rPropSet.setAnyProperty(PROP_CharInteropGrabBag, makeAny(comphelper::concatSequences(aGrabBag, aVectorOfPropertyValues))); } void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter ) const commit 309569f7d1d144e7b1bcaa0211f04e9b26b9f2fd Author: Andrea Gelmini <andrea.gelm...@gelma.net> AuthorDate: Fri Apr 24 18:40:02 2020 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Apr 26 15:39:08 2020 +0200 Fix typo Change-Id: I0c0c7350b1b8c8630953cdf87146da933de757e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92869 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/sw/inc/crstate.hxx b/sw/inc/crstate.hxx index c7a67428d2e6..9b223319fd93 100644 --- a/sw/inc/crstate.hxx +++ b/sw/inc/crstate.hxx @@ -31,7 +31,7 @@ enum class SwFillMode TabSpace, ///< fill with spaces and tabs Space, ///< fill with spaces Margin, ///< only align left, center, right - Indent ///< by left paragraph indention + Indent ///< by left paragraph indentation }; struct SwFillCursorPos commit 2c7bed21f45174833bf2b7d2598b008062917c65 Author: Andrea Gelmini <andrea.gelm...@gelma.net> AuthorDate: Sun Apr 26 13:33:56 2020 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Apr 26 15:38:46 2020 +0200 Fix typo in code Change-Id: I4709f3fd11c8d5800efab65b6f9533cbad3ffe78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92927 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/include/test/sheet/xcalculatable.hxx b/include/test/sheet/xcalculatable.hxx index 7978fe42acdc..94614768ef15 100644 --- a/include/test/sheet/xcalculatable.hxx +++ b/include/test/sheet/xcalculatable.hxx @@ -27,7 +27,7 @@ public: void testCalculate(); void testCalculateAll(); - void testEnableAutomaticCaclulation(); + void testEnableAutomaticCalculation(); protected: ~XCalculatable() {} diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx index b939d7558cff..48b050b1134b 100644 --- a/sc/qa/extras/scmodelobj.cxx +++ b/sc/qa/extras/scmodelobj.cxx @@ -56,7 +56,7 @@ public: // XCalculatable CPPUNIT_TEST(testCalculate); CPPUNIT_TEST(testCalculateAll); - CPPUNIT_TEST(testEnableAutomaticCaclulation); + CPPUNIT_TEST(testEnableAutomaticCalculation); // XConsolidatable CPPUNIT_TEST(testCreateConsolidationDescriptor); diff --git a/test/source/sheet/xcalculatable.cxx b/test/source/sheet/xcalculatable.cxx index a63669b1727d..44c20153401c 100644 --- a/test/source/sheet/xcalculatable.cxx +++ b/test/source/sheet/xcalculatable.cxx @@ -22,7 +22,7 @@ using namespace com::sun::star::uno; namespace apitest { -void XCalculatable::testEnableAutomaticCaclulation() +void XCalculatable::testEnableAutomaticCalculation() { uno::Reference<sheet::XCalculatable> xCalculatable(init(), UNO_QUERY_THROW); commit ddcbaf462821d373592f9560d1e1e117cce05709 Author: Andrea Gelmini <andrea.gelm...@gelma.net> AuthorDate: Wed Apr 22 22:05:09 2020 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Apr 26 15:37:59 2020 +0200 tdf#124176: Use pragma once instead of include guards Started to fixing typo "DEFINITON"->"DEFINITION", eventually #pragma Change-Id: Ie7617b33671614b3ac09907d380f2ffdd9b68bdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92734 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx b/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx index 8c318c92773f..3a01d91359ca 100644 --- a/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx +++ b/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_VCL_INC_FONT_OPENTYPEFEATUREDEFINITONLIST_HXX -#define INCLUDED_VCL_INC_FONT_OPENTYPEFEATUREDEFINITONLIST_HXX +#pragma once #include <vcl/dllapi.h> #include <vcl/font/Feature.hxx> @@ -46,6 +45,4 @@ class VCL_DLLPUBLIC OpenTypeFeatureDefinitionList } // end font namespace } // end vcl namespace -#endif // INCLUDED_VCL_INC_FONT_OPENTYPEFEATUREDEFINITONLIST_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 83de7f38b7ae3c0b357974a536ae53fd6a2d231e Author: Andrea Gelmini <andrea.gelm...@gelma.net> AuthorDate: Sun Apr 26 13:26:08 2020 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Apr 26 15:35:36 2020 +0200 tdf#124176: Use pragma once instead of include guards Started to fix typo DESCRPTION ended with #pragma Change-Id: I0a99e0d1f0696cfbf2cd54e97b8b346bbe8e7e4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92925 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/framework/inc/uielement/uicommanddescription.hxx b/framework/inc/uielement/uicommanddescription.hxx index 652a8966805c..6886224ceb00 100644 --- a/framework/inc/uielement/uicommanddescription.hxx +++ b/framework/inc/uielement/uicommanddescription.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_UICOMMANDDESCRIPTION_HXX -#define INCLUDED_FRAMEWORK_INC_UIELEMENT_UICOMMANDDESCRIPTION_HXX +#pragma once #include <unordered_map> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -92,6 +91,4 @@ public: } // namespace framework -#endif // __FRAMEWORK_SERVICES_UICOMMANDDESCRPTION_HXX_ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 9f07fb6d15de5682cc2e09f0261ba59341ceb8ef Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Apr 25 20:58:01 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Apr 26 15:34:06 2020 +0200 update pches Change-Id: I83a61da7dda6c72552eecd377f1c3744c92a797e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92909 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/accessibility/inc/pch/precompiled_acc.hxx b/accessibility/inc/pch/precompiled_acc.hxx index 64aa57dbfd1f..839b881744c0 100644 --- a/accessibility/inc/pch/precompiled_acc.hxx +++ b/accessibility/inc/pch/precompiled_acc.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:13:02 using: + Generated on 2020-04-25 20:54:48 using: ./bin/update_pch accessibility acc --cutoff=4 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -25,6 +25,7 @@ #include <assert.h> #include <atomic> #include <cassert> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -62,9 +63,7 @@ #include <rtl/alloc.h> #include <rtl/instance.hxx> #include <rtl/math.h> -#include <rtl/math.hxx> #include <rtl/ref.hxx> -#include <rtl/strbuf.h> #include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> @@ -81,7 +80,6 @@ #include <sal/detail/log.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> diff --git a/basctl/inc/pch/precompiled_basctl.hxx b/basctl/inc/pch/precompiled_basctl.hxx index 0f8dbc95596b..4eefcdfdf3be 100644 --- a/basctl/inc/pch/precompiled_basctl.hxx +++ b/basctl/inc/pch/precompiled_basctl.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:13:06 using: + Generated on 2020-04-25 20:54:48 using: ./bin/update_pch basctl basctl --cutoff=3 --exclude:system --include:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -26,6 +26,7 @@ #include <atomic> #include <cassert> #include <climits> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -71,10 +72,7 @@ #include <rtl/alloc.h> #include <rtl/instance.hxx> #include <rtl/math.h> -#include <rtl/math.hxx> #include <rtl/ref.hxx> -#include <rtl/strbuf.h> -#include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> #include <rtl/stringconcat.hxx> @@ -91,7 +89,6 @@ #include <sal/config.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx index 178ccf6addfc..6784722aea6d 100644 --- a/basic/inc/pch/precompiled_sb.hxx +++ b/basic/inc/pch/precompiled_sb.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:13:12 using: + Generated on 2020-04-25 20:54:48 using: ./bin/update_pch basic sb --cutoff=2 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -31,6 +31,7 @@ #include <boost/property_tree/ptree_fwd.hpp> #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 +#include <osl/endian.h> #include <osl/file.hxx> #include <osl/process.h> #include <osl/thread.h> diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index 48c2646a5c02..da780cfc1106 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:13:18 using: + Generated on 2020-04-25 20:54:50 using: ./bin/update_pch chart2 chartcontroller --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -23,6 +23,7 @@ #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -35,6 +36,7 @@ #include <limits> #include <list> #include <map> +#include <math.h> #include <memory> #include <new> #include <optional> @@ -99,7 +101,6 @@ #include <vcl/builderpage.hxx> #include <vcl/cairo.hxx> #include <vcl/checksum.hxx> -#include <vcl/ctrl.hxx> #include <vcl/customweld.hxx> #include <vcl/devicecoordinate.hxx> #include <vcl/dllapi.h> diff --git a/comphelper/inc/pch/precompiled_comphelper.hxx b/comphelper/inc/pch/precompiled_comphelper.hxx index 62362a331734..93c2c2a0edb3 100644 --- a/comphelper/inc/pch/precompiled_comphelper.hxx +++ b/comphelper/inc/pch/precompiled_comphelper.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:13:22 using: + Generated on 2020-04-25 20:54:51 using: ./bin/update_pch comphelper comphelper --cutoff=4 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -23,6 +23,7 @@ #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -83,7 +84,6 @@ #include <sal/config.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> diff --git a/connectivity/inc/pch/precompiled_ado.hxx b/connectivity/inc/pch/precompiled_ado.hxx index 378bab57d8c6..b8d5da4587d0 100644 --- a/connectivity/inc/pch/precompiled_ado.hxx +++ b/connectivity/inc/pch/precompiled_ado.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:13:28 using: + Generated on 2020-04-25 20:54:51 using: ./bin/update_pch connectivity ado --cutoff=2 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: diff --git a/connectivity/inc/pch/precompiled_dbase.hxx b/connectivity/inc/pch/precompiled_dbase.hxx index 7d84b5570cc2..e98e54cbd6e2 100644 --- a/connectivity/inc/pch/precompiled_dbase.hxx +++ b/connectivity/inc/pch/precompiled_dbase.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-02-01 10:57:27 using: + Generated on 2020-04-25 20:54:52 using: ./bin/update_pch connectivity dbase --cutoff=2 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -194,6 +194,7 @@ #include <resource/sharedresources.hxx> #include <salhelper/salhelperdllapi.h> #include <salhelper/simplereferenceobject.hxx> +#include <sdbcx/VCatalog.hxx> #include <svl/svldllapi.h> #include <tools/config.hxx> #include <tools/lineend.hxx> @@ -219,7 +220,6 @@ #include <connectivity/dbexception.hxx> #include <connectivity/dbtoolsdllapi.hxx> #include <connectivity/sdbcx/IRefreshable.hxx> -#include <sdbcx/VCatalog.hxx> #include <connectivity/sdbcx/VColumn.hxx> #include <connectivity/sqliterator.hxx> #include <propertyids.hxx> diff --git a/cppcanvas/inc/pch/precompiled_cppcanvas.hxx b/cppcanvas/inc/pch/precompiled_cppcanvas.hxx index 186ba9f6e100..3e90a4796bb8 100644 --- a/cppcanvas/inc/pch/precompiled_cppcanvas.hxx +++ b/cppcanvas/inc/pch/precompiled_cppcanvas.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:14:04 using: + Generated on 2020-04-25 20:54:54 using: ./bin/update_pch cppcanvas cppcanvas --cutoff=11 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -23,8 +23,8 @@ #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> +#include <cmath> #include <cstddef> -#include <cstring> #include <float.h> #include <functional> #include <iomanip> @@ -56,7 +56,6 @@ #include <rtl/math.hxx> #include <rtl/ref.hxx> #include <rtl/strbuf.h> -#include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> #include <rtl/stringconcat.hxx> @@ -64,13 +63,11 @@ #include <rtl/textcvt.h> #include <rtl/textenc.h> #include <rtl/ustrbuf.h> -#include <rtl/ustrbuf.hxx> #include <rtl/ustring.h> #include <rtl/ustring.hxx> #include <sal/config.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx index f9b19ac20073..66ae4731096a 100644 --- a/cui/inc/pch/precompiled_cui.hxx +++ b/cui/inc/pch/precompiled_cui.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:14:12 using: + Generated on 2020-04-25 20:54:55 using: ./bin/update_pch cui cui --cutoff=8 --exclude:system --include:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -24,6 +24,7 @@ #include <algorithm> #include <array> #include <cassert> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -73,9 +74,7 @@ #include <rtl/character.hxx> #include <rtl/instance.hxx> #include <rtl/math.h> -#include <rtl/math.hxx> #include <rtl/ref.hxx> -#include <rtl/strbuf.h> #include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> @@ -91,7 +90,6 @@ #include <sal/config.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> @@ -111,7 +109,6 @@ #include <vcl/builderpage.hxx> #include <vcl/cairo.hxx> #include <vcl/checksum.hxx> -#include <vcl/ctrl.hxx> #include <vcl/customweld.hxx> #include <vcl/devicecoordinate.hxx> #include <vcl/dllapi.h> @@ -388,7 +385,6 @@ #include <tools/poly.hxx> #include <tools/ref.hxx> #include <tools/solar.h> -#include <tools/stream.hxx> #include <tools/time.hxx> #include <tools/toolsdllapi.h> #include <tools/urlobj.hxx> diff --git a/dbaccess/inc/pch/precompiled_dba.hxx b/dbaccess/inc/pch/precompiled_dba.hxx index 4c1e2316b0ae..09dd21764475 100644 --- a/dbaccess/inc/pch/precompiled_dba.hxx +++ b/dbaccess/inc/pch/precompiled_dba.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:14:19 using: + Generated on 2020-04-25 20:54:56 using: ./bin/update_pch dbaccess dba --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -25,6 +25,7 @@ #include <assert.h> #include <atomic> #include <cassert> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -67,8 +68,6 @@ #include <rtl/math.h> #include <rtl/math.hxx> #include <rtl/ref.hxx> -#include <rtl/strbuf.h> -#include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> #include <rtl/stringconcat.hxx> @@ -84,7 +83,6 @@ #include <sal/config.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> diff --git a/dbaccess/inc/pch/precompiled_dbaxml.hxx b/dbaccess/inc/pch/precompiled_dbaxml.hxx index e71c6f22403d..3e41685ba191 100644 --- a/dbaccess/inc/pch/precompiled_dbaxml.hxx +++ b/dbaccess/inc/pch/precompiled_dbaxml.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:14:21 using: + Generated on 2020-04-25 20:54:57 using: ./bin/update_pch dbaccess dbaxml --cutoff=2 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -23,8 +23,13 @@ #if PCH_LEVEL >= 1 #include <cassert> #include <cstddef> +#include <cstring> #include <functional> +#include <limits> #include <memory> +#include <new> +#include <string_view> +#include <type_traits> #include <utility> #include <vector> #include <boost/property_tree/ptree_fwd.hpp> @@ -34,8 +39,11 @@ #include <rtl/instance.hxx> #include <rtl/ref.hxx> #include <rtl/strbuf.hxx> +#include <rtl/stringconcat.hxx> +#include <rtl/stringutils.hxx> #include <rtl/unload.h> #include <rtl/uri.hxx> +#include <rtl/ustrbuf.h> #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> #include <sal/config.h> diff --git a/dbaccess/inc/pch/precompiled_dbu.hxx b/dbaccess/inc/pch/precompiled_dbu.hxx index a9965da5147e..6a7aa8f6022d 100644 --- a/dbaccess/inc/pch/precompiled_dbu.hxx +++ b/dbaccess/inc/pch/precompiled_dbu.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:14:25 using: + Generated on 2020-04-25 20:54:58 using: ./bin/update_pch dbaccess dbu --cutoff=12 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -34,12 +34,14 @@ #include <optional> #include <ostream> #include <string_view> +#include <type_traits> #include <utility> #include <vector> #include <boost/property_tree/ptree_fwd.hpp> #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 #include <osl/diagnose.h> +#include <osl/endian.h> #include <osl/file.hxx> #include <osl/interlck.h> #include <osl/mutex.h> diff --git a/desktop/inc/pch/precompiled_sofficeapp.hxx b/desktop/inc/pch/precompiled_sofficeapp.hxx index 8cf4868bb5f4..e7790c5864f1 100644 --- a/desktop/inc/pch/precompiled_sofficeapp.hxx +++ b/desktop/inc/pch/precompiled_sofficeapp.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:15:27 using: + Generated on 2020-04-25 20:54:59 using: ./bin/update_pch desktop sofficeapp --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -23,6 +23,7 @@ #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -68,10 +69,8 @@ #include <rtl/digest.h> #include <rtl/instance.hxx> #include <rtl/math.h> -#include <rtl/math.hxx> #include <rtl/process.h> #include <rtl/ref.hxx> -#include <rtl/strbuf.h> #include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> @@ -87,7 +86,6 @@ #include <sal/config.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx index 2e7acea69e7b..9aaf7bace296 100644 --- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx +++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:15:30 using: + Generated on 2020-04-25 20:54:59 using: ./bin/update_pch drawinglayer drawinglayer --cutoff=4 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -24,6 +24,7 @@ #include <algorithm> #include <cassert> #include <cstddef> +#include <cstring> #include <deque> #include <limits.h> #include <limits> @@ -42,15 +43,15 @@ #include <osl/mutex.hxx> #include <rtl/alloc.h> #include <rtl/instance.hxx> +#include <rtl/math.hxx> #include <rtl/ref.hxx> -#include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> #include <rtl/stringconcat.hxx> #include <rtl/stringutils.hxx> #include <rtl/textenc.h> #include <rtl/unload.h> -#include <rtl/ustrbuf.hxx> +#include <rtl/ustrbuf.h> #include <rtl/ustring.h> #include <rtl/ustring.hxx> #include <sal/config.h> diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx index 241d6ffda958..f36565045dff 100644 --- a/editeng/inc/pch/precompiled_editeng.hxx +++ b/editeng/inc/pch/precompiled_editeng.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:15:33 using: + Generated on 2020-04-25 20:54:59 using: ./bin/update_pch editeng editeng --cutoff=5 --exclude:system --include:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -25,6 +25,7 @@ #include <assert.h> #include <atomic> #include <cassert> +#include <cmath> #include <cstddef> #include <cstring> #include <deque> @@ -71,7 +72,6 @@ #include <rtl/math.hxx> #include <rtl/ref.hxx> #include <rtl/strbuf.h> -#include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> #include <rtl/stringconcat.hxx> @@ -79,7 +79,6 @@ #include <rtl/tencinfo.h> #include <rtl/textcvt.h> #include <rtl/textenc.h> -#include <rtl/ustrbuf.h> #include <rtl/ustrbuf.hxx> #include <rtl/ustring.h> #include <rtl/ustring.hxx> @@ -87,7 +86,6 @@ #include <sal/config.h> #include <sal/log.hxx> #include <sal/macros.h> -#include <sal/mathconf.h> #include <sal/saldllapi.h> #include <sal/types.h> #include <sal/typesizes.h> @@ -177,6 +175,7 @@ #include <com/sun/star/util/Time.hpp> #include <com/sun/star/xml/sax/XFastAttributeList.hpp> #include <com/sun/star/xml/sax/XFastContextHandler.hpp> +#include <com/sun/star/xml/sax/XFastTokenHandler.hpp> #include <comphelper/accessiblecomponenthelper.hxx> #include <comphelper/accessiblecontexthelper.hxx> #include <comphelper/comphelperdllapi.h> diff --git a/external/libmwaw/inc/pch/precompiled_mwaw.hxx b/external/libmwaw/inc/pch/precompiled_mwaw.hxx index 02f73c16688b..939d664dd904 100644 --- a/external/libmwaw/inc/pch/precompiled_mwaw.hxx +++ b/external/libmwaw/inc/pch/precompiled_mwaw.hxx @@ -13,15 +13,16 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2019-05-18 14:37:42 using: + Generated on 2020-04-25 20:55:00 using: ./bin/update_pch external/libmwaw mwaw --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: - ./bin/update_pch_bisect .\external/libmwaw\inc\pch\precompiled_mwaw.hxx "make external/libmwaw.build" --find-conflicts + ./bin/update_pch_bisect ./external/libmwaw/inc/pch/precompiled_mwaw.hxx "make external/libmwaw.build" --find-conflicts */ #if PCH_LEVEL >= 1 #include <algorithm> +#include <cctype> #include <cmath> #include <cstdarg> #include <cstdio> diff --git a/forms/inc/pch/precompiled_frm.hxx b/forms/inc/pch/precompiled_frm.hxx index 22b4fee6928e..cf54496c431e 100644 --- a/forms/inc/pch/precompiled_frm.hxx +++ b/forms/inc/pch/precompiled_frm.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-21 11:15:38 using: + Generated on 2020-04-25 20:55:01 using: ./bin/update_pch forms frm --cutoff=2 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -42,6 +42,7 @@ #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 #include <osl/diagnose.h> +#include <osl/endian.h> #include <osl/interlck.h> #include <osl/mutex.hxx> #include <rtl/alloc.h> diff --git a/framework/inc/pch/precompiled_fwe.hxx b/framework/inc/pch/precompiled_fwe.hxx index 895d8940aece..f73501641b71 100644 ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits