[Libreoffice-commits] core.git: vcl/quartz

2023-10-10 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/AquaGraphicsBackend.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 556b095dfb99c5db92328a63ffa30f07d8840db2
Author: Stephan Bergmann 
AuthorDate: Mon Oct 9 16:44:36 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Oct 10 08:07:09 2023 +0200

Silence a new -Werror,-Wdeprecated-declarations for now

Change-Id: I5b457a4e1b9804b53a72d53a49ca9695424fc0c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157708
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/AquaGraphicsBackend.cxx 
b/vcl/quartz/AquaGraphicsBackend.cxx
index 729f47f66dc0..4badefacf435 100644
--- a/vcl/quartz/AquaGraphicsBackend.cxx
+++ b/vcl/quartz/AquaGraphicsBackend.cxx
@@ -1141,7 +1141,11 @@ bool AquaGraphicsBackend::drawEPS(tools::Long nX, 
tools::Long nY, tools::Long nW
 {
 // convert the raw data to an NSImageRef
 NSData* xNSData = [NSData dataWithBytes:pEpsData 
length:static_cast(nByteCount)];
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+// 'NSEPSImageRep' is deprecated: first deprecated in macOS 14.0 - 
`NSEPSImageRep` instances
+// cannot be created on macOS 14.0 and later
 NSImageRep* xEpsImage = [NSEPSImageRep imageRepWithData:xNSData];
+SAL_WNODEPRECATED_DECLARATIONS_POP
 if (!xEpsImage)
 {
 return false;


[Libreoffice-commits] core.git: vcl/quartz

2023-07-05 Thread Patrick Luby (via logerrit)
 vcl/quartz/salbmp.cxx |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit aa5c3d32d7c85b496fa86d8198478fb6dc157811
Author: Patrick Luby 
AuthorDate: Wed Jul 5 15:51:32 2023 -0400
Commit: Patrick Luby 
CommitDate: Thu Jul 6 00:46:54 2023 +0200

Fix failure to generate the correct color mask

OutputDevice::ImplDrawRotateText() draws black text but
that will generate gray pixels due to antialiasing so
count dark gray the same as black, light gray the same
as white, and the rest as medium gray.

The results are not smooth since LibreOffice appears to
redraw these semi-transparent masks repeatedly without
clearing the background so the semi-transparent pixels
will grow darker with repeatedly redraws due to
cumulative blending. But it is now better than before.

Change-Id: If64ff5ab52a6e441b587aa3c3c12b08137ecf34e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154079
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index afd65d863370..ab435c0acdfc 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -560,7 +560,33 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
 sal_uInt32 x = nWidth;
 while( x-- )
 {
-*pDest++ = (pSourcePixels->readPixel() == 0) ? nColor : 0;
+// Fix failure to generate the correct color mask
+// OutputDevice::ImplDrawRotateText() draws black text but
+// that will generate gray pixels due to antialiasing so
+// count dark gray the same as black, light gray the same
+// as white, and the rest as medium gray.
+// The results are not smooth since LibreOffice appears to
+// redraw these semi-transparent masks repeatedly without
+// clearing the background so the semi-transparent pixels
+// will grow darker with repeatedly redraws due to
+// cumulative blending. But it is now better than before.
+sal_uInt8 nAlpha = 255 - 
pSourcePixels->readPixel().GetRed();
+sal_uInt32 nPremultColor = nColor;
+if ( nAlpha < 192 )
+{
+if ( nAlpha < 64 )
+{
+nPremultColor = 0;
+}
+else
+{
+reinterpret_cast()[0] /= 
2;
+reinterpret_cast()[1] /= 
2;
+reinterpret_cast()[2] /= 
2;
+reinterpret_cast()[3] /= 
2;
+}
+}
+*pDest++ = nPremultColor;
 }
 pSource += mnBytesPerRow;
 }


[Libreoffice-commits] core.git: vcl/quartz

2023-05-29 Thread Khaled Hosny (via logerrit)
 vcl/quartz/salgdi.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit ab1985d0b39e8bcc976543b9700e04610f434423
Author: Khaled Hosny 
AuthorDate: Mon May 29 11:01:56 2023 +0300
Commit: خالد حسني 
CommitDate: Mon May 29 16:13:16 2023 +0200

tdf#149297: Fix Y position of vertical glyphs on macOS

Remove the Y position offset that became redundant and now double shifts
the glyphs after:

commit dd0d0b44fd1c6c0292d7b2eb3f5cf2baa21e4481
Author: Mark Hung 
Date:   Sun May 2 15:12:46 2021 +0800

vcl: adjust LayoutText() for vertical writing.

Change-Id: Iac7abfa69acfe75860d05800f446c25ed622bb95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152366
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 0793c15dd4ab..522ccb2b3add 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -346,16 +346,10 @@ void AquaGraphicsBackend::drawTextLayout(const 
GenericSalLayout& rLayout, bool b
 if (rFont.mfFontRotation)
 {
 if (pGlyph->IsVertical())
-{
 bUprightGlyph = true;
-// Adjust the position of upright (vertical) glyphs.
-aGCPos.y -= CTFontGetAscent(pCTFont) - 
CTFontGetDescent(pCTFont);
-}
 else
-{
 // Transform the position of rotated glyphs.
 aGCPos = CGPointApplyAffineTransform(aGCPos, aRotMatrix);
-}
 }
 
 aGlyphIds.push_back(pGlyph->glyphId());


[Libreoffice-commits] core.git: vcl/quartz

2022-12-11 Thread Andrea Gelmini (via logerrit)
 vcl/quartz/salbmp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 01c9c971e43782800ebf63acc763a7e7fba096c1
Author: Andrea Gelmini 
AuthorDate: Sun Dec 11 21:48:41 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Dec 12 00:24:53 2022 +

Fix typo

Change-Id: Ifd46201254b8a5db1d21d99d469d331688e8731c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143952
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index cd191482f5aa..05b5093bafc1 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -123,7 +123,7 @@ bool QuartzSalBitmap::Create( const SkiaSalBitmap& rSalBmp, 
const SalTwoRect& rP
 
 // Ugly but necessary to acquire the bitmap buffer because all of the
 // SalBitmap instances that callers pass are already const. At least we
-// only need to read, not write to the bitmap paramter.
+// only need to read, not write to the bitmap parameter.
 SkiaSalBitmap& rSkiaSalBmp = const_cast( rSalBmp );
 
 BitmapBuffer *pSrcBuffer = rSkiaSalBmp.AcquireBuffer( 
BitmapAccessMode::Read );


[Libreoffice-commits] core.git: vcl/quartz

2022-11-21 Thread Caolán McNamara (via logerrit)
 vcl/quartz/ctfonts.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 7017ae2fd7161ee9ed07095f56dd3da9eb9e6b10
Author: Caolán McNamara 
AuthorDate: Sat Nov 19 10:08:57 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 21 09:55:53 2022 +0100

IsSymbolFont means that its a Windows Symbol Encoding

so kCTFontSymbolicClass doesn't fulfil that meaning, if we want
something more generic to indicate that a font is only useful
for "icons, dingbats, technical symbols, and so on." then we need
a different thing. Its baked in everywhere else that a "SymbolFont"
uses RTL_TEXTENCODING_SYMBOL.

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

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 89460c3943a1..93a862653b74 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -379,8 +379,6 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 if( CFDictionaryGetValueIfPresent( pAttrDict, kCTFontSymbolicTrait, 
reinterpret_cast() ) )
 {
 CFNumberGetValue( pSymbolNum, kCFNumberSInt64Type,  );
-rDFA.SetSymbolFlag( (nSymbolTrait & kCTFontClassMaskTrait) == 
kCTFontSymbolicClass );
-
 if (nSymbolTrait & kCTFontMonoSpaceTrait)
 rDFA.SetPitch(PITCH_FIXED);
 }


[Libreoffice-commits] core.git: vcl/quartz

2022-11-05 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/ctfonts.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 804f21e42bdc9328ab0f17b983411657e1f6215d
Author: Stephan Bergmann 
AuthorDate: Fri Nov 4 16:03:02 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 6 01:15:35 2022 +0100

loplugin:unusedvariablecheck

apparently a leftover from 643fec7cf7a81bf8c89a8efd47c0310b38f9076c "vcl: 
add
PhysicalFontFace::GetVariations()"

Change-Id: I78141d5de4c3f63096552eb25b70da3e5de36df9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142284
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 0adc0bbfef39..f75f8c4c3406 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -279,7 +279,6 @@ std::vector 
CoreTextFontFace::GetVariations() const
 if (pAxes)
 {
 CFDictionaryRef pVariations = CTFontCopyVariation(pFont);
-std::vector aHBVariations;
 if (pVariations)
 {
 CFIndex nAxes = CFArrayGetCount(pAxes);


[Libreoffice-commits] core.git: vcl/quartz

2022-10-29 Thread Khaled Hosny (via logerrit)
 vcl/quartz/ctfonts.cxx |   46 +-
 1 file changed, 21 insertions(+), 25 deletions(-)

New commits:
commit e7676fda295279470b5f28fa03a915ead467a51b
Author: Khaled Hosny 
AuthorDate: Sat Oct 29 14:43:12 2022 +0200
Commit: خالد حسني 
CommitDate: Sat Oct 29 16:15:53 2022 +0200

vcl: fix memory leak in CoreTextFontFace::GetHbTable()

If the !nTag case, we created a CTFontRef but never released it.

Change-Id: Iaf06d62f03b7cbcb2b2eda87db598ef983c55994
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142022
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 861c57fa1ba9..9a2e2ab4ee69 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -219,21 +219,18 @@ hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) 
const
 {
 hb_blob_t* pBlob = nullptr;
 CTFontDescriptorRef pFontDesc = 
reinterpret_cast(GetFontId());
+CTFontRef pFont = CTFontCreateWithFontDescriptor(pFontDesc, 0.0, nullptr);
 
 if (!nTag)
 {
 // If nTag is 0, the whole font data is requested. CoreText does not
 // give us that, so we will construct an HarfBuzz face from CoreText
 // table data and return the blob of that face.
-auto rCTFont = CTFontCreateWithFontDescriptor(pFontDesc, 0.0, nullptr);
 
-auto pTags = CTFontCopyAvailableTables(rCTFont, 
kCTFontTableOptionNoOptions);
-if (pTags)
+auto pTags = CTFontCopyAvailableTables(pFont, 
kCTFontTableOptionNoOptions);
+CFIndex nTags = pTags ? CFArrayGetCount(pTags) : 0;
+if (nTags > 0)
 {
-auto nTags = CFArrayGetCount(pTags);
-if (!nTags)
-return nullptr;
-
 hb_face_t* pHbFace = hb_face_builder_create();
 for (CFIndex i = 0; i < nTags; i++)
 {
@@ -246,30 +243,29 @@ hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) 
const
 pBlob = hb_face_reference_blob(pHbFace);
 
 hb_face_destroy(pHbFace);
-CFRelease(pTags);
 }
-
-return pBlob;
+if (pTags)
+CFRelease(pTags);
 }
-
-CTFontRef pFont = CTFontCreateWithFontDescriptor(pFontDesc, 0.0, nullptr);
-CFDataRef pData = CTFontCopyTable(pFont, nTag, 
kCTFontTableOptionNoOptions);
-
-const CFIndex nLength = pData ? CFDataGetLength(pData) : 0;
-if (nLength > 0)
+else
 {
-auto pBuffer = new UInt8[nLength];
-const CFRange aRange = CFRangeMake(0, nLength);
-CFDataGetBytes(pData, aRange, pBuffer);
+CFDataRef pData = CTFontCopyTable(pFont, nTag, 
kCTFontTableOptionNoOptions);
+const CFIndex nLength = pData ? CFDataGetLength(pData) : 0;
+if (nLength > 0)
+{
+auto pBuffer = new UInt8[nLength];
+const CFRange aRange = CFRangeMake(0, nLength);
+CFDataGetBytes(pData, aRange, pBuffer);
 
-pBlob = hb_blob_create(reinterpret_cast(pBuffer), nLength,
-   HB_MEMORY_MODE_READONLY, pBuffer,
-   [](void* data) { delete[] 
static_cast(data); });
+pBlob = hb_blob_create(reinterpret_cast(pBuffer), 
nLength,
+   HB_MEMORY_MODE_READONLY, pBuffer,
+   [](void* data) { delete[] 
static_cast(data); });
+}
+if (pData)
+CFRelease(pData);
 }
-if (pData)
-CFRelease(pData);
-CFRelease(pFont);
 
+CFRelease(pFont);
 return pBlob;
 }
 


[Libreoffice-commits] core.git: vcl/quartz

2022-10-11 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/ctfonts.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d0f3e24a7a34aac41e0b433d45c657b136ff8fe0
Author: Stephan Bergmann 
AuthorDate: Tue Oct 11 08:09:51 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Oct 11 09:12:17 2022 +0200

loplugin:loopvartoosmall

> /Users/stephan/lo/core/vcl/quartz/ctfonts.cxx:255:33: error: loop index 
type 'unsigned int' is narrower than length type 'CFIndex' (aka 'long') 
[loplugin:loopvartoosmall]
> for (auto i = 0u; i < nTags; i++)
>   ~~^~~

(and whatever the motivation in d7083fe6dd383ac4144fbe53e300bc3d34f26ef6
"tdf#72456: Support font embedding on macOS" to use an unsigned 0u here)

Change-Id: I6a96dd2b2146c27d68a8a53daf3c2fe1f744738d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141201
Reviewed-by: خالد حسني 
Tested-by: Jenkins

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index eb98b24569df..887abe4f2f35 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -252,7 +252,7 @@ hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) const
 return nullptr;
 
 hb_face_t* pHbFace = hb_face_builder_create();
-for (auto i = 0u; i < nTags; i++)
+for (CFIndex i = 0; i < nTags; i++)
 {
 auto nTable = 
reinterpret_cast(CFArrayGetValueAtIndex(pTags, i));
 assert(nTable);


[Libreoffice-commits] core.git: vcl/quartz

2022-10-01 Thread Khaled Hosny (via logerrit)
 vcl/quartz/salgdi.cxx |   11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

New commits:
commit 3b6e9582ce43242a2304047561116bb26808408b
Author: Khaled Hosny 
AuthorDate: Sat Oct 1 14:13:25 2022 +0200
Commit: خالد حسني 
CommitDate: Sat Oct 1 16:33:26 2022 +0200

tdf#72456: Don’t cache macOS font list

The “system” font list is used for both actual system fonts and fonts we
add with AddTempDevFont(), so the caching makes loading embedded fonts
broken the first time the file is opened, requiring a next open without
closing the application.

The callers, I think, are careful not to call GetDevFontList() unless
they really want to refresh the font list, so the caching is probably
superfluous if not wrong.

Change-Id: Ie14cc473a64425fd5270bc65ffd61dea2d873cfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140840
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 54127bc07b22..aa5c5ca598ef 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -278,17 +278,8 @@ void 
AquaSalGraphics::GetDevFontList(vcl::font::PhysicalFontCollection* pFontCol
 
 AddLocalTempFontDirs();
 
-// The idea is to cache the list of system fonts once it has been 
generated.
-// SalData seems to be a good place for this caching. However we have to
-// carefully make the access to the font list thread-safe. If we register
-// a font-change event handler to update the font list in case fonts have
-// changed on the system we have to lock access to the list. The right
-// way to do that is the solar mutex since GetDevFontList is protected
-// through it as should be all event handlers
-
 SalData* pSalData = GetSalData();
-if( !pSalData->mpFontList )
-pSalData->mpFontList = GetCoretextFontList();
+pSalData->mpFontList = GetCoretextFontList();
 
 // Copy all PhysicalFontFace objects contained in the SystemFontList
 pSalData->mpFontList->AnnounceFonts( *pFontCollection );


[Libreoffice-commits] core.git: vcl/quartz

2022-10-01 Thread Khaled Hosny (via logerrit)
 vcl/quartz/ctfonts.cxx |   39 ---
 1 file changed, 36 insertions(+), 3 deletions(-)

New commits:
commit d7083fe6dd383ac4144fbe53e300bc3d34f26ef6
Author: Khaled Hosny 
AuthorDate: Sat Oct 1 10:24:00 2022 +0200
Commit: خالد حسني 
CommitDate: Sat Oct 1 13:10:22 2022 +0200

tdf#72456: Support font embedding on macOS

With the previous commit, when we want the full font data we pass 0 for
table tag. This does not work with CoreText’s CTFontCopyTable(), we we
emulate it by using hb_face_builder to construct a full font from
individual font tables.

Change-Id: I0edb10982434872221466e9ec9ef9cd39087967a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140831
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 9166d323f7dd..eb98b24569df 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -234,6 +234,41 @@ bool CoreTextStyle::GetGlyphOutline(sal_GlyphId nId, 
basegfx::B2DPolyPolygon& rR
 
 hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) const
 {
+hb_blob_t* pBlob = nullptr;
+
+if (!nTag)
+{
+// If nTag is 0, the whole font data is requested. CoreText does not
+// give us that, so we will construct an HarfBuzz face from CoreText
+// table data and return the blob of that face.
+auto pFontDesc = reinterpret_cast(GetFontId());
+auto rCTFont = CTFontCreateWithFontDescriptor(pFontDesc, 0.0, nullptr);
+
+auto pTags = CTFontCopyAvailableTables(rCTFont, 
kCTFontTableOptionNoOptions);
+if (pTags)
+{
+auto nTags = CFArrayGetCount(pTags);
+if (!nTags)
+return nullptr;
+
+hb_face_t* pHbFace = hb_face_builder_create();
+for (auto i = 0u; i < nTags; i++)
+{
+auto nTable = 
reinterpret_cast(CFArrayGetValueAtIndex(pTags, i));
+assert(nTable);
+auto pTable = GetHbTable(nTable);
+assert(pTable);
+hb_face_builder_add_table(pHbFace, nTable, pTable);
+}
+pBlob = hb_face_reference_blob(pHbFace);
+
+hb_face_destroy(pHbFace);
+CFRelease(pTags);
+}
+
+return pBlob;
+}
+
 sal_uLong nLength = 0;
 unsigned char* pBuffer = nullptr;
 nLength = GetFontTable(nTag, nullptr);
@@ -243,7 +278,6 @@ hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) const
 GetFontTable(nTag, pBuffer);
 }
 
-hb_blob_t* pBlob = nullptr;
 if (pBuffer != nullptr)
 pBlob = hb_blob_create(reinterpret_cast(pBuffer), 
nLength, HB_MEMORY_MODE_READONLY,
pBuffer, [](void* data){ delete[] 
static_cast(data); });
@@ -307,8 +341,7 @@ int CoreTextFontFace::GetFontTable(uint32_t nTagCode, 
unsigned char* pResultBuf
 // get the raw table length
 CTFontDescriptorRef pFontDesc = reinterpret_cast( 
GetFontId());
 CTFontRef rCTFont = CTFontCreateWithFontDescriptor( pFontDesc, 0.0, 
nullptr);
-const uint32_t opts( kCTFontTableOptionNoOptions );
-CFDataRef pDataRef = CTFontCopyTable( rCTFont, nTagCode, opts);
+CFDataRef pDataRef = CTFontCopyTable(rCTFont, nTagCode, 
kCTFontTableOptionNoOptions);
 CFRelease( rCTFont);
 if( !pDataRef)
 return 0;


[Libreoffice-commits] core.git: vcl/quartz

2022-07-21 Thread Tomaž Vajngerl (via logerrit)
 vcl/quartz/salbmp.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit a02d4f656add39658c30669f2652bf6536207098
Author: Tomaž Vajngerl 
AuthorDate: Wed Jul 20 23:43:47 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Jul 21 18:16:25 2022 +0200

remove 4-bit bitmap bits that were still present in QuartzSalBitmap

Change-Id: I3a363f9b382e298422e3a4bd6b58504cbaba077e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137286
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index f0f5fb9a5b8f..cdc405ad362c 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -224,7 +224,6 @@ bool QuartzSalBitmap::AllocateUserData()
 switch( mnBits )
 {
 case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break;
-case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break;
 case 8: mnBytesPerRow = mnWidth; break;
 case 24:mnBytesPerRow = (mnWidth << 1) + mnWidth; break;
 case 32:mnBytesPerRow = mnWidth << 2; break;
@@ -370,20 +369,17 @@ static const BitmapPalette& GetDefaultPalette( int 
mnBits, bool bMonochrome )
 // since all other platforms do so, too.
 static bool bDefPalInit = false;
 static BitmapPalette aDefPalette256;
-static BitmapPalette aDefPalette16;
 static BitmapPalette aDefPalette2;
 if( ! bDefPalInit )
 {
 bDefPalInit = true;
 aDefPalette256.SetEntryCount( 256 );
-aDefPalette16.SetEntryCount( 16 );
 aDefPalette2.SetEntryCount( 2 );
 
 // Standard colors
 unsigned int i;
 for( i = 0; i < 16; i++ )
 {
-aDefPalette16[i] =
 aDefPalette256[i] = BitmapColor( aImplSalSysPalEntryAry[i].mnRed,
  aImplSalSysPalEntryAry[i].mnGreen,
  aImplSalSysPalEntryAry[i].mnBlue 
);
@@ -414,7 +410,6 @@ static const BitmapPalette& GetDefaultPalette( int mnBits, 
bool bMonochrome )
 switch( mnBits )
 {
 case 1: return aDefPalette2;
-case 4: return aDefPalette16;
 case 8: return aDefPalette256;
 default: break;
 }


[Libreoffice-commits] core.git: vcl/quartz

2022-05-10 Thread Caolán McNamara (via logerrit)
 vcl/quartz/salgdi.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 4b693a0c594fb3b73f4a4c1e03e9916f1a107012
Author: Caolán McNamara 
AuthorDate: Tue May 10 16:44:27 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 10 20:33:48 2022 +0200

tdf#148470 if macOS glyph fallback provided a partial result flag what 
failed

so another font can be attempted for the remainder

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

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 98b00b305366..1ce488be9c4d 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -73,6 +74,12 @@ public:
 bool FindFontSubstitute(vcl::font::FontSelectPattern&, 
LogicalFontInstance* pLogicalFont, OUString&) const override;
 };
 
+bool FontHasCharacter(CTFontRef pFont, const OUString& rString, sal_Int32 
nIndex, sal_Int32 nLen)
+{
+CGGlyph glyphs[nLen];
+return CTFontGetGlyphsForCharacters(pFont, reinterpret_cast(rString.getStr() + nIndex), glyphs, nLen);
+}
+
 }
 
 bool 
CoreTextGlyphFallbackSubstititution::FindFontSubstitute(vcl::font::FontSelectPattern&
 rPattern, LogicalFontInstance* pLogicalFont,
@@ -89,6 +96,19 @@ bool 
CoreTextGlyphFallbackSubstititution::FindFontSubstitute(vcl::font::FontSele
 {
 bFound = true;
 
+// tdf#148470 remove the resolved chars from rMissing to flag 
which ones are still missing
+// for an attempt with another font
+OUStringBuffer aStillMissingChars;
+for (sal_Int32 nStrIndex = 0; nStrIndex < 
rMissingChars.getLength();)
+{
+sal_Int32 nOldStrIndex = nStrIndex;
+rMissingChars.iterateCodePoints();
+sal_Int32 nCharLength = nStrIndex - nOldStrIndex;
+if (!FontHasCharacter(pFallback, rMissingChars, nOldStrIndex, 
nCharLength))
+aStillMissingChars.append(rMissingChars.getStr() + 
nOldStrIndex, nCharLength);
+}
+rMissingChars = aStillMissingChars.toString();
+
 CTFontDescriptorRef pDesc = CTFontCopyFontDescriptor(pFallback);
 FontAttributes rAttr = DevFontFromCTFontDescriptor(pDesc, nullptr);
 


[Libreoffice-commits] core.git: vcl/quartz

2021-10-09 Thread Chris Sherlock (via logerrit)
 vcl/quartz/ctfonts.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit d389a54e64accc3f46c1a646f947e9af9badd08e
Author: Chris Sherlock 
AuthorDate: Sun Oct 10 03:45:37 2021 +1100
Commit: Mike Kaganski 
CommitDate: Sun Oct 10 07:49:21 2021 +0200

tdf#144757 - fixed fonts not shown in font list

When in font options, the Fonts in "Font Setting for HTML, Basic and SQL
Sources" were not showing any fixed (non-proportional) fonts in the list
when "Non-proportional fonts only" was ticked.

The reason this was occuring was because we were not populating the
fixed font attribute when getting the CT font descriptor.

Change-Id: I06127ac48bd0f3bc9b70217b36bbf584a1b0fdc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123316
Reviewed-by: Noel Grandin 
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 7de60b88f24d..f7c922b8aa9e 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -376,6 +376,9 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 {
 CFNumberGetValue( pSymbolNum, kCFNumberSInt64Type,  );
 rDFA.SetSymbolFlag( (nSymbolTrait & kCTFontClassMaskTrait) == 
kCTFontSymbolicClass );
+
+if (nSymbolTrait & kCTFontMonoSpaceTrait)
+rDFA.SetPitch(PITCH_FIXED);
 }
 
 // get the font weight


[Libreoffice-commits] core.git: vcl/quartz

2021-08-19 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/AquaGraphicsBackend.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0d14e1251efeec9f651a28f553447c6d06b778e9
Author: Stephan Bergmann 
AuthorDate: Thu Aug 19 15:52:27 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Aug 19 17:21:57 2021 +0200

loplugin:sequenceloop (macOS)

Change-Id: I5d004dfcce2ce1aad520f9e541432a60627161a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120739
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/AquaGraphicsBackend.cxx 
b/vcl/quartz/AquaGraphicsBackend.cxx
index 6bc44b39f89e..ee3362e4462b 100644
--- a/vcl/quartz/AquaGraphicsBackend.cxx
+++ b/vcl/quartz/AquaGraphicsBackend.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -691,7 +692,7 @@ bool AquaGraphicsBackend::drawPolyPolygon(const 
basegfx::B2DHomMatrix& rObjectTo
 CGMutablePathRef xPath = CGPathCreateMutable();
 // tdf#120252 Use the correct, already transformed PolyPolygon (as long as
 // the transformation is not used here...)
-for (auto const& rPolygon : aPolyPolygon)
+for (auto const& rPolygon : std::as_const(aPolyPolygon))
 {
 AddPolygonToPath(xPath, rPolygon, true, !getAntiAlias(), 
mrShared.isPenVisible());
 }


[Libreoffice-commits] core.git: vcl/quartz

2021-05-03 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/AquaGraphicsBackend.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 564ba9278189607b228e6545b8bbcb64eeba85ce
Author: Stephan Bergmann 
AuthorDate: Mon May 3 17:15:55 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 4 07:45:19 2021 +0200

loplugin:redundantstatic

Change-Id: I933a51e9107d8f7dff5eeb03f9aba14dff534574
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115046
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/AquaGraphicsBackend.cxx 
b/vcl/quartz/AquaGraphicsBackend.cxx
index 0aa6042f7eb4..6bc44b39f89e 100644
--- a/vcl/quartz/AquaGraphicsBackend.cxx
+++ b/vcl/quartz/AquaGraphicsBackend.cxx
@@ -50,8 +50,8 @@ namespace
 {
 const basegfx::B2DPoint aHalfPointOfs(0.5, 0.5);
 
-static void AddPolygonToPath(CGMutablePathRef xPath, const 
basegfx::B2DPolygon& rPolygon,
- bool bClosePath, bool bPixelSnap, bool bLineDraw)
+void AddPolygonToPath(CGMutablePathRef xPath, const basegfx::B2DPolygon& 
rPolygon, bool bClosePath,
+  bool bPixelSnap, bool bLineDraw)
 {
 // short circuit if there is nothing to do
 const int nPointCount = rPolygon.count();
@@ -128,14 +128,14 @@ static void AddPolygonToPath(CGMutablePathRef xPath, 
const basegfx::B2DPolygon&
 }
 }
 
-static void alignLinePoint(const Point* i_pIn, float& o_fX, float& o_fY)
+void alignLinePoint(const Point* i_pIn, float& o_fX, float& o_fY)
 {
 o_fX = static_cast(i_pIn->getX()) + 0.5;
 o_fY = static_cast(i_pIn->getY()) + 0.5;
 }
 
-static void getBoundRect(sal_uInt32 nPoints, const Point* pPtAry, tools::Long& 
rX, tools::Long& rY,
- tools::Long& rWidth, tools::Long& rHeight)
+void getBoundRect(sal_uInt32 nPoints, const Point* pPtAry, tools::Long& rX, 
tools::Long& rY,
+  tools::Long& rWidth, tools::Long& rHeight)
 {
 tools::Long nX1 = pPtAry->getX();
 tools::Long nX2 = nX1;
@@ -167,7 +167,7 @@ static void getBoundRect(sal_uInt32 nPoints, const Point* 
pPtAry, tools::Long& r
 rHeight = nY2 - nY1 + 1;
 }
 
-static Color ImplGetROPColor(SalROPColor nROPColor)
+Color ImplGetROPColor(SalROPColor nROPColor)
 {
 Color nColor;
 if (nROPColor == SalROPColor::N0)
@@ -181,7 +181,7 @@ static Color ImplGetROPColor(SalROPColor nROPColor)
 return nColor;
 }
 
-static void drawPattern50(void*, CGContextRef rContext)
+void drawPattern50(void*, CGContextRef rContext)
 {
 static const CGRect aRects[2] = { { { 0, 0 }, { 2, 2 } }, { { 2, 2 }, { 2, 
2 } } };
 CGContextAddRects(rContext, aRects, 2);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2021-04-06 Thread Tomaž Vajngerl (via logerrit)
 vcl/quartz/salbmp.cxx |  241 ++
 1 file changed, 11 insertions(+), 230 deletions(-)

New commits:
commit c47ad11f8c2e917adebbd5d7b3a3ef6cc4b3e670
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 5 23:31:44 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 6 08:40:57 2021 +0200

vcl: quartz - use ScanlineTransformer instead of local converter

ScanlineTransformer was created because there are multiple impl.
of the same tool (ImplPixelFormat), but it never replaced those
duplications. This change removes one of the duplications - the
one in Quartz backend.

Change-Id: I637433ae59e7577022b86e582eb4a8a64f3055f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113610
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 72c0b8d5634f..8fadba1b509e 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef MACOSX
 #include 
@@ -253,226 +254,6 @@ bool QuartzSalBitmap::AllocateUserData()
 return bool(m_pUserBuffer);
 }
 
-namespace {
-
-class ImplPixelFormat
-{
-public:
-static std::unique_ptr GetFormat( sal_uInt16 nBits, const 
BitmapPalette& rPalette );
-
-virtual void StartLine( sal_uInt8* pLine ) = 0;
-virtual void SkipPixel( sal_uInt32 nPixel ) = 0;
-virtual Color ReadPixel() = 0;
-virtual void WritePixel( Color nColor ) = 0;
-virtual ~ImplPixelFormat() { }
-};
-
-class ImplPixelFormat32 : public ImplPixelFormat
-// currently ARGB-format for 32bit depth
-{
-sal_uInt8* pData;
-public:
-virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-pData += nPixel << 2;
-}
-virtual Color ReadPixel() override
-{
-const Color c( pData[1], pData[2], pData[3] );
-pData += 4;
-return c;
-}
-virtual void WritePixel( Color nColor ) override
-{
-*pData++ = 0;
-*pData++ = nColor.GetRed();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetBlue();
-}
-};
-
-class ImplPixelFormat24 : public ImplPixelFormat
-// currently BGR-format for 24bit depth
-{
-sal_uInt8* pData;
-public:
-virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-pData += (nPixel << 1) + nPixel;
-}
-virtual Color ReadPixel() override
-{
-const Color c( pData[2], pData[1], pData[0] );
-pData += 3;
-return c;
-}
-virtual void WritePixel( Color nColor ) override
-{
-*pData++ = nColor.GetBlue();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetRed();
-}
-};
-
-class ImplPixelFormat8 : public ImplPixelFormat
-{
-private:
-sal_uInt8* pData;
-const BitmapPalette& mrPalette;
-const sal_uInt16 mnPaletteCount;
-
-public:
-explicit ImplPixelFormat8( const BitmapPalette& rPalette )
-: pData(nullptr)
-, mrPalette(rPalette)
-, mnPaletteCount(rPalette.GetEntryCount())
-{
-}
-virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-pData += nPixel;
-}
-virtual Color ReadPixel() override
-{
-const sal_uInt8 nIndex(*pData++);
-
-// Caution(!) rPalette.GetEntryCount() may be != (depth^^2)-1 (!)
-if(nIndex < mnPaletteCount)
-return mrPalette[nIndex];
-else
-return COL_BLACK;
-}
-virtual void WritePixel( Color nColor ) override
-{
-*pData++ = static_cast< sal_uInt8 >( mrPalette.GetBestIndex( 
nColor ) );
-}
-};
-
-class ImplPixelFormat4 : public ImplPixelFormat
-{
-private:
-sal_uInt8* pData;
-const BitmapPalette& mrPalette;
-const sal_uInt16 mnPaletteCount;
-sal_uInt32 mnX;
-sal_uInt32 mnShift;
-
-public:
-explicit ImplPixelFormat4( const BitmapPalette& rPalette )
-: pData(nullptr)
-, mrPalette(rPalette)
-, mnPaletteCount(rPalette.GetEntryCount())
-, mnX(0)
-, mnShift(0)
-{
-}
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-mnX += nPixel;
-if( nPixel & 1 )
-{
-mnShift ^= 4;
-}
-}
-virtual void StartLine( sal_uInt8* pLine ) override
-{
-pData = pLine;
-mnX = 0;
-mnShift = 4;
-}
-virtual Color ReadPixel() override
-{
-// Caution(!) rPalette.GetEntryCount() may be != (depth^^2)-1 (!)
-const sal_uInt8 nIndex(( pData[mnX >> 1] >> mnShift) & 0x0f);
-mnX++;
-mnShift ^= 4;
-
-

[Libreoffice-commits] core.git: vcl/quartz

2021-03-23 Thread Thorsten Wagner (via logerrit)
 vcl/quartz/salgdicommon.cxx |   42 +-
 1 file changed, 9 insertions(+), 33 deletions(-)

New commits:
commit 00d12793f5d9a73f784e23aff61e2618f0fc01c0
Author: Thorsten Wagner 
AuthorDate: Sat Mar 20 21:20:53 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Mar 23 10:06:39 2021 +0100

tdf#141063 Always use region rectangles for clipping on macOS

The use of polygons currently causes misalignment by one pixel.
Use of polygons is dropped on macOS by this change similar it has
been done for SKIA to fix tdf#133208.

Change-Id: I31faf7cf9b33908a52cb60d1b631308b4fe45e56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112823
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index d82681f1091f..51e35e79905a 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -127,21 +127,6 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
 }
 }
 
-static void AddPolyPolygonToPath( CGMutablePathRef xPath,
-  const basegfx::B2DPolyPolygon& rPolyPoly,
-  bool bPixelSnap, bool bLineDraw )
-{
-// short circuit if there is nothing to do
-if( rPolyPoly.count() == 0 )
-{
-return;
-}
-for(auto const& rPolygon : rPolyPoly)
-{
-AddPolygonToPath( xPath, rPolygon, true, bPixelSnap, bLineDraw );
-}
-}
-
 bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
 const PhysicalFontFace* pFontData,
 const sal_GlyphId* pGlyphIds, const 
sal_uInt8* pEncoding,
@@ -1439,30 +1424,21 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& 
i_rClip )
 mxClipPath = CGPathCreateMutable();
 
 // set current path, either as polypolgon or sequence of rectangles
-if(i_rClip.HasPolyPolygonOrB2DPolyPolygon())
-{
-const basegfx::B2DPolyPolygon aClip(i_rClip.GetAsB2DPolyPolygon());
+RectangleVector aRectangles;
+i_rClip.GetRegionRectangles(aRectangles);
 
-AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAlias(), false );
-}
-else
+for(const auto& rRect : aRectangles)
 {
-RectangleVector aRectangles;
-i_rClip.GetRegionRectangles(aRectangles);
+const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
 
-for(const auto& rRect : aRectangles)
+if(nW)
 {
-const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
+const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 
logic in original
 
-if(nW)
+if(nH)
 {
-const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // 
uses +1 logic in original
-
-if(nH)
-{
-const CGRect aRect = CGRectMake( rRect.Left(), 
rRect.Top(), nW, nH);
-CGPathAddRect( mxClipPath, nullptr, aRect );
-}
+const CGRect aRect = CGRectMake( rRect.Left(), rRect.Top(), 
nW, nH);
+CGPathAddRect( mxClipPath, nullptr, aRect );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2021-01-21 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/salgdicommon.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4578b867c37abd9fb822d1d6f4935bd961403973
Author: Stephan Bergmann 
AuthorDate: Thu Jan 21 13:42:53 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 21 16:54:53 2021 +0100

loplugin:doubleconvert (macOS)

Change-Id: I3225ec0916b793a322acb44010563052451f782e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109758
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 33ffc43741a1..f58cfecf712e 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1046,7 +1046,7 @@ Color AquaSalGraphics::getPixel( tools::Long nX, 
tools::Long nY )
 if (!maLayer.isSet() || (nX < 0) || (nX >= mnWidth) ||
 (nY < 0) || (nY >= mnHeight))
 {
-return sal_uInt32(COL_BLACK);
+return COL_BLACK;
 }
 // prepare creation of matching a CGBitmapContext
 #if defined OSL_BIGENDIAN
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2021-01-04 Thread Tor Lillqvist (via logerrit)
 vcl/quartz/salbmp.cxx |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 4f3b78e9e2e16ded92b7e3f28fc84a98b79de117
Author: Tor Lillqvist 
AuthorDate: Mon Jan 4 13:26:29 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Jan 4 21:52:19 2021 +0100

Don't use m prefix for a local variable

Change-Id: I73e106923d463215078a465f9ff933ea3c89255f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108665
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 4603fe57bf45..ecd3c974b081 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -916,26 +916,26 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& 
rData )
 CGImageRef xImage = 
CGBitmapContextCreateImage(maGraphicContext.get());
 
 // re-create the context with single change: include 
kCGBitmapByteOrder32Host flag.
-CGContextHolder 
maGraphicContextNew(CGBitmapContextCreate(CGBitmapContextGetData(maGraphicContext.get()),
-  
CGBitmapContextGetWidth(maGraphicContext.get()),
-  
CGBitmapContextGetHeight(maGraphicContext.get()),
-  
CGBitmapContextGetBitsPerComponent(maGraphicContext.get()),
-  
CGBitmapContextGetBytesPerRow(maGraphicContext.get()),
-  
CGBitmapContextGetColorSpace(maGraphicContext.get()),
-  
CGBitmapContextGetBitmapInfo(maGraphicContext.get()) | 
kCGBitmapByteOrder32Host));
+CGContextHolder 
aGraphicContextNew(CGBitmapContextCreate(CGBitmapContextGetData(maGraphicContext.get()),
+ 
CGBitmapContextGetWidth(maGraphicContext.get()),
+ 
CGBitmapContextGetHeight(maGraphicContext.get()),
+ 
CGBitmapContextGetBitsPerComponent(maGraphicContext.get()),
+ 
CGBitmapContextGetBytesPerRow(maGraphicContext.get()),
+ 
CGBitmapContextGetColorSpace(maGraphicContext.get()),
+ 
CGBitmapContextGetBitmapInfo(maGraphicContext.get()) | 
kCGBitmapByteOrder32Host));
 CFRelease(maGraphicContext.get());
 
 // Needs to be flipped
-maGraphicContextNew.saveState();
-CGContextTranslateCTM (maGraphicContextNew.get(), 0, 
CGBitmapContextGetHeight(maGraphicContextNew.get()));
-CGContextScaleCTM (maGraphicContextNew.get(), 1.0, -1.0);
+aGraphicContextNew.saveState();
+CGContextTranslateCTM (aGraphicContextNew.get(), 0, 
CGBitmapContextGetHeight(aGraphicContextNew.get()));
+CGContextScaleCTM (aGraphicContextNew.get(), 1.0, -1.0);
 
-CGContextDrawImage(maGraphicContextNew.get(), CGRectMake( 0, 0, 
CGImageGetWidth(xImage), CGImageGetHeight(xImage)), xImage);
+CGContextDrawImage(aGraphicContextNew.get(), CGRectMake( 0, 0, 
CGImageGetWidth(xImage), CGImageGetHeight(xImage)), xImage);
 
 // Flip back
-CGContextRestoreGState( maGraphicContextNew.get() );
+CGContextRestoreGState( aGraphicContextNew.get() );
 CGImageRelease( xImage );
-maGraphicContext = maGraphicContextNew;
+maGraphicContext = aGraphicContextNew;
 }
 
 rData.mnWidth = mnWidth;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-12-30 Thread Tor Lillqvist (via logerrit)
 vcl/quartz/salvd.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 2e42a85fe0d7a1a7d0a1778f1a6d3625fc3c9d79
Author: Tor Lillqvist 
AuthorDate: Wed Dec 30 15:08:20 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Dec 30 15:09:02 2020 +0200

tdf#138122: Add comment wondering what the code does

Change-Id: I0caea1297404e7970571085cc787ff23e614e500

diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 6462a51573ce..1e6e5b2536d0 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -295,6 +295,11 @@ bool AquaSalVirtualDevice::SetSize( tools::Long nDX, 
tools::Long nDY )
 {
 // get the matching Quartz context
 CGContextRef xDrawContext = CGLayerGetContext( maLayer.get() );
+
+// Here we pass the CGLayerRef that the CGLayerHolder maLayer holds as 
the first parameter
+// to SetVirDevGraphics(). That parameter is of type CGLayerHolder, so 
what we actually pass
+// is an implicitly constructed *separate* CGLayerHolder. Is that what 
we want? No idea.
+// Possibly we could pass just maLayer as such? But doing that does 
not fix tdf#138122.
 mpGraphics->SetVirDevGraphics(maLayer.get(), xDrawContext, 
mnBitmapDepth);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-12-22 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/utils.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 72ff89f147340795fae439c6b9274e67e286c5b6
Author: Stephan Bergmann 
AuthorDate: Tue Dec 22 13:50:28 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 22 18:30:33 2020 +0100

loplugin:loopvartoosmall

Change-Id: Ia9ae40b6286801c7cbdab6856d57e0ddd37aba87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108161
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index 0182ec118886..b07e68f74642 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -89,7 +89,7 @@ OUString NSStringArrayToOUString(NSArray* array)
 {
 OUString result = "[";
 OUString sep;
-for (unsigned i = 0; i < [array count]; i++)
+for (NSUInteger i = 0; i < [array count]; i++)
 {
 result = result + sep + OUString::fromUtf8([[array objectAtIndex:i] 
UTF8String]);
 sep = ",";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/salgdiutils.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit f9c6a153c95c4acc6ba02e660c6ca51166b4c79a
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 15:06:38 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 17:16:24 2020 +0100

-Werror,-Wdeprecated-anon-enum-enum-conversion

...even though CGBitmapContextCreate is documented to take a mixture of
CGImageAlphaInfo and CGBitmapInfo flags; so convert all to the uint32_t
CGBitmapContextCreate bitmapInfo parameter type

Change-Id: Ic6630c68760fe29b6abf6053e80a852a31349839
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105755
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 751b14c94921..985fe38a2d11 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -18,6 +18,9 @@
  */
 
 #include 
+
+#include 
+
 #include 
 
 #include 
@@ -155,14 +158,16 @@ bool AquaSalGraphics::CheckContext()
 const CGSize aLayerSize = { static_cast(nScaledWidth), 
static_cast(nScaledHeight) };
 
 const int nBytesPerRow = (nBitmapDepth * nScaledWidth) / 8;
-int nFlags = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host;
+std::uint32_t nFlags = std::uint32_t(kCGImageAlphaNoneSkipFirst)
+| std::uint32_t(kCGBitmapByteOrder32Host);
 maBGContextHolder.set(CGBitmapContextCreate(
 nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, 
GetSalData()->mxRGBSpace, nFlags));
 
 maLayer.set(CGLayerCreateWithContext(maBGContextHolder.get(), 
aLayerSize, nullptr));
 maLayer.setScale(fScale);
 
-nFlags = kCGImageAlphaPremultipliedFirst | 
kCGBitmapByteOrder32Host;
+nFlags = std::uint32_t(kCGImageAlphaPremultipliedFirst)
+| std::uint32_t(kCGBitmapByteOrder32Host);
 maCSContextHolder.set(CGBitmapContextCreate(
 nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, 
GetSalData()->mxRGBSpace, nFlags));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-11-12 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/utils.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f7e6c9853decbb61dc9aaa5ed3a3aa33d529d6e2
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 08:19:33 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 12 15:00:37 2020 +0100

loplugin:cstylecast (macOS)

Change-Id: Ic2833f2e6dfea4a9e3dd1094151f86e07be83040
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105623
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index ce5f9e4fa77e..cc18eb0d409f 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -208,7 +208,7 @@ std::ostream  <<(std::ostream& s, CGColorSpaceRef 
cs)
 
 CFStringRef name = CGColorSpaceCopyName(cs);
 if (name != nullptr)
-s << " (" << [(NSString *)name UTF8String] << ")";
+s << " (" << [static_cast(name) UTF8String] << ")";
 #endif
 return s;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-11-11 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/salgdiutils.cxx |4 ++--
 vcl/quartz/utils.cxx   |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d6d7beae483ec58e45c0f38fd66dc6c24e996275
Author: Stephan Bergmann 
AuthorDate: Wed Nov 11 21:07:13 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 12 08:10:18 2020 +0100

loplugin:nullptr (macOS)

Change-Id: I94b624f5340709e2cc456be12c7b21eab508dddb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105609
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 57953e536796..645cfe4db765 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -157,14 +157,14 @@ bool AquaSalGraphics::CheckContext()
 const int nBytesPerRow = (nBitmapDepth * nScaledWidth) / 8;
 int nFlags = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host;
 maBGContextHolder.set(CGBitmapContextCreate(
-NULL, nScaledWidth, nScaledHeight, 8, nBytesPerRow, 
GetSalData()->mxRGBSpace, nFlags));
+nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, 
GetSalData()->mxRGBSpace, nFlags));
 
 maLayer.set(CGLayerCreateWithContext(maBGContextHolder.get(), 
aLayerSize, nullptr));
 maLayer.setScale(fScale);
 
 nFlags = kCGImageAlphaPremultipliedFirst | 
kCGBitmapByteOrder32Host;
 maCSContextHolder.set(CGBitmapContextCreate(
-NULL, nScaledWidth, nScaledHeight, 8, nBytesPerRow, 
GetSalData()->mxRGBSpace, nFlags));
+nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, 
GetSalData()->mxRGBSpace, nFlags));
 
 CGContextRef xDrawContext = CGLayerGetContext(maLayer.get());
 maContextHolder = xDrawContext;
diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index 5bb42db9710c..ce5f9e4fa77e 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -207,7 +207,7 @@ std::ostream  <<(std::ostream& s, CGColorSpaceRef 
cs)
 }
 
 CFStringRef name = CGColorSpaceCopyName(cs);
-if (name != NULL)
+if (name != nullptr)
 s << " (" << [(NSString *)name UTF8String] << ")";
 #endif
 return s;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-10-18 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/utils.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit b4e442f7bc011ad0e3dfb2172664049e775229b1
Author: Stephan Bergmann 
AuthorDate: Sun Oct 18 15:34:09 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Oct 18 16:23:42 2020 +0200

-Werror,-Wunused-parameter

...since 2cd47f53b4c7bd300c210eaa466e13adc832c9b5 "tdf#137468: Add debug 
output
function for CGColorSpaceRef"

Change-Id: If392589071ddbc787e54863bafd65734aafe8c67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104480
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index 1bbd5cdde873..5bb42db9710c 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -209,9 +209,8 @@ std::ostream  <<(std::ostream& s, CGColorSpaceRef 
cs)
 CFStringRef name = CGColorSpaceCopyName(cs);
 if (name != NULL)
 s << " (" << [(NSString *)name UTF8String] << ")";
-
-return s;
 #endif
+return s;
 }
 
 /* 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/quartz

2020-09-26 Thread Andrea Gelmini (via logerrit)
 vcl/quartz/salgdi.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 7ed86a2d4244e7417b8a3c944bad32865aaa3a25
Author: Andrea Gelmini 
AuthorDate: Fri Sep 25 12:28:52 2020 +0200
Commit: Julien Nabet 
CommitDate: Sat Sep 26 11:35:34 2020 +0200

Fix typo in code

It passed "make check" on Linux

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

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 1501043924b6..a0bb509dc2b6 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -272,9 +272,9 @@ void AquaSalGraphics::GetFontMetric(ImplFontMetricDataRef& 
rxFontMetric, int nFa
 
 static bool AddTempDevFont(const OUString& rFontFileURL)
 {
-OUString aUSytemPath;
-OSL_VERIFY( !osl::FileBase::getSystemPathFromFileURL( rFontFileURL, 
aUSytemPath ) );
-OString aCFileName = OUStringToOString( aUSytemPath, RTL_TEXTENCODING_UTF8 
);
+OUString aUSystemPath;
+OSL_VERIFY( !osl::FileBase::getSystemPathFromFileURL( rFontFileURL, 
aUSystemPath ) );
+OString aCFileName = OUStringToOString( aUSystemPath, 
RTL_TEXTENCODING_UTF8 );
 
 CFStringRef rFontPath = CFStringCreateWithCString(nullptr, 
aCFileName.getStr(), kCFStringEncodingUTF8);
 CFURLRef rFontURL = CFURLCreateWithFileSystemPath(nullptr, rFontPath, 
kCFURLPOSIXPathStyle, true);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-07-21 Thread Tor Lillqvist (via logerrit)
 vcl/quartz/salgdiutils.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 0936710f750a24e732072484dd8576883fa9bedf
Author: Tor Lillqvist 
AuthorDate: Mon Jul 20 14:43:33 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Jul 22 07:31:16 2020 +0200

This file is used for macOS only

Change-Id: I9500453c8964b774e4b0be41a7b2f1a8c28040b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99138
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99183
Tested-by: Jenkins

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 589bd2ae22e5..426aea29dc78 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -134,11 +134,7 @@ bool AquaSalGraphics::CheckContext()
 
 const int nBytesPerRow = (nBitmapDepth * nScaledWidth) / 8;
 void* pRawData = std::malloc(nBytesPerRow * nScaledHeight);
-#ifdef MACOSX
-const int nFlags = kCGImageAlphaNoneSkipFirst;
-#else
-const int nFlags = kCGImageAlphaNoneSkipFirst | 
kCGImageByteOrder32Little;
-#endif
+const int nFlags = kCGImageAlphaNoneSkipFirst;
 CGContextHolder aContextHolder(CGBitmapContextCreate(
 pRawData, nScaledWidth, nScaledHeight, 8, nBytesPerRow, 
GetSalData()->mxRGBSpace, nFlags));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-06-11 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/salgdicommon.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 662a0fcdac5fd5b8709cc5bf2589cbe5b9dfc077
Author: Stephan Bergmann 
AuthorDate: Thu Jun 11 13:20:49 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jun 11 16:02:33 2020 +0200

loplugin:simplifybool (macOS)

Change-Id: Iae0a2966aa6394e16c2ba3d4155d90bac373472f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96118
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 3126400709f2..5acc4d4e4e77 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -924,7 +924,7 @@ bool AquaSalGraphics::drawPolyLine(
 
 const CGRect aRefreshRect = CGPathGetBoundingBox( xPath );
 // #i97317# workaround for Quartz having problems with drawing small 
polygons
-if( ! ((aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 
0.125)) )
+if( (aRefreshRect.size.width > 0.125) || (aRefreshRect.size.height > 
0.125) )
 {
 // use the path to prepare the graphics context
 maContextHolder.saveState();
@@ -987,7 +987,7 @@ bool AquaSalGraphics::drawPolyPolygon(
 
 const CGRect aRefreshRect = CGPathGetBoundingBox( xPath );
 // #i97317# workaround for Quartz having problems with drawing small 
polygons
-if( ! ((aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 
0.125)) )
+if( (aRefreshRect.size.width > 0.125) || (aRefreshRect.size.height > 
0.125) )
 {
 // prepare drawing mode
 CGPathDrawingMode eMode;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-05-28 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/salbmp.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2d13059635ecc8505023c052e29ed2bb164d6af4
Author: Stephan Bergmann 
AuthorDate: Thu May 28 19:13:46 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu May 28 22:25:54 2020 +0200

loplugin:simplifypointertobool (macOS)

Change-Id: Ie26580277fa6d0734b8af1eb029e0883a3c6f886
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95064
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 2f6820b2877e..87861256be43 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -145,7 +145,7 @@ bool QuartzSalBitmap::Create( const SalBitmap& rSalBmp, 
sal_uInt16 nNewBitCount
 {
 const QuartzSalBitmap& rSourceBitmap = static_cast(rSalBmp);
 
-if (isValidBitCount(nNewBitCount) && rSourceBitmap.m_pUserBuffer.get())
+if (isValidBitCount(nNewBitCount) && rSourceBitmap.m_pUserBuffer)
 {
 mnBits = nNewBitCount;
 mnWidth = rSourceBitmap.mnWidth;
@@ -249,7 +249,7 @@ bool QuartzSalBitmap::CreateContext()
 }
 }
 
-if (m_pContextBuffer.get())
+if (m_pContextBuffer)
 {
 maGraphicContext.set(CGBitmapContextCreate(m_pContextBuffer.get(), 
mnWidth, mnHeight,
bitsPerComponent, 
nContextBytesPerRow,
@@ -695,7 +695,7 @@ static const BitmapPalette& GetDefaultPalette( int mnBits, 
bool bMonochrome )
 BitmapBuffer* QuartzSalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ )
 {
 // TODO: AllocateUserData();
-if (!m_pUserBuffer.get())
+if (!m_pUserBuffer)
 return nullptr;
 
 BitmapBuffer* pBuffer = new BitmapBuffer;
@@ -843,7 +843,7 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
  int nHeight, Color nMaskColor ) 
const
 {
 CGImageRef xMask = nullptr;
-if (m_pUserBuffer.get() && (nX + nWidth <= mnWidth) && (nY + nHeight <= 
mnHeight))
+if (m_pUserBuffer && (nX + nWidth <= mnWidth) && (nY + nHeight <= 
mnHeight))
 {
 const sal_uInt32 nDestBytesPerRow = nWidth << 2;
 std::unique_ptr pMaskBuffer(new (std::nothrow) 
sal_uInt32[ nHeight * nDestBytesPerRow / 4] );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-03-25 Thread Tor Lillqvist (via logerrit)
 vcl/quartz/salgdicommon.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 77638038470a93d30a82f2ece86b89eda82696f9
Author: Tor Lillqvist 
AuthorDate: Wed Mar 25 09:40:51 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Mar 25 19:36:56 2020 +0100

Avoid CGContextSetLineWidth warning about negative line width

Change-Id: I82d37d0277e324e269674ed40592026e0097fa33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91027
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91031
Tested-by: Jenkins

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 4ca5eede4578..6489b33d1fd9 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -935,7 +935,12 @@ bool AquaSalGraphics::drawPolyLine(
 CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency );
 CGContextSetLineJoin( maContextHolder.get(), aCGLineJoin );
 CGContextSetLineCap( maContextHolder.get(), aCGLineCap );
-CGContextSetLineWidth( maContextHolder.get(), aLineWidth.getX() );
+
+// aLineWidth.getX() can be negative here. That causes a warning that 
shows up in the debugger.
+if (aLineWidth.getX() > 0)
+{
+CGContextSetLineWidth( maContextHolder.get(), aLineWidth.getX() );
+}
 CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit);
 CGContextDrawPath( maContextHolder.get(), kCGPathStroke );
 maContextHolder.restoreState();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-02-08 Thread Andrea Gelmini (via logerrit)
 vcl/quartz/salgdicommon.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cd053d44f3c23fdb25ae42e7581884ff25b62d7f
Author: Andrea Gelmini 
AuthorDate: Fri Feb 7 22:05:19 2020 +0100
Commit: Julien Nabet 
CommitDate: Sat Feb 8 09:32:04 2020 +0100

Fix typo

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

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 2f0ea1a061c2..c16af4f223e5 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -857,7 +857,7 @@ bool AquaSalGraphics::drawPolyLine(
 basegfx::utils::applyLineDashing(
 rPolyLine, // source
 *pStroke, // pattern
-, // traget for lines
+, // target for lines
 nullptr, // target for gaps
 fDotDashLength); // full length if available
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-01-03 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/ctfonts.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 67d5b5b3d16711956025df0a742fe06b7fb3d0f9
Author: Stephan Bergmann 
AuthorDate: Fri Jan 3 14:43:58 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 3 18:57:55 2020 +0100

Avoid -Werror,-Wdeprecated-enum-float-conversion

...with Clang 10 trunk:

> vcl/quartz/ctfonts.cxx:414:35: error: arithmetic between enumeration type 
'FontWeight' and floating-point type 'double' is deprecated 
[-Werror,-Wdeprecated-enum-float-conversion]
> nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - 
WEIGHT_NORMAL)/0.68));
> ~ ^ 
~~~

etc.  These computations had been introduced with
ea8422d42e838e7ddfeb8d9f77f3ecedecb29ce8 "Cherry-pick Core Text port from 
AOO",
and it looks like they indeed want to compute a suitable value in the
WEIGHT_THIN (=1), ..., WEIGHT_BLACK (=10) range of enum FontWeight, resp. 
the
WIDTH_ULRA_CONDENSED (=1), ..., WIDTH_ULTRA_EXPANDED (=9) range of enum
FontWidth (rather than, say, float values in the THIN = 50.0, ..., BLACK = 
200.0
constants range of css.awt.FontWeight, resp. the ULTRACONDENSED = 50.0, ...,
ULTRAEXPANDED = 200.0 constants range of css.awt.FontWidth).

Change-Id: I054e4e215331f84cea03de681aa4b0fb7c12eef5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86176
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 4f9657b993b4..b0e9e8f5644a 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -411,7 +411,7 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 
 if( fWeight > 0 )
 {
-nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - 
WEIGHT_NORMAL)/0.68));
+nInt = rint(int(WEIGHT_NORMAL) + fWeight * ((WEIGHT_BLACK - 
WEIGHT_NORMAL)/0.68));
 if( nInt > WEIGHT_BLACK )
 {
 nInt = WEIGHT_BLACK;
@@ -419,7 +419,7 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 }
 else if( fWeight < 0 )
 {
-nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_NORMAL - 
WEIGHT_THIN)/0.8));
+nInt = rint(int(WEIGHT_NORMAL) + fWeight * ((WEIGHT_NORMAL - 
WEIGHT_THIN)/0.8));
 if( nInt < WEIGHT_THIN )
 {
 nInt = WEIGHT_THIN;
@@ -443,7 +443,7 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 
 if( fWidth > 0 )
 {
-nInt = rint( WIDTH_NORMAL + fWidth * ((WIDTH_ULTRA_EXPANDED - 
WIDTH_NORMAL)/0.4));
+nInt = rint( int(WIDTH_NORMAL) + fWidth * ((WIDTH_ULTRA_EXPANDED - 
WIDTH_NORMAL)/0.4));
 if( nInt > WIDTH_ULTRA_EXPANDED )
 {
 nInt = WIDTH_ULTRA_EXPANDED;
@@ -451,7 +451,7 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 }
 else if( fWidth < 0 )
 {
-nInt = rint( WIDTH_NORMAL + fWidth * ((WIDTH_NORMAL - 
WIDTH_ULTRA_CONDENSED)/0.5));
+nInt = rint( int(WIDTH_NORMAL) + fWidth * ((WIDTH_NORMAL - 
WIDTH_ULTRA_CONDENSED)/0.5));
 if( nInt < WIDTH_ULTRA_CONDENSED )
 {
 nInt = WIDTH_ULTRA_CONDENSED;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2020-01-03 Thread Stephan Bergmann (via logerrit)
 vcl/quartz/salgdicommon.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5b8f505cd11517362b2c4a29c87d802a286a677d
Author: Stephan Bergmann 
AuthorDate: Fri Jan 3 14:39:46 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 3 18:09:49 2020 +0100

Avoid -Werror,-Wdeprecated-anon-enum-enum-conversion

...with Clang 10 trunk:

> vcl/quartz/salgdicommon.cxx:1299:59: error: bitwise operation between 
different enumeration types ('CGImageAlphaInfo' and '(anonymous enum at 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h:51:9)')
 is deprecated [-Werror,-Wdeprecated-anon-enum-enum-conversion]
>kCGImageAlphaNoneSkipFirst | 
kCGBitmapByteOrder32Big );
>~~ ^ 
~~~

 documents the "uint32_t bitmapInfo" 
parameter of
CGBitmapContextCreate as:  "The constants for specifying the alpha channel
information are declared with the CGImageAlphaInfo type but can be passed to
this parameter safely.  You can also pass the other constants associated 
with
the CGBitmapInfo type."

Change-Id: Idee410c65bd022a125a2f5a34cda007a8ca07580
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86175
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index c7cc31af..f5f1aba8b41a 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1296,7 +1296,7 @@ Color AquaSalGraphics::getPixel( long nX, long nY )
 CGContextRef xOnePixelContext =
 CGBitmapContextCreate( , 1, 1, 8, 32,
GetSalData()->mxRGBSpace,
-   kCGImageAlphaNoneSkipFirst | 
kCGBitmapByteOrder32Big );
+   uint32_t(kCGImageAlphaNoneSkipFirst) | 
uint32_t(kCGBitmapByteOrder32Big) );
 
 // update this graphics layer
 ApplyXorContext();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2019-10-14 Thread Julien Nabet (via logerrit)
 vcl/quartz/salgdi.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f1020c61e950b0ccca06d56df676a366907c0db2
Author: Julien Nabet 
AuthorDate: Mon Oct 14 21:39:19 2019 +0200
Commit: Julien Nabet 
CommitDate: Mon Oct 14 23:27:49 2019 +0200

Fix method name origin in SAL_WARN_IF(vcl/quartz/salgdi)

Change-Id: I7fff6af5e521318324df63b32d4be7b0e0f12771
Reviewed-on: https://gerrit.libreoffice.org/80803
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 0d5ecab6a419..8884d0bd9f3b 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -735,7 +735,7 @@ bool AquaSalGraphics::GetRawFontData( const 
PhysicalFontFace* pFontData,
 nOfs += nPrepSize;
 }
 
-SAL_WARN_IF( (nOfs!=nTotalSize), "vcl", "AquaSalGraphics::CreateFontSubset 
(nOfs!=nTotalSize)");
+SAL_WARN_IF( (nOfs!=nTotalSize), "vcl", "AquaSalGraphics::GetRawFontData 
(nOfs!=nTotalSize)");
 
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/quartz

2019-07-25 Thread Tor Lillqvist (via logerrit)
 vcl/quartz/salgdicommon.cxx |   14 --
 1 file changed, 14 deletions(-)

New commits:
commit 8d5164463a77f7957c26bc922689f45b394a2cf6
Author: Tor Lillqvist 
AuthorDate: Fri Mar 15 18:32:50 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 25 09:57:11 2019 +0200

tdf#124042: Remove unnecessary code for iOS

We don't need to pop the Core Graphics context state stack completely
before releasing the context. The code that tried to do that failed
anyway when the context was a "foreign" one (from doc_paintWindowDPI()
in core's init.cxx) thad had already been released there.

Also removed another apparently unnecessary ifndef for iOS.

Change-Id: Idcd1e6edd06ab259ec850fd66fcbabc3df0ae3af
Reviewed-on: https://gerrit.libreoffice.org/76263
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index d4d9ef7c2231..eee568533259 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1961,25 +1961,11 @@ void AquaSalGraphics::SetVirDevGraphics(CGLayerHolder 
const & rLayer, CGContextR
 mbPrinter = false;
 mbVirDev = true;
 
-#ifdef IOS
-(void) nBitmapDepth;
-
-if (!xContext)
-{
-// We will return early a few lines lower.
-// Undo the "stack initialization" done at the initial call of
-// this method, see end.
-maContextHolder.restoreState();
-}
-#endif
-
 // set graphics properties
 maLayer = rLayer;
 maContextHolder.set(xContext);
 
-#ifndef IOS
 mnBitmapDepth = nBitmapDepth;
-#endif
 
 #ifdef IOS
 mbForeignContext = xContext != NULL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/quartz

2019-06-04 Thread Tor Lillqvist (via logerrit)
 vcl/quartz/salgdicommon.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 9c8478d428293c6223c8d1bdd1e93f7729b6d952
Author: Tor Lillqvist 
AuthorDate: Tue Jun 4 18:58:56 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Jun 4 20:52:50 2019 +0300

tdf#11: Bin apparently unnecessary early return

Removing these few lines of code fixes the problem on iOS, and has no
apparent ill effect on macOS. But sure, I didn't check that thoroughly
on macOS, so in case this has a bad effect on macOS after all, need to
reinstate the few lines but make them #ifndef IOS.

(Still passes make check.)

Change-Id: I2380d010ba223a698acfe916fca4580a1502be98

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 333c23c93035..af70708eb0f2 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -587,12 +587,6 @@ bool AquaSalGraphics::drawAlphaBitmap( const SalTwoRect& 
rTR,
const SalBitmap& rSrcBitmap,
const SalBitmap& rAlphaBmp )
 {
-if (rTR.mnSrcWidth != rTR.mnDestWidth || rTR.mnSrcHeight != 
rTR.mnDestHeight)
-{
-// TODO - would be better to scale it by the native code
-return false;
-}
-
 // An image mask can't have a depth > 8 bits (should be 1 to 8 bits)
 if( rAlphaBmp.GetBitCount() > 8 )
 return false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/quartz

2019-06-02 Thread Xisco Fauli (via logerrit)
 vcl/quartz/salgdicommon.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 93477d1a963e38e3319013e43835a8ffef200972
Author: Xisco Fauli 
AuthorDate: Sat Jun 1 19:45:53 2019 +0200
Commit: Xisco Faulí 
CommitDate: Sun Jun 2 12:13:56 2019 +0200

tdf#125506: use rObjectToDevice if needed

Use same logic as in vcl/unx/generic/gdi/gdiimpl.cxx

Regression from 16091ff88aaab9ba9103c4e369bf79b97f431f40

See https://bugs.documentfoundation.org/show_bug.cgi?id=125506#c13
Thanks to Thorsten Wagner for pinpointing

Change-Id: I7a7a8c4b3355f5621ba1603939a3757cd03e
Reviewed-on: https://gerrit.libreoffice.org/73319
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 913d2ac43f19..333c23c93035 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -874,10 +874,15 @@ bool AquaSalGraphics::drawPolyLine(
 return false;
 #endif
 
+// need to check/handle LineWidth when ObjectToDevice transformation is 
used
+const basegfx::B2DVector aDeviceLineWidths(rObjectToDevice * rLineWidths);
+const bool bCorrectLineWidth(aDeviceLineWidths.getX() < 1.0 && 
rLineWidths.getX() >= 1.0);
+const basegfx::B2DVector aLineWidths(bCorrectLineWidth ? rLineWidths : 
aDeviceLineWidths);
+
 // #i101491# Aqua does not support B2DLineJoin::NONE; return false to use
 // the fallback (own geometry preparation)
 // #i104886# linejoin-mode and thus the above only applies to "fat" lines
-if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (rLineWidths.getX() > 
1.3) )
+if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (aLineWidths.getX() > 
1.3) )
 return false;
 
 // Transform to DeviceCoordinates, get DeviceLineWidth, execute 
PixelSnapHairline
@@ -946,7 +951,7 @@ bool AquaSalGraphics::drawPolyLine(
 CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency );
 CGContextSetLineJoin( maContextHolder.get(), aCGLineJoin );
 CGContextSetLineCap( maContextHolder.get(), aCGLineCap );
-CGContextSetLineWidth( maContextHolder.get(), rLineWidths.getX() );
+CGContextSetLineWidth( maContextHolder.get(), aLineWidths.getX() );
 CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit);
 SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << 
",kCGPathStroke)" );
 CGContextDrawPath( maContextHolder.get(), kCGPathStroke );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/quartz

2019-05-31 Thread Xisco Fauli (via logerrit)
 vcl/quartz/salgdicommon.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 16091ff88aaab9ba9103c4e369bf79b97f431f40
Author: Xisco Fauli 
AuthorDate: Fri May 31 12:24:25 2019 +0200
Commit: Katarina Behrens 
CommitDate: Fri May 31 14:31:00 2019 +0200

tdf#125506 tdf#121241: No need to transform to DeviceCoordinates

Regression from b9fa01a8d1137a95af9865a3e47995734c40da6e

Change-Id: Ie4ab65966e274bff4d699b7cd4dc0fd47d26c558
Reviewed-on: https://gerrit.libreoffice.org/73249
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 05e84b98b810..913d2ac43f19 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -874,19 +874,17 @@ bool AquaSalGraphics::drawPolyLine(
 return false;
 #endif
 
-// Transform to DeviceCoordinates, get DeviceLineWidth, execute 
PixelSnapHairline
-const basegfx::B2DVector aLineWidths(rObjectToDevice * rLineWidths);
-
 // #i101491# Aqua does not support B2DLineJoin::NONE; return false to use
 // the fallback (own geometry preparation)
 // #i104886# linejoin-mode and thus the above only applies to "fat" lines
-if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (aLineWidths.getX() > 
1.3) )
+if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (rLineWidths.getX() > 
1.3) )
 return false;
 
 // Transform to DeviceCoordinates, get DeviceLineWidth, execute 
PixelSnapHairline
 basegfx::B2DPolygon aPolyLine(rPolyLine);
 aPolyLine.transform(rObjectToDevice);
-if(bPixelSnapHairline) { aPolyLine = 
basegfx::utils::snapPointsOfHorizontalOrVerticalEdges(aPolyLine); }
+if(bPixelSnapHairline)
+aPolyLine = 
basegfx::utils::snapPointsOfHorizontalOrVerticalEdges(aPolyLine);
 
 // setup line attributes
 CGLineJoin aCGLineJoin = kCGLineJoinMiter;
@@ -948,7 +946,7 @@ bool AquaSalGraphics::drawPolyLine(
 CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency );
 CGContextSetLineJoin( maContextHolder.get(), aCGLineJoin );
 CGContextSetLineCap( maContextHolder.get(), aCGLineCap );
-CGContextSetLineWidth( maContextHolder.get(), aLineWidths.getX() );
+CGContextSetLineWidth( maContextHolder.get(), rLineWidths.getX() );
 CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit);
 SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << 
",kCGPathStroke)" );
 CGContextDrawPath( maContextHolder.get(), kCGPathStroke );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/quartz

2019-05-08 Thread Tomaž Vajngerl (via logerrit)
 vcl/quartz/salbmp.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 558c8bd9d5c5910e3290049e08fc7c3280151fd4
Author: Tomaž Vajngerl 
AuthorDate: Wed May 8 22:43:00 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed May 8 23:17:17 2019 +0200

Add some comments to macOS backend impl. of SalBitmap

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

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 3d7af959b90d..c47151f137b7 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -908,6 +908,7 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
 reinterpret_cast()[3] = nMaskColor.GetBlue();
 
 sal_uInt8* pSource = m_pUserBuffer.get();
+// First to nY on y-axis, as that is our starting point (sub-image)
 if( nY )
 pSource += nY * mnBytesPerRow;
 
@@ -915,7 +916,7 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
 while( y-- )
 {
 pSourcePixels->StartLine( pSource );
-pSourcePixels->SkipPixel(nX);
+pSourcePixels->SkipPixel(nX); // Skip on x axis to nX
 sal_uInt32 x = nWidth;
 while( x-- )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/quartz

2019-03-15 Thread Libreoffice Gerrit user
 vcl/quartz/salgdicommon.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 3140194a85fe4a6ac69c8cddc4d3b019430cd6e8
Author: Tor Lillqvist 
AuthorDate: Fri Mar 15 18:18:38 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Mar 15 18:43:42 2019 +0200

tdf#124042: If mrContext is zero, calling Core Graphics APIs on it is futile

If mrContext is zero, the CG calls using it won't do anything and will
cause "invalid context" warnings when running under Xcode. So just
return early. Such calls to drawPolyPolygon() are apparently not
essential but accidental and of no real use. Possibly related to bogus
"focus" indicator painting. Which does not make sense on iOS as we
aren't drawing to any actual "windows" with "focus".

Change-Id: Icc4a768d8b255c09a8972551443ce59f4ad56089

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index ab8065f9f401..772c538c7a5d 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -966,6 +966,11 @@ bool AquaSalGraphics::drawPolyPolygon(
 const basegfx::B2DPolyPolygon& rPolyPolygon,
 double fTransparency)
 {
+#ifdef IOS
+if (!mrContext)
+return true;
+#endif
+
 // short circuit if there is nothing to do
 if( rPolyPolygon.count() == 0 )
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: vcl/quartz

2019-02-01 Thread Libreoffice Gerrit user
 vcl/quartz/salgdi.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 3430192b9c9cc04f7aa46329c84b667f93c9ef39
Author: Noel Grandin 
AuthorDate: Thu Jan 31 16:49:40 2019 +0100
Commit: Noel Grandin 
CommitDate: Fri Feb 1 16:37:31 2019 +0100

remove unnecessary SAL_WARN

none of other backends warn about this

Change-Id: I9b7ceba413d15698a28806cbb35bd02ccc6e9585
Reviewed-on: https://gerrit.libreoffice.org/67229
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 8a7a69890cd5..1331c229166e 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -425,10 +425,7 @@ void AquaSalGraphics::DrawTextLayout(const 
GenericSalLayout& rLayout)
 }
 
 if (aGlyphIds.empty())
-{
-SAL_WARN("vcl.quartz", "aGlyphIds is empty!?");
 return;
-}
 
 assert(aGlyphIds.size() == aGlyphPos.size());
 #if 0
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-12-26 Thread Libreoffice Gerrit user
 vcl/quartz/salbmp.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 993913469e74e9db9743004bbe36aa412411671c
Author: Tor Lillqvist 
AuthorDate: Wed Dec 26 13:31:16 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Dec 26 13:31:16 2018 +0200

Add some pondering about code of questionable provenance in a comment

Change-Id: I20b3c8ba0ae4018307a97150440c708cfa3edc40

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 34fd42caf2ad..791844632267 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -955,6 +955,11 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& 
rData )
 {
 /**
  * We need to hack things because VCL does not use 
kCGBitmapByteOrder32Host, while Cairo requires it.
+ *
+ * Not sure what the above comment means. We don't use Cairo on 
macOS or iOS.
+ *
+ * This whole if statement was originally (before 2011) inside 
#ifdef CAIRO. Did we use Cairo on Mac back then?
+ * Anyway, nowadays (since many years, I think) we don't, so 
should this if statement be dropped? Fun.
  */
 SAL_INFO("vcl.cg", "QuartzSalBitmap::" << __func__ << "(): 
kCGBitmapByteOrder32Host not found => inserting it.");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-12-20 Thread Libreoffice Gerrit user
 vcl/quartz/salgdiutils.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 4a170d29eb35f288b1c66d810bb17ee0f3ddecc6
Author: Tor Lillqvist 
AuthorDate: Fri Dec 21 01:01:47 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Dec 21 01:01:47 2018 +0200

Bin unnecessary #ifdef, this file is for macOS only

Change-Id: Ia969648653b71e441446c38c4bed632ff1e53cc6

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 30c5755d1efd..ba94be73f132 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -152,9 +152,6 @@ bool AquaSalGraphics::CheckContext()
 const int nBytesPerRow = (nBitmapDepth * mnWidth) / 8;
 void* pRawData = std::malloc(nBytesPerRow * mnHeight);
 const int nFlags = kCGImageAlphaNoneSkipFirst;
-#ifndef MACOSX
-nFlags |= kCGImageByteOrder32Little;
-#endif
 mrContext = CGBitmapContextCreate(pRawData, mnWidth, mnHeight, 
8, nBytesPerRow,
   GetSalData()->mxRGBSpace, 
nFlags);
 SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << mnWidth << "x" 
<< mnHeight
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-12-11 Thread Libreoffice Gerrit user
 vcl/quartz/salvd.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 016746b9a9b85114560dead3ee226e4483a0d564
Author: Tor Lillqvist 
AuthorDate: Tue Dec 11 20:41:09 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Dec 11 20:41:09 2018 +0200

Adapt MACOSX/IOS ifdef for the now constness of the nFlags variable

Change-Id: Ic6c51cdc219e663c59dee32f61e337709c90fbd2

diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 96a64ae765b5..0fe4e7f923d3 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -276,9 +276,10 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
 
 const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
 void* pRawData = std::malloc( nBytesPerRow * nDY );
+#ifdef MACOSX
 const int nFlags = kCGImageAlphaNoneSkipFirst;
-#ifndef MACOSX
-nFlags |= kCGImageByteOrder32Little;
+#else
+const int nFlags = kCGImageAlphaNoneSkipFirst | 
kCGImageByteOrder32Little;
 #endif
 mxBitmapContext = CGBitmapContextCreate(pRawData, nDX, nDY, 8, 
nBytesPerRow,
 GetSalData()->mxRGBSpace, 
nFlags);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-12-11 Thread Libreoffice Gerrit user
 vcl/quartz/salvd.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7c35d5f0669f461254668c1854291e1324b37c21
Author: Tor Lillqvist 
AuthorDate: Tue Dec 11 19:37:54 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Dec 11 19:37:54 2018 +0200

Comment out an assertion that fails every time for me on macOS

Change-Id: I458f44d16b242700b228db647582c4b40b14661a

diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 5f2422d6f455..ee1f5e61f96f 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -273,7 +273,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 if (!xCGContext)
 {
-assert(Application::IsBitmapRendering());
+// assert(Application::IsBitmapRendering());
 mnBitmapDepth = 32;
 
 const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-12-11 Thread Libreoffice Gerrit user
 vcl/quartz/salgdiutils.cxx |  100 +
 vcl/quartz/salvd.cxx   |   43 +++
 2 files changed, 73 insertions(+), 70 deletions(-)

New commits:
commit b14371703236160bf34480ef831e9b2244e140ee
Author: Jan-Marek Glogowski 
AuthorDate: Tue Dec 11 10:48:44 2018 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Tue Dec 11 15:49:42 2018 +0100

OSX always fall back to a bitmap context

I'm not sure this is the best idea, but without a context many
things will definitly break. In theory this is just needed for
bitmap-only rendering mode.

This is a more general solution of commit e659c6a1857f ("Work
around odd macOS 10.14 graphicsContextWithWindow failure").

Change-Id: I3708c25b302a38e1b0c0cccbcacd6cb9b5ff33dc
Reviewed-on: https://gerrit.libreoffice.org/64952
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 6ef9a2430c29..2218d3e936a4 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -94,13 +94,12 @@ void AquaSalGraphics::UnsetState()
  */
 bool AquaSalGraphics::CheckContext()
 {
-if( mbWindow && mpFrame && mpFrame->getNSWindow() )
+if (mbWindow && mpFrame && (mpFrame->getNSWindow() || 
Application::IsBitmapRendering()))
 {
 const unsigned int nWidth = mpFrame->maGeometry.nWidth;
 const unsigned int nHeight = mpFrame->maGeometry.nHeight;
 
-CGContextRef rReleaseContext = nullptr;
-CGLayerRef   rReleaseLayer = nullptr;
+CGLayerRef rReleaseLayer = nullptr;
 
 // check if a new drawing context is needed (e.g. after a resize)
 if( (unsigned(mnWidth) != nWidth) || (unsigned(mnHeight) != nHeight) )
@@ -108,62 +107,77 @@ bool AquaSalGraphics::CheckContext()
 mnWidth = nWidth;
 mnHeight = nHeight;
 // prepare to release the corresponding resources
-rReleaseContext = mrContext;
-rReleaseLayer   = mxLayer;
+if (mxLayer)
+rReleaseLayer = mxLayer;
+else if (mrContext)
+{
+SAL_INFO("vcl.cg", "CGContextRelease(" << mrContext << ")");
+CGContextRelease(mrContext);
+}
 mrContext = nullptr;
 mxLayer = nullptr;
 }
 
-if( !mrContext )
+if (!mrContext)
 {
-const CGSize aLayerSize = { static_cast(nWidth), 
static_cast(nHeight) };
-NSGraphicsContext* pNSGContext = [NSGraphicsContext 
graphicsContextWithWindow: mpFrame->getNSWindow()];
+if (mpFrame->getNSWindow())
+{
+const CGSize aLayerSize = { static_cast(nWidth), 
static_cast(nHeight) };
+NSGraphicsContext* pNSGContext = [NSGraphicsContext 
graphicsContextWithWindow: mpFrame->getNSWindow()];
 SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'graphicsPort' is deprecated: first 
deprecated in macOS 10.14
-CGContextRef xCGContext = static_cast([pNSGContext 
graphicsPort]);
+CGContextRef xCGContext = 
static_cast([pNSGContext graphicsPort]);
 SAL_WNODEPRECATED_DECLARATIONS_POP
-mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, 
nullptr );
-SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << 
"," << aLayerSize << ",NULL) = " << mxLayer );
-if( mxLayer )
-{
-mrContext = CGLayerGetContext( mxLayer );
-SAL_INFO( "vcl.cg", "CGLayerGetContext(" << mxLayer << ") = " 
<< mrContext );
-}
+mxLayer = CGLayerCreateWithContext(xCGContext, aLayerSize, 
nullptr);
+SAL_INFO("vcl.cg", "CGLayerCreateWithContext(" << xCGContext 
<< "," << aLayerSize << ",NULL) = " << mxLayer);
+if (mxLayer)
+{
+mrContext = CGLayerGetContext( mxLayer );
+SAL_INFO( "vcl.cg", "CGLayerGetContext(" << mxLayer << ") 
= " << mrContext );
+}
 
-if( mrContext )
-{
-// copy original layer to resized layer
-if( rReleaseLayer )
+if (rReleaseLayer)
 {
-SAL_INFO( "vcl.cg", "CGContextDrawLayerAtPoint(" << 
mrContext << "," << CGPointZero << "," << rReleaseLayer << ")" );
-CGContextDrawLayerAtPoint( mrContext, CGPointZero, 
rReleaseLayer );
+// copy original layer to resized layer
+if (mrContext)
+{
+SAL_INFO("vcl.cg", "CGContextDrawLayerAtPoint(" << 
mrContext << "," << CGPointZero << "," << rReleaseLayer << ")");
+CGContextDrawLayerAtPoint(mrContext, CGPointZero, 
rReleaseLayer);
+}
+SAL_INFO("vcl.cg", "CGLayerRelease(" << rReleaseLayer << 
")");

[Libreoffice-commits] core.git: vcl/quartz

2018-11-08 Thread Libreoffice Gerrit user
 vcl/quartz/salgdicommon.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7e0bfbd763fec8640b4c6e34abf86d5bca12466b
Author: Armin Le Grand 
AuthorDate: Thu Nov 8 15:36:37 2018 +0100
Commit: Armin Le Grand 
CommitDate: Thu Nov 8 17:36:18 2018 +0100

tdf#120252 use the already transformed PolyPolygon

Change-Id: I38abc73116720b99364c3de9fa4378c730385dc2
Reviewed-on: https://gerrit.libreoffice.org/63104
Reviewed-by: Xisco Faulí 
Tested-by: Xisco Faulí 
Reviewed-by: Armin Le Grand 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 43714cbae3d3..6d66c7e7556c 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -981,7 +981,9 @@ bool AquaSalGraphics::drawPolyPolygon(
 // setup poly-polygon path
 CGMutablePathRef xPath = CGPathCreateMutable();
 SAL_INFO( "vcl.cg", "CGPathCreateMutable() = " << xPath );
-for(auto const& rPolygon : rPolyPolygon)
+// tdf#120252 Use the correct, already transformed PolyPolygon (as long as
+// the transformation is not used here...)
+for(auto const& rPolygon : aPolyPolygon)
 {
 AddPolygonToPath( xPath, rPolygon, true, !getAntiAliasB2DDraw(), 
IsPenVisible() );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-11-06 Thread Libreoffice Gerrit user
 vcl/quartz/salvd.cxx |   12 
 1 file changed, 12 deletions(-)

New commits:
commit 178f5210e658325a705dda675c7d0c05421eea9f
Author: Tor Lillqvist 
AuthorDate: Tue Nov 6 15:06:21 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Nov 6 16:56:23 2018 +0100

Bin more no longer needed dbgutil code

It was used to initialise a virtual device pixel buffer to an
"interesting" pattern, in case actual rendering to it failed. But it
hasn't been needed in a while. And similar code can always be added
temporarily if needed, no need to keep permanently, even in #ifdef
DBG_UTIL.

Change-Id: I650afcb811b903ce3d6d50b9f1eb38c83be68df5
Reviewed-on: https://gerrit.libreoffice.org/62962
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 333276678b57..5f4c1337d9b8 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -283,12 +283,6 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
 void* pRawData = std::malloc( nBytesPerRow * nDY );
-#ifdef DBG_UTIL
-for (ssize_t i = 0; i < nBytesPerRow * nDY; i++)
-{
-static_cast(pRawData)[i] = (i & 0xFF);
-}
-#endif
 mxBitmapContext = CGBitmapContextCreate( pRawData, nDX, nDY,
  8, nBytesPerRow, 
GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst );
 SAL_INFO( "vcl.cg",  "CGBitmapContextCreate(" << nDX << "x" << 
nDY << "x32) = " << mxBitmapContext );
@@ -300,12 +294,6 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
 void* pRawData = std::malloc( nBytesPerRow * nDY );
-#ifdef DBG_UTIL
-for (ssize_t i = 0; i < nBytesPerRow * nDY; i++)
-{
-((sal_uInt8*)pRawData)[i] = (i & 0xFF);
-}
-#endif
 mxBitmapContext = CGBitmapContextCreate( pRawData, nDX, nDY,
  8, nBytesPerRow, 
GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst | 
kCGImageByteOrder32Little );
 SAL_INFO( "vcl.cg",  "CGBitmapContextCreate(" << nDX << "x" << nDY << 
"x32) = " << mxBitmapContext );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-10-30 Thread Libreoffice Gerrit user
 vcl/quartz/salgdicommon.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0ea92ad5332ddb6583c82275071c3be3939ebf28
Author: Andrea Gelmini 
AuthorDate: Tue Oct 30 16:15:26 2018 +0100
Commit: Julien Nabet 
CommitDate: Tue Oct 30 19:40:40 2018 +0100

Fix typo

Change-Id: I1d00e975eaf85b5233755abefb952ca1eeacbb4e
Reviewed-on: https://gerrit.libreoffice.org/62630
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 4a8419b8b20d..43714cbae3d3 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1401,7 +1401,7 @@ void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, 
sal_Int32& rDPIY )
 rDPIX = mnRealDPIX;
 rDPIY = mnRealDPIY;
 #else
-// This *must* be 96 or else the iOS app will behave very nadly (tiles are 
scaled wrongly and
+// This *must* be 96 or else the iOS app will behave very badly (tiles are 
scaled wrongly and
 // don't match each others at their boundaries, and other issues). But 
*why* it must be 96 I
 // have no idea. The commit that changed it to 96 from (the arbitrary) 200 
did not say. If you
 // know where else 96 is explicitly or implicitly hard-coded, please 
modify this comment.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-10-30 Thread Libreoffice Gerrit user
 vcl/quartz/salgdicommon.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit b9e4bb65bcd7600f8e9150aa18ecd2527646ae05
Author: Tor Lillqvist 
AuthorDate: Tue Oct 30 15:12:14 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Oct 30 15:47:28 2018 +0200

Add comment about AquaSalGraphics::GetResolution() returning a DPI of 96

Change-Id: I3b89cb6c24c263a1a8ea4e249ab24256a7d6f3f7

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 549ad3e33f5b..4a8419b8b20d 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -1401,6 +1401,10 @@ void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, 
sal_Int32& rDPIY )
 rDPIX = mnRealDPIX;
 rDPIY = mnRealDPIY;
 #else
+// This *must* be 96 or else the iOS app will behave very nadly (tiles are 
scaled wrongly and
+// don't match each others at their boundaries, and other issues). But 
*why* it must be 96 I
+// have no idea. The commit that changed it to 96 from (the arbitrary) 200 
did not say. If you
+// know where else 96 is explicitly or implicitly hard-coded, please 
modify this comment.
 rDPIX = rDPIY = 96;
 #endif
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-10-25 Thread Libreoffice Gerrit user
 vcl/quartz/salgdi.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c799679135882337e65eab23eabdcae2d8b42786
Author: Tor Lillqvist 
AuthorDate: Thu Oct 25 17:35:37 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Oct 25 17:35:37 2018 +0300

Need 

Change-Id: I416523b701f6468bcbbc47e9e4e507c319b6beaa

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index eaf1d2b9c273..fc600660c935 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-10-08 Thread Libreoffice Gerrit user
 vcl/quartz/salvd.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit e659c6a1857fbb8e5a6e8ff60fe241483eea32dd
Author: Stephan Bergmann 
AuthorDate: Mon Oct 8 11:21:45 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Oct 8 13:36:58 2018 +0200

Work around odd macOS 10.14 graphicsContextWithWindow failure

When running on macOS 10.14, both master and libreoffice-6-1 (at least) 
started
to fail CppunitTest_vcl_bitmap_render_test with

> 
/Users/stephan/Software/lo2/core/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx:90:
 Assertion
> Test name: BitmapRenderTest::testTdf113918
> equality assertion failed
> - Expected: mcBlueOrIndex: 255, mcGreen: 255, mcRed: 255, mcAlpha: 0
> - Actual  : mcBlueOrIndex: 1, mcGreen: 112, mcRed: 15, mcAlpha: 0

in --enable-debug/--enable-dbgutil builds.

I tracked that down to the OSL_DEBUG_LEVEL>0--only call to
Scheduler::ProcessEventsToIdle in test::BootstrapFixture::setUp
(test/source/bootstrapfixture.cxx).  If that call is also included in 
non-debug
(i.e., OSL_DEBUG_LEVEL=0) builds, or if it is removed from all builds and
instead an unsuspecting

  [NSApp nextEventMatchingMask: 0 untilDate: nil inMode: 
NSDefaultRunLoopMode dequeue: NO];

is added directly before the call to

  pVDev->SetOutputSizePixel(Size(2480, 3508));

at the start of BitmapRenderTest::testTdf113918
(vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx:76), the test always 
fails.

What happens is that, after such a nextEventMatchingMask call done, the 
call to
NSGraphicsContext graphicsContextWithWindow in 
AquaSalVirtualDevice::SetSize (as
called from the SetOutputSizePixel call in the test) returns nil, for 
unclear
reasons.

Until those underlying reasons are understood, change the code of SetSize to
"fall back to a bitmap context" also in case the graphicsContextWithWindow 
call
returned nil.

Change-Id: I604ebd2c444b58610e4ed73ec70af87b0a08e864
Reviewed-on: https://gerrit.libreoffice.org/61519
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 77fee8f13d8a..8de6d38ee52d 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -273,7 +273,14 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
 xCGContext = [pNSContext CGContext];
 }
 }
-else
+// At least on macOS 10.14 during CppunitTests (that have hidden 
windows), it happens
+// that the above
+//
+//   [NSGraphicsContext graphicsContextWithWindow: pNSWindow]
+//
+// returns nil for unclear reasons; so use the below fallback even 
if there is a
+// pNSWindow but obtaining a graphics context for it fails:
+if (xCGContext == nullptr)
 {
 // fall back to a bitmap context
 mnBitmapDepth = 32;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-10-03 Thread Libreoffice Gerrit user
 vcl/quartz/salbmp.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit f5775505396e5459561883d5a1b9f091f84161d8
Author: Tor Lillqvist 
AuthorDate: Wed Oct 3 11:25:01 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Oct 3 11:41:50 2018 +0300

We need to include  here

Change-Id: I9670407cd9e848d208f844f6d0879a5a19b86f4c

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 94c02fd92aee..8f3b9e3492ca 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -24,6 +24,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-10-02 Thread Libreoffice Gerrit user
 vcl/quartz/salgdi.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 4e1b526f35abe6a0a01edaa72f9134cb878d4945
Author: Tor Lillqvist 
AuthorDate: Tue Oct 2 18:26:41 2018 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Oct 2 21:12:07 2018 +0300

We shouldn't call DrawTextLayout() without a context on iOS

Change-Id: I3e72909ca1aa9f97721d982f16624f496152ae2d

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 43ca506220c9..36569d626d3b 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -393,6 +393,14 @@ bool AquaSalGraphics::GetGlyphBoundRect(const GlyphItem& 
rGlyph, tools::Rectangl
 
 void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
 {
+#ifdef IOS
+if (!CheckContext())
+{
+SAL_WARN("vcl.cg", "AquaSalGraphics::DrawTextLayout() without 
context");
+return;
+}
+#endif
+
 const CoreTextStyle& rStyle = *static_cast(());
 const FontSelectPattern& rFontSelect = rStyle.GetFontSelectPattern();
 if (rFontSelect.mnHeight == 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-09-20 Thread Libreoffice Gerrit user
 vcl/quartz/salbmp.cxx |   26 +++---
 1 file changed, 11 insertions(+), 15 deletions(-)

New commits:
commit be30b7616cef6efa607eba00f52c8192759f7099
Author: Noel Grandin 
AuthorDate: Sat Sep 15 21:49:40 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 20 15:42:59 2018 +0200

loplugin:useuniqueptr in ImplPixelFormat

Change-Id: If116578f68438550bddab5d2257b9af4ec8a69b0
Reviewed-on: https://gerrit.libreoffice.org/60705
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index b46a7f174168..94c02fd92aee 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -348,7 +348,7 @@ namespace {
 class ImplPixelFormat
 {
 public:
-static ImplPixelFormat* GetFormat( sal_uInt16 nBits, const BitmapPalette& 
rPalette );
+static std::unique_ptr GetFormat( sal_uInt16 nBits, const 
BitmapPalette& rPalette );
 
 virtual void StartLine( sal_uInt8* pLine ) = 0;
 virtual void SkipPixel( sal_uInt32 nPixel ) = 0;
@@ -572,16 +572,16 @@ public:
 }
 };
 
-ImplPixelFormat* ImplPixelFormat::GetFormat( sal_uInt16 nBits, const 
BitmapPalette& rPalette )
+std::unique_ptr ImplPixelFormat::GetFormat( sal_uInt16 nBits, 
const BitmapPalette& rPalette )
 {
 switch( nBits )
 {
-case 1: return new ImplPixelFormat1( rPalette );
-case 4: return new ImplPixelFormat4( rPalette );
-case 8: return new ImplPixelFormat8( rPalette );
-case 16: return new ImplPixelFormat16;
-case 24: return new ImplPixelFormat24;
-case 32: return new ImplPixelFormat32;
+case 1: return o3tl::make_unique( rPalette );
+case 4: return o3tl::make_unique( rPalette );
+case 8: return o3tl::make_unique( rPalette );
+case 16: return o3tl::make_unique();
+case 24: return o3tl::make_unique();
+case 32: return o3tl::make_unique();
 default:
 assert(false);
 return nullptr;
@@ -635,8 +635,8 @@ void QuartzSalBitmap::ConvertBitmapData( sal_uInt32 nWidth, 
sal_uInt32 nHeight,
 {
 // TODO: this implementation is for clarity, not for speed
 
-ImplPixelFormat* pD = ImplPixelFormat::GetFormat( nDestBits, 
rDestPalette );
-ImplPixelFormat* pS = ImplPixelFormat::GetFormat( nSrcBits, 
rSrcPalette );
+std::unique_ptr pD = ImplPixelFormat::GetFormat( 
nDestBits, rDestPalette );
+std::unique_ptr pS = ImplPixelFormat::GetFormat( 
nSrcBits, rSrcPalette );
 
 if( pD && pS )
 {
@@ -655,8 +655,6 @@ void QuartzSalBitmap::ConvertBitmapData( sal_uInt32 nWidth, 
sal_uInt32 nHeight,
 pDestData += nDestBytesPerRow;
 }
 }
-delete pS;
-delete pD;
 }
 }
 
@@ -940,7 +938,7 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
 std::unique_ptr pMaskBuffer(new (std::nothrow) 
sal_uInt32[ nHeight * nDestBytesPerRow / 4] );
 sal_uInt32* pDest = pMaskBuffer.get();
 
-ImplPixelFormat* pSourcePixels = ImplPixelFormat::GetFormat( mnBits, 
maPalette );
+std::unique_ptr pSourcePixels = 
ImplPixelFormat::GetFormat( mnBits, maPalette );
 
 if( pMaskBuffer && pSourcePixels )
 {
@@ -972,8 +970,6 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
 SAL_INFO("vcl.cg", "CGImageCreate(" << nWidth << "x" << nHeight << 
"x8) = " << xMask );
 CFRelease(xDataProvider);
 }
-
-delete pSourcePixels;
 }
 return xMask;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-09-20 Thread Libreoffice Gerrit user
 vcl/quartz/salbmp.cxx |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 6d0d6a875867c823603f5947f7a035601042f903
Author: Noel Grandin 
AuthorDate: Sat Sep 15 21:18:22 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 20 08:19:13 2018 +0200

loplugin:useuniqueptr in QuartzSalBitmap::CreateColorMask

Change-Id: I7fbebf3730aa79209a3ad954522ad8695e5d8c24
Reviewed-on: https://gerrit.libreoffice.org/60704
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index e8df35c712bf..b46a7f174168 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -937,8 +937,8 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
 if (m_pUserBuffer.get() && (nX + nWidth <= mnWidth) && (nY + nHeight <= 
mnHeight))
 {
 const sal_uInt32 nDestBytesPerRow = nWidth << 2;
-sal_uInt32* pMaskBuffer = static_cast( std::malloc( 
nHeight * nDestBytesPerRow ) );
-sal_uInt32* pDest = pMaskBuffer;
+std::unique_ptr pMaskBuffer(new (std::nothrow) 
sal_uInt32[ nHeight * nDestBytesPerRow / 4] );
+sal_uInt32* pDest = pMaskBuffer.get();
 
 ImplPixelFormat* pSourcePixels = ImplPixelFormat::GetFormat( mnBits, 
maPalette );
 
@@ -967,15 +967,11 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int 
nY, int nWidth,
 pSource += mnBytesPerRow;
 }
 
-CGDataProviderRef xDataProvider( 
CGDataProviderCreateWithData(nullptr, pMaskBuffer, nHeight * nDestBytesPerRow, 
) );
+CGDataProviderRef xDataProvider( 
CGDataProviderCreateWithData(nullptr, pMaskBuffer.release(), nHeight * 
nDestBytesPerRow, ) );
 xMask = CGImageCreate(nWidth, nHeight, 8, 32, nDestBytesPerRow, 
GetSalData()->mxRGBSpace, kCGImageAlphaPremultipliedFirst, xDataProvider, 
nullptr, true, kCGRenderingIntentDefault);
 SAL_INFO("vcl.cg", "CGImageCreate(" << nWidth << "x" << nHeight << 
"x8) = " << xMask );
 CFRelease(xDataProvider);
 }
-else
-{
-free(pMaskBuffer);
-}
 
 delete pSourcePixels;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-09-19 Thread Libreoffice Gerrit user
 vcl/quartz/utils.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 21614aadc2b7a7bb6d2e00a5a081d8d233e4384b
Author: Noel Grandin 
AuthorDate: Sat Sep 15 17:28:30 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 19 09:59:38 2018 +0200

use unique_ptr in GetOUString

Change-Id: If229508c3d6cb57b0a52a1f0d9ecd3b82d9f1760
Reviewed-on: https://gerrit.libreoffice.org/60699
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index bbb29170a8b5..0e0ac8f4d90a 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -46,12 +46,11 @@ OUString GetOUString( CFStringRef rStr )
 return OUString( reinterpret_cast(pConstStr), 
nLength );
 }
 
-UniChar* pStr = static_cast( std::malloc( 
sizeof(UniChar)*nLength ) );
+std::unique_ptr pStr(new UniChar[nLength]);
 CFRange aRange = { 0, nLength };
-CFStringGetCharacters( rStr, aRange, pStr );
+CFStringGetCharacters( rStr, aRange, pStr.get() );
 
-OUString aRet( reinterpret_cast(pStr), nLength );
-std::free( pStr );
+OUString aRet( reinterpret_cast(pStr.get()), nLength );
 return aRet;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-08-21 Thread Libreoffice Gerrit user
 vcl/quartz/salgdi.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 29140ebaa7226ddab129010bd16306ffeeb13efc
Author: Caolán McNamara 
AuthorDate: Tue Aug 21 08:53:11 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 21 14:53:34 2018 +0200

only need FontSelectPatternAttributes here

Change-Id: I5112b1e6db223a3df83b6769af140b3f698fdebd
Reviewed-on: https://gerrit.libreoffice.org/59384
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 428b5c5daf10..e586ccb6c19f 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -402,7 +402,7 @@ bool AquaSalGraphics::GetGlyphBoundRect(const GlyphItem& 
rGlyph, tools::Rectangl
 void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
 {
 const CoreTextStyle& rStyle = *static_cast(());
-const FontSelectPattern& rFontSelect = rStyle.GetFontSelectPattern();
+const FontSelectPatternAttributes& rFontSelect = 
rStyle.GetFontSelectPattern();
 if (rFontSelect.mnHeight == 0)
 return;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-06-29 Thread Tor Lillqvist
 vcl/quartz/salgdi.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 35189d1ebf74e88bd349eaaebc23b78e6fceee56
Author: Tor Lillqvist 
Date:   Fri Jun 29 09:45:25 2018 +0300

This cast seems completely unnecessary to me?

Change-Id: I93a135afc1402d9095828c4d41d669471a37f565
Reviewed-on: https://gerrit.libreoffice.org/56661
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index e9522835a8f1..025e273ef272 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -116,7 +116,7 @@ CoreTextFontFace::~CoreTextFontFace()
 
 sal_IntPtr CoreTextFontFace::GetFontId() const
 {
-return static_cast(mnFontId);
+return mnFontId;
 }
 
 const FontCharMapRef CoreTextFontFace::GetFontCharMap() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-06-29 Thread Bartosz Kosiorek
 vcl/quartz/salbmp.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 054a3586bb4808728a5cd58ea8a867539c08e55c
Author: Bartosz Kosiorek 
Date:   Thu Jun 28 09:52:50 2018 +0200

tdf#117335 Fix displaying GIF images

To fix regression the sal_uInt16 was used instead of sal_uInt8.
Verified on macOS High Sierra 10.13.5.
I also checked if with this fix, there is no issue with displaying EMF 
(tdf#113197)
Sample document from tdf#113197 is displaying correctly.

Change-Id: I6504717d831a193b0a878ced2f335d34a993aed6
Reviewed-on: https://gerrit.libreoffice.org/56578
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
Reviewed-by: Bartosz Kosiorek 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 7146461c7af1..d7de93591f8a 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -438,13 +438,13 @@ class ImplPixelFormat8 : public ImplPixelFormat
 private:
 sal_uInt8* pData;
 const BitmapPalette& mrPalette;
-const sal_uInt8 mnPaletteCount;
+const sal_uInt16 mnPaletteCount;
 
 public:
 explicit ImplPixelFormat8( const BitmapPalette& rPalette )
 : pData(nullptr)
 , mrPalette(rPalette)
-, mnPaletteCount(static_cast< sal_uInt8 >(rPalette.GetEntryCount()))
+, mnPaletteCount(rPalette.GetEntryCount())
 {
 }
 virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
@@ -473,7 +473,7 @@ class ImplPixelFormat4 : public ImplPixelFormat
 private:
 sal_uInt8* pData;
 const BitmapPalette& mrPalette;
-const sal_uInt8 mnPaletteCount;
+const sal_uInt16 mnPaletteCount;
 sal_uInt32 mnX;
 sal_uInt32 mnShift;
 
@@ -481,7 +481,7 @@ public:
 explicit ImplPixelFormat4( const BitmapPalette& rPalette )
 : pData(nullptr)
 , mrPalette(rPalette)
-, mnPaletteCount(static_cast< sal_uInt8 >(rPalette.GetEntryCount()))
+, mnPaletteCount(rPalette.GetEntryCount())
 , mnX(0)
 , mnShift(0)
 {
@@ -526,14 +526,14 @@ class ImplPixelFormat1 : public ImplPixelFormat
 private:
 sal_uInt8* pData;
 const BitmapPalette& mrPalette;
-const sal_uInt8 mnPaletteCount;
+const sal_uInt16 mnPaletteCount;
 sal_uInt32 mnX;
 
 public:
 explicit ImplPixelFormat1( const BitmapPalette& rPalette )
 : pData(nullptr)
 , mrPalette(rPalette)
-, mnPaletteCount(static_cast< sal_uInt8 >(rPalette.GetEntryCount()))
+, mnPaletteCount(rPalette.GetEntryCount())
 , mnX(0)
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-03-21 Thread Stephan Bergmann
 vcl/quartz/salbmp.cxx |   13 -
 1 file changed, 13 deletions(-)

New commits:
commit 718c82d1de44d2d7c16e4299b61171b72186f50b
Author: Stephan Bergmann 
Date:   Wed Mar 21 15:17:04 2018 +0100

Don't initialize data for --enable-dbgutil only

This had originally been introduced with
0f6149593129c3d208f07d0d017dec0c71760778 "Make it easier to catch code that
assumes SalBitmaps are created pre-cleared".  But it only made it harder to 
find
the issue reverted with ebe247642d85d39b6e1ffae3cf92c31748f2e983 "Revert
'tdf#116213 OS X and OpenGL bitmap scaline sizes are not 32-bit aligned'".

Change-Id: I344e1ab4b390baa8364ade5fd2737a12708facdc

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index f9a10a44020b..aba40b44d8e0 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -272,10 +272,6 @@ bool QuartzSalBitmap::CreateContext()
 try
 {
 m_pContextBuffer = o3tl::make_shared_array(mnHeight * 
nContextBytesPerRow);
-#ifdef DBG_UTIL
-for (size_t i = 0; i < mnHeight * nContextBytesPerRow; i++)
-m_pContextBuffer.get()[i] = (i & 0xFF);
-#endif
 
 if( !bSkipConversion )
 {
@@ -342,15 +338,6 @@ bool QuartzSalBitmap::AllocateUserData()
 m_pUserBuffer.reset( static_cast(nullptr) );
 mnBytesPerRow = 0;
 }
-#ifdef DBG_UTIL
-else
-{
-for (size_t i = 0; i < mnBytesPerRow * mnHeight; i++)
-{
-m_pUserBuffer.get()[i] = (i & 0xFF);
-}
-}
-#endif
 
 return m_pUserBuffer.get() != nullptr;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-02-22 Thread Tor Lillqvist
 vcl/quartz/ctfonts.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit f7733528e88a6619f82b54b59e92a9bca72c0a89
Author: Tor Lillqvist 
Date:   Thu Feb 22 22:45:30 2018 +0200

tdf#68889: Fix the weight reported by the system for the problematic font

Like the previous fix for Courier Std. Let's hope there won't be a lot
of these special cases. Maybe some generic heuristic would be better.
Like if a font's GetStyleName() is "Medium", "Medium Oblique", or
"Medium Italic" then always force its weight to be WEIGHT_NORMAL?

Change-Id: I204655cd9c4e32d5cbbd68bb93c6282d23993b80

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 297c4dd58941..1ac73c59a60f 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -394,6 +394,17 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 fWeight = 0;
 }
 
+// tdf#68889: Ditto for Gill Sans MT Pro. Here I can kinda understand it, 
maybe the
+// kCTFontWeightTrait is intended to give a subjective "optical" 
impression of how the font
+// looks, and Gill Sans MT Pro Medium is kinda heavy. But with the way 
LibreOffice uses fonts,
+// we still should think of it as being "medium" weight.
+if (rDFA.GetFamilyName() == "Gill Sans MT Pro" &&
+(rDFA.GetStyleName() == "Medium" || rDFA.GetStyleName() == "Medium 
Italic") &&
+fWeight > 0.2)
+{
+fWeight = 0;
+}
+
 if( fWeight > 0 )
 {
 nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - 
WEIGHT_NORMAL)/0.68));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-02-22 Thread Tor Lillqvist
 vcl/quartz/ctfonts.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 1d7f96a324a4c2ab82a04513c6a38dc31fd061fa
Author: Tor Lillqvist 
Date:   Thu Feb 22 13:52:13 2018 +0200

tdf#67744: Fix the weight reported by the system for the problematic font

A hack, but oh well.

Change-Id: I13580d27acfb0cc200bdb0cc1911518675d3e32e
Reviewed-on: https://gerrit.libreoffice.org/50172
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index dbe4eb2cb96e..297c4dd58941 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -382,6 +382,18 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 CFNumberRef pWeightNum = static_cast(CFDictionaryGetValue( 
pAttrDict, kCTFontWeightTrait ));
 CFNumberGetValue( pWeightNum, kCFNumberDoubleType,  );
 int nInt = WEIGHT_NORMAL;
+
+// Special case fixes
+
+// tdf#67744: Courier Std Medium is always bold. We get a 
kCTFontWeightTrait of 0.23 which
+// surely must be wrong.
+if (rDFA.GetFamilyName() == "Courier Std" &&
+(rDFA.GetStyleName() == "Medium" || rDFA.GetStyleName() == "Medium 
Oblique") &&
+fWeight > 0.2)
+{
+fWeight = 0;
+}
+
 if( fWeight > 0 )
 {
 nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - 
WEIGHT_NORMAL)/0.68));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2018-02-22 Thread Noel Grandin
 vcl/quartz/salbmp.cxx |   67 +-
 1 file changed, 29 insertions(+), 38 deletions(-)

New commits:
commit 60a95595d0e85dd64aab685e8c0500e0af85f3ed
Author: Noel Grandin 
Date:   Wed Feb 21 21:19:14 2018 +0200

ColorData->Color in vcl quartz

Change-Id: Ie0de7f989ab4aefa900da6b9b75fcfe98584c8f3
Reviewed-on: https://gerrit.libreoffice.org/50124
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 28365159afa7..e7a614dbe50f 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -364,8 +364,8 @@ public:
 
 virtual void StartLine( sal_uInt8* pLine ) = 0;
 virtual void SkipPixel( sal_uInt32 nPixel ) = 0;
-virtual ColorData ReadPixel() = 0;
-virtual void WritePixel( ColorData nColor ) = 0;
+virtual Color ReadPixel() = 0;
+virtual void WritePixel( Color nColor ) = 0;
 virtual ~ImplPixelFormat() { }
 };
 
@@ -379,18 +379,18 @@ public:
 {
 pData += nPixel << 2;
 }
-virtual ColorData ReadPixel() override
+virtual Color ReadPixel() override
 {
-const ColorData c = RGB_COLORDATA( pData[1], pData[2], pData[3] );
+const Color c = RGB_COLORDATA( pData[1], pData[2], pData[3] );
 pData += 4;
 return c;
 }
-virtual void WritePixel( ColorData nColor ) override
+virtual void WritePixel( Color nColor ) override
 {
 *pData++ = 0;
-*pData++ = COLORDATA_RED( nColor );
-*pData++ = COLORDATA_GREEN( nColor );
-*pData++ = COLORDATA_BLUE( nColor );
+*pData++ = nColor.GetRed();
+*pData++ = nColor.GetGreen();
+*pData++ = nColor.GetBlue();
 }
 };
 
@@ -404,17 +404,17 @@ public:
 {
 pData += (nPixel << 1) + nPixel;
 }
-virtual ColorData ReadPixel() override
+virtual Color ReadPixel() override
 {
-const ColorData c = RGB_COLORDATA( pData[2], pData[1], pData[0] );
+const Color c = RGB_COLORDATA( pData[2], pData[1], pData[0] );
 pData += 3;
 return c;
 }
-virtual void WritePixel( ColorData nColor ) override
+virtual void WritePixel( Color nColor ) override
 {
-*pData++ = COLORDATA_BLUE( nColor );
-*pData++ = COLORDATA_GREEN( nColor );
-*pData++ = COLORDATA_RED( nColor );
+*pData++ = nColor.GetBlue();
+*pData++ = nColor.GetGreen();
+*pData++ = nColor.GetRed();
 }
 };
 
@@ -432,17 +432,17 @@ public:
 {
 pData += nPixel;
 }
-virtual ColorData ReadPixel() override
+virtual Color ReadPixel() override
 {
-const ColorData c = RGB_COLORDATA( (*pData & 0xf800) >> 8, (*pData & 
0x07e0) >> 3 , (*pData & 0x001f) << 3 );
+const Color c = RGB_COLORDATA( (*pData & 0xf800) >> 8, (*pData & 
0x07e0) >> 3 , (*pData & 0x001f) << 3 );
 pData++;
 return c;
 }
-virtual void WritePixel( ColorData nColor ) override
+virtual void WritePixel( Color nColor ) override
 {
-*pData++ =  ((COLORDATA_RED( nColor ) & 0xf8 ) << 8 ) |
-((COLORDATA_GREEN( nColor ) & 0xfc ) << 3 ) |
-((COLORDATA_BLUE( nColor ) & 0xf8 ) >> 3 );
+*pData++ =  (( nColor.GetRed() & 0xf8 ) << 8 ) |
+(( nColor.GetGreen() & 0xfc ) << 3 ) |
+(( nColor.GetBlue() & 0xf8 ) >> 3 );
 }
 };
 
@@ -463,16 +463,13 @@ public:
 {
 pData += nPixel;
 }
-virtual ColorData ReadPixel() override
+virtual Color ReadPixel() override
 {
 return mrPalette[ *pData++ ].GetColor().GetColor();
 }
-virtual void WritePixel( ColorData nColor ) override
+virtual void WritePixel( Color nColor ) override
 {
-const BitmapColor aColor( COLORDATA_RED( nColor ),
-  COLORDATA_GREEN( nColor ),
-  COLORDATA_BLUE( nColor ) );
-*pData++ = static_cast< sal_uInt8 >( mrPalette.GetBestIndex( 
aColor ) );
+*pData++ = static_cast< sal_uInt8 >( mrPalette.GetBestIndex( 
nColor ) );
 }
 };
 
@@ -506,20 +503,17 @@ public:
 mnX = 0;
 mnShift = 4;
 }
-virtual ColorData ReadPixel() override
+virtual Color ReadPixel() override
 {
 const BitmapColor& rColor = mrPalette[( pData[mnX >> 1] >> 
mnShift) & 0x0f];
 mnX++;
 mnShift ^= 4;
 return rColor.GetColor().GetColor();
 }
-virtual void WritePixel( ColorData nColor ) override
+virtual void WritePixel( Color nColor ) override
 {
-const BitmapColor aColor( COLORDATA_RED( nColor ),
-  COLORDATA_GREEN( nColor ),
-  COLORDATA_BLUE( nColor ) );
  

[Libreoffice-commits] core.git: vcl/quartz

2018-01-23 Thread Tor Lillqvist
 vcl/quartz/ctfonts.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 407546e7c3f8c732ccf60e5fb3844f6efb86f932
Author: Tor Lillqvist 
Date:   Tue Jan 23 15:04:00 2018 +0200

tdf#69254: Tweak mapping from CoreText weight to our FontWeight a bit

Make the mapping of light weights more likely to hit different enum
values for slightly different weights.

We want to be able to distinguish between for instance Overpass Light
(with weight -0.4) and Overpass ExtraLight (with weight -0.5).

Change-Id: If83fbce68149b267a49ef9bcb6624d8790de7c56
Reviewed-on: https://gerrit.libreoffice.org/48409
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index fbdf2efe89a3..dbe4eb2cb96e 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -392,7 +392,7 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 }
 else if( fWeight < 0 )
 {
-nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_NORMAL - 
WEIGHT_THIN)/0.9));
+nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_NORMAL - 
WEIGHT_THIN)/0.8));
 if( nInt < WEIGHT_THIN )
 {
 nInt = WEIGHT_THIN;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2017-08-08 Thread Julien Nabet
 vcl/quartz/salgdi.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 986cd454b2a39ac380b137148f944c0d5ead2631
Author: Julien Nabet 
Date:   Tue Aug 8 18:55:17 2017 +0200

tdf#111497: fix leak in FindFontSubstitute with CFRelease

Change-Id: I9d7de52b4a1ee102b233b982e97ecbf731b476f2
Reviewed-on: https://gerrit.libreoffice.org/40895
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index edd38fa4559b..42bb48ffefd4 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -92,6 +92,7 @@ bool 
CoreTextGlyphFallbackSubstititution::FindFontSubstitute(FontSelectPattern&
 rPattern.mpFontData = 
pSalData->mpFontList->GetFontDataFromId(reinterpret_cast(pDesc));
 
 CFRelease(pFallback);
+CFRelease(pDesc);
 }
 CFRelease(pStr);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2017-08-07 Thread Julien Nabet
 vcl/quartz/salgdi.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit bc5bd201609ae197f320823880e66187ae94c98a
Author: Julien Nabet 
Date:   Mon Aug 7 19:31:58 2017 +0200

tdf#111432: fix leaks in AddTempDevFont with CFRelease

Change-Id: I11183b7fd21d2398de9e5f5854763cef96963caa
Reviewed-on: https://gerrit.libreoffice.org/40845
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index b1d393876e16..edd38fa4559b 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -300,6 +300,8 @@ static bool AddTempDevFont(const OUString& rFontFileURL)
 {
 CFRelease(error);
 }
+CFRelease(rFontPath);
+CFRelease(rFontURL);
 
 return success;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2017-02-22 Thread Khaled Hosny
 vcl/quartz/ctfonts.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 04d086531ff4a3ab24b704489270c7c23792bd20
Author: Khaled Hosny 
Date:   Wed Feb 22 23:56:19 2017 +0200

tdf#104509: Fix GetGlyphBoundRect on Mac

The rectangle top and bottom were mixed up! I tried to fix this in
8cef9b4dbafdebc0566d6d7f715f27f978ddfe5b, but it was not the right fix.

Change-Id: Ia033ff2823bfd641e830d748d413d7791bfee5b8
Reviewed-on: https://gerrit.libreoffice.org/34557
Tested-by: Jenkins 
Reviewed-by: Khaled Hosny 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 1c60db3..b5db7e5 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -167,9 +167,9 @@ bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& 
rGlyph, Rectangle& rRect
 aCGRect = CGRectApplyAffineTransform(aCGRect, 
CGAffineTransformMakeRotation(mfFontRotation));
 
 rRect.Left()   = lrint( aCGRect.origin.x );
-rRect.Top()= lrint(-aCGRect.origin.y );
+rRect.Top()= lrint(-aCGRect.origin.y - aCGRect.size.height );
 rRect.Right()  = lrint( aCGRect.origin.x + aCGRect.size.width );
-rRect.Bottom() = lrint( aCGRect.origin.y - aCGRect.size.height );
+rRect.Bottom() = lrint(-aCGRect.origin.y );
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-12-12 Thread Khaled Hosny
 vcl/quartz/ctfonts.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 04a77bfa9c5a3da6d99ee6ad8d4802638b7d76fa
Author: Khaled Hosny 
Date:   Mon Dec 12 14:51:32 2016 +0200

Don’t return false for blank glyphs

CTFontCreatePathForGlyph() will return NULL for blank glyphs causing
CoreTextStyle::GetGlyphOutline() to return false which propagated as
error all the way to OutputDevice::GetTextOutlines() causing it to
needlessly enter into fallback code. Other implementations just return
true and an empty polygon here.

Change-Id: Ib20ebff00f7cb3aae22f1c6b4c3a0e9d7a429987
Reviewed-on: https://gerrit.libreoffice.org/31902
Tested-by: Jenkins 
Reviewed-by: Khaled Hosny 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index f5ea6db..1c60db3 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -231,6 +231,19 @@ bool CoreTextStyle::GetGlyphOutline(const GlyphItem& 
rGlyph, basegfx::B2DPolyPol
 
 CGGlyph nCGGlyph = rGlyph.maGlyphId;
 CTFontRef pCTFont = static_cast(CFDictionaryGetValue( 
mpStyleDict, kCTFontAttributeName ));
+
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation;
+SAL_WNODEPRECATED_DECLARATIONS_POP
+CGRect aCGRect = CTFontGetBoundingRectsForGlyphs(pCTFont, 
aFontOrientation, , nullptr, 1);
+
+if (!CGRectIsNull(aCGRect) && CGRectIsEmpty(aCGRect))
+{
+// CTFontCreatePathForGlyph returns NULL for blank glyphs, but we want
+// to return true for them.
+return true;
+}
+
 CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, nullptr );
 if (!xPath)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-11-13 Thread Khaled Hosny
 vcl/quartz/salgdi.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 24707c7b8d5e7b3d72decb9749b83153b273917f
Author: Khaled Hosny 
Date:   Sun Nov 13 14:24:39 2016 +0200

Fix build

Change-Id: I55db5ba855b8d72e9be0298a68b094c7b01d9f54

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index cb885c0..91454c7 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -128,8 +128,6 @@ sal_IntPtr CoreTextFontFace::GetFontId() const
 return (sal_IntPtr)mnFontId;
 }
 
-static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);}
-
 const FontCharMapRef CoreTextFontFace::GetFontCharMap() const
 {
 // return the cached charmap
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-11-07 Thread Stephan Bergmann
 vcl/quartz/ctfonts.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 02cf121aaba00a4ef7f8fe44203838e0fa1cf738
Author: Stephan Bergmann 
Date:   Mon Nov 7 09:09:38 2016 +0100

-Werror,-Wdeprecated-declarations

Change-Id: Ia54f11b799fefcddcbf3b9f49e806bfc0895773f

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 735a30b..20fba1f 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -148,8 +148,12 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef& 
rxFontMetric ) const
 CGGlyph nKashidaGid = 0;
 if (CTFontGetGlyphsForCharacters(aCTFontRef, , , 1))
 {
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+// 'kCTFontHorizontalOrientation' is deprecated: first deprecated 
in
+// macOS 10.11
 double nKashidaAdv = CTFontGetAdvancesForGlyphs(aCTFontRef,
 kCTFontHorizontalOrientation, , nullptr, 1);
+SAL_WNODEPRECATED_DECLARATIONS_POP
 rxFontMetric->SetMinKashida(lrint(nKashidaAdv));
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-11-02 Thread Khaled Hosny
 vcl/quartz/ctfonts.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8cef9b4dbafdebc0566d6d7f715f27f978ddfe5b
Author: Khaled Hosny 
Date:   Wed Nov 2 23:38:13 2016 +0200

Fix GetGlyphBoundRect() on macOS

The Y sign should be reversed to match VCL, apparently it was either
unused on macOS before CommonSalLayout or it was wrong all along.

This was the source of CppunitTest_svgio failure on macOS with
CommonSalLayout.

Change-Id: I3108aab7b6780c912e86e5591ca0f41ea437137b

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 948bfb5..11905c2 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -157,9 +157,9 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId 
aGlyphId, Rectangle& rRect )
 const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, 
aFontOrientation, , nullptr, 1 );
 
 rRect.Left()   = lrint( aCGRect.origin.x );
-rRect.Top()= lrint( aCGRect.origin.y );
+rRect.Top()= lrint(-aCGRect.origin.y );
 rRect.Right()  = lrint( aCGRect.origin.x + aCGRect.size.width );
-rRect.Bottom() = lrint( aCGRect.origin.y + aCGRect.size.height );
+rRect.Bottom() = lrint( aCGRect.origin.y - aCGRect.size.height );
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz vcl/unx vcl/win

2016-10-25 Thread Khaled Hosny
 vcl/quartz/ctfonts.cxx |   14 ++
 vcl/unx/generic/fontmanager/fontconfig.cxx |   12 
 vcl/win/gdi/salfont.cxx|9 +
 3 files changed, 35 insertions(+)

New commits:
commit 48304cb5b4d8df71463837e2e48aa7c4d9594df9
Author: Khaled Hosny 
Date:   Tue Oct 25 02:25:08 2016 +0200

Skip font formats not supported by CommonSalLayout

Don’t list fonts we can’t handle, bad things would happen…

Change-Id: Ic88486e34da69090deb3e8c394cb75a8e4e5cbd0

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index ac17abc..948bfb5 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -341,6 +341,20 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 // get font attributes
 CFDictionaryRef pAttrDict = 
static_cast(CTFontDescriptorCopyAttribute( pFD, 
kCTFontTraitsAttribute ));
 
+if (bFontEnabled && *bFontEnabled && SalLayout::UseCommonLayout())
+{
+// Ignore font formats not supported by CommonSalLayout.
+int nFormat;
+CFNumberRef pFormat = 
static_cast(CTFontDescriptorCopyAttribute(pFD, 
kCTFontFormatAttribute));
+CFNumberGetValue(pFormat, kCFNumberIntType, );
+if (nFormat == kCTFontFormatUnrecognized || nFormat == 
kCTFontFormatPostScript || nFormat == kCTFontFormatBitmap)
+{
+SAL_INFO("vcl.fonts", "Ignoring font with unsupported format: " << 
rDFA.GetFamilyName());
+*bFontEnabled = false;
+}
+CFRelease(pFormat);
+}
+
 // get symbolic trait
 // TODO: use other traits such as MonoSpace/Condensed/Expanded or Vertical 
too
 SInt64 nSymbolTrait = 0;
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx 
b/vcl/unx/generic/fontmanager/fontconfig.cxx
index cbdbd33..a8731401 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include "fontinstance.hxx"
+#include "sallayout.hxx"
 #include 
 #include 
 #include 
@@ -119,6 +120,17 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
 FcResult eOutRes = FcPatternGetBool( pPattern, FC_OUTLINE, 0, 
 );
 if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
 continue;
+if (SalLayout::UseCommonLayout())
+{
+// Ignore Type 1 fonts; CommonSalLayout does not support them.
+FcChar8* pFormat = nullptr;
+FcResult eFormatRes = FcPatternGetString(pPattern, FC_FONTFORMAT, 
0, );
+if ((eFormatRes == FcResultMatch) &&
+(strcmp(reinterpret_cast(pFormat), "Type 1") == 0))
+{
+continue;
+}
+}
 FcPatternReference( pPattern );
 FcFontSetAdd( m_pOutlineSet, pPattern );
 }
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 956459b..7f11d65 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1532,6 +1532,15 @@ int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe,
 if( (nFontType & RASTER_FONTTYPE) && !(nFontType & 
DEVICE_FONTTYPE) )
 return 1;
 
+// Ignore font formats not supported by CommonSalLayout.
+if (SalLayout::UseCommonLayout())
+if ((nFontType & RASTER_FONTTYPE))
+{
+SAL_INFO("vcl.fonts", "Ignoring font with unsupported format: "
+ << OUString(reinterpret_cast(pLogFont->elfLogFont.lfFaceName)));
+return 1;
+}
+
 WinFontFace* pData = ImplLogMetricToDevFontDataW( pLogFont, 
&(pMetric->ntmTm), nFontType );
 pData->SetFontId( sal_IntPtr( pInfo->mnFontCount++ ) );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-09-23 Thread Julien Nabet
 vcl/quartz/salgdicommon.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5333743d3b8288fb40e4657aedf1db2255f6a62b
Author: Julien Nabet 
Date:   Thu Sep 22 20:26:25 2016 +0200

tdf#100994: use CGContextStrokePath instead

This is a blind fix attempt to fix "Freeze when first action after launch 
with OSX Sierra with iMac 5K"

I started from bt:
frame #9: 0x7fffbe094cf6 CoreGraphics`CGContextDrawPath + 183
frame #10: 0x000102b16cda 
libvcllo.dylib`AquaSalGraphics::drawPolyLine(unsigned int, SalPoint const*) + 
330
frame #11: 0x000102929039 
libvcllo.dylib`OutputDevice::drawPolyLine(tools::Polygon const&, LineInfo 
const&) + 361
frame #12: 0x000102928d30 
libvcllo.dylib`OutputDevice::DrawPolyLine(basegfx::B2DPolygon const&, double, 
basegfx::B2DLineJoin, com::sun::star::drawing::LineCap, double) + 768
(see 
https://bug-attachments.documentfoundation.org/attachment.cgi?id=127502)

then:

http://stackoverflow.com/questions/32871234/how-to-make-kcgpathstroke-work-in-swift-2
which advises to replace:
 CGContextDrawPath(ctx, kCGPathStroke)
by
CGContextDrawPath(ctx, .Stroke)

and finally this:
http://stackoverflow.com/questions/37838578/how-to-stroke-a-cgpath
which advises to directly use this:
CGContextStrokePath(context)

Change-Id: I99f9800c39f18d16488f7ef4114a71722f9b8123
Reviewed-on: https://gerrit.libreoffice.org/29194
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index aae7eff..ed6e4db 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1439,8 +1439,8 @@ void AquaSalGraphics::drawPolyLine( sal_uInt32 nPoints, 
const SalPoint *pPtAry )
 SAL_INFO( "vcl.cg", "CGContextAddLineToPoint(" << mrContext << "," << 
fX << "," << fY << ")" );
 CGContextAddLineToPoint( mrContext, fX, fY );
 }
-SAL_INFO( "vcl.cg", "CGContextDrawPath(" << mrContext << ",kCGPathStroke)" 
);
-CGContextDrawPath( mrContext, kCGPathStroke );
+SAL_INFO( "vcl.cg", "CGContextStrokePath(" << mrContext << ")" );
+CGContextStrokePath(mrContext);
 
 RefreshRect( nX, nY, nWidth, nHeight );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-08-14 Thread Stephan Bergmann
 vcl/quartz/ctlayout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e22fc8076f347702670134cb7a36d523d046423c
Author: Stephan Bergmann 
Date:   Sun Aug 14 22:41:00 2016 +0200

loplugin:overrideparam

Change-Id: I78513a531f93f6578290107b1d71977820dac965

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index d4eed46..2415298 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -47,7 +47,7 @@ public:
 
 virtual DeviceCoordinate GetTextWidth() const override;
 virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const 
override;
-virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, 
DeviceCoordinate nCharExtra = 0, int nFactor = 1) const override;
+virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, 
DeviceCoordinate nCharExtra, int nFactor) const override;
 virtual voidGetCaretPositions( int nArraySize, long* pCaretXArray ) 
const override;
 virtual boolGetBoundRect( SalGraphics&, Rectangle& ) const override;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz vcl/source vcl/win

2016-05-14 Thread Jochen Nitschke
 vcl/quartz/salbmp.cxx   |   12 +---
 vcl/source/filter/wmf/wmfwr.cxx |1 +
 vcl/source/fontsubset/cff.cxx   |   12 
 vcl/source/gdi/pdffontcache.hxx |6 +-
 vcl/win/gdi/gdiimpl.cxx |4 
 5 files changed, 23 insertions(+), 12 deletions(-)

New commits:
commit b00d1e37c8d178f8199a45d1c9f08cae6bcef698
Author: Jochen Nitschke 
Date:   Fri May 13 20:56:38 2016 +0200

cppcheck: uninitialised members in vcl

and remove clear() on std::vector types in ctors

Change-Id: I8e239676d46e30049d4d5886a5b8de99cadd3f45
Reviewed-on: https://gerrit.libreoffice.org/24983
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 4a1a9f0..48906a3 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -445,7 +445,8 @@ private:
 
 public:
 explicit ImplPixelFormat8( const BitmapPalette& rPalette )
-: mrPalette( rPalette )
+: pData(nullptr)
+, mrPalette(rPalette)
 {
 }
 virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
@@ -476,7 +477,10 @@ private:
 
 public:
 explicit ImplPixelFormat4( const BitmapPalette& rPalette )
-: mrPalette( rPalette )
+: pData(nullptr)
+, mrPalette(rPalette)
+, mnX(0)
+, mnShift(0)
 {
 }
 virtual void SkipPixel( sal_uInt32 nPixel ) override
@@ -521,7 +525,9 @@ private:
 
 public:
 explicit ImplPixelFormat1( const BitmapPalette& rPalette )
-: mrPalette( rPalette )
+: pData(nullptr)
+, mrPalette(rPalette)
+, mnX(0)
 {
 }
 virtual void SkipPixel( sal_uInt32 nPixel ) override
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index b759697..8feb82d 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -151,6 +151,7 @@ WMFWriter::WMFWriter()
 , eDstTextAlign(ALIGN_BASELINE)
 , eDstHorTextAlign(W_TA_LEFT)
 , bDstIsClipping(false)
+, bHandleAllocated{}
 , nDstPenHandle(0)
 , nDstFontHandle(0)
 , nDstBrushHandle(0)
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index ac3bf78..74725ea 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -424,8 +424,11 @@ CffSubsetterContext::CffSubsetterContext( const U8* 
pBasePtr, int nBaseLen)
 , mpCharStringOps(nullptr)
 , mpCharStringEscs(nullptr)
 , mnStackIdx(0)
+, mnValStack{}
+, mnTransVals{}
 , mnHintSize(0)
 , mnHorzHintSize(0)
+, mnHintStack{}
 , maCharWidth(-1)
 {
 //  setCharStringType( 1);
@@ -1406,12 +1409,6 @@ CffLocal::CffLocal()
 ,   mnLangGroup( 0)
 ,   mbForceBold( false)
 {
-maStemSnapH.clear();
-maStemSnapV.clear();
-maBlueValues.clear();
-maOtherBlues.clear();
-maFamilyBlues.clear();
-maFamilyOtherBlues.clear();
 }
 
 CffGlobal::CffGlobal()
@@ -1434,8 +1431,6 @@ CffGlobal::CffGlobal()
 ,   mnFullNameSID( 0)
 ,   mnFamilyNameSID( 0)
 {
-maFontBBox.clear();
-// TODO; maFontMatrix.clear();
 }
 
 bool CffSubsetterContext::initialCffRead()
@@ -1734,6 +1729,7 @@ public:
 Type1Emitter::Type1Emitter( FILE* pOutFile, bool bPfbSubset)
 :   mpFileOut( pOutFile)
 ,   mbCloseOutfile( false)
+,   maBuffer{}
 ,   mnEECryptR( 55665)  // default eexec seed, TODO: mnEECryptSeed
 ,   mpPtr( maBuffer)
 ,   mbPfbSubset( bPfbSubset)
diff --git a/vcl/source/gdi/pdffontcache.hxx b/vcl/source/gdi/pdffontcache.hxx
index 8bca64e..f668629 100644
--- a/vcl/source/gdi/pdffontcache.hxx
+++ b/vcl/source/gdi/pdffontcache.hxx
@@ -38,7 +38,11 @@ namespace vcl
 std::type_info* m_typeFontFace;
 
 FontIdentifier( const PhysicalFontFace*, bool bVertical );
-FontIdentifier() : m_nFontId(0), m_bVertical( false ) {}
+FontIdentifier()
+: m_nFontId(0)
+, m_bVertical(false)
+, m_typeFontFace(nullptr)
+{}
 
 // Less than needed for std::set and std::map
 bool operator<( const FontIdentifier& rRight ) const
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 817b062..8a43898 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -263,7 +263,11 @@ int ImplIsPaletteEntry( BYTE nRed, BYTE nGreen, BYTE nBlue 
)
 WinSalGraphicsImpl::WinSalGraphicsImpl(WinSalGraphics& rParent):
 mrParent(rParent),
 mbXORMode(false),
+mbPen(false),
 mhPen(0),
+mbStockPen(false),
+mbBrush(false),
+mbStockBrush(false),
 mhBrush(0)
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-05-12 Thread Stephan Bergmann
 vcl/quartz/ctfonts.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8d711b2dfdd552e1210eb92091317da27fa7a1b8
Author: Stephan Bergmann 
Date:   Thu May 12 10:38:58 2016 +0200

Missing SAL_FALLTHROUGH (see comment above)

Change-Id: I25d7c76462699e0f206e622841744fef9527108b

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 724f8c7..5f4347b 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -181,6 +181,7 @@ static void MyCGPathApplierFunc( void* pData, const 
CGPathElement* pElement )
 {
 break;
 }
+SAL_FALLTHROUGH;
 case kCGPathElementAddLineToPoint:
 rPolygon.append( basegfx::B2DPoint( +pElement->points[0].x, 
-pElement->points[0].y ) );
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-05-01 Thread Jochen Nitschke
 vcl/quartz/salbmp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 438f2db139dfee1036da3baae85c82c9a14448b5
Author: Jochen Nitschke 
Date:   Sun May 1 14:43:38 2016 +0200

fix copy error

since commit 4cab94239be70bd5800a8808652514f14501d303

Change-Id: I8fbd55977bdf8531a66123948c0c4d23657713d4
Reviewed-on: https://gerrit.libreoffice.org/24558
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 8603f26..4a1a9f0 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -605,7 +605,7 @@ void QuartzSalBitmap::ConvertBitmapData( sal_uInt32 nWidth, 
sal_uInt32 nHeight,
 BitmapBuffer aDstBuf;
 aDstBuf.mnFormat = BMP_FORMAT_32BIT_TC_ARGB;
 aDstBuf.mpBits = pDestData;
-aSrcBuf.mnBitCount = nDestBits;
+aDstBuf.mnBitCount = nDestBits;
 aDstBuf.mnScanlineSize = nDestBytesPerRow;
 
 aSrcBuf.mnWidth = aDstBuf.mnWidth = nWidth;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-02-26 Thread Stephan Bergmann
 vcl/quartz/salbmp.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit e08d84547fcb5db6f91deb1af3ec6b3a4b060caf
Author: Stephan Bergmann 
Date:   Fri Feb 26 21:07:16 2016 +0100

loplugin:commaoperator

Change-Id: I481fe73256bf0d974c54a6419874fa76ea4beaa6

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index bbb82c0..8603f26 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -111,11 +111,15 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int 
nBitmapBits,
 DBG_ASSERT( xLayer, "QuartzSalBitmap::Create() from non-layered context" );
 
 // sanitize input parameters
-if( nX < 0 )
-nWidth += nX, nX = 0;
+if( nX < 0 ) {
+nWidth += nX;
+nX = 0;
+}
 
-if( nY < 0 )
-nHeight += nY, nY = 0;
+if( nY < 0 ) {
+nHeight += nY;
+nY = 0;
+}
 
 const CGSize aLayerSize = CGLayerGetSize( xLayer );
 SAL_INFO("vcl.cg", "CGLayerGetSize(" << xLayer << ") = " << aLayerSize );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2016-01-22 Thread Michael Stahl
 vcl/quartz/ctlayout.cxx |   35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

New commits:
commit 9e519ebf8737c8455b8286aa8abaa8a9c683a04d
Author: Michael Stahl 
Date:   Wed Jan 20 11:38:42 2016 +0100

vcl: replace boost::ptr_vector with std::vector

Change-Id: Ia5e5349e879d46d6a57b7b83b31346766c11c58b
Reviewed-on: https://gerrit.libreoffice.org/21662
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 2b0eedb..6bdcad3 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -19,7 +19,8 @@
 
 #include 
 
-#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -79,7 +80,7 @@ private:
 mutable double  mfBaseAdv;
 
 mutable bool  bLayouted; // true if the glyph layout information are 
cached and current;
-mutable boost::ptr_vector m_vRunData;
+mutable std::vector m_vRunData;
 
 };
 
@@ -109,7 +110,7 @@ CTLayout::~CTLayout()
 
 bool CTLayout::LayoutText( ImplLayoutArgs& rArgs )
 {
-m_vRunData.release();
+m_vRunData.clear();
 bLayouted = false;
 
 // release an eventual older layout
@@ -452,7 +453,7 @@ void CTLayout::DrawText( SalGraphics& rGraphics ) const
 
 bool CTLayout::CacheGlyphLayout() const // eew!
 {
-m_vRunData.release();
+m_vRunData.clear();
 if(!mpCTLine)
 {
 return false;
@@ -465,7 +466,7 @@ bool CTLayout::CacheGlyphLayout() const // eew!
 {
 CTRunRef pRun = static_cast(CFArrayGetValueAtIndex( aRuns, i 
));
 CTRunData* pRunData = new CTRunData(pRun, nPos);
-m_vRunData.push_back(pRunData);
+m_vRunData.push_back(std::unique_ptr(pRunData));
 nPos += pRunData->m_nGlyphs;
 }
 bLayouted = true;
@@ -494,9 +495,9 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* 
pOutGlyphIds, Point& rPos, i
 CTFontDescriptorRef pFontDesc = nullptr;
 FontAttributes rDevFontAttr;
 
-boost::ptr_vector::const_iterator iter = m_vRunData.begin();
+auto iter = m_vRunData.begin();
 
-while(iter != m_vRunData.end() && iter->m_EndPos <= nStart)
+while (iter != m_vRunData.end() && (*iter)->m_EndPos <= nStart)
 {
 ++iter;
 }
@@ -509,7 +510,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* 
pOutGlyphIds, Point& rPos, i
 if( pFallbackFonts )
 {
 pFont = static_cast(CFDictionaryGetValue( 
mpTextStyle->GetStyleDict(), kCTFontAttributeName ));
-pFontDesc = CTFontCopyFontDescriptor( iter->m_pFont );
+pFontDesc = CTFontCopyFontDescriptor( (*iter)->m_pFont );
 rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, nullptr );
 }
 }
@@ -518,19 +519,19 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* 
pOutGlyphIds, Point& rPos, i
 while( i < nStart + nLen )
 {
 // convert glyph details for VCL
-int j = i - iter->m_StartPos;
-*(pOutGlyphIds++) = iter->m_pGlyphs[ j ];
+int j = i - (*iter)->m_StartPos;
+*(pOutGlyphIds++) = (*iter)->m_pGlyphs[ j ];
 if( pGlyphAdvances )
 {
-*(pGlyphAdvances++) = lrint(iter->m_pAdvances[ j ].width);
+*(pGlyphAdvances++) = lrint((*iter)->m_pAdvances[ j ].width);
 }
 if( pCharIndexes )
 {
-*(pCharIndexes++) = iter->m_pStringIndices[ j ] + mnMinCharPos;
+*(pCharIndexes++) = (*iter)->m_pStringIndices[ j ] + mnMinCharPos;
 }
 if( pFallbackFonts )
 {
-if ( !CFEqual( iter->m_pFont,  pFont ) )
+if (!CFEqual((*iter)->m_pFont,  pFont))
 {
 pFallbackFont = new CoreTextFontFace( rDevFontAttr, 
reinterpret_cast(pFontDesc) );
 *(pFallbackFonts++) = pFallbackFont;
@@ -542,23 +543,23 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* 
pOutGlyphIds, Point& rPos, i
 }
 if( i == nStart )
 {
-const CGPoint& rFirstPos = iter->m_pPositions[ j ];
+const CGPoint& rFirstPos = (*iter)->m_pPositions[ j ];
 rPos = GetDrawPosition( Point( rFirstPos.x, rFirstPos.y) );
 }
 i += 1;
 count += 1;
-if(i == iter->m_EndPos)
+if (i == (*iter)->m_EndPos)
 {
 // note: we assume that we do not have empty runs in the middle of 
things
 ++iter;
-if( iter == m_vRunData.end())
+if (iter == m_vRunData.end())
 {
 break;
 }
 if( pFallbackFonts )
 {
 pFont = static_cast(CFDictionaryGetValue( 
mpTextStyle->GetStyleDict(), kCTFontAttributeName ));
-pFontDesc = CTFontCopyFontDescriptor( iter->m_pFont );
+pFontDesc = CTFontCopyFontDescriptor( (*iter)->m_pFont );
 rDevFontAttr = 

[Libreoffice-commits] core.git: vcl/quartz

2015-11-05 Thread Michael Meeks
 vcl/quartz/salgdiutils.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 2dd20b4745a5876ca40106163799e89bf539b2cf
Author: Michael Meeks 
Date:   Thu Nov 5 14:22:09 2015 +

Comment the quartz off-screen buffering code.

Change-Id: Ie9a52745a83ca6e4281faa4f1dc8b8ea7411badf
Reviewed-on: https://gerrit.libreoffice.org/19805
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 58d1d45..f142620 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -89,6 +89,10 @@ void AquaSalGraphics::UnsetState()
 }
 }
 
+/**
+ * (re-)create the off-screen mxLayer we render everything to if
+ * necessary: eg. not initialized yet, or it has an incorrect size.
+ */
 bool AquaSalGraphics::CheckContext()
 {
 if( mbWindow && mpFrame && mpFrame->getNSWindow() )
@@ -174,6 +178,11 @@ CGContextRef AquaSalGraphics::GetContext()
 return mrContext;
 }
 
+/**
+ * Blit the contents of our internal mxLayer state to the
+ * associated window, if any; cf. drawRect event handling
+ * on the frame.
+ */
 void AquaSalGraphics::UpdateWindow( NSRect& )
 {
 if( !mpFrame )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-10-02 Thread Stephan Bergmann
 vcl/quartz/ctfonts.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 04b08eeaaff12ac6cf5e6717f327f46ef49e85bf
Author: Stephan Bergmann 
Date:   Fri Oct 2 14:25:35 2015 +0200

-Werror,-Wdeprecated-declarations

Change-Id: I87922fb64dda54f245954d6c5eb3b244812ceaf0

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 321f371..e5faad9 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -145,7 +145,9 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId 
aGlyphId, Rectangle& rRect )
 // XXX: this is broken if the glyph came from fallback font
 CTFontRef aCTFontRef = static_cast(CFDictionaryGetValue( 
mpStyleDict, kCTFontAttributeName ));
 
+SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.11 kCTFontDefaultOrientation
 const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation; // 
TODO: horz/vert
+SAL_WNODEPRECATED_DECLARATIONS_POP
 const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, 
aFontOrientation, , NULL, 1 );
 
 rRect.Left()   = lrint( aCGRect.origin.x );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-07-03 Thread Norbert Thiebaud
 vcl/quartz/CTRunData.cxx |2 
 vcl/quartz/CTRunData.hxx |2 
 vcl/quartz/ctlayout.cxx  |  270 ++-
 3 files changed, 61 insertions(+), 213 deletions(-)

New commits:
commit ab39f8c213bffa00f2b196c05a23ab3ccda8f901
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Fri Jul 3 13:35:45 2015 -0500

tdf#88941 Revert vcl quartz: Add support back for DXArray tweaking

This reverts commit 4a0cb642f18b674f37db8e9bd30942740df08e4c.
MacOSx only (more exactly CoreText only)
The handling of DXArray was buggy and need to be re-worked
so this revert to the previous case where DXArray are esssentially
ignored at the char level and only kept at the fragment size level
and used to redistribute space in a fragment

This create some issue too but on more esoteric case than
the one noticed in tdf#88941

Change-Id: Icb33d0600267c3136f3a6b15de8ecd739898ce04
Reviewed-on: https://gerrit.libreoffice.org/16747
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/quartz/CTRunData.cxx b/vcl/quartz/CTRunData.cxx
index 930f6d17..7ef3891 100644
--- a/vcl/quartz/CTRunData.cxx
+++ b/vcl/quartz/CTRunData.cxx
@@ -17,7 +17,6 @@ CTRunData::CTRunData( CTRunRef pRun, int start)
 : ownership_flags(0)
 , m_StartPos(start)
 , m_pRun(pRun)
-, m_pAdjPositions(NULL)
 {
 assert(pRun);
 
@@ -87,7 +86,6 @@ CTRunData::~CTRunData()
 {
 delete [] m_pPositions;
 }
-delete [] m_pAdjPositions;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/quartz/CTRunData.hxx b/vcl/quartz/CTRunData.hxx
index 9151467..3201acf 100644
--- a/vcl/quartz/CTRunData.hxx
+++ b/vcl/quartz/CTRunData.hxx
@@ -32,7 +32,7 @@ public:
 const CGPoint* m_pPositions;
 const CGSize*  m_pAdvances;
 const CFIndex* m_pStringIndices;
-CGPoint* m_pAdjPositions;
+
 CTRunData(CTRunRef pRun, int start);
~CTRunData();
 };
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 82d9c64..20dca01 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -57,7 +57,6 @@ private:
 voiddrawCTLine(AquaSalGraphics rAquaGraphics, CTLineRef 
ctline, const CoreTextStyle* const pStyle) const;
 CGPoint GetTextDrawPosition() const;
 boolCacheGlyphLayout() const;
-voidApplyDXArray( ImplLayoutArgs rArgs);
 
 const CoreTextStyle* constmpTextStyle;
 
@@ -103,9 +102,7 @@ CTLayout::~CTLayout()
 CFRelease( mpCTLine );
 }
 if( mpAttrString )
-{
 CFRelease( mpAttrString );
-}
 }
 
 bool CTLayout::LayoutText( ImplLayoutArgs rArgs )
@@ -116,7 +113,6 @@ bool CTLayout::LayoutText( ImplLayoutArgs rArgs )
 // release an eventual older layout
 if( mpAttrString )
 CFRelease( mpAttrString );
-
 mpAttrString = NULL;
 if( mpCTLine )
 {
@@ -164,151 +160,91 @@ bool CTLayout::LayoutText( ImplLayoutArgs rArgs )
 return true;
 }
 
-void CTLayout::ApplyDXArray(ImplLayoutArgs rArgs)
+void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 {
-CacheGlyphLayout();
-
-for (boost::ptr_vectorCTRunData::iterator iter = m_vRunData.begin();
- iter != m_vRunData.end();
- ++iter)
+if( !mpCTLine)
 {
-CTRunStatus status = CTRunGetStatus(iter-m_pRun);
-delete[] iter-m_pAdjPositions;
-iter-m_pAdjPositions = new CGPoint[iter-m_nGlyphs];
+return;
+}
 
-SAL_INFO( vcl.ct, Apply DXArray Run status: status);
 
-if(!(status  kCTRunStatusNonMonotonic))
-{
-/* simple 1 to 1 */
-SAL_INFO( vcl.ct, nb glyph in vrun:  iter-m_nGlyphs);
-for(int i = 0 ; i  iter-m_nGlyphs; i++)
-{
-SAL_INFO( vcl.ct, StringIndices[  i   ] =   
iter-m_pStringIndices[i]);
-int j = iter-m_pStringIndices[i];
-if(j == 0)
-{
-iter-m_pAdjPositions[i].x = 0;
-SAL_INFO( vcl.ct, m_pAdjPostion[  i  ] = 0.0);
-}
-else
-{
-iter-m_pAdjPositions[i].x = rArgs.mpDXArray[j - 1];
-SAL_INFO( vcl.ct, m_pAdjPostion[  i  ] = 
rArgs.mpDXArray[   j - 1   ]=   rArgs.mpDXArray[j -1]);
-}
-iter-m_pAdjPositions[i].y = iter-m_pPositions[i].y;
-}
-}
-else
-{
-SAL_INFO( vcl.ct, drop DXArray info);
-delete[] iter-m_pAdjPositions;
-iter-m_pAdjPositions = NULL;
-}
-}
-}
+int nPixelWidth = rArgs.mpDXArray ? rArgs.mpDXArray[ mnCharCount - 1 ] : 
rArgs.mnLayoutWidth;
+if( nPixelWidth = 0)
+return;
 
-void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
-{
-if( !mpCTLine)
+// HACK: justification requests which change the width by just one pixel 
are probably
+  

[Libreoffice-commits] core.git: vcl/quartz

2015-05-24 Thread Thorsten Wagner
 vcl/quartz/ctlayout.cxx |   60 +---
 1 file changed, 42 insertions(+), 18 deletions(-)

New commits:
commit 187af9b0c09f6ba57e994a25a756f0994beae7e5
Author: Thorsten Wagner thorsten.wagne...@gmail.com
Date:   Tue May 5 01:06:11 2015 +0200

tdf#87373: Bad text spacing on OS X

Adjustments to character positions less than one pixel are ignored.
These adjustments are probably introduced by lossy conversions between
integer based and float based coordinates.

DXArray elements are adjusted to integers avoiding cummulated rounding
differences.

Change-Id: I65d476301247251a7d329b14adb70be367538c97
Reviewed-on: https://gerrit.libreoffice.org/15633
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Khaled Hosny khaledho...@eglug.org

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 67733de..82d9c64 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -215,13 +215,17 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 return;
 }
 
-DeviceCoordinate nPixelWidth = 0;
-
 if(rArgs.mpDXArray  !(rArgs.mnFlags  SalLayoutFlags::BiDiRtl) )
 {
-nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
-if( nPixelWidth = 0)
+DeviceCoordinate nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
+
+// justification requests which change the width by just one pixel are 
probably
+// introduced by lossy conversions between integer based coordinate 
system
+DeviceCoordinate nOrigWidth = lrint( GetTextWidth() );
+if( (nPixelWidth = 0) || ((nOrigWidth = rint( nPixelWidth - 1 ))  
(nOrigWidth = rint( nPixelWidth + 1 ))) )
+{
 return;
+}
 ApplyDXArray( rArgs );
 if( mnTrailingSpaceCount )
 {
@@ -230,13 +234,15 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount - 1];
 mfTrailingSpaceWidth = nFullPixelWidth - nPixelWidth;
 if( nPixelWidth = 0)
+{
 return;
+}
 }
 mfCachedWidth = nPixelWidth;
 }
 else
 {
-nPixelWidth = rArgs.mnLayoutWidth;
+DeviceCoordinate nPixelWidth = rArgs.mnLayoutWidth;
 
 if( nPixelWidth = 0  rArgs.mnFlags  SalLayoutFlags::BiDiRtl)
 {
@@ -244,7 +250,9 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 }
 
 if( nPixelWidth = 0)
+{
 return;
+}
 
 // if the text to be justified has whitespace in it then
 // - Writer goes crazy with its HalfSpace magic
@@ -721,21 +729,27 @@ DeviceCoordinate CTLayout::GetTextWidth() const
 
 DeviceCoordinate CTLayout::FillDXArray( DeviceCoordinate* pDXArray ) const
 {
-DeviceCoordinate nPixWidth = GetTextWidth();
+DeviceCoordinate nPixelWidth = GetTextWidth();
+
 // short circuit requests which don't need full details
 if( !pDXArray )
-return nPixWidth;
+{
+return nPixelWidth;
+}
 
 for(int i = 0; i  mnCharCount; i++)
 {
 pDXArray[i] = 0.0;
 }
+
+// prepare the sub-pixel accurate logical-width array
+::std::vectorfloat aWidthVector( mnCharCount );
 if( mnTrailingSpaceCount  (mfTrailingSpaceWidth  0.0) )
 {
 const double fOneWidth = mfTrailingSpaceWidth / mnTrailingSpaceCount;
 for(int i = mnCharCount - mnTrailingSpaceCount; i  mnCharCount; i++)
 {
-pDXArray[i] = fOneWidth;
+aWidthVector[i] = fOneWidth;
 }
 }
 
@@ -743,9 +757,9 @@ DeviceCoordinate CTLayout::FillDXArray( DeviceCoordinate* 
pDXArray ) const
 CFArrayRef aGlyphRuns = CTLineGetGlyphRuns( mpCTLine );
 const int nRunCount = CFArrayGetCount( aGlyphRuns );
 typedef std::vectorCGSize CGSizeVector;
-CGSizeVector aSizeVec;
+CGSizeVector aSizeVector;
 typedef std::vectorCFIndex CFIndexVector;
-CFIndexVector aIndexVec;
+CFIndexVector aIndexVector;
 
 for( int nRunIndex = 0; nRunIndex  nRunCount; ++nRunIndex )
 {
@@ -753,19 +767,29 @@ DeviceCoordinate CTLayout::FillDXArray( DeviceCoordinate* 
pDXArray ) const
 const CFIndex nGlyphCount = CTRunGetGlyphCount( pGlyphRun );
 const CFRange aFullRange = CFRangeMake( 0, nGlyphCount );
 
-aSizeVec.resize( nGlyphCount );
-aIndexVec.resize( nGlyphCount );
-CTRunGetAdvances( pGlyphRun, aFullRange, aSizeVec[0] );
-CTRunGetStringIndices( pGlyphRun, aFullRange, aIndexVec[0] );
+aSizeVector.resize( nGlyphCount );
+aIndexVector.resize( nGlyphCount );
+CTRunGetAdvances( pGlyphRun, aFullRange, aSizeVector[0] );
+CTRunGetStringIndices( pGlyphRun, aFullRange, aIndexVector[0] );
 
 for( int i = 0; i != nGlyphCount; ++i )
 {
-const int nRelIdx = aIndexVec[i];
-SAL_INFO( vcl.ct, pDXArray[ g:  i  - c:  

[Libreoffice-commits] core.git: vcl/quartz

2015-05-03 Thread Khaled Hosny
 vcl/quartz/ctlayout.cxx |   49 +++-
 1 file changed, 20 insertions(+), 29 deletions(-)

New commits:
commit 1f059a591966b69e8943cefa1169a1b6526e2199
Author: Khaled Hosny khaledho...@eglug.org
Date:   Mon May 4 08:08:18 2015 +0300

Revert Fix tdf#87373: Kerning broken on OS X

This reverts commit bec8fc58a827c220b3f28462ae127cc1c571d1bf.

It does not really solve the bad spacing issue and it broke handling of
trailing whitespace in right-to-left text.

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index bf207b6..b9d4f1b 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -215,38 +215,19 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 return;
 }
 
-DeviceCoordinate nPixelWidth = rArgs.mnLayoutWidth;
+DeviceCoordinate nPixelWidth = 0;
 
-if( rArgs.mpDXArray  !(rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL) )
+if(rArgs.mpDXArray  !(rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL) )
 {
 nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
-}
-if( nPixelWidth = 0)
-{
-return;
-}
-// short-circuit when justifying an all-whitespace string
-if( mnTrailingSpaceCount = mnCharCount)
-{
-mfCachedWidth = nPixelWidth;
-return;
-}
-
-// justification requests which change the width by just one pixel are 
probably
-// introduced by lossy conversions between integer based coordinate system
-const DeviceCoordinate nOrigWidth = GetTextWidth();
-
-if( (nOrigWidth = nPixelWidth - 1)  (nOrigWidth = nPixelWidth + 1) )
-{
-return;
-}
-if( rArgs.mpDXArray  !(rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL) )
-{
+if( nPixelWidth = 0)
+return;
 ApplyDXArray( rArgs );
 if( mnTrailingSpaceCount )
 {
 DeviceCoordinate nFullPixelWidth = nPixelWidth;
-nPixelWidth = rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount 
- 1];
+nPixelWidth = (mnTrailingSpaceCount == mnCharCount) ? 0 :
+rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount - 1];
 mfTrailingSpaceWidth = nFullPixelWidth - nPixelWidth;
 if( nPixelWidth = 0)
 return;
@@ -255,6 +236,15 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 }
 else
 {
+nPixelWidth = rArgs.mnLayoutWidth;
+
+if( nPixelWidth = 0  rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL)
+{
+nPixelWidth = GetTextWidth();
+}
+
+if( nPixelWidth = 0)
+return;
 
 // if the text to be justified has whitespace in it then
 // - Writer goes crazy with its HalfSpace magic
@@ -265,10 +255,10 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 {
 mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( 
mpCTLine );
 nPixelWidth -= mfTrailingSpaceWidth;
-if( nPixelWidth = 0)
-{
-return;
-}
+}
+if(nPixelWidth = 0)
+{
+return;
 }
 
 // recreate the CoreText line layout without trailing spaces
@@ -295,6 +285,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 }
 CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, 
nPixelWidth);
 SAL_INFO( vcl.ct, CTLineCreateJustifiedLine(  mpCTLine  
,1.0,  nPixelWidth  ) =   pNewCTLine );
+
 if( !pNewCTLine )
 {
 // CTLineCreateJustifiedLine can and does fail
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-04-28 Thread Khaled Hosny
 vcl/quartz/ctfonts.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3e1dbbe21ddd9b40fde12da6cb680e91aa0a4e54
Author: Khaled Hosny khaledho...@eglug.org
Date:   Tue Apr 28 02:35:37 2015 +0300

tdf#71034: [OS X] Ugly (too heavy) fake bold

Instead of using a hardcoded stroking value, adopt the formula used by
AOO which seems to give better results.

Change-Id: I87d55e1fadccf4521c26cd60458d968fcd8a2386
Reviewed-on: https://gerrit.libreoffice.org/15553
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 02db1af..700c0e1 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -80,7 +80,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern rFSD )
  ((mpFontData-GetWeight()  WEIGHT_SEMIBOLD) 
   (mpFontData-GetWeight() != WEIGHT_DONTKNOW)) )
 {
-int nStroke = -10.0;
+int nStroke = -lrint((3.5F * pReqFont-GetWeight()) / 
mpFontData-GetWeight());
 CFNumberRef rStroke = CFNumberCreate(NULL, kCFNumberSInt32Type, 
nStroke);
 CFDictionarySetValue(mpStyleDict, kCTStrokeWidthAttributeName, 
rStroke);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-04-27 Thread Thorsten Wagner
 vcl/quartz/ctlayout.cxx |   49 
 1 file changed, 29 insertions(+), 20 deletions(-)

New commits:
commit bec8fc58a827c220b3f28462ae127cc1c571d1bf
Author: Thorsten Wagner thorsten.wagne...@gmail.com
Date:   Sun Apr 26 13:05:35 2015 +0200

Fix tdf#87373: Kerning broken on OS X

Adjustments to character positions less than one pixel are ignored.
These adjustments are probably introduced by lossy conversions between
integer based and float based coordinates.

Change-Id: Ie4506658aba7bb3e2b211817568676b099afef03
Reviewed-on: https://gerrit.libreoffice.org/15539
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index b9d4f1b..bf207b6 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -215,19 +215,38 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 return;
 }
 
-DeviceCoordinate nPixelWidth = 0;
+DeviceCoordinate nPixelWidth = rArgs.mnLayoutWidth;
 
-if(rArgs.mpDXArray  !(rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL) )
+if( rArgs.mpDXArray  !(rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL) )
 {
 nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
-if( nPixelWidth = 0)
-return;
+}
+if( nPixelWidth = 0)
+{
+return;
+}
+// short-circuit when justifying an all-whitespace string
+if( mnTrailingSpaceCount = mnCharCount)
+{
+mfCachedWidth = nPixelWidth;
+return;
+}
+
+// justification requests which change the width by just one pixel are 
probably
+// introduced by lossy conversions between integer based coordinate system
+const DeviceCoordinate nOrigWidth = GetTextWidth();
+
+if( (nOrigWidth = nPixelWidth - 1)  (nOrigWidth = nPixelWidth + 1) )
+{
+return;
+}
+if( rArgs.mpDXArray  !(rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL) )
+{
 ApplyDXArray( rArgs );
 if( mnTrailingSpaceCount )
 {
 DeviceCoordinate nFullPixelWidth = nPixelWidth;
-nPixelWidth = (mnTrailingSpaceCount == mnCharCount) ? 0 :
-rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount - 1];
+nPixelWidth = rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount 
- 1];
 mfTrailingSpaceWidth = nFullPixelWidth - nPixelWidth;
 if( nPixelWidth = 0)
 return;
@@ -236,15 +255,6 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 }
 else
 {
-nPixelWidth = rArgs.mnLayoutWidth;
-
-if( nPixelWidth = 0  rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL)
-{
-nPixelWidth = GetTextWidth();
-}
-
-if( nPixelWidth = 0)
-return;
 
 // if the text to be justified has whitespace in it then
 // - Writer goes crazy with its HalfSpace magic
@@ -255,10 +265,10 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 {
 mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( 
mpCTLine );
 nPixelWidth -= mfTrailingSpaceWidth;
-}
-if(nPixelWidth = 0)
-{
-return;
+if( nPixelWidth = 0)
+{
+return;
+}
 }
 
 // recreate the CoreText line layout without trailing spaces
@@ -285,7 +295,6 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 }
 CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, 
nPixelWidth);
 SAL_INFO( vcl.ct, CTLineCreateJustifiedLine(  mpCTLine  
,1.0,  nPixelWidth  ) =   pNewCTLine );
-
 if( !pNewCTLine )
 {
 // CTLineCreateJustifiedLine can and does fail
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-04-25 Thread Thorsten Wagner
 vcl/quartz/ctfonts.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3a96d8ead86dc210085f09076fd270f247442f0a
Author: Thorsten Wagner thorsten.wagne...@gmail.com
Date:   Fri Apr 24 00:11:41 2015 +0200

tdf#90822: Descenders cropped

Change-Id: I0985fb290c18630aab2d33a5ac59e32a172e7630
Reviewed-on: https://gerrit.libreoffice.org/15502
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 584ceaa..02db1af 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -123,10 +123,10 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricData 
rMetric ) const
 
 const CGFloat fAscent = CTFontGetAscent( aCTFontRef );
 const CGFloat fCapHeight = CTFontGetCapHeight( aCTFontRef );
-rMetric.mnAscent   = fAscent;
-rMetric.mnDescent  = CTFontGetDescent( aCTFontRef );
-rMetric.mnExtLeading   = CTFontGetLeading( aCTFontRef );
-rMetric.mnIntLeading   = fAscent - fCapHeight;
+rMetric.mnAscent   = lrint( fAscent );
+rMetric.mnDescent  = lrint( CTFontGetDescent( aCTFontRef ));
+rMetric.mnExtLeading   = lrint( CTFontGetLeading( aCTFontRef ));
+rMetric.mnIntLeading   = lrint( fAscent - fCapHeight );
 
 // since ImplFontMetricData::mnWidth is only used for stretching/squeezing 
fonts
 // setting this width to the pixel height of the fontsize is good enough
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-04-17 Thread Stephan Bergmann
 vcl/quartz/salbmp.cxx |   23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

New commits:
commit d457c25c491267999b1f82f2b4f76f7ccbe9cf37
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Apr 17 16:16:41 2015 +0200

Blind fix for ImplPixelFormat16

As pointed out by tml on IRC, its implementation looks completely bogus, and
together with the previous 40a26be24bd64a6c7c8cc98228fd440c8b9323b5
loplugin:implicitboolconversion gold that gives rise to the suspicion 
that the
class is effectively unused anyway.

Change-Id: If5fa5cdd1dac51f10dba7c77ad9975ee61ccc8be

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index a0e5ca4..2bb7b29 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -334,12 +334,10 @@ namespace {
 
 class ImplPixelFormat
 {
-protected:
-sal_uInt8* pData;
 public:
 static ImplPixelFormat* GetFormat( sal_uInt16 nBits, const BitmapPalette 
rPalette );
 
-virtual void StartLine( sal_uInt8* pLine ) { pData = pLine; }
+virtual void StartLine( sal_uInt8* pLine ) = 0;
 virtual void SkipPixel( sal_uInt32 nPixel ) = 0;
 virtual ColorData ReadPixel() = 0;
 virtual void WritePixel( ColorData nColor ) = 0;
@@ -349,7 +347,9 @@ public:
 class ImplPixelFormat32 : public ImplPixelFormat
 // currently ARGB-format for 32bit depth
 {
+sal_uInt8* pData;
 public:
+virtual void StartLine( sal_uInt8* pLine ) SAL_OVERRIDE { pData = pLine; }
 virtual void SkipPixel( sal_uInt32 nPixel ) SAL_OVERRIDE
 {
 pData += nPixel  2;
@@ -372,7 +372,9 @@ public:
 class ImplPixelFormat24 : public ImplPixelFormat
 // currently BGR-format for 24bit depth
 {
+sal_uInt8* pData;
 public:
+virtual void StartLine( sal_uInt8* pLine ) SAL_OVERRIDE { pData = pLine; }
 virtual void SkipPixel( sal_uInt32 nPixel ) SAL_OVERRIDE
 {
 pData += (nPixel  1) + nPixel;
@@ -394,13 +396,12 @@ public:
 class ImplPixelFormat16 : public ImplPixelFormat
 // currently R5G6B5-format for 16bit depth
 {
-protected:
-sal_uInt16* pData16;
+sal_uInt16* pData;
 public:
 
 virtual void StartLine( sal_uInt8* pLine ) SAL_OVERRIDE
 {
-pData16 = reinterpret_castsal_uInt16*(pLine);
+pData = reinterpret_castsal_uInt16*(pLine);
 }
 virtual void SkipPixel( sal_uInt32 nPixel ) SAL_OVERRIDE
 {
@@ -408,14 +409,14 @@ public:
 }
 virtual ColorData ReadPixel() SAL_OVERRIDE
 {
-const ColorData c = RGB_COLORDATA( (*pData  0x7c00)  7, (*pData  
0x03e0)  2 , (*pData  0x001f)  3 );
+const ColorData c = RGB_COLORDATA( (*pData  0xf800)  8, (*pData  
0x07e0)  3 , (*pData  0x001f)  3 );
 pData++;
 return c;
 }
 virtual void WritePixel( ColorData nColor ) SAL_OVERRIDE
 {
-*pData++ =  ((COLORDATA_RED( nColor )  0xf8 )  7 ) |
-((COLORDATA_GREEN( nColor )  0xf8 )  2 ) |
+*pData++ =  ((COLORDATA_RED( nColor )  0xf8 )  8 ) |
+((COLORDATA_GREEN( nColor )  0xfc )  3 ) |
 ((COLORDATA_BLUE( nColor )  0xf8 )  3 );
 }
 };
@@ -423,6 +424,7 @@ public:
 class ImplPixelFormat8 : public ImplPixelFormat
 {
 private:
+sal_uInt8* pData;
 const BitmapPalette mrPalette;
 
 public:
@@ -430,6 +432,7 @@ public:
 : mrPalette( rPalette )
 {
 }
+virtual void StartLine( sal_uInt8* pLine ) SAL_OVERRIDE { pData = pLine; }
 virtual void SkipPixel( sal_uInt32 nPixel ) SAL_OVERRIDE
 {
 pData += nPixel;
@@ -448,6 +451,7 @@ public:
 class ImplPixelFormat4 : public ImplPixelFormat
 {
 private:
+sal_uInt8* pData;
 const BitmapPalette mrPalette;
 sal_uInt32 mnX;
 sal_uInt32 mnShift;
@@ -489,6 +493,7 @@ public:
 class ImplPixelFormat1 : public ImplPixelFormat
 {
 private:
+sal_uInt8* pData;
 const BitmapPalette mrPalette;
 sal_uInt32 mnX;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-04-16 Thread Stephan Bergmann
 vcl/quartz/salbmp.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 40a26be24bd64a6c7c8cc98228fd440c8b9323b5
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Apr 16 21:19:06 2015 +0200

loplugin:implicitboolconversion gold

Change-Id: Ie0768c822d1271cacd230f8bd9a4c7987e1ebba3

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index fd0fe7d..a0e5ca4 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -414,8 +414,8 @@ public:
 }
 virtual void WritePixel( ColorData nColor ) SAL_OVERRIDE
 {
-*pData++ =  ((COLORDATA_RED( nColor )  0xf8 )  7 ) ||
-((COLORDATA_GREEN( nColor )  0xf8 )  2 ) ||
+*pData++ =  ((COLORDATA_RED( nColor )  0xf8 )  7 ) |
+((COLORDATA_GREEN( nColor )  0xf8 )  2 ) |
 ((COLORDATA_BLUE( nColor )  0xf8 )  3 );
 }
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-03-30 Thread Tor Lillqvist
 vcl/quartz/salgdicommon.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 17309d29794951cd07376a1bfcc547b418a28241
Author: Tor Lillqvist t...@collabora.com
Date:   Mon Mar 30 01:38:34 2015 +0300

Don't crash if no screens available (no access to the window system)

Fixes a crash when running gengal on OS X in a ssh session when not
logged in through the window system at the same time.

Change-Id: I6a47666aeac43fc140f52ae2d62b36eadc976246

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 8cbbf65..ac65c77 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1693,7 +1693,7 @@ void AquaSalGraphics::initResolution( NSWindow* )
 if( pScreen == nil )
 {
 NSArray* pScreens = [NSScreen screens];
-if( pScreens )
+if( pScreens  [pScreens count]  0)
 pScreen = [pScreens objectAtIndex: 0];
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2015-01-28 Thread Stephan Bergmann
 vcl/quartz/ctfonts.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 787efbe6b155d6dde0d38000b108fd210471bb22
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jan 28 14:16:28 2015 +0100

loplugin:cstylecast (Mac OS X)

Change-Id: If1fd605c01fa892c7730930606a29a7bed9edb5e

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 5fb772b..fd42315 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -324,7 +324,7 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool
 // TODO: use other traits such as MonoSpace/Condensed/Expanded or Vertical 
too
 SInt64 nSymbolTrait = 0;
 CFNumberRef pSymbolNum = NULL;
-if( CFDictionaryGetValueIfPresent( pAttrDict, kCTFontSymbolicTrait, (const 
void**)pSymbolNum ) ) {
+if( CFDictionaryGetValueIfPresent( pAttrDict, kCTFontSymbolicTrait, 
reinterpret_castconst void**(pSymbolNum) ) ) {
 CFNumberGetValue( pSymbolNum, kCFNumberSInt64Type, nSymbolTrait );
 rDFA.SetSymbolFlag( ((nSymbolTrait  kCTFontClassMaskTrait) == 
kCTFontSymbolicClass) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-12-03 Thread galbarnissan
 vcl/quartz/ctlayout.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 00fda95ae461120d515d7cbdcadf8834b6ff12fe
Author: galbarnissan gal.bar.nis...@cloudon.com
Date:   Wed Dec 3 11:55:31 2014 +0200

fdo#85806: Hebrew and Arabic is not working on MAC

Change-Id: Id4476a041eb539d0b9c1227070289d34a939c6f6
Reviewed-on: https://gerrit.libreoffice.org/13288
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 759b3f5..5803976 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -217,7 +217,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 
 DeviceCoordinate nPixelWidth = 0;
 
-if(rArgs.mpDXArray)
+if(rArgs.mpDXArray  !(rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL) )
 {
 nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
 if( nPixelWidth = 0)
@@ -231,18 +231,18 @@ void CTLayout::AdjustLayout( ImplLayoutArgs rArgs )
 mfTrailingSpaceWidth = nFullPixelWidth - nPixelWidth;
 if( nPixelWidth = 0)
 return;
-// in RTL-layouts trailing spaces are leftmost
-// TODO: use BiDi-algorithm to thoroughly check this assumption
-if( rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL)
-{
-mfBaseAdv = mfTrailingSpaceWidth;
-}
 }
 mfCachedWidth = nPixelWidth;
 }
 else
 {
 nPixelWidth = rArgs.mnLayoutWidth;
+
+if( nPixelWidth = 0  rArgs.mnFlags  SAL_LAYOUT_BIDI_RTL)
+{
+nPixelWidth = GetTextWidth();
+}
+
 if( nPixelWidth = 0)
 return;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-11-15 Thread Tor Lillqvist
 vcl/quartz/salgdi.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 1defd9aeb9c051dc3b719bade5edb58462b4b817
Author: Tor Lillqvist t...@collabora.com
Date:   Sun Nov 16 08:31:16 2014 +0200

Avoid error: redefinition of 'GetImpl' for iOS

Whether this stuff actually works at all for iOS any more I have no
idea, and can't be bothered to check in my own time. Why do I bother
fixing compilation errors then? Good question.

Change-Id: If0ec4fbde42536d3d90e8c5337948815b5f47cef

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index f133dfd..0b1ffef 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -315,11 +315,15 @@ AquaSalGraphics::~AquaSalGraphics()
 }
 }
 
+#ifndef IOS
+
 SalGraphicsImpl* AquaSalGraphics::GetImpl() const
 {
 return NULL;
 }
 
+#endif
+
 void AquaSalGraphics::SetTextColor( SalColor nSalColor )
 {
 maTextColor = RGBAColor( nSalColor );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-09-15 Thread Stephan Bergmann
 vcl/quartz/salgdi.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5e9e36f251f3dbd33521ebe41a747db8b9f7ce06
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Sep 15 14:28:59 2014 +0200

Missing GetImplFontCapabilities - GetFontCapabilities

Change-Id: I5fa85ebe407d72654e95075626d8102f037374c7

diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index dda82ef..80d6d5e 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -133,7 +133,7 @@ const ImplFontCharMap* 
CoreTextFontData::GetImplFontCharMap() const
 return mpCharMap;
 }
 
-bool CoreTextFontData::GetImplFontCapabilities(vcl::FontCapabilities 
rFontCapabilities) const
+bool CoreTextFontData::GetFontCapabilities(vcl::FontCapabilities 
rFontCapabilities) const
 {
 // read this only once per font
 if( mbFontCapabilitiesRead )
@@ -502,7 +502,7 @@ bool 
AquaSalGraphics::GetFontCapabilities(vcl::FontCapabilities rFontCapabiliti
 if( !mpFontData )
 return false;
 
-return mpFontData-GetImplFontCapabilities(rFontCapabilities);
+return mpFontData-GetFontCapabilities(rFontCapabilities);
 }
 
 // fake a SFNT font directory entry for a font table
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-09-03 Thread Tor Lillqvist
 vcl/quartz/salbmp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 633e5e16cd233cbb28b24527bb27bf5463ea7276
Author: Tor Lillqvist t...@collabora.com
Date:   Wed Sep 3 19:01:30 2014 +0200

What is a ridiculous size in 32-bit code is also ridiculous in 64-bit code

Avoids the CppunitTest_vcl_filters_test allocating an insane amount of
memory when run as 64-bit on OS X.

Change-Id: I978347849c2cf5fd1663e5a85a788b736e239e94

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 2704dc4..a980510 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -303,7 +303,7 @@ bool QuartzSalBitmap::AllocateUserData()
 
 bool alloc = false;
 if (mnBytesPerRow != 0
- mnBytesPerRow = std::numeric_limitsstd::size_t::max() / mnHeight)
+ mnBytesPerRow = std::numeric_limitssal_uInt32::max() / mnHeight)
 {
 try
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-07-20 Thread Norbert Thiebaud
 vcl/quartz/ctlayout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9fe24ebe32b18ef8371e1b1d168fa64a48a73b37
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Sun Jul 20 23:10:37 2014 +0200

vcl mac SDK issue with API manipulating Rect

Change-Id: Icad89fe16e428a5e4d87ab4b19131bdd804528b7

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index b02ed15..7c851d3 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -543,7 +543,7 @@ void CTLayout::drawCTLine(AquaSalGraphics rAquaGraphics, 
CTLineRef ctline, cons
 
 CTRunGetPositions(run, glyphRange, position);
 CTRunGetAdvances(run, glyphRange, advance);
-CGRect bulletRect = NSMakeRect(aTextPos.x + position.x 
+ advance.width / 4,
+CGRect bulletRect = CGRectMake(aTextPos.x + position.x 
+ advance.width / 4,
aTextPos.y + position.y + 
ascent / 3 - baseSize / 5,  baseSize / 5, baseSize / 5 );
 CGContextSaveGState(context);
 RGBAColor bulletColor(MAKE_SALCOLOR(0x26, 0x8b, 0xd2 
)); // NON_PRINTING_CHARACTER_COLOR
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-06-14 Thread Douglas Mencken
 vcl/quartz/ctfonts.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 4af1b789545bc3815f79fafed5b1806b3c08b69d
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Thu Jun 12 14:38:10 2014 -0400

workaround for kCTForegroundColorFromContextAttributeName unavailability

fixes error: ‘kCTForegroundColorFromContextAttributeName’ was not 
declared in this scope

see commits:
  5bc5387669bca8a0b410e295b0992fd2424a1536

Change-Id: Ifdf69ab2f9a6437d18a6d3e3f5d756beeed3ba5c
Reviewed-on: https://gerrit.libreoffice.org/9758
Reviewed-by: Noel Grandin noelgran...@gmail.com
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index d2e3d32..38cf249 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -27,6 +27,10 @@
 #ifdef MACOSX
 #include osx/salinst.h
 #include osx/saldata.hxx
+// kCTForegroundColorFromContextAttributeName is available on 10.5, but it is 
hidden
+#ifndef kCTForegroundColorFromContextAttributeName
+extern const CFStringRef kCTForegroundColorFromContextAttributeName;
+#endif
 #endif
 #include quartz/salgdi.h
 #include quartz/utils.h
@@ -103,7 +107,6 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern rFSD 
)
 // allow delayed setting the font color, i.e. after the text layout
 CFDictionarySetValue( mpStyleDict, 
kCTForegroundColorFromContextAttributeName, kCFBooleanTrue );
 
-
 #if 0 // LastResort is implicit in CoreText's font cascading
 const void* aGFBDescriptors[] = { CTFontDescriptorCreateWithNameAndSize( 
CFSTR(LastResort), 0) }; // TODO: use the full GFB list
 const int nGfbCount = sizeof(aGFBDescriptors) / sizeof(*aGFBDescriptors);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-06-03 Thread Herbert Dürr
 vcl/quartz/salgdiutils.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ee9dd6c086f7bda615d5b28d3319a83ce1673607
Author: Herbert Dürr h...@apache.org
Date:   Mon Jun 2 11:47:23 2014 +

#i125020# fix rounding error in AquaSalGraphics::RefreshRect()

Rounding left and width down can accumulate a rounding error of almost two 
in
the calculation of right. The existing code compensates for this by 
increasing
the width by two, but since left has been decremented by one to accommodate 
for
antialiasing artifacts this compensation is one to few by itself and two to 
few
when accounting for antialiasing artifacts on the right. Y-pos and height 
have
the same problems and get the matching fix.

(cherry picked from commit 073ec69fb970830d39c8700317ee74dbbdfd1fda)

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index c251203..639398f 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -184,8 +184,8 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float 
lWidth, float lHeigh
 // this helps with antialiased rendering
 const Rectangle aVclRect(Point(static_castlong int(lX-1),
 static_castlong int(lY-1) ),
- Size(  static_castlong int(lWidth+2),
-static_castlong int(lHeight+2) ) );
+ Size(  static_castlong int(lWidth+3),
+static_castlong int(lHeight+3) ) );
 mpFrame-maInvalidRect.Union( aVclRect );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2014-06-03 Thread Herbert Dürr
 vcl/quartz/ctlayout.cxx |   35 +++
 1 file changed, 27 insertions(+), 8 deletions(-)

New commits:
commit 687f0c9300d499b78deea2890b4c2019adb2d67d
Author: Herbert Dürr h...@apache.org
Date:   Tue May 20 12:00:50 2014 +

Resolves: #i124935# fix expanded/condensed text breaking...

in the CoreText engine

the concept of an extra-width per code-unit was obsolete at least since apps
supported unicode with its different normalization forms, diacritical marks,
surrogate-pairs, non-printing characters such as ZWJ/ZWNJ/RLM, etc.  so of
course modern engines like CoreText don't aid this typographical crime.

The fix here extends the CTLayout::GetTextBreak() method to handle the 
obsolete
semantic of per code-unit extra-widths by successively approximating the 
number
of involved code-units.
(cherry picked from commit a9b9ceff86f35be1eeff5f251d24e338db760a1e)

Conflicts:
vcl/aqua/source/gdi/ctlayout.cxx

Change-Id: I52a7f7488a9e8a303ed7271df2a24a3c85098ce3

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 347cc5e..8c42cc8 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -580,20 +580,39 @@ long CTLayout::FillDXArray( sal_Int32* pDXArray ) const
 return nPixWidth;
 }
 
-sal_Int32 CTLayout::GetTextBreak( long nMaxWidth, long /*nCharExtra*/, int 
nFactor ) const
+sal_Int32 CTLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor 
) const
 {
 if( !mpCTLine )
 return -1;
 
 CTTypesetterRef aCTTypeSetter = CTTypesetterCreateWithAttributedString( 
mpAttrString );
-const double fCTMaxWidth = (double)nMaxWidth / nFactor;
-CFIndex nIndex = CTTypesetterSuggestClusterBreak( aCTTypeSetter, 0, 
fCTMaxWidth );
-CFRelease( aCTTypeSetter );
-
-if( nIndex = mnCharCount )
-return -1;
+CFIndex nBestGuess = (nCharExtra = 0) ? 0 : mnCharCount;
+for( int i = 1; i = mnCharCount; i *= 2 )
+{
+// guess the target width considering char-extra expansion/condensation
+const double nTargetWidth = nMaxWidth - nBestGuess * nCharExtra;
+const double fCTMaxWidth = nTargetWidth / nFactor;
+// calculate the breaking index for the guessed target width
+const CFIndex nNewIndex = CTTypesetterSuggestClusterBreak( 
aCTTypeSetter, 0, fCTMaxWidth );
+if( nNewIndex = mnCharCount ) {
+CFRelease( aCTTypeSetter );
+return -1;
+}
+// check if the original extra-width guess was good
+if( !nCharExtra )
+nBestGuess = nNewIndex;
+if( nBestGuess == nNewIndex )
+break;
+// prepare another round for a different number of characters
+CFIndex nNewGuess = (nNewIndex + nBestGuess + 1) / 2;
+if( nNewGuess == nBestGuess )
+nNewGuess += (nNewIndex  nBestGuess) ? +1 : -1;
+nBestGuess = nNewGuess;
+}
 
-nIndex += mnMinCharPos;
+// suggest the best fitting cluster break as breaking position
+CFRelease( aCTTypeSetter );
+const int nIndex = nBestGuess + mnMinCharPos;
 return nIndex;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >