[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2022-05-21 Thread Caolán McNamara (via logerrit)
 vcl/Library_vcl.mk   |2 
 vcl/source/filter/itiff/ccidecom.cxx | 1100 --
 vcl/source/filter/itiff/itiff.cxx| 1695 ---
 vcl/source/filter/itiff/lzwdecom.cxx |  215 
 4 files changed, 3012 deletions(-)

New commits:
commit e59c9be85f8d00dc64c80e21dee91304fe232be2
Author: Caolán McNamara 
AuthorDate: Fri May 20 10:00:14 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 21 11:52:56 2022 +0200

drop old tiff filter

Change-Id: I3bfeae4751cb9173fbe2efdbda531a9a1a491c8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134695
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 5828084eb5a9..6910927bfde0 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -455,9 +455,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/filter/ipdf/pdfdocument \
 vcl/source/filter/iras/iras \
 vcl/source/filter/itga/itga \
-vcl/source/filter/itiff/ccidecom \
 vcl/source/filter/itiff/itiff \
-vcl/source/filter/itiff/lzwdecom \
 vcl/source/filter/ixbm/xbmread \
 vcl/source/filter/ixpm/xpmread \
 vcl/source/filter/jpeg/Exif \
diff --git a/vcl/source/filter/itiff/ccidecom.cxx 
b/vcl/source/filter/itiff/ccidecom.cxx
deleted file mode 100644
index a82041afa445..
--- a/vcl/source/filter/itiff/ccidecom.cxx
+++ /dev/null
@@ -1,1100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include "ccidecom.hxx"
-#include 
-
-//=== Huffman tables 
-
-// White-Run --
-
-#define CCIWhiteTableSize 105
-
-const CCIHuffmanTableEntry CCIWhiteTable[CCIWhiteTableSize]={
-{0, 0x0035,  8 },
-{1, 0x0007,  6 },
-{2, 0x0007,  4 },
-{3, 0x0008,  4 },
-{4, 0x000b,  4 },
-{5, 0x000c,  4 },
-{6, 0x000e,  4 },
-{7, 0x000f,  4 },
-{8, 0x0013,  5 },
-{9, 0x0014,  5 },
-{   10, 0x0007,  5 },
-{   11, 0x0008,  5 },
-{   12, 0x0008,  6 },
-{   13, 0x0003,  6 },
-{   14, 0x0034,  6 },
-{   15, 0x0035,  6 },
-{   16, 0x002a,  6 },
-{   17, 0x002b,  6 },
-{   18, 0x0027,  7 },
-{   19, 0x000c,  7 },
-{   20, 0x0008,  7 },
-{   21, 0x0017,  7 },
-{   22, 0x0003,  7 },
-{   23, 0x0004,  7 },
-{   24, 0x0028,  7 },
-{   25, 0x002b,  7 },
-{   26, 0x0013,  7 },
-{   27, 0x0024,  7 },
-{   28, 0x0018,  7 },
-{   29, 0x0002,  8 },
-{   30, 0x0003,  8 },
-{   31, 0x001a,  8 },
-{   32, 0x001b,  8 },
-{   33, 0x0012,  8 },
-{   34, 0x0013,  8 },
-{   35, 0x0014,  8 },
-{   36, 0x0015,  8 },
-{   37, 0x0016,  8 },
-{   38, 0x0017,  8 },
-{   39, 0x0028,  8 },
-{   40, 0x0029,  8 },
-{   41, 0x002a,  8 },
-{   42, 0x002b,  8 },
-{   43, 0x002c,  8 },
-{   44, 0x002d,  8 },
-{   45, 0x0004,  8 },
-{   46, 0x0005,  8 },
-{   47, 0x000a,  8 },
-{   48, 0x000b,  8 },
-{   49, 0x0052,  8 },
-{   50, 0x0053,  8 },
-{   51, 0x0054,  8 },
-{   52, 0x0055,  8 },
-{   53, 0x0024,  8 },
-{   54, 0x0025,  8 },
-{   55, 0x0058,  8 },
-{   56, 0x0059,  8 },
-{   57, 0x005a,  8 },
-{   58, 0x005b,  8 },
-{   59, 0x004a,  8 },
-{   60, 0x004b,  8 },
-{   61, 0x0032,  8 },
-{   62, 0x0033,  8 },
-{   63, 0x0034,  8 },
-{   64, 0x001b,  5 },
-{  128, 0x0012,  5 },
-{  192, 0x0017,  6 },
-{  256, 0x0037,  7 },
-{  320, 0x0036,  8 },
-{  384, 0x0037,  8 },
-{  448, 0x0064,  8 },
-{  512, 0x0065,  8 },
-{  576, 0x0068,  8 },
-{  640, 0x0067,  8 },
-{  704, 0x00cc,  9 },
-{  768, 0x00cd,  9 },
-{  832, 0x00d2,  9 },
-{  896, 0x00d3,  9 },
-{  960, 0x00d4,  9 },
-{ 1024, 0x00d5,  9 },
-{ 1088, 0x00d6,  9 },
-{ 1152, 0x00d7,  9 },
-{ 1216, 0x00d8,  9 },
-{ 1280, 0x00d9,  9 },
-{ 1344, 0x00da,  9 },
-{ 1408, 0x00db,  

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2022-05-17 Thread Julien Nabet (via logerrit)
 vcl/Library_vcl.mk|1 
 vcl/source/filter/itiff/itiff.cxx |   64 --
 2 files changed, 1 insertion(+), 64 deletions(-)

New commits:
commit 522de4493e982d987f55fd88a64dd9e83c46e895
Author: Julien Nabet 
AuthorDate: Tue May 17 21:04:51 2022 +0200
Commit: Julien Nabet 
CommitDate: Tue May 17 21:05:28 2022 +0200

Revert "tdf#122057: read tiff with deflate compression (code 32946 only)"

This reverts commit f0d3727322207b3a547313e14305440ad7009079.

Reason for revert: Gimp was displaying a black rectangle, thought it was 
ok. Then with just Firefox, I could see that it should display a design plan 
for a house.

Change-Id: I3a87ba24e779aee74d2124bf985b66c9cd7a0bb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134449
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 626134894bd0..a141e22348dd 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -69,7 +69,6 @@ $(eval $(call gb_Library_use_libraries,vcl,\
 i18nutil \
 $(if $(ENABLE_JAVA),jvmaccess) \
 $(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
-package2 \
 sal \
 salhelper \
 sot \
diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 894241a68d38..cff68f9e6ec9 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -20,10 +20,6 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
-
 #include 
 #include 
 #include 
@@ -712,64 +708,6 @@ bool TIFFReader::ReadMap()
 return false;
 }
 }
-else if ( nCompression == 32946 ) // deflate compression (legacy code)
-{
-sal_uInt32 nStrip(0);
-if (nStrip >= aStripOffsets.size())
-return false;
-pTIFF->Seek(aStripOffsets[nStrip]);
-
-
-sal_Int32 nRowSize = (static_cast(nImageWidth) * 
nSamplesPerPixel / nPlanes * nBitsPerSample + 7) >> 3;
-
-for (sal_Int32 ny = 0; ny < nImageLength; ++ny)
-{
-for (sal_uInt32 np = 0; np < nPlanes; ++np)
-{
-if ( ny / GetRowsPerStrip() + np * nStripsPerPlane > nStrip )
-{
-nStrip = ny / GetRowsPerStrip() + np * nStripsPerPlane;
-if (nStrip >= aStripOffsets.size())
-return false;
-pTIFF->Seek(aStripOffsets[nStrip]);
-}
-if (np >= SAL_N_ELEMENTS(aMap))
-return false;
-
-// Inflater uses in and out sequences
-// 1) Preparation: read in nBytesPerRow from the stream, put 
it on the sequence and initialize decompresser with it
-css::uno::Sequence aInput(nBytesPerRow);
-sal_uInt8* aInputArray = reinterpret_cast< sal_uInt8* >( 
aInput.getArray( ) );
-for (size_t i = 0; i < nBytesPerRow ; ++i)
-{
-pTIFF->ReadUChar(aInputArray[i]);
-}
-std::optional< ::ZipUtils::Inflater> 
decompresser(std::in_place, false);
-decompresser->setInput(aInput);
-
-// 2) Decompression
-css::uno::Sequence aOutput(nRowSize);
-decompresser->doInflateSegment(aOutput, 0, nRowSize);
-decompresser->end();
-decompresser.reset();
-
-// 3) Result retrieving: put the read row in the aMap which 
will be read by ConvertScanline later
-auto pDest = getMapData(np);
-for (sal_Int32 i = 0; i < nRowSize; ++i)
-*pDest++ = aInput[i];
-
-if ( pTIFF->GetError() )
-return false;
-}
-
-nTotalDataRead += nBytesPerRow;
-if (nMaxAllowedDecompression && nTotalDataRead > 
nMaxAllowedDecompression)
-return false;
-
-if ( !ConvertScanline( ny ) )
-return false;
-}
-}
 else if ( nCompression == 32773 )
 {
 sal_uInt32 nStrip(0);
@@ -1646,7 +1584,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & 
rGraphic )
 bStatus = false;
 }
 }
-else if (nCompression == 5 || nCompression == 32946)
+else if (nCompression == 5)
 {
 sal_uInt32 np = nPlanes - 1;
 if (np >= SAL_N_ELEMENTS(aMap))


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2022-05-17 Thread Julien Nabet (via logerrit)
 vcl/Library_vcl.mk|1 
 vcl/source/filter/itiff/itiff.cxx |   64 +-
 2 files changed, 64 insertions(+), 1 deletion(-)

New commits:
commit f0d3727322207b3a547313e14305440ad7009079
Author: Julien Nabet 
AuthorDate: Tue May 17 17:25:58 2022 +0200
Commit: Julien Nabet 
CommitDate: Tue May 17 20:53:01 2022 +0200

tdf#122057: read tiff with deflate compression (code 32946 only)

tiff format is more a multiformat container with different combination of 
parameters,
above all compression and photometric interpretation.

For this one, the only pb was deflate compression wasn't dealt with.
So just use existing LO wrapper for deflate lib in package part.

Remark: for the moment only decompression 32946 (legacy deflate) is managed 
not Adobe deflate (code 8).
I expected the same behaviour but some tests with tdf#131199 showed it 
didn't work.

Change-Id: I2c8d244fa89a2378bfe3b87d3d3262810c9952be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134485
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index a141e22348dd..626134894bd0 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -69,6 +69,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\
 i18nutil \
 $(if $(ENABLE_JAVA),jvmaccess) \
 $(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
+package2 \
 sal \
 salhelper \
 sot \
diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index cff68f9e6ec9..894241a68d38 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -20,6 +20,10 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -708,6 +712,64 @@ bool TIFFReader::ReadMap()
 return false;
 }
 }
+else if ( nCompression == 32946 ) // deflate compression (legacy code)
+{
+sal_uInt32 nStrip(0);
+if (nStrip >= aStripOffsets.size())
+return false;
+pTIFF->Seek(aStripOffsets[nStrip]);
+
+
+sal_Int32 nRowSize = (static_cast(nImageWidth) * 
nSamplesPerPixel / nPlanes * nBitsPerSample + 7) >> 3;
+
+for (sal_Int32 ny = 0; ny < nImageLength; ++ny)
+{
+for (sal_uInt32 np = 0; np < nPlanes; ++np)
+{
+if ( ny / GetRowsPerStrip() + np * nStripsPerPlane > nStrip )
+{
+nStrip = ny / GetRowsPerStrip() + np * nStripsPerPlane;
+if (nStrip >= aStripOffsets.size())
+return false;
+pTIFF->Seek(aStripOffsets[nStrip]);
+}
+if (np >= SAL_N_ELEMENTS(aMap))
+return false;
+
+// Inflater uses in and out sequences
+// 1) Preparation: read in nBytesPerRow from the stream, put 
it on the sequence and initialize decompresser with it
+css::uno::Sequence aInput(nBytesPerRow);
+sal_uInt8* aInputArray = reinterpret_cast< sal_uInt8* >( 
aInput.getArray( ) );
+for (size_t i = 0; i < nBytesPerRow ; ++i)
+{
+pTIFF->ReadUChar(aInputArray[i]);
+}
+std::optional< ::ZipUtils::Inflater> 
decompresser(std::in_place, false);
+decompresser->setInput(aInput);
+
+// 2) Decompression
+css::uno::Sequence aOutput(nRowSize);
+decompresser->doInflateSegment(aOutput, 0, nRowSize);
+decompresser->end();
+decompresser.reset();
+
+// 3) Result retrieving: put the read row in the aMap which 
will be read by ConvertScanline later
+auto pDest = getMapData(np);
+for (sal_Int32 i = 0; i < nRowSize; ++i)
+*pDest++ = aInput[i];
+
+if ( pTIFF->GetError() )
+return false;
+}
+
+nTotalDataRead += nBytesPerRow;
+if (nMaxAllowedDecompression && nTotalDataRead > 
nMaxAllowedDecompression)
+return false;
+
+if ( !ConvertScanline( ny ) )
+return false;
+}
+}
 else if ( nCompression == 32773 )
 {
 sal_uInt32 nStrip(0);
@@ -1584,7 +1646,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & 
rGraphic )
 bStatus = false;
 }
 }
-else if (nCompression == 5)
+else if (nCompression == 5 || nCompression == 32946)
 {
 sal_uInt32 np = nPlanes - 1;
 if (np >= SAL_N_ELEMENTS(aMap))


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2021-04-01 Thread Miklos Vajna (via logerrit)
 vcl/Library_vcl.mk |1 
 vcl/source/filter/ipdf/pdfread.cxx |   40 
 vcl/source/pdf/PDFiumLibrary.cxx   |   57 
 vcl/source/pdf/PDFiumTools.cxx |   73 +
 4 files changed, 82 insertions(+), 89 deletions(-)

New commits:
commit f1779fcef6535edf53d194fbd366de232653f189
Author: Miklos Vajna 
AuthorDate: Wed Mar 31 20:51:38 2021 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 1 09:10:51 2021 +0200

vcl pdfread: clean up not needed HAVE_FEATURE_PDFIUM ifdefs

Towards completely avoiding the HAVE_FEATURE_PDFIUM ifdef forest.

Change-Id: Ide634f14087ec18e5ab8186be21def0698ddbd5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113428
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index fba19b4e5fb3..c788fb164ce9 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -499,6 +499,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/fontsubset/sft \
 vcl/source/fontsubset/ttcr \
 vcl/source/fontsubset/xlat \
+vcl/source/pdf/PDFiumTools \
 vcl/source/uitest/logger \
 vcl/source/uitest/uiobject \
 vcl/source/uitest/uitest \
diff --git a/vcl/source/filter/ipdf/pdfread.cxx 
b/vcl/source/filter/ipdf/pdfread.cxx
index c51d350e3dda..86adec409f90 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -9,11 +9,7 @@
 
 #include 
 
-#include 
-
-#if HAVE_FEATURE_PDFIUM
 #include 
-#endif
 
 #include 
 #include 
@@ -27,8 +23,6 @@ using namespace com::sun::star;
 
 namespace
 {
-#if HAVE_FEATURE_PDFIUM
-
 /// Convert to inch, then assume 96 DPI.
 inline double pointToPixel(const double fPoint, const double fResolutionDPI)
 {
@@ -96,14 +90,6 @@ bool getCompatibleStream(SvStream& rInStream, SvStream& 
rOutStream)
 
 return rOutStream.good();
 }
-#else
-bool getCompatibleStream(SvStream& rInStream, SvStream& rOutStream)
-{
-rInStream.Seek(STREAM_SEEK_TO_BEGIN);
-rOutStream.WriteStream(rInStream, STREAM_SEEK_TO_END);
-return rOutStream.good();
-}
-#endif // HAVE_FEATURE_PDFIUM
 
 BinaryDataContainer createBinaryDataContainer(SvStream& rStream)
 {
@@ -131,9 +117,12 @@ namespace vcl
 size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector& 
rBitmaps,
 const size_t nFirstPage, int nPages, const 
basegfx::B2DTuple* pSizeHint)
 {
-#if HAVE_FEATURE_PDFIUM
 const double fResolutionDPI = 96;
 auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+if (!pPdfium)
+{
+return 0;
+}
 
 // Load the buffer using pdfium.
 std::unique_ptr pPdfDocument = 
pPdfium->openDocument(pBuffer, nSize);
@@ -217,15 +206,6 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, 
std::vector& r
 }
 
 return rBitmaps.size();
-#else
-(void)pBuffer;
-(void)nSize;
-(void)rBitmaps;
-(void)nFirstPage;
-(void)nPages;
-(void)pSizeHint;
-return 0;
-#endif // HAVE_FEATURE_PDFIUM
 }
 
 bool importPdfVectorGraphicData(SvStream& rStream,
@@ -253,7 +233,6 @@ bool ImportPDF(SvStream& rStream, Graphic& rGraphic)
 return true;
 }
 
-#if HAVE_FEATURE_PDFIUM
 namespace
 {
 basegfx::B2DPoint convertFromPDFInternalToHMM(basegfx::B2DSize const& 
rInputPoint,
@@ -431,11 +410,9 @@ findAnnotations(const 
std::unique_ptr& pPage, basegfx::B2D
 }
 
 } // end anonymous namespace
-#endif
 
 size_t ImportPDFUnloaded(const OUString& rURL, std::vector& 
rGraphics)
 {
-#if HAVE_FEATURE_PDFIUM
 std::unique_ptr xStream(
 ::utl::UcbStreamHelper::CreateStream(rURL, StreamMode::READ | 
StreamMode::SHARE_DENYNONE));
 
@@ -448,6 +425,10 @@ size_t ImportPDFUnloaded(const OUString& rURL, 
std::vector& rG
 auto pGfxLink = std::make_shared(aDataContainer, 
GfxLinkType::NativePdf);
 
 auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+if (!pPdfium)
+{
+return 0;
+}
 
 // Load the buffer using pdfium.
 auto pPdfDocument = pPdfium->openDocument(pGfxLink->GetData(), 
pGfxLink->GetDataSize());
@@ -487,11 +468,6 @@ size_t ImportPDFUnloaded(const OUString& rURL, 
std::vector& rG
 }
 
 return rGraphics.size();
-#else
-(void)rURL;
-(void)rGraphics;
-return 0;
-#endif // HAVE_FEATURE_PDFIUM
 }
 }
 
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index 53bf57e3aa8a..e8951c476648 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -411,63 +411,6 @@ public:
 };
 }
 
-OUString convertPdfDateToISO8601(OUString const& rInput)
-{
-if (rInput.getLength() < 6)
-return OUString();
-
-OUString prefix = rInput.copy(0, 2);
-if (prefix != "D:")
-return OUString();
-
-OUString sYear = rInput.copy(2, 4);
-
-OUString sMonth("01");
-if (rInput.getLength() >= 8)
-sMonth = rInput.copy(6, 2);
-
-OUString sDay("01");
-if (rInput.getLength() >= 

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source xmlsecurity/qa

2021-02-26 Thread Miklos Vajna (via logerrit)
 vcl/Library_vcl.mk  |   15 ++-
 vcl/source/pdf/DummyPDFiumLibrary.cxx   |   23 +++
 vcl/source/pdf/PDFiumLibrary.cxx|6 --
 xmlsecurity/qa/unit/signing/signing.cxx |   24 
 4 files changed, 61 insertions(+), 7 deletions(-)

New commits:
commit e04e32b6c66e59f7cf57ed38ac3a730f68eed4b7
Author: Miklos Vajna 
AuthorDate: Thu Feb 25 20:54:21 2021 +0100
Commit: Miklos Vajna 
CommitDate: Fri Feb 26 12:22:02 2021 +0100

pdfium: don't build PDFiumLibrary when PDFium is disabled

Rather provide a stub implementation of PDFiumLibrary::get(), so other
code can call it unconditionally.

This is meant to allow removing the 10 stub functions in
VectorGraphicSearch later.

Also fix up CppunitTest_xmlsecurity_signing to pass in the
disable-pdfium case by avoiding the known-problematic checks.

Change-Id: I748fcc5c623c5ce937bd2980bfdfaadbdf6cedf7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111564
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 10a4ef7ad48d..6f60030a869b 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -318,7 +318,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/pdf/ResourceDict \
 vcl/source/pdf/Matrix3 \
 vcl/source/pdf/XmpMetadata \
-vcl/source/pdf/PDFiumLibrary \
 vcl/source/pdf/ExternalPDFStreams \
 vcl/source/graphic/BinaryDataContainer \
 vcl/source/graphic/BinaryDataContainerTools \
@@ -520,6 +519,20 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/jsdialog/executor \
 ))
 
+ifneq ($(filter PDFIUM,$(BUILD_TYPE)),)
+
+$(eval $(call gb_Library_add_exception_objects,vcl,\
+vcl/source/pdf/PDFiumLibrary \
+))
+
+else
+
+$(eval $(call gb_Library_add_exception_objects,vcl,\
+vcl/source/pdf/DummyPDFiumLibrary \
+))
+
+endif
+
 $(eval $(call gb_Library_add_cobjects,vcl,\
 vcl/source/filter/jpeg/transupp \
 ))
diff --git a/vcl/source/pdf/DummyPDFiumLibrary.cxx 
b/vcl/source/pdf/DummyPDFiumLibrary.cxx
new file mode 100644
index ..7c42084ebee1
--- /dev/null
+++ b/vcl/source/pdf/DummyPDFiumLibrary.cxx
@@ -0,0 +1,23 @@
+/* -*- 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 
+
+namespace vcl::pdf
+{
+std::shared_ptr& PDFiumLibrary::get()
+{
+static std::shared_ptr pInstance;
+return pInstance;
+}
+
+} // end vcl::pdf
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index cb91edf99ebc..562e0d474f7d 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -8,10 +8,6 @@
  *
  */
 
-#include 
-
-#if HAVE_FEATURE_PDFIUM
-
 #include 
 
 #include 
@@ -1337,6 +1333,4 @@ std::shared_ptr& PDFiumLibrary::get()
 
 } // end vcl::pdf
 
-#endif // HAVE_FEATURE_PDFIUM
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 3a784dd9e0fd..a76b14252a21 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -304,6 +304,12 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAPDF)
 // Read back the signature and make sure that it's valid.
 aManager.read(/*bUseTempStream=*/false);
 std::vector& rInformations = 
aManager.getCurrentSignatureInformations();
+std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
+if (!pPDFium)
+{
+return;
+}
+
 CPPUNIT_ASSERT_EQUAL(static_cast(1), rInformations.size());
 // This was SecurityOperationStatus_UNKNOWN, signing with an ECDSA key was
 // broken.
@@ -550,6 +556,12 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPDFGood)
 CPPUNIT_ASSERT(pObjectShell);
 // We expect NOTVALIDATED in case the root CA is not imported on the 
system, and OK otherwise, so accept both.
 SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
+if (!pPDFium)
+{
+return;
+}
+
 CPPUNIT_ASSERT_MESSAGE(
 (OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
 (nActual == SignatureState::NOTVALIDATED || nActual == 
SignatureState::OK));
@@ -563,6 +575,12 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPDFBad)
 CPPUNIT_ASSERT(pBaseModel);
 SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
 CPPUNIT_ASSERT(pObjectShell);
+std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
+if (!pPDFium)
+{
+return;
+}
+
 

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2019-05-31 Thread Miklos Vajna (via logerrit)
 vcl/Library_vcl.mk   |1 
 vcl/source/window/bufferdevice.cxx   |   36 +++
 vcl/source/window/bufferdevice.hxx   |   36 +++
 vcl/source/window/menubarwindow.cxx  |   11 +
 vcl/source/window/menufloatingwindow.cxx |9 +--
 5 files changed, 77 insertions(+), 16 deletions(-)

New commits:
commit 42bf893a8479f70d7d8f00e03105ce15e8545f8b
Author: Miklos Vajna 
AuthorDate: Fri May 31 14:56:46 2019 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 31 20:19:56 2019 +0200

tdf#125550 vcl menu bar / floating window: fix text color

Regression from commit e8d5b8beb5958147235ff955ed38c47b51d860ff
(tdf#113714 vcl menu bar window: avoid flicker, 2019-05-20), the problem
was that a freshly created VirtualDevice doesn't have the default text
color, so we need to initialize that explicitly based on the render
context text color.

Also introduce a BufferDevice to do this initialization, instead of
fixing this in MenuBarWindow::Paint(), then copy the fix to
MenuFloatingWindow::Paint().

Change-Id: Ib171cd52e7cabe0bc3c639821f558d8303039fe6
Reviewed-on: https://gerrit.libreoffice.org/73269
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ba82f48deeff..428e69324782 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -124,6 +124,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/window/accel \
 vcl/source/window/accmgr \
 vcl/source/window/brdwin \
+vcl/source/window/bufferdevice \
 vcl/source/window/accessibility \
 vcl/source/window/legacyaccessibility \
 vcl/source/window/clipping \
diff --git a/vcl/source/window/bufferdevice.cxx 
b/vcl/source/window/bufferdevice.cxx
new file mode 100644
index ..5db4cfff458a
--- /dev/null
+++ b/vcl/source/window/bufferdevice.cxx
@@ -0,0 +1,36 @@
+/* -*- 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 "bufferdevice.hxx"
+
+namespace vcl
+{
+BufferDevice::BufferDevice(const VclPtr& pWindow, 
vcl::RenderContext& rRenderContext)
+: m_pBuffer(VclPtr::Create())
+, m_pWindow(pWindow)
+, m_rRenderContext(rRenderContext)
+{
+m_pBuffer->SetOutputSizePixel(pWindow->GetOutputSizePixel(), false);
+m_pBuffer->SetTextColor(rRenderContext.GetTextColor());
+m_pBuffer->DrawOutDev(Point(0, 0), pWindow->GetOutputSizePixel(), Point(0, 
0),
+  pWindow->GetOutputSizePixel(), rRenderContext);
+}
+
+BufferDevice::~BufferDevice()
+{
+m_rRenderContext.DrawOutDev(Point(0, 0), m_pWindow->GetOutputSizePixel(), 
Point(0, 0),
+m_pWindow->GetOutputSizePixel(), *m_pBuffer);
+}
+
+vcl::RenderContext* BufferDevice::operator->() { return m_pBuffer.get(); }
+
+vcl::RenderContext& BufferDevice::operator*() { return *m_pBuffer; }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/bufferdevice.hxx 
b/vcl/source/window/bufferdevice.hxx
new file mode 100644
index ..26bf28e615fa
--- /dev/null
+++ b/vcl/source/window/bufferdevice.hxx
@@ -0,0 +1,36 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_VCL_SOURCE_WINDOW_BUFFERDEVICE_HXX
+#define INCLUDED_VCL_SOURCE_WINDOW_BUFFERDEVICE_HXX
+
+#include 
+#include 
+
+namespace vcl
+{
+/// Buffers drawing on a vcl::RenderContext using a VirtualDevice.
+class BufferDevice
+{
+ScopedVclPtr m_pBuffer;
+VclPtr m_pWindow;
+vcl::RenderContext& m_rRenderContext;
+
+public:
+BufferDevice(const VclPtr& pWindow, vcl::RenderContext& 
rRenderContext);
+~BufferDevice();
+
+vcl::RenderContext* operator->();
+vcl::RenderContext& operator*();
+};
+}
+
+#endif // INCLUDED_VCL_SOURCE_WINDOW_BUFFERDEVICE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/menubarwindow.cxx 
b/vcl/source/window/menubarwindow.cxx
index b32e38790cd4..81e7cbe573c6 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include "bufferdevice.hxx"
 
 // document closing button
 #define IID_DOCUMENTCLOSE 1
@@ -914,11 +915,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::Recta
 }
 
 // Make sure that all 

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2018-03-05 Thread Chris Sherlock
 vcl/Library_vcl.mk|3 
 vcl/source/bitmap/bitmap.cxx  | 1088 ---
 vcl/source/bitmap/bitmappaint.cxx | 1158 ++
 3 files changed, 1164 insertions(+), 1085 deletions(-)

New commits:
commit bdd62b4c327ab894dbba00fe2e07696c1b7d9de6
Author: Chris Sherlock 
Date:   Thu Mar 1 06:07:39 2018 +1100

vcl: split painting bitmap functions to bitmappaint.cxx

Change-Id: Ib5f52e4b7b5121de15cdb205165fcbdb8b09bc8a
Reviewed-on: https://gerrit.libreoffice.org/50530
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index b116fd15705a..9e292916f843 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -300,8 +300,9 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/gdi/wall \
 vcl/source/gdi/scrptrun \
 vcl/source/gdi/CommonSalLayout \
-vcl/source/bitmap/bitmap \
+   vcl/source/bitmap/bitmap \
 vcl/source/bitmap/bitmapfilter \
+vcl/source/bitmap/bitmappaint \
 vcl/source/bitmap/bitmapscalesuper \
 vcl/source/bitmap/BitmapScaleConvolution \
 vcl/source/bitmap/BitmapSymmetryCheck \
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index bf670f20ffce..b5602327f75d 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -17,20 +17,15 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
 
 #include 
 #include 
+
+#include 
 #include 
 
 Bitmap::Bitmap()
@@ -377,366 +372,6 @@ void Bitmap::ReleaseAccess( BitmapInfoAccess* 
pBitmapAccess )
 delete pBitmapAccess;
 }
 
-bool Bitmap::Erase(const Color& rFillColor)
-{
-if (IsEmpty())
-return true;
-
-Bitmap::ScopedWriteAccess  pWriteAcc(*this);
-bool bRet = false;
-
-if (pWriteAcc)
-{
-const ScanlineFormat nFormat = pWriteAcc->GetScanlineFormat();
-sal_uInt8 cIndex = 0;
-bool bFast = false;
-
-switch (nFormat)
-{
-case ScanlineFormat::N1BitMsbPal:
-case ScanlineFormat::N1BitLsbPal:
-{
-cIndex = 
static_cast(pWriteAcc->GetBestPaletteIndex(rFillColor));
-cIndex = (cIndex ? 255 : 0);
-bFast = true;
-}
-break;
-
-case ScanlineFormat::N4BitMsnPal:
-case ScanlineFormat::N4BitLsnPal:
-{
-cIndex = 
static_cast(pWriteAcc->GetBestPaletteIndex(rFillColor));
-cIndex = cIndex | ( cIndex << 4 );
-bFast = true;
-}
-break;
-
-case ScanlineFormat::N8BitPal:
-{
-cIndex = 
static_cast(pWriteAcc->GetBestPaletteIndex(rFillColor));
-bFast = true;
-}
-break;
-
-case ScanlineFormat::N24BitTcBgr:
-case ScanlineFormat::N24BitTcRgb:
-{
-if (rFillColor.GetRed() == rFillColor.GetGreen() &&
-rFillColor.GetRed() == rFillColor.GetBlue())
-{
-cIndex = rFillColor.GetRed();
-bFast = true;
-}
-else
-bFast = false;
-}
-break;
-
-default:
-bFast = false;
-break;
-}
-
-if( bFast )
-{
-const sal_uLong nBufSize = pWriteAcc->GetScanlineSize() * 
pWriteAcc->Height();
-memset( pWriteAcc->GetBuffer(), cIndex, nBufSize );
-}
-else
-{
-const tools::Rectangle aRect( Point(), Size( pWriteAcc->Width(), 
pWriteAcc->Height() ) );
-pWriteAcc->SetFillColor( rFillColor );
-pWriteAcc->FillRect( aRect );
-}
-
-bRet = true;
-}
-
-return bRet;
-}
-
-bool Bitmap::Invert()
-{
-ScopedWriteAccess   pAcc(*this);
-boolbRet = false;
-
-if( pAcc )
-{
-if( pAcc->HasPalette() )
-{
-BitmapPalette   aBmpPal( pAcc->GetPalette() );
-const sal_uInt16nCount = aBmpPal.GetEntryCount();
-
-for( sal_uInt16 i = 0; i < nCount; i++ )
-aBmpPal[ i ].Invert();
-
-pAcc->SetPalette( aBmpPal );
-}
-else
-{
-const long  nWidth = pAcc->Width();
-const long  nHeight = pAcc->Height();
-
-for( long nY = 0; nY < nHeight; nY++ )
-{
-Scanline pScanline = pAcc->GetScanline(nY);
-for( long nX = 0; nX < nWidth; nX++ )
-pAcc->SetPixelOnData( pScanline, nX, 
pAcc->GetPixelFromData( pScanline, nX ).Invert() );
- 

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2017-08-24 Thread Miklos Vajna
 vcl/Library_vcl.mk|8 
 vcl/source/gdi/pdfwriter_impl.cxx |   14 --
 2 files changed, 22 deletions(-)

New commits:
commit b23cd7ea0607ea1c0ec2022e80349d96368e3923
Author: Miklos Vajna 
Date:   Thu Aug 24 09:29:03 2017 +0200

vcl PDF export: remove no longer direct NSS dependency

The relevant code has been moved to svl.

Change-Id: Id2b77c797745af21d3d5f954357a02d54fb67908
Reviewed-on: https://gerrit.libreoffice.org/41498
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 00cbf3b6a23e..f6eaae2d4e13 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -63,14 +63,6 @@ $(eval $(call gb_Library_use_externals,vcl,\
$(if $(filter PDFIUM,$(BUILD_TYPE)),pdfium) \
 ))
 
-ifeq ($(TLS),NSS)
-$(eval $(call gb_Library_use_externals,vcl,\
-   $(if $(filter-out IOS WNT,$(OS)), \
-   nss3 \
-   plc4) \
-))
-endif
-
 $(eval $(call gb_Library_use_libraries,vcl,\
 $(call gb_Helper_optional,BREAKPAD, \
crashreport) \
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 63d9848e2a22..9e3db7068a25 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -85,20 +85,6 @@
 
 #include "pdfwriter_impl.hxx"
 
-#if HAVE_FEATURE_NSS && !defined(_WIN32)
-// NSS headers for PDF signing
-#include "nss.h"
-#include "cert.h"
-#include "hasht.h"
-#include "secerr.h"
-#include "sechash.h"
-#include "cms.h"
-#include "cmst.h"
-
-// We use curl for RFC3161 time stamp requests
-#include 
-#endif
-
 #ifdef _WIN32
 // WinCrypt headers for PDF signing
 // Note: this uses Windows 7 APIs and requires the relevant data types
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2016-11-12 Thread Takeshi Abe
 vcl/Library_vcl.mk   |1 -
 vcl/source/window/mouseevent.cxx |   26 --
 2 files changed, 27 deletions(-)

New commits:
commit 73e21792efb36209b6ca8c14377e40756f9173b0
Author: Takeshi Abe 
Date:   Fri Nov 11 23:42:44 2016 +0900

Remove empty file

Change-Id: I7a6a9c6aa0720b9ba482b8ffa902452c3fac69fe
Reviewed-on: https://gerrit.libreoffice.org/30779
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 888a9d0..8b158fb 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -169,7 +169,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/window/mnemonic \
 vcl/source/window/mnemonicengine \
 vcl/source/window/mouse \
-vcl/source/window/mouseevent \
 vcl/source/window/msgbox \
 vcl/source/window/popupmenuwindow \
 vcl/source/window/printdlg \
diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx
deleted file mode 100644
index 8b47d69..000
--- a/vcl/source/window/mouseevent.cxx
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include 
-
-#include 
-#include 
-#include 
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2016-01-14 Thread Chris Sherlock
 vcl/Library_vcl.mk |1 
 vcl/source/font/fontmetric.cxx |  218 ++---
 vcl/source/gdi/metric.cxx  |  207 --
 3 files changed, 184 insertions(+), 242 deletions(-)

New commits:
commit f0841c6c86c8c8403eb1d78a1bd43a8adac75e3a
Author: Chris Sherlock 
Date:   Fri Jan 15 10:59:18 2016 +1100

vcl: move metric.cxx to font/fontmetric.cxx

Change-Id: If8e4a479967a84f7c43c762c55a3a60b7083d6d9

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index df22d62..3c63a77 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -286,7 +286,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/gdi/lineinfo \
 vcl/source/gdi/mapmod \
 vcl/source/gdi/metaact \
-vcl/source/gdi/metric \
 vcl/source/gdi/octree \
 vcl/source/gdi/oldprintadaptor \
 vcl/source/gdi/pdfextoutdevdata \
diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index 3f27d62..728d84f 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -17,53 +17,203 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "i18nlangtag/mslangid.hxx"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
+#include 
 
-#include "sallayout.hxx"
-#include "svdata.hxx"
-
-#include "impfont.hxx"
-#include "outdata.hxx"
-#include "fontinstance.hxx"
-#include "fontattributes.hxx"
+#include "impfontmetric.hxx"
 #include "impfontmetricdata.hxx"
-
-#include "outdev.h"
-#include "window.h"
-
-#include "PhysicalFontCollection.hxx"
 #include "PhysicalFontFace.hxx"
-#include "PhysicalFontFamily.hxx"
 
-#include "svids.hrc"
-
-#include 
-#if ENABLE_GRAPHITE
-#include "graphite_features.hxx"
-#endif
-
-#include "../gdi/pdfwriter_impl.hxx"
+#include 
+#include 
+#include 
 
 #include 
-#include 
-#include 
-#include 
-#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::rtl;
 using namespace ::utl;
 
+FontMetric::FontMetric()
+:   mpImplMetric( new ImplFontMetric() )
+{}
+
+FontMetric::FontMetric( const FontMetric& rFontMetric )
+: Font( rFontMetric )
+, mpImplMetric( rFontMetric.mpImplMetric )
+{}
+
+FontMetric::~FontMetric()
+{
+mpImplMetric = nullptr;
+}
+
+FontMetric& FontMetric::operator=( const FontMetric& rFontMetric )
+{
+Font::operator=( rFontMetric );
+
+if( mpImplMetric != rFontMetric.mpImplMetric )
+{
+mpImplMetric = rFontMetric.mpImplMetric;
+}
+
+return *this;
+}
+
+bool FontMetric::operator==( const FontMetric& rFontMetric ) const
+{
+if( !Font::operator==( rFontMetric ) )
+return false;
+if( mpImplMetric == rFontMetric.mpImplMetric )
+return true;
+if( *mpImplMetric == *rFontMetric.mpImplMetric  )
+return true;
+return false;
+}
+
+FontType FontMetric::GetType() const
+{
+return (mpImplMetric->IsScalable() ? TYPE_SCALABLE : TYPE_RASTER);
+}
+
+long FontMetric::GetAscent() const
+{
+return mpImplMetric->GetAscent();
+}
+
+void FontMetric::SetAscent( long nAscent )
+{
+mpImplMetric->SetAscent( nAscent );
+}
+
+long FontMetric::GetDescent() const
+{
+return mpImplMetric->GetDescent();
+}
+
+void FontMetric::SetDescent( long nDescent )
+{
+mpImplMetric->SetDescent( nDescent );
+}
+
+long FontMetric::GetInternalLeading() const
+{
+return mpImplMetric->GetInternalLeading();
+}
+
+void FontMetric::SetInternalLeading( long nLeading )
+{
+mpImplMetric->SetInternalLeading( nLeading );
+}
+
+long FontMetric::GetExternalLeading() const
+{
+return mpImplMetric->GetExternalLeading();
+}
+
+void FontMetric::SetExternalLeading( long nLeading )
+{
+mpImplMetric->SetExternalLeading( nLeading );
+}
+
+long FontMetric::GetLineHeight() const
+{
+return mpImplMetric->GetLineHeight();
+}
+
+void FontMetric::SetLineHeight( long nHeight )
+{
+mpImplMetric->SetLineHeight( nHeight );
+}
+
+long FontMetric::GetSlant() const
+{
+return mpImplMetric->GetSlant();
+}
+
+void FontMetric::SetSlant( long nSlant )
+{
+mpImplMetric->SetSlant( nSlant );
+}
+
+long FontMetric::GetBulletOffset() const
+{
+return mpImplMetric->GetBulletOffset();
+}
+
+void FontMetric::SetBulletOffset( long nOffset )
+{
+mpImplMetric->SetBulletOffset( nOffset );
+}
+
+bool FontMetric::IsScalable() const
+{
+return mpImplMetric->IsScalable();
+}
+
+void FontMetric::SetScalableFlag(bool bScalable)
+{
+mpImplMetric->SetScalableFlag( bScalable );
+}
+
+bool FontMetric::IsFullstopCentered() const
+{
+return mpImplMetric->IsFullstopCentered();
+}
+
+void FontMetric::SetFullstopCenteredFlag(bool bScalable)
+{
+mpImplMetric->SetFullstopCenteredFlag( bScalable );
+}
+
+bool FontMetric::IsBuiltInFont() const
+{
+return mpImplMetric->IsBuiltInFont();
+}
+
+void FontMetric::SetBuiltInFontFlag( bool bIsBuiltInFont )
+{
+

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2016-01-13 Thread Chris Sherlock
 vcl/Library_vcl.mk   |2 
 vcl/source/font/font.cxx |  990 +++
 vcl/source/gdi/font.cxx  |  990 ---
 3 files changed, 991 insertions(+), 991 deletions(-)

New commits:
commit 2496c497b6ffe9c69370ccc12bb103099c877165
Author: Chris Sherlock 
Date:   Thu Jan 14 11:14:31 2016 +1100

vcl: move font.cxx from gdi directory to font directory

Change-Id: I6768b37a4b0b98202b7d2410d8cbfac47dac0415

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index d9bc47f..df22d62 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -271,7 +271,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/gdi/dibtools \
 vcl/source/gdi/embeddedfontshelper \
 vcl/source/gdi/extoutdevdata \
-vcl/source/gdi/font \
 vcl/source/gdi/gdimtf \
 vcl/source/gdi/gdimetafiletools \
 vcl/source/gdi/gfxlink \
@@ -397,6 +396,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/font/fontcache \
 vcl/source/font/fontcharmap \
 vcl/source/font/fontmetric \
+vcl/source/font/font \
 vcl/source/fontsubset/cff \
 vcl/source/fontsubset/fontsubset \
 vcl/source/fontsubset/gsub \
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/font/font.cxx
similarity index 100%
rename from vcl/source/gdi/font.cxx
rename to vcl/source/font/font.cxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2016-01-11 Thread Chris Sherlock
 vcl/Library_vcl.mk |2 
 vcl/source/gdi/fontcharmap.cxx |  599 +
 vcl/source/gdi/impfont.cxx |  599 -
 3 files changed, 600 insertions(+), 600 deletions(-)

New commits:
commit 49f39e0de1a4fb4360198087bf1b2d1fc61742c6
Author: Chris Sherlock 
Date:   Mon Jan 11 18:36:36 2016 +1100

vcl: tidyup file name impfont.cxx -> fontcharmap.cxx

Change-Id: Ib2acc963704c7613e1d3bd1761b619ece1aef79f
Reviewed-on: https://gerrit.libreoffice.org/21339
Tested-by: Jenkins 
Reviewed-by: Chris Sherlock 

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 961bb05..578786f 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -281,7 +281,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/gdi/hatch \
 vcl/source/gdi/impanmvw \
 vcl/source/gdi/impbmp \
-vcl/source/gdi/impfont \
+vcl/source/gdi/fontcharmap \
 vcl/source/gdi/impgraph \
 vcl/source/gdi/impvect \
 vcl/source/gdi/jobset \
diff --git a/vcl/source/gdi/impfont.cxx b/vcl/source/gdi/fontcharmap.cxx
similarity index 100%
rename from vcl/source/gdi/impfont.cxx
rename to vcl/source/gdi/fontcharmap.cxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2014-05-23 Thread Chris Sherlock
 vcl/Library_vcl.mk   |1 
 vcl/source/window/mouse.cxx  |  776 +++
 vcl/source/window/window.cxx |  727 
 3 files changed, 777 insertions(+), 727 deletions(-)

New commits:
commit 1cda4728bf668351f25595570592fe112e763cff
Author: Chris Sherlock chris.sherloc...@gmail.com
Date:   Fri May 23 20:39:23 2014 +1000

vcl: move mouse functions from window.cxx to mouse.cxx

Change-Id: I4cd0769cd20869e9316c35ff20e4fa477b5aab16

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 7ea6981..3bf8648 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -134,6 +134,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/window/menu \
 vcl/source/window/mnemonic \
 vcl/source/window/mnemonicengine \
+vcl/source/window/mouse \
 vcl/source/window/mouseevent \
 vcl/source/window/event \
 vcl/source/window/msgbox \
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
new file mode 100644
index 000..e4503bb
--- /dev/null
+++ b/vcl/source/window/mouse.cxx
@@ -0,0 +1,776 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+
+#include config_features.h
+
+#include tools/time.hxx
+
+#include vcl/svapp.hxx
+#include vcl/salgtype.hxx
+#include vcl/window.hxx
+#include vcl/floatwin.hxx
+#include vcl/cursor.hxx
+#include vcl/sysdata.hxx
+
+#include sal/types.h
+
+#include window.h
+#include outdev.h
+#include svdata.hxx
+#include salobj.hxx
+#include salgdi.hxx
+#include salframe.hxx
+#include dndlcon.hxx
+#include dndevdis.hxx
+
+#include com/sun/star/datatransfer/dnd/XDragSource.hpp
+#include com/sun/star/datatransfer/dnd/XDropTarget.hpp
+
+#include comphelper/processfactory.hxx
+
+using namespace ::com::sun::star::uno;
+
+sal_uInt16 Window::ImplHitTest( const Point rFramePos )
+{
+Point aFramePos( rFramePos );
+if( ImplIsAntiparallel() )
+{
+// - RTL - re-mirror frame pos at this window
+const OutputDevice *pOutDev = GetOutDev();
+pOutDev-ReMirror( aFramePos );
+}
+Rectangle aRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, 
mnOutHeight ) );
+if ( !aRect.IsInside( aFramePos ) )
+return 0;
+if ( mpWindowImpl-mbWinRegion )
+{
+Point aTempPos = aFramePos;
+aTempPos.X() -= mnOutOffX;
+aTempPos.Y() -= mnOutOffY;
+if ( !mpWindowImpl-maWinRegion.IsInside( aTempPos ) )
+return 0;
+}
+
+sal_uInt16 nHitTest = WINDOW_HITTEST_INSIDE;
+if ( mpWindowImpl-mbMouseTransparent )
+nHitTest |= WINDOW_HITTEST_TRANSPARENT;
+return nHitTest;
+}
+
+int Window::ImplTestMousePointerSet()
+{
+// as soon as mouse is captured, switch mouse-pointer
+if ( IsMouseCaptured() )
+return sal_True;
+
+// if the mouse is over the window, switch it
+Rectangle aClientRect( Point( 0, 0 ), GetOutputSizePixel() );
+if ( aClientRect.IsInside( GetPointerPosPixel() ) )
+return sal_True;
+
+return sal_False;
+}
+
+PointerStyle Window::ImplGetMousePointer() const
+{
+PointerStyleePointerStyle;
+boolbWait = false;
+
+if ( IsEnabled()  IsInputEnabled()  ! IsInModalMode() )
+ePointerStyle = GetPointer().GetStyle();
+else
+ePointerStyle = POINTER_ARROW;
+
+const Window* pWindow = this;
+do
+{
+// when the pointer is not visible stop the search, as
+// this status should not be overwritten
+if ( pWindow-mpWindowImpl-mbNoPtrVisible )
+return POINTER_NULL;
+
+if ( !bWait )
+{
+if ( pWindow-mpWindowImpl-mnWaitCount )
+{
+ePointerStyle = POINTER_WAIT;
+bWait = true;
+}
+else
+{
+if ( pWindow-mpWindowImpl-mbChildPtrOverwrite )
+ePointerStyle = pWindow-GetPointer().GetStyle();
+}
+}
+
+if ( pWindow-ImplIsOverlapWindow() )
+break;
+
+pWindow = pWindow-ImplGetParent();
+}
+while ( pWindow );
+
+

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2014-05-19 Thread Chris Sherlock
 vcl/Library_vcl.mk   |1 
 vcl/source/window/debug.cxx  |   48 +++
 vcl/source/window/window.cxx |   24 -
 3 files changed, 49 insertions(+), 24 deletions(-)

New commits:
commit f797e6c4676a69b862a1db316fafa591ebe269f3
Author: Chris Sherlock chris.sherloc...@gmail.com
Date:   Tue May 20 00:32:25 2014 +1000

vcl: move debug function from window.cxx to debug.cxx

Change-Id: I9c3debcdda4b6ee943792e8799d436b097df2982

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 27179ea..aee5c13 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -109,6 +109,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/window/legacyaccessibility \
 vcl/source/window/clipping \
 vcl/source/window/stacking \
+vcl/source/window/debug \
 vcl/source/window/btndlg \
 vcl/source/window/builder \
 vcl/source/window/cmdevt \
diff --git a/vcl/source/window/debug.cxx b/vcl/source/window/debug.cxx
new file mode 100644
index 000..4aa875a
--- /dev/null
+++ b/vcl/source/window/debug.cxx
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include vcl/window.hxx
+#include vcl/outdev.hxx
+
+#include window.h
+
+#ifdef DBG_UTIL
+const char* ImplDbgCheckWindow( const void* pObj )
+{
+DBG_TESTSOLARMUTEX();
+
+const Window* pWindow = (Window*)pObj;
+
+if ( (pWindow-GetType()  WINDOW_FIRST) || (pWindow-GetType()  
WINDOW_LAST) )
+return Window data overwrite;
+
+// check window-chain
+Window* pChild = pWindow-mpWindowImpl-mpFirstChild;
+while ( pChild )
+{
+if ( pChild-mpWindowImpl-mpParent != pWindow )
+return Child-Window-Parent wrong;
+pChild = pChild-mpWindowImpl-mpNext;
+}
+
+return NULL;
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2291b7f..063a7f5 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -298,30 +298,6 @@ Window::Window( Window* pParent, const ResId rResId )
 Show();
 }
 
-
-#ifdef DBG_UTIL
-const char* ImplDbgCheckWindow( const void* pObj )
-{
-DBG_TESTSOLARMUTEX();
-
-const Window* pWindow = (Window*)pObj;
-
-if ( (pWindow-GetType()  WINDOW_FIRST) || (pWindow-GetType()  
WINDOW_LAST) )
-return Window data overwrite;
-
-// check window-chain
-Window* pChild = pWindow-mpWindowImpl-mpFirstChild;
-while ( pChild )
-{
-if ( pChild-mpWindowImpl-mpParent != pWindow )
-return Child-Window-Parent wrong;
-pChild = pChild-mpWindowImpl-mpNext;
-}
-
-return NULL;
-}
-#endif
-
 bool Window::AcquireGraphics() const
 {
 DBG_TESTSOLARMUTEX();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2014-05-19 Thread Chris Sherlock
 vcl/Library_vcl.mk  |1 +
 vcl/source/window/globalization.cxx |   35 +++
 vcl/source/window/window.cxx|   12 
 3 files changed, 36 insertions(+), 12 deletions(-)

New commits:
commit bb2f6e6c5130d8b6ad702b00c1aa4f8d559056a3
Author: Chris Sherlock chris.sherloc...@gmail.com
Date:   Tue May 20 02:54:11 2014 +1000

vcl: move globalization functions from window.cxx to globalization.cxx

Change-Id: I8f617f2c480f8c5c7f5230cc6d6a6e82d8750857

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index aee5c13..5325505 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -110,6 +110,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/window/clipping \
 vcl/source/window/stacking \
 vcl/source/window/debug \
+vcl/source/window/globalization \
 vcl/source/window/btndlg \
 vcl/source/window/builder \
 vcl/source/window/cmdevt \
diff --git a/vcl/source/window/globalization.cxx 
b/vcl/source/window/globalization.cxx
new file mode 100644
index 000..2165897
--- /dev/null
+++ b/vcl/source/window/globalization.cxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include vcl/window.hxx
+#include vcl/outdev.hxx
+
+void Window::EnableRTL ( bool bEnable )
+{
+StateChanged( STATE_CHANGE_MIRRORING );
+OutputDevice::EnableRTL(bEnable);
+}
+
+bool Window::HasMirroredGraphics() const
+{
+const OutputDevice* pOutDev = GetOutDev();
+return pOutDev-OutputDevice::HasMirroredGraphics();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ce8f7df..b3dc24e 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -397,12 +397,6 @@ void Window::ReleaseGraphics( bool bRelease )
 mpNextGraphics  = NULL;
 }
 
-void Window::EnableRTL ( bool bEnable )
-{
-StateChanged( STATE_CHANGE_MIRRORING );
-OutputDevice::EnableRTL(bEnable);
-}
-
 void Window::CopyDeviceArea( SalTwoRect aPosAry, sal_uInt32 nFlags )
 {
 if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || 
aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
@@ -429,12 +423,6 @@ void Window::CopyDeviceArea( SalTwoRect aPosAry, 
sal_uInt32 nFlags )
 OutputDevice::CopyDeviceArea(aPosAry, nFlags);
 }
 
-bool Window::HasMirroredGraphics() const
-{
-const OutputDevice* pOutDev = GetOutDev();
-return pOutDev-OutputDevice::HasMirroredGraphics();
-}
-
 void Window::ImplInitAppFontData( Window* pWindow )
 {
 ImplSVData* pSVData = ImplGetSVData();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2014-05-19 Thread Chris Sherlock
 vcl/Library_vcl.mk   |1 
 vcl/source/window/window.cxx |  131 ---
 2 files changed, 1 insertion(+), 131 deletions(-)

New commits:
commit 87ea3aa1cf2a73a3aa9f7a7d40aac5545579d854
Author: Chris Sherlock chris.sherloc...@gmail.com
Date:   Tue May 20 08:04:21 2014 +1000

vcl: move resource functions from window.cxx to resource.cxx

Change-Id: I050cb975dfa6ba20a6a840f24d30745fbafbfaef

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 5325505..4e53256 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -101,6 +101,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
 ))
 
 $(eval $(call gb_Library_add_exception_objects,vcl,\
+vcl/source/window/resource \
 vcl/source/window/abstdlg \
 vcl/source/window/accel \
 vcl/source/window/accmgr \
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b3dc24e..b77447c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1170,137 +1170,6 @@ void Window::ImplCallMove()
 ImplCallEventListeners( VCLEVENT_WINDOW_MOVE );
 }
 
-static OString ImplAutoHelpID( ResMgr* pResMgr )
-{
-OString aRet;
-
-if( pResMgr  Application::IsAutoHelpIdEnabled() )
-aRet = pResMgr-GetAutoHelpId();
-
-return aRet;
-}
-
-WinBits Window::ImplInitRes( const ResId rResId )
-{
-GetRes( rResId );
-
-char* pRes = (char*)GetClassRes();
-pRes += 8;
-sal_uInt32 nStyle = (sal_uInt32)GetLongRes( (void*)pRes );
-rResId.SetWinBits( nStyle );
-return nStyle;
-}
-
-WindowResHeader Window::ImplLoadResHeader( const ResId rResId )
-{
-WindowResHeader aHeader;
-
-aHeader.nObjMask = ReadLongRes();
-
-// we need to calculate auto helpids before the resource gets closed
-// if the resource  only contains flags, it will be closed before we try 
to read a help id
-// so we always create an auto help id that might be overwritten later
-// HelpId
-aHeader.aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
-
-// ResourceStyle
-aHeader.nRSStyle = ReadLongRes();
-// WinBits
-ReadLongRes();
-
-if( aHeader.nObjMask  WINDOW_HELPID )
-aHeader.aHelpId = ReadByteStringRes();
-
-return aHeader;
-}
-
-void Window::ImplLoadRes( const ResId rResId )
-{
-WindowResHeader aHeader = ImplLoadResHeader( rResId );
-
-SetHelpId( aHeader.aHelpId );
-
-sal_uLong nObjMask = aHeader.nObjMask;
-
-bool  bPos  = false;
-bool  bSize = false;
-Point aPos;
-Size  aSize;
-
-if ( nObjMask  (WINDOW_XYMAPMODE | WINDOW_X | WINDOW_Y) )
-{
-// use size as per resource
-MapUnit ePosMap = MAP_PIXEL;
-
-bPos = true;
-
-if ( nObjMask  WINDOW_XYMAPMODE )
-ePosMap = (MapUnit)ReadLongRes();
-if ( nObjMask  WINDOW_X )
-aPos.X() = ImplLogicUnitToPixelX( ReadLongRes(), ePosMap );
-if ( nObjMask  WINDOW_Y )
-aPos.Y() = ImplLogicUnitToPixelY( ReadLongRes(), ePosMap );
-}
-
-if ( nObjMask  (WINDOW_WHMAPMODE | WINDOW_WIDTH | WINDOW_HEIGHT) )
-{
-// use size as per resource
-MapUnit eSizeMap = MAP_PIXEL;
-
-bSize = true;
-
-if ( nObjMask  WINDOW_WHMAPMODE )
-eSizeMap = (MapUnit)ReadLongRes();
-if ( nObjMask  WINDOW_WIDTH )
-aSize.Width() = ImplLogicUnitToPixelX( ReadLongRes(), eSizeMap );
-if ( nObjMask  WINDOW_HEIGHT )
-aSize.Height() = ImplLogicUnitToPixelY( ReadLongRes(), eSizeMap );
-}
-
-sal_uLong nRSStyle = aHeader.nRSStyle;
-
-// looks bad due to optimization
-if ( nRSStyle  RSWND_CLIENTSIZE )
-{
-if ( bPos )
-SetPosPixel( aPos );
-if ( bSize )
-SetOutputSizePixel( aSize );
-}
-else if ( bPos  bSize )
-SetPosSizePixel( aPos, aSize );
-else if ( bPos )
-SetPosPixel( aPos );
-else if ( bSize )
-SetSizePixel( aSize );
-
-if ( nRSStyle  RSWND_DISABLED )
-Enable( false );
-
-if ( nObjMask  WINDOW_TEXT )
-SetText( ReadStringRes() );
-if ( nObjMask  WINDOW_HELPTEXT )
-{
-SetHelpText( ReadStringRes() );
-mpWindowImpl-mbHelpTextDynamic = true;
-}
-if ( nObjMask  WINDOW_QUICKTEXT )
-SetQuickHelpText( ReadStringRes() );
-if ( nObjMask  WINDOW_EXTRALONG )
-{
-sal_uIntPtr nRes = ReadLongRes();
-SetData( (void*)nRes );
-}
-if ( nObjMask  WINDOW_UNIQUEID )
-SetUniqueId( ReadByteStringRes() );
-
-if ( nObjMask  WINDOW_BORDER_STYLE )
-{
-sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes();
-SetBorderStyle( nBorderStyle );
-}
-}
-
 ImplWinData* Window::ImplGetWinData() const
 {
 if ( !mpWindowImpl-mpWinData )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2014-05-12 Thread Chris Sherlock
 vcl/Library_vcl.mk |1 
 vcl/source/window/clipping.cxx |  412 +
 vcl/source/window/window.cxx   |  299 -
 3 files changed, 413 insertions(+), 299 deletions(-)

New commits:
commit 1b7aee193f8e99ec3984a93b47c6f506c1e5db2f
Author: Chris Sherlock chris.sherloc...@gmail.com
Date:   Tue May 13 09:20:00 2014 +1000

vcl: move Window clipping functions to clipping.cxx

Change-Id: I19de157b90d52ab19fbd7c4ffc7eedeb9bf9a99a

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index d8764f5..bd9a541c 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -107,6 +107,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/window/brdwin \
 vcl/source/window/accessibility \
 vcl/source/window/legacyaccessibility \
+vcl/source/window/clipping \
 vcl/source/window/btndlg \
 vcl/source/window/builder \
 vcl/source/window/cmdevt \
diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx
new file mode 100644
index 000..e6ffb04
--- /dev/null
+++ b/vcl/source/window/clipping.cxx
@@ -0,0 +1,412 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include config_features.h
+
+#include i18nlangtag/mslangid.hxx
+
+#include tools/time.hxx
+#include tools/debug.hxx
+#include tools/rc.h
+
+#include unotools/fontcfg.hxx
+#include unotools/confignode.hxx
+
+#include vcl/layout.hxx
+#include vcl/salgtype.hxx
+#include vcl/event.hxx
+#include vcl/fixed.hxx
+#include vcl/help.hxx
+#include vcl/cursor.hxx
+#include vcl/svapp.hxx
+#include vcl/window.hxx
+#include vcl/syswin.hxx
+#include vcl/syschild.hxx
+#include vcl/dockwin.hxx
+#include vcl/menu.hxx
+#include vcl/wrkwin.hxx
+#include vcl/wall.hxx
+#include vcl/gradient.hxx
+#include vcl/button.hxx
+#include vcl/taskpanelist.hxx
+#include vcl/dialog.hxx
+#include vcl/unowrap.hxx
+#include vcl/gdimtf.hxx
+#include vcl/pdfextoutdevdata.hxx
+#include vcl/popupmenuwindow.hxx
+#include vcl/lazydelete.hxx
+#include vcl/virdev.hxx
+#include vcl/settings.hxx
+
+// declare system types in sysdata.hxx
+#include svsys.h
+#include vcl/sysdata.hxx
+
+#include salframe.hxx
+#include salobj.hxx
+#include salinst.hxx
+#include salgdi.hxx
+#include svdata.hxx
+#include dbggui.hxx
+#include outfont.hxx
+#include window.h
+#include toolbox.h
+#include outdev.h
+#include PhysicalFontCollection.hxx
+#include brdwin.hxx
+#include helpwin.hxx
+#include sallayout.hxx
+#include dndlcon.hxx
+#include dndevdis.hxx
+
+#include com/sun/star/accessibility/XAccessible.hpp
+#include com/sun/star/accessibility/AccessibleRole.hpp
+#include com/sun/star/awt/XWindowPeer.hpp
+#include com/sun/star/awt/XTopWindow.hpp
+#include com/sun/star/awt/XWindow.hpp
+#include com/sun/star/awt/XDisplayConnection.hpp
+#include com/sun/star/datatransfer/dnd/XDragSource.hpp
+#include com/sun/star/datatransfer/dnd/XDropTarget.hpp
+#include com/sun/star/datatransfer/clipboard/XClipboard.hpp
+#include com/sun/star/datatransfer/clipboard/SystemClipboard.hpp
+#include com/sun/star/lang/XInitialization.hpp
+#include com/sun/star/lang/XComponent.hpp
+#include com/sun/star/lang/XServiceName.hpp
+#include com/sun/star/rendering/CanvasFactory.hpp
+#include com/sun/star/rendering/XCanvas.hpp
+#include com/sun/star/rendering/XSpriteCanvas.hpp
+#include comphelper/processfactory.hxx
+
+#include sal/macros.h
+#include rtl/strbuf.hxx
+
+#include set
+#include typeinfo
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::datatransfer::clipboard;
+using namespace ::com::sun::star::datatransfer::dnd;
+using namespace ::com::sun::star;
+using namespace com::sun;
+
+using ::com::sun::star::awt::XTopWindow;
+
+void Window::InitClipRegion()
+{
+DBG_TESTSOLARMUTEX();
+
+Region  aRegion;
+
+// Put back backed up background
+if ( mpWindowImpl-mpFrameData-mpFirstBackWin )
+ImplInvalidateAllOverlapBackgrounds();
+if ( mpWindowImpl-mbInPaint )
+aRegion = *(mpWindowImpl-mpPaintRegion);
+else
+{
+aRegion = *(ImplGetWinChildClipRegion());

[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/source

2014-02-06 Thread Stephan Bergmann
 vcl/Library_vcl.mk   |2 
 vcl/source/filter/jpeg/JpegReader.cxx|   62 +---
 vcl/source/filter/jpeg/JpegReader.hxx|   17 +
 vcl/source/filter/jpeg/JpegTransform.cxx |6 
 vcl/source/filter/jpeg/JpegWriter.cxx|   56 +---
 vcl/source/filter/jpeg/jpeg.h|   43 +--
 vcl/source/filter/jpeg/jpegc.c   |  389 ---
 vcl/source/filter/jpeg/jpegc.cxx |  383 ++
 8 files changed, 459 insertions(+), 499 deletions(-)

New commits:
commit 11dbbc792f53dc581822c873eb198731c3425576
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Feb 6 14:20:00 2014 +0100

Make vcl/source/filter/jpeg/jpegc.c be C++ code

...simplify the corresponding jpeg.h now that it deals in C++, and fold
SetJpegPreviewSizeHint into ReadJPEG to avoid global static data.

Change-Id: Id3721bdb37be05e3e6bbbaef3b0aa0c0e1a9ff5a

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 04fc6cc..1725823 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -173,6 +173,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/filter/ixpm/xpmread \
 vcl/source/filter/jpeg/Exif \
 vcl/source/filter/jpeg/jpeg \
+vcl/source/filter/jpeg/jpegc \
 vcl/source/filter/jpeg/JpegReader \
 vcl/source/filter/jpeg/JpegWriter \
 vcl/source/filter/jpeg/JpegTransform \
@@ -314,7 +315,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 ))
 
 $(eval $(call gb_Library_add_cobjects,vcl,\
-vcl/source/filter/jpeg/jpegc \
 vcl/source/filter/jpeg/transupp \
 ))
 
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx 
b/vcl/source/filter/jpeg/JpegReader.cxx
index 5d3af16..61d7985 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -17,16 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include sal/config.h
 
-#include tools/solar.h
-
-extern C
-{
-#include stdio.h
-#include jpeg.h
-#include jpeglib.h
-#include jerror.h
-}
+#include stdio.h
+#include jpeg.h
+#include jpeglib.h
+#include jerror.h
 
 #include JpegReader.hxx
 #include vcl/bmpacc.hxx
@@ -43,21 +39,14 @@ namespace {
 static const sal_uInt64 MAX_BITMAP_BYTE_SIZE = sal_uInt64(512 * 1024 * 
1024);
 }
 
-extern C void* CreateBitmapFromJPEGReader( void* pJPEGReader, void* 
pJPEGCreateBitmapParam )
-{
-return ( (JPEGReader*) pJPEGReader )-CreateBitmap( pJPEGCreateBitmapParam 
);
-}
-
 /* Expanded data source object for stdio input */
 
-typedef struct {
-struct  jpeg_source_mgr pub;/* public fields */
+struct SourceManagerStruct {
+jpeg_source_mgr pub;/* public fields */
 SvStream*   stream; /* source stream */
 JOCTET* buffer; /* start of buffer */
 boolean start_of_file;  /* have we gotten any data yet? */
-} SourceManagerStruct;
-
-typedef SourceManagerStruct* SourceManagerStructPointer;
+};
 
 /*
  * Initialize source --- called by jpeg_read_header
@@ -65,7 +54,7 @@ typedef SourceManagerStruct* SourceManagerStructPointer;
  */
 extern C void init_source (j_decompress_ptr cinfo)
 {
-SourceManagerStructPointer source = (SourceManagerStructPointer) 
cinfo-src;
+SourceManagerStruct * source = (SourceManagerStruct *) cinfo-src;
 
 /* We reset the empty-input-file flag for each image,
  * but we don't clear the input buffer.
@@ -99,7 +88,7 @@ long StreamRead( SvStream* pStream, void* pBuffer, long 
nBufferSize )
 
 extern C boolean fill_input_buffer (j_decompress_ptr cinfo)
 {
-SourceManagerStructPointer source = (SourceManagerStructPointer) 
cinfo-src;
+SourceManagerStruct * source = (SourceManagerStruct *) cinfo-src;
 size_t nbytes;
 
 nbytes = StreamRead(source-stream, source-buffer, BUFFER_SIZE);
@@ -126,7 +115,7 @@ extern C boolean fill_input_buffer (j_decompress_ptr 
cinfo)
 
 extern C void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes)
 {
-SourceManagerStructPointer source = (SourceManagerStructPointer) 
cinfo-src;
+SourceManagerStruct * source = (SourceManagerStruct *) cinfo-src;
 
 /* Just a dumb implementation for now.  Could use fseek() except
  * it doesn't work on pipes.  Not clear that being smart is worth
@@ -153,9 +142,9 @@ extern C void term_source (j_decompress_ptr)
 /* no work necessary here */
 }
 
-extern C void jpeg_svstream_src (j_decompress_ptr cinfo, void* input)
+void jpeg_svstream_src (j_decompress_ptr cinfo, void* input)
 {
-SourceManagerStructPointer source;
+SourceManagerStruct * source;
 SvStream* stream = (SvStream*)input;
 
 /* The source object and input buffer are made permanent so that a series
@@ -168,14 +157,14 @@ extern C void jpeg_svstream_src (j_decompress_ptr 
cinfo, void* input)
 
 if (cinfo-src == NULL)
 { /* first time for this JPEG object? */
-cinfo-src = (struct jpeg_source_mgr *)
+