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

2022-12-11 Thread Patrick Luby (via logerrit)
 vcl/inc/quartz/salbmp.h|6 +
 vcl/osx/salinst.cxx|6 +
 vcl/quartz/AquaGraphicsBackend.cxx |  139 +
 vcl/quartz/salbmp.cxx  |   60 +++
 4 files changed, 210 insertions(+), 1 deletion(-)

New commits:
commit 9eb732a32023e74c44ac8c3b5af9f5424273bb6c
Author: Patrick Luby 
AuthorDate: Sat Dec 10 14:16:39 2022 -0500
Commit: Caolán McNamara 
CommitDate: Sun Dec 11 20:02:53 2022 +

Related: tdf#146842 Convert SkiaSalBitmap to QuartzSalBitmap

Commit de3f13e2175564316eb5a62dee65e9ff8f31b460 disabled Skia for printing.
However, since all SalBitmaps created are either all QuartzSalBitmaps or all
SkiaSalBitmaps, a crash occurs whenever a SkiaSalBitmap is passed to a
printer's SalGraphics instance which is now always non-Skia.

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

diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h
index 8a9e94d043cc..459a2b528f99 100644
--- a/vcl/inc/quartz/salbmp.h
+++ b/vcl/inc/quartz/salbmp.h
@@ -30,6 +30,9 @@
 #include 
 #include 
 #include 
+#if HAVE_FEATURE_SKIA
+#include 
+#endif
 
 #include 
 
@@ -61,6 +64,9 @@ public:
 boolCreate( const SalBitmap& rSalBmp ) override;
 boolCreate( const SalBitmap& rSalBmp, SalGraphics* pGraphics ) 
override;
 boolCreate( const SalBitmap& rSalBmp, vcl::PixelFormat 
eNewPixelFormat) override;
+#if HAVE_FEATURE_SKIA
+boolCreate( const SkiaSalBitmap& rSkiaSalBmp, const 
SalTwoRect& rPosAry );
+#endif
 virtual boolCreate( const css::uno::Reference< 
css::rendering::XBitmapCanvas >& rBitmapCanvas,
 Size& rSize,
 bool bMask = false ) override;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index e7f202ae7ae5..22a024bc265d 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -524,7 +524,11 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* 
pEvent )
 bool AquaSalInstance::RunInMainYield( bool bHandleAllCurrentEvents )
 {
 OSX_SALDATA_RUNINMAIN_UNION( DoYield( false, bHandleAllCurrentEvents), 
boolean )
-assert( false && "Don't call this from the main thread!" );
+
+// PrinterController::removeTransparencies() calls this frequently on the
+// main thread so reduce the severity from an assert so that printing still
+// works in a debug builds
+SAL_WARN_IF( true, "vcl", "Don't call this from the main thread!" );
 return false;
 
 }
diff --git a/vcl/quartz/AquaGraphicsBackend.cxx 
b/vcl/quartz/AquaGraphicsBackend.cxx
index 987ce5b784a5..7482986dd58a 100644
--- a/vcl/quartz/AquaGraphicsBackend.cxx
+++ b/vcl/quartz/AquaGraphicsBackend.cxx
@@ -44,6 +44,11 @@
 #include 
 #endif
 
+#if HAVE_FEATURE_SKIA
+#include 
+#include 
+#endif
+
 using namespace vcl;
 
 namespace
@@ -187,6 +192,48 @@ void drawPattern50(void*, CGContextRef rContext)
 CGContextAddRects(rContext, aRects, 2);
 CGContextFillPath(rContext);
 }
+
+#if HAVE_FEATURE_SKIA
+
+// Related: tdf#146842 Convert SkiaSalBitmap to QuartzSalBitmap
+// Commit de3f13e2175564316eb5a62dee65e9ff8f31b460 disabled Skia for printing.
+// However, since all SalBitmaps created are either all QuartzSalBitmaps or all
+// SkiaSalBitmaps, a crash occurs whenever a SkiaSalBitmap is passed to a
+// printer's SalGraphics instance which is now always non-Skia.
+QuartzSalBitmap* checkAndConvertToQuartzSalBitmap(const SalTwoRect& rPosAry,
+  const SalBitmap& rSalBitmap,
+  SalTwoRect* 
pAdjustedSrcPosAry)
+{
+QuartzSalBitmap* pRet = nullptr;
+
+if (SkiaHelper::isVCLSkiaEnabled() && dynamic_cast())
+{
+const SkiaSalBitmap& rSkiaBitmap = static_cast(rSalBitmap);
+
+SalTwoRect aSrcPosAry(rPosAry);
+aSrcPosAry.mnDestX = 0;
+aSrcPosAry.mnDestY = 0;
+
+pRet = new QuartzSalBitmap;
+if (pRet)
+{
+// Ignore any failures as returning a nullptr will lead to a crash
+pRet->Create(rSkiaBitmap, aSrcPosAry);
+
+if (pAdjustedSrcPosAry)
+{
+pAdjustedSrcPosAry->mnSrcX = 0;
+pAdjustedSrcPosAry->mnSrcY = 0;
+pAdjustedSrcPosAry->mnSrcWidth = aSrcPosAry.mnDestWidth;
+pAdjustedSrcPosAry->mnSrcHeight = aSrcPosAry.mnDestHeight;
+}
+}
+}
+
+return pRet;
+}
+
+#endif
 }
 
 AquaGraphicsBackend::AquaGraphicsBackend(AquaSharedAttributes& rShared)
@@ -904,6 +951,21 @@ void AquaGraphicsBackend::drawBitmap(const SalTwoRect& 
rPosAry, const SalBitmap&
 if (!mrShared.checkContext())
 return;
 
+#if HAVE_FEATURE_SKIA
+if (mrShared.mbPrinter)
+{
+SAL_INFO("vcl.print", "Printing with 

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

2022-12-09 Thread Patrick Luby (via logerrit)
 vcl/inc/quartz/salgdi.h |2 +-
 vcl/osx/salprn.cxx  |2 +-
 vcl/quartz/salgdi.cxx   |   11 +--
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit de3f13e2175564316eb5a62dee65e9ff8f31b460
Author: Patrick Luby 
AuthorDate: Wed Dec 7 14:24:57 2022 -0500
Commit: Caolán McNamara 
CommitDate: Fri Dec 9 09:17:42 2022 +

tdf#146842 Do not use Skia for printing

Skia does not work with a native print graphics contexts. I am not sure why 
but from what I can see, the Skia implementation drawing to a bitmap buffer. 
However, in an NSPrintOperation, the print view's backing buffer is 
CGPDFContext so even if this bug could be solved by blitting the Skia bitmap 
buffer, the printed PDF would not have selectable text so always disable Skia 
for print graphics contexts.

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

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 61ff01c12e3a..9e070c4215ce 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -454,7 +454,7 @@ class AquaSalGraphics : public SalGraphicsAutoDelegateToImpl
 rtl::ReferencempFont[MAX_FALLBACK];
 
 public:
-AquaSalGraphics();
+AquaSalGraphics(bool bPrinter = false);
 virtual ~AquaSalGraphics() override;
 
 voidSetVirDevGraphics(SalVirtualDevice* 
pVirDev,CGLayerHolder const , CGContextRef, int nBitDepth = 0);
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index bec30a35b562..e9101e390085 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -71,7 +71,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const 
SalPrinterQueueInfo& i_rQueue ) :
 [mpPrintInfo setOrientation: NSPaperOrientationPortrait];
 }
 
-mpGraphics = new AquaSalGraphics();
+mpGraphics = new AquaSalGraphics(true);
 
 const int nWidth = 100, nHeight = 100;
 mpContextMemory.reset(new (std::nothrow) sal_uInt8[nWidth * 4 * nHeight]);
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 1058b7bc31e9..571e44f23e71 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -137,14 +137,21 @@ sal_IntPtr CoreTextFontFace::GetFontId() const
 return reinterpret_cast(mxFontDescriptor);
 }
 
-AquaSalGraphics::AquaSalGraphics()
+AquaSalGraphics::AquaSalGraphics(bool bPrinter)
 : mnRealDPIX( 0 )
 , mnRealDPIY( 0 )
 {
 SAL_INFO( "vcl.quartz", "AquaSalGraphics::AquaSalGraphics() this=" << this 
);
 
 #if HAVE_FEATURE_SKIA
-if(SkiaHelper::isVCLSkiaEnabled())
+// tdf#146842 Do not use Skia for printing
+// Skia does not work with a native print graphics contexts. I am not sure
+// why but from what I can see, the Skia implementation drawing to a bitmap
+// buffer. However, in an NSPrintOperation, the print view's backing buffer
+// is CGPDFContext so even if this bug could be solved by blitting the
+// Skia bitmap buffer, the printed PDF would not have selectable text so
+// always disable Skia for print graphics contexts.
+if(!bPrinter && SkiaHelper::isVCLSkiaEnabled())
 mpBackend.reset(new AquaSkiaSalGraphicsImpl(*this, maShared));
 #else
 if(false)


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

2022-10-12 Thread Noel Grandin (via logerrit)
 vcl/inc/osx/saldata.hxx|3 ++-
 vcl/inc/quartz/ctfonts.hxx |2 +-
 vcl/inc/quartz/salgdi.h|8 +---
 vcl/osx/saldata.cxx|2 +-
 vcl/quartz/ctfonts.cxx |   12 +---
 vcl/quartz/salgdi.cxx  |   11 ++-
 vcl/skia/osx/gdiimpl.cxx   |2 +-
 7 files changed, 21 insertions(+), 19 deletions(-)

New commits:
commit 2e78c92dfeefc301b1cc69130433917c3e77bfdc
Author: Noel Grandin 
AuthorDate: Mon Oct 3 16:00:11 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 12 13:09:24 2022 +0200

use unique_ptr for SystemFontList, fix leak

Using unique_ptr here fixes a leak, which in turn was hiding
the fact that we don't manage the lifecycle of CTFontDescriptor
in CoreTextFontFace properly

Change-Id: I2ade5fae9a40ad0ebb10538488018941f3f285c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140916
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index e201f45715c2..ba4d6e8c856b 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -68,7 +69,7 @@ public:
 SalObject*mpFirstObject;// pointer 
of first object window
 SalVirtualDevice *mpFirstVD;// first 
VirDev
 SalPrinter   *mpFirstPrinter;   // first 
printing printer
-SystemFontList   *mpFontList;
+std::unique_ptr   mpFontList;
 NSStatusItem* mpStatusItem; // one 
status item that draws all our statuses
 // at the 
moment this is only one add menu button
 CGColorSpaceRef   mxRGBSpace;
diff --git a/vcl/inc/quartz/ctfonts.hxx b/vcl/inc/quartz/ctfonts.hxx
index 431385aeeda6..be68dea71c9a 100644
--- a/vcl/inc/quartz/ctfonts.hxx
+++ b/vcl/inc/quartz/ctfonts.hxx
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-SystemFontList* GetCoretextFontList();
+std::unique_ptr GetCoretextFontList();
 FontAttributes DevFontFromCTFontDescriptor(CTFontDescriptorRef, bool*);
 
 #endif // INCLUDED_VCL_INC_QUARTZ_CTFONTS_HXX
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 0bf004033c52..5d2611f5b06e 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -61,11 +61,13 @@ class XorEmulation;
 class CoreTextFontFace : public vcl::font::PhysicalFontFace
 {
 public:
-CoreTextFontFace( const FontAttributes&, 
sal_IntPtr nFontID );
+CoreTextFontFace( const FontAttributes&, 
CTFontDescriptorRef xRef );
 virtual ~CoreTextFontFace() override;
 
 sal_IntPtr  GetFontId() const override;
 
+CTFontDescriptorRef GetFontDescriptorRef() const { return 
mxFontDescriptor; }
+
 int GetFontTable( uint32_t nTagCode, unsigned 
char* ) const;
 
 rtl::Reference CreateFontInstance(const 
vcl::font::FontSelectPattern&) const override;
@@ -73,7 +75,7 @@ public:
 virtual hb_blob_t*  GetHbTable(hb_tag_t nTag) const override;
 
 private:
-const sal_IntPtrmnFontId;
+CTFontDescriptorRef mxFontDescriptor;
 };
 
 class CoreTextStyle final : public LogicalFontInstance
@@ -96,7 +98,7 @@ public:
 bool mbFauxBold;
 
 private:
-explicit CoreTextStyle(const vcl::font::PhysicalFontFace&, const 
vcl::font::FontSelectPattern&);
+explicit CoreTextStyle(const CoreTextFontFace&, const 
vcl::font::FontSelectPattern&);
 
 virtual void ImplInitHbFont(hb_font_t*) override;
 bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const 
override;
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index d49df78d2ccf..e3b6703d0878 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #import "apple_remote/RemoteMainController.h"
 
@@ -49,7 +50,6 @@ SalData::SalData()
 mpFirstObject( nullptr ),
 mpFirstVD( nullptr ),
 mpFirstPrinter( nullptr ),
-mpFontList( nullptr ),
 mpStatusItem( nil ),
 mxRGBSpace( CGColorSpaceCreateWithName(kCGColorSpaceSRGB) ),
 mxGraySpace( CGColorSpaceCreateWithName(kCGColorSpaceGenericGrayGamma2_2) 
),
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 887abe4f2f35..298a5274aa1f 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -41,7 +41,7 @@
 #include 
 #include 
 
-CoreTextStyle::CoreTextStyle(const vcl::font::PhysicalFontFace& rPFF, const 
vcl::font::FontSelectPattern& rFSP)
+CoreTextStyle::CoreTextStyle(const CoreTextFontFace& rPFF, const 
vcl::font::FontSelectPattern& rFSP)
 : LogicalFontInstance(rPFF, rFSP)
 , 

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

2021-01-28 Thread Stephan Bergmann (via logerrit)
 vcl/inc/quartz/salgdi.h |1 
 vcl/osx/salgdiutils.cxx |   50 
 vcl/osx/salmacos.cxx|2 -
 vcl/quartz/salgdi.cxx   |8 +++
 4 files changed, 36 insertions(+), 25 deletions(-)

New commits:
commit b3737c638671ab39c5e6aaeaf5426d102392cc0a
Author: Stephan Bergmann 
AuthorDate: Thu Jan 28 09:39:48 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 28 10:43:09 2021 +0100

Revert "tdf#138122 Detect window scaling for multi display configurations 
on macOS"

This reverts commit f318b856ed055f1952276355f811153f6b29c93e.
It appears this reliably causes CppunitTest_vcl_backend_test to fail on 
macOS on
at least tb69, see e.g.  and
,

  [_RUN_] BackendTest::testDrawBlendExtended
  
/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/vcl/qa/cppunit/BackendTest.cxx:688:BackendTest::testDrawBlendExtended
  equality assertion failed
  - Expected: c[80ff]
  - Actual  : c[]

  BackendTest::testDrawBlendExtended finished in: 1ms
  [_RUN_] BackendTest::testDrawAlphaBitmapMirrored
  
/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/vcl/qa/cppunit/BackendTest.cxx:749:BackendTest::testDrawAlphaBitmapMirrored
  equality assertion failed
  - Expected: c[ffff]
  - Actual  : c[00ff]

  BackendTest::testDrawAlphaBitmapMirrored finished in: 1ms
  [_RUN_] BackendTest::testTdf124848
  
/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/vcl/qa/cppunit/BackendTest.cxx:808:BackendTest::testTdf124848
  equality assertion failed
  - Expected: c[00ff]
  - Actual  : c[]

And it also causes my local macOS 11.1 ARM64 build to consistently fail that
way, both the original patch set 1 (with the older parent) and the submitted
patch set 2 (with a newer parent).

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

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 4897d96c6089..69b735787bdc 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,6 +174,7 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
+boolmbWindowScaling;
 
 #else // IOS
 
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index f3ddd946f699..01626d348999 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,35 +35,37 @@
 #include 
 #include 
 
-// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
-// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
+float AquaSalGraphics::GetWindowScaling()
+{
+float fScale = 1.0f;
 
-// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
-// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
-// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
-// scaling when displays are added while application is running is not 
supported.
+#ifdef MACOSX
 
-static bool  bWindowScaling = false;
-static float fWindowScale = 1.0f;
+// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
+// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
+// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
+// text and graphics.
 
-float AquaSalGraphics::GetWindowScaling()
-{
-if (!bWindowScaling)
+// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
+
+if (mbWindowScaling)
 {
-NSArray *aScreens = [NSScreen screens];
-if (aScreens != nullptr)
-{
-int nScreens = [aScreens count];
-for (int i = 0; i < nScreens; i++)
-{
-float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
-if (fScale > fWindowScale)
-  fWindowScale = fScale;
-}
-bWindowScaling = true;
-}
+fScale = 

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

2021-01-27 Thread Thorsten Wagner (via logerrit)
 vcl/inc/quartz/salgdi.h |1 
 vcl/osx/salgdiutils.cxx |   50 +++-
 vcl/osx/salmacos.cxx|2 -
 vcl/quartz/salgdi.cxx   |8 ---
 4 files changed, 25 insertions(+), 36 deletions(-)

New commits:
commit f318b856ed055f1952276355f811153f6b29c93e
Author: Thorsten Wagner 
AuthorDate: Wed Jan 27 01:01:10 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Wed Jan 27 10:09:59 2021 +0100

tdf#138122 Detect window scaling for multi display configurations on macOS

(1) Activate window scaling when at least one retina display is connected

(2) Remove environment variable VCL_MACOS_FORCE_WINDOW_SCALING

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

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 69b735787bdc..4897d96c6089 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,7 +174,6 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
-boolmbWindowScaling;
 
 #else // IOS
 
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index 01626d348999..f3ddd946f699 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,37 +35,35 @@
 #include 
 #include 
 
-float AquaSalGraphics::GetWindowScaling()
-{
-float fScale = 1.0f;
-
-#ifdef MACOSX
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
-// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
-// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
-// text and graphics.
+// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
+// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
 
-// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
-
-if (mbWindowScaling)
-{
-fScale = 2.0f;
-return fScale;
-}
+// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
+// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
+// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
+// scaling when displays are added while application is running is not 
supported.
 
-#endif
+static bool  bWindowScaling = false;
+static float fWindowScale = 1.0f;
 
-AquaSalFrame *pSalFrame = mpFrame;
-if (!pSalFrame)
-pSalFrame = static_cast(GetSalData()->mpInstance->anyFrame());
-if (pSalFrame)
+float AquaSalGraphics::GetWindowScaling()
+{
+if (!bWindowScaling)
 {
-NSWindow *pNSWindow = pSalFrame->getNSWindow();
-if (pNSWindow)
-fScale = [pNSWindow backingScaleFactor];
+NSArray *aScreens = [NSScreen screens];
+if (aScreens != nullptr)
+{
+int nScreens = [aScreens count];
+for (int i = 0; i < nScreens; i++)
+{
+float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
+if (fScale > fWindowScale)
+  fWindowScale = fScale;
+}
+bWindowScaling = true;
+}
 }
-return fScale;
+return fWindowScale;
 }
 
 void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame )
diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx
index 0f41dd9e8c4a..5b1265130cd0 100644
--- a/vcl/osx/salmacos.cxx
+++ b/vcl/osx/salmacos.cxx
@@ -19,7 +19,7 @@
 
 // This file contains the macOS-specific versions of the functions which were 
touched in the commit
 // to fix tdf#138122. The iOS-specific versions of these functions are kept 
(for now, when this
-// comment is written) as they were before that commit in vcl/isx/salios.cxx.
+// comment is written) as they were before that commit in vcl/ios/salios.cxx.
 
 #include 
 #include 
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 8dd9ec9222ad..ae6a40cfd4e2 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -205,14 +205,6 @@ AquaSalGraphics::AquaSalGraphics()
 , mbVirDev( false )
 #ifdef MACOSX
 , mbWindow( false )
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable. If
-// unset window scaling from main display will be used. After 

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

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/inc/osx/salframe.h   |   19 ++-
 vcl/inc/osx/salinst.h|3 +
 vcl/inc/osx/salobj.h |7 ++--
 vcl/inc/osx/salprn.h |   11 --
 vcl/inc/quartz/salgdi.h  |   36 +++-
 vcl/inc/quartz/salvd.h   |   14 
 vcl/osx/a11yutil.mm  |3 +
 vcl/osx/salframe.cxx |   49 +++-
 vcl/osx/salframeview.mm  |   26 +++
 vcl/osx/salmenu.cxx  |   10 ++---
 vcl/osx/salnativewidgets.cxx |   12 +++---
 vcl/osx/salobj.cxx   |6 ++-
 vcl/osx/salprn.cxx   |   23 ++---
 vcl/osx/salsys.cxx   |6 +--
 vcl/quartz/ctfonts.cxx   |   10 ++---
 vcl/quartz/salgdi.cxx|   13 ---
 vcl/quartz/salgdicommon.cxx  |   74 +++
 vcl/quartz/salvd.cxx |   13 ---
 18 files changed, 185 insertions(+), 150 deletions(-)

New commits:
commit 7a83d0a268a348a86dd31acbac94872eab82f75b
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 15:13:56 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 19:03:09 2020 +0100

loplugin:toolslong in Library_vclplug_osx

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

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 3d0f19f418a0..d634647715ce 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -24,6 +24,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -117,10 +118,12 @@ public:
 virtual voidSetMenu( SalMenu* pSalMenu ) override;
 virtual voidDrawMenuBar() override;
 virtual voidShow( bool bVisible, bool bNoActivate = false 
) override;
-virtual voidSetMinClientSize( long nWidth, long nHeight ) 
override;
-virtual voidSetMaxClientSize( long nWidth, long nHeight ) 
override;
-virtual voidSetPosSize( long nX, long nY, long nWidth, 
long nHeight, sal_uInt16 nFlags ) override;
-virtual voidGetClientSize( long& rWidth, long& rHeight ) 
override;
+virtual voidSetMinClientSize( tools::Long nWidth, 
tools::Long nHeight )
+override;
+virtual voidSetMaxClientSize( tools::Long nWidth, 
tools::Long nHeight )
+override;
+virtual voidSetPosSize( tools::Long nX, tools::Long nY, 
tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) override;
+virtual voidGetClientSize( tools::Long& rWidth, 
tools::Long& rHeight ) override;
 virtual voidGetWorkArea( tools::Rectangle& rRect ) 
override;
 virtual SalFrame*   GetParent() const override;
 virtual voidSetWindowState( const SalFrameState* pState ) 
override;
@@ -131,7 +134,7 @@ public:
 virtual voidToTop( SalFrameToTop nFlags ) override;
 virtual voidSetPointer( PointerStyle ePointerStyle ) 
override;
 virtual voidCaptureMouse( bool bMouse ) override;
-virtual voidSetPointerPos( long nX, long nY ) override;
+virtual voidSetPointerPos( tools::Long nX, tools::Long nY 
) override;
 virtual voidFlush( void ) override;
 virtual voidFlush( const tools::Rectangle& ) override;
 virtual voidSetInputContext( SalInputContext* pContext ) 
override;
@@ -157,7 +160,8 @@ public:
 // start setting the clipregion consisting of nRects rectangles
 virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
 // add a rectangle to the clip region
-virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight 
) override;
+virtual void UnionClipRegion(
+tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long 
nHeight ) override;
 // done setting up the clipregion
 virtual void EndSetClipRegion() override;
 
@@ -193,7 +197,8 @@ public:
 void screenParametersChanged();
 
 protected:
-SalEvent PreparePosSize(long nX, long nY, long nWidth, long nHeight, 
sal_uInt16 nFlags);
+SalEvent PreparePosSize(
+tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long 
nHeight, sal_uInt16 nFlags);
 
 private: // methods
 /** do things on initial show (like centering on parent or on screen)
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index edece53b6bea..97cbe37e2038 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef MACOSX
 #include 
@@ -101,7 +102,7 @@ public:
 virtual voidDestroyObject( SalObject* pObject ) override;
 virtual std::unique_ptr
 CreateVirtualDevice( SalGraphics* pGraphics,
-   

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

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/inc/osx/saldata.hxx |4 ++--
 vcl/inc/quartz/salgdi.h |7 ---
 vcl/osx/salframe.cxx|2 +-
 vcl/osx/salprn.cxx  |2 +-
 vcl/quartz/salgdicommon.cxx |4 ++--
 vcl/quartz/salgdiutils.cxx  |2 +-
 6 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit bfc7706b4344ec9b9b300213147f2b874ce21c21
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 14:34:48 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 17:15:23 2020 +0100

DPI values are generally represented as sal_Int32 in VCL

cf. e.g. pure virtual SalGraphics::GetResolution (vcl/inc/salgdi.hxx)

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

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 483902ff21cf..378741a739d9 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -85,8 +85,8 @@ public:
 AppleRemoteMainController*mpAppleRemoteMainController;
 #endif
 NSObject* mpDockIconClickHandler;
-long  mnDPIX;   // 
#i100617# read DPI only once per office life
-long  mnDPIY;   // 
#i100617# read DPI only once per office life
+sal_Int32 mnDPIX;   // 
#i100617# read DPI only once per office life
+sal_Int32 mnDPIY;   // 
#i100617# read DPI only once per office life
 
 css::uno::Reference< css::uno::XInterface >   mxClipboard;
 
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index d10ea2879559..0dbfd0065090 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -143,8 +143,8 @@ class AquaSalGraphics : public SalGraphics
 int mnHeight;
 int mnBitmapDepth;  // zero unless 
bitmap
 /// device resolution of this graphics
-longmnRealDPIX;
-longmnRealDPIY;
+sal_Int32   mnRealDPIX;
+sal_Int32   mnRealDPIY;
 
 /// path representing current clip region
 CGMutablePathRefmxClipPath;
@@ -190,7 +190,8 @@ public:
 boolIsBrushVisible() const  { return 
maFillColor.IsVisible(); }
 
 voidSetWindowGraphics( AquaSalFrame* pFrame );
-voidSetPrinterGraphics( CGContextRef, long nRealDPIX, 
long nRealDPIY );
+voidSetPrinterGraphics(
+CGContextRef, sal_Int32 nRealDPIX, sal_Int32 nRealDPIY );
 voidSetVirDevGraphics(CGLayerHolder const & rLayer, 
CGContextRef, int nBitDepth = 0);
 #ifdef MACOSX
 voidinitResolution( NSWindow* );
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 1ffb1b46dccd..76cd52e65541 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1189,7 +1189,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 return aRet;
 }
 
-static vcl::Font getFont( NSFont* pFont, long nDPIY, const vcl::Font& rDefault 
)
+static vcl::Font getFont( NSFont* pFont, sal_Int32 nDPIY, const vcl::Font& 
rDefault )
 {
 vcl::Font aResult( rDefault );
 if( pFont )
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index c0d05fde9fb5..7da42376569f 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -101,7 +101,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef 
i_rContext ) const
 if( mpPrintInfo )
 {
 // FIXME: get printer resolution
-long nDPIX = 720, nDPIY = 720;
+sal_Int32 nDPIX = 720, nDPIY = 720;
 NSSize aPaperSize = [mpPrintInfo paperSize];
 
 NSRect aImageRect = [mpPrintInfo imageablePageBounds];
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 0e1508fd9104..4b2b59459e1e 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1353,8 +1353,8 @@ void AquaSalGraphics::initResolution(NSWindow* nsWindow)
 // Apple suggest to do it this way
 const CGDirectDisplayID nDisplayID = 
static_cast([pVal longValue]);
 const CGSize aSize = CGDisplayScreenSize( nDisplayID ); // 
=> result is in millimeters
-mnRealDPIX = static_cast((CGDisplayPixelsWide( 
nDisplayID ) * 25.4) / aSize.width);
-mnRealDPIY = static_cast((CGDisplayPixelsHigh( 
nDisplayID ) * 25.4) / aSize.height);
+mnRealDPIX = static_cast((CGDisplayPixelsWide( 
nDisplayID ) * 25.4) / aSize.width);
+mnRealDPIY = static_cast((CGDisplayPixelsHigh( 
nDisplayID ) * 25.4) / 

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

2017-09-29 Thread Jan-Marek Glogowski
 vcl/inc/osx/runinmain.hxx |6 +++---
 vcl/inc/osx/saldata.hxx   |2 +-
 vcl/inc/osx/salframe.h|2 +-
 vcl/osx/saldata.cxx   |2 +-
 vcl/osx/salframe.cxx  |8 
 vcl/osx/salframeview.mm   |8 
 vcl/osx/salinst.cxx   |   22 +++---
 vcl/osx/salobj.cxx|2 +-
 vcl/osx/salprn.cxx|2 +-
 vcl/osx/saltimer.cxx  |8 
 vcl/osx/vclnsapp.mm   |   10 +-
 vcl/quartz/salvd.cxx  |2 +-
 12 files changed, 37 insertions(+), 37 deletions(-)

New commits:
commit 442771d105fbce531ec3df5673dcc4a5f7a8bc7b
Author: Jan-Marek Glogowski 
Date:   Fri Sep 29 09:18:51 2017 +0200

OSX rename mpFirstInstance to mpInstance

In the same spirit as the Windows commit
7c52d86f7b05fe7e0178f6d98a12a531b88a32ff.

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

diff --git a/vcl/inc/osx/runinmain.hxx b/vcl/inc/osx/runinmain.hxx
index c971d3a25639..0c2a5268d70a 100644
--- a/vcl/inc/osx/runinmain.hxx
+++ b/vcl/inc/osx/runinmain.hxx
@@ -140,13 +140,13 @@ union RuninmainResult
  */
 
 #define OSX_SALDATA_RUNINMAIN( command ) \
-OSX_RUNINMAIN( GetSalData()->mpFirstInstance, command )
+OSX_RUNINMAIN( GetSalData()->mpInstance, command )
 
 #define OSX_SALDATA_RUNINMAIN_POINTER( command, type ) \
-OSX_RUNINMAIN_POINTER( GetSalData()->mpFirstInstance, command, type )
+OSX_RUNINMAIN_POINTER( GetSalData()->mpInstance, command, type )
 
 #define OSX_SALDATA_RUNINMAIN_UNION( command, member ) \
-OSX_RUNINMAIN_UNION( GetSalData()->mpFirstInstance, command, member )
+OSX_RUNINMAIN_UNION( GetSalData()->mpInstance, command, member )
 
 #endif // INCLUDED_VCL_INC_OSX_RUNINMAIN_HXX
 
diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 5ec684b83973..357a2df6a74b 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -63,7 +63,7 @@ class SalData
 {
 public:
 SALTIMERPROC  mpTimerProc;  // timer 
callback proc
-AquaSalInstance  *mpFirstInstance;  // pointer 
of first instance
+AquaSalInstance  *mpInstance;
 std::list  maPresentationFrames;  // 
list of frames in presentation mode
 SalObject*mpFirstObject;// pointer 
of first object window
 SalVirtualDevice *mpFirstVD;// first 
VirDev
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index f8cef1834106..55779e6868be 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -206,7 +206,7 @@ private: // data
 
 inline bool AquaSalFrame::isAlive( const AquaSalFrame* pFrame )
 {
-AquaSalInstance *pInst = GetSalData()->mpFirstInstance;
+AquaSalInstance *pInst = GetSalData()->mpInstance;
 return pInst && pInst->isFrameAlive( pFrame );
 }
 
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index de139319e8bd..a445e5cfb7ad 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -37,7 +37,7 @@ static void SAL_CALL releasePool( void* pPool )
 SalData::SalData()
 :
 mpTimerProc( nullptr ),
-mpFirstInstance( nullptr ),
+mpInstance( nullptr ),
 mpFirstObject( nullptr ),
 mpFirstVD( nullptr ),
 mpFirstPrinter( nullptr ),
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index dcdfe6d9c936..ff87c83e3205 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -87,12 +87,12 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 initWindowAndView();
 
 SalData* pSalData = GetSalData();
-pSalData->mpFirstInstance->insertFrame( this );
+pSalData->mpInstance->insertFrame( this );
 }
 
 AquaSalFrame::~AquaSalFrame()
 {
-assert( GetSalData()->mpFirstInstance->IsMainThread() );
+assert( GetSalData()->mpInstance->IsMainThread() );
 
 // if the frame is destroyed and has the current menubar
 // set the default menubar
@@ -105,7 +105,7 @@ AquaSalFrame::~AquaSalFrame()
 [SalFrameView unsetMouseFrame: this];
 
 SalData* pSalData = GetSalData();
-pSalData->mpFirstInstance->eraseFrame( this );
+pSalData->mpInstance->eraseFrame( this );
 pSalData->maPresentationFrames.remove( this );
 
 SAL_WARN_IF( this == s_pCaptureFrame, "vcl", "capture frame destroyed" );
@@ -294,7 +294,7 @@ void AquaSalFrame::ReleaseGraphics( SalGraphics *pGraphics )
 
 bool AquaSalFrame::PostEvent(ImplSVEvent* pData)
 {
-GetSalData()->mpFirstInstance->PostEvent( this, pData, SalEvent::UserEvent 
);
+GetSalData()->mpInstance->PostEvent( this, pData, SalEvent::UserEvent );
 return TRUE;
 }
 
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 184c5bc15b70..1f0a3690bb70 100644
--- 

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

2016-09-14 Thread Stephan Bergmann
 vcl/inc/osx/a11ylistener.hxx  |2 +-
 vcl/inc/osx/salframe.h|2 +-
 vcl/inc/osx/salinst.h |2 +-
 vcl/inc/osx/salmenu.h |4 ++--
 vcl/inc/osx/salobj.h  |2 +-
 vcl/inc/osx/salprn.h  |4 ++--
 vcl/inc/osx/salsys.h  |2 +-
 vcl/inc/osx/saltimer.h|2 +-
 vcl/inc/quartz/salbmp.h   |2 +-
 vcl/inc/quartz/salgdi.h   |4 ++--
 vcl/inc/quartz/salvd.h|2 +-
 vcl/osx/DataFlavorMapping.cxx |2 +-
 vcl/osx/DragSource.hxx|2 +-
 vcl/osx/DragSourceContext.hxx |2 +-
 vcl/osx/DropTarget.hxx|2 +-
 vcl/osx/OSXTransferable.hxx   |2 +-
 vcl/osx/a11yfocuslistener.hxx |2 +-
 vcl/osx/clipboard.hxx |2 +-
 vcl/quartz/ctlayout.cxx   |2 +-
 19 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit bd132e558df9e1cfe48beb7a67f9237ed78465c5
Author: Stephan Bergmann 
Date:   Wed Sep 14 12:53:30 2016 +0200

loplugin:override

Change-Id: Ica137897f02c5caa4c4891f75531ada3957025d9

diff --git a/vcl/inc/osx/a11ylistener.hxx b/vcl/inc/osx/a11ylistener.hxx
index 525446c..353b642 100644
--- a/vcl/inc/osx/a11ylistener.hxx
+++ b/vcl/inc/osx/a11ylistener.hxx
@@ -35,7 +35,7 @@ class AquaA11yEventListener :
 
 public:
 AquaA11yEventListener(id wrapperObject, sal_Int16 role);
-virtual ~AquaA11yEventListener();
+virtual ~AquaA11yEventListener() override;
 
 // XEventListener
 virtual void SAL_CALL disposing( const css::lang::EventObject& Source )
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 81e1614..94afaf3 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -103,7 +103,7 @@ public:
 */
 AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle );
 
-virtual ~AquaSalFrame();
+virtual ~AquaSalFrame() override;
 
 virtual SalGraphics*AcquireGraphics() override;
 virtual voidReleaseGraphics( SalGraphics* pGraphics ) 
override;
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index fbc4319..b56b8df 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -79,7 +79,7 @@ public:
 
 public:
 AquaSalInstance();
-virtual ~AquaSalInstance();
+virtual ~AquaSalInstance() override;
 
 virtual SalFrame*   CreateChildFrame( SystemParentData* pParent, 
SalFrameStyleFlags nStyle ) override;
 virtual SalFrame*   CreateFrame( SalFrame* pParent, SalFrameStyleFlags 
nStyle ) override;
diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index f4407f3..f21c750 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -53,7 +53,7 @@ private:
 static void statusLayout();
 public:
 AquaSalMenu( bool bMenuBar );
-virtual ~AquaSalMenu();
+virtual ~AquaSalMenu() override;
 
 virtual bool VisibleMenuBar() override;
 // must return true to actually display native menu bars
@@ -100,7 +100,7 @@ class AquaSalMenuItem : public SalMenuItem
 {
 public:
 AquaSalMenuItem( const SalItemParams* );
-virtual ~AquaSalMenuItem();
+virtual ~AquaSalMenuItem() override;
 
 sal_uInt16  mnId; // Item ID
 VclPtrmpVCLMenu;// VCL Menu into which this 
MenuItem is inserted
diff --git a/vcl/inc/osx/salobj.h b/vcl/inc/osx/salobj.h
index 19a0090..c5d4465 100644
--- a/vcl/inc/osx/salobj.h
+++ b/vcl/inc/osx/salobj.h
@@ -52,7 +52,7 @@ public:
 void setClippedPosSize();
 
 AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWinData );
-virtual ~AquaSalObject();
+virtual ~AquaSalObject() override;
 
 virtual voidResetClipRegion() override;
 virtual voidBeginSetClipRegion( sal_uLong nRects ) 
override;
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index bfedb08..f47a32b 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -62,7 +62,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 
 public:
 AquaSalInfoPrinter( const SalPrinterQueueInfo& pInfo );
-virtual ~AquaSalInfoPrinter();
+virtual ~AquaSalInfoPrinter() override;
 
 voidSetupPrinterGraphics( CGContextRef i_xContext 
) const;
 
@@ -117,7 +117,7 @@ class AquaSalPrinter : public SalPrinter
 AquaSalInfoPrinter* mpInfoPrinter;  // pointer to the 
compatible InfoPrinter
 public:
 AquaSalPrinter( AquaSalInfoPrinter* i_pInfoPrinter );
-virtual ~AquaSalPrinter();
+virtual ~AquaSalPrinter() override;
 
 virtual boolStartJob( const OUString* i_pFileName,
   const OUString& i_rJobName,
diff --git a/vcl/inc/osx/salsys.h b/vcl/inc/osx/salsys.h
index b667b31..e1b18f9 100644
--- a/vcl/inc/osx/salsys.h
+++ b/vcl/inc/osx/salsys.h
@@ -29,7 +29,7 @@ class VCL_DLLPUBLIC AquaSalSystem : public SalSystem
 {
 public:
 AquaSalSystem() {}
-virtual ~AquaSalSystem();
+

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

2015-01-04 Thread Caolán McNamara
 vcl/inc/osx/saldata.hxx |6 +++---
 vcl/inc/pch/precompiled_vcl.hxx |4 ++--
 vcl/inc/quartz/salgdi.h |4 ++--
 vcl/inc/win/salgdi.h|4 ++--
 vcl/osx/DataFlavorMapping.hxx   |4 ++--
 vcl/quartz/ctfonts.cxx  |2 --
 6 files changed, 11 insertions(+), 13 deletions(-)

New commits:
commit 547b472d5b81ef7f22c32b089bd9f42f721c1cbf
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Jan 4 20:20:21 2015 +

vcl/osx boost::unordered_map-std::unordered_map

Change-Id: I00dabf3307734e319a8187df111e1065ea383524

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 86667ac..4ac39dd 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -34,9 +34,9 @@
 #include salwtype.hxx
 
 #include list
-#include vector
 #include map
-#include boost/unordered_set.hpp
+#include unordered_set
+#include vector
 
 #include cstdio
 #include cstdarg
@@ -70,7 +70,7 @@ public:
 SALTIMERPROC  mpTimerProc;  // timer 
callback proc
 AquaSalInstance  *mpFirstInstance;  // pointer 
of first instance
 std::listAquaSalFrame*  maFrames; // list of 
all frames
-boost::unordered_setconst AquaSalFrame*,FrameHash  maFrameCheck; // 
for fast check of frame existence
+std::unordered_setconst AquaSalFrame*,FrameHash  maFrameCheck;// for 
fast check of frame existence
 std::listAquaSalFrame*  maPresentationFrames;  // 
list of frames in presentation mode
 SalObject*mpFirstObject;// pointer 
of first object window
 SalVirtualDevice *mpFirstVD;// first 
VirDev
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index 9d3018a..484f1e0 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -146,8 +146,6 @@
 #include boost/scoped_ptr.hpp
 #include boost/shared_ptr.hpp
 #include boost/static_assert.hpp
-#include boost/unordered_map.hpp
-#include boost/unordered_set.hpp
 #include cassert
 #include cmath
 #include com/sun/star/accessibility/AccessibleEventObject.hpp
@@ -396,6 +394,8 @@
 #include uno/current_context.hxx
 #include uno/dispatcher.h
 #include uno/mapping.hxx
+#include unordered_map
+#include unordered_set
 #include unotools/calendarwrapper.hxx
 #include unotools/charclass.hxx
 #include unotools/configmgr.hxx
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 3abfdb6..87c35c1 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -43,7 +43,7 @@
 #include salgdi.hxx
 
 #include quartz/salgdicommon.hxx
-#include boost/unordered_map.hpp
+#include unordered_map
 
 class AquaSalFrame;
 class ImplDevFontAttributes;
@@ -133,7 +133,7 @@ private:
 CTFontCollectionRef mpCTFontCollection;
 CFArrayRef mpCTFontArray;
 
-typedef boost::unordered_mapsal_IntPtr,CoreTextFontData* CTFontContainer;
+typedef std::unordered_mapsal_IntPtr,CoreTextFontData* CTFontContainer;
 CTFontContainer maFontContainer;
 };
 
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 5a46cb1f..6ce3a61 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -29,7 +29,7 @@
 #include vcl/fontcapabilities.hxx
 
 #include boost/scoped_ptr.hpp
-#include boost/unordered_set.hpp
+#include unordered_set
 
 #include config_graphite.h
 #if ENABLE_GRAPHITE
@@ -134,7 +134,7 @@ private:
 
 voidReadGsubTable( HDC ) const;
 
-typedef boost::unordered_setsal_UCS4 UcsHashSet;
+typedef std::unordered_setsal_UCS4 UcsHashSet;
 mutable UcsHashSet  maGsubTable;
 mutable boolmbGsubRead;
 public:
diff --git a/vcl/osx/DataFlavorMapping.hxx b/vcl/osx/DataFlavorMapping.hxx
index a3cff1c..1917aeb 100644
--- a/vcl/osx/DataFlavorMapping.hxx
+++ b/vcl/osx/DataFlavorMapping.hxx
@@ -29,8 +29,8 @@
 #import Cocoa/Cocoa.h
 #include postmac.h
 
-#include boost/unordered_map.hpp
 #include memory
+#include unordered_map
 #include boost/shared_ptr.hpp
 
 /* An interface to get the clipboard data in either
@@ -119,7 +119,7 @@ private:
 
 private:
   ::com::sun::star::uno::Reference 
::com::sun::star::datatransfer::XMimeContentTypeFactory mrXMimeCntFactory;
-  typedef boost::unordered_map OUString, NSString*, OUStringHash  
OfficeOnlyTypes;
+  typedef std::unordered_map OUString, NSString*, OUStringHash  
OfficeOnlyTypes;
   mutable OfficeOnlyTypes maOfficeOnlyTypes;
 };
 
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 80253ab..5fb772b 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include boost/unordered_map.hpp
-
 #include impfont.hxx
 #include outfont.hxx
 #include PhysicalFontCollection.hxx
___
Libreoffice-commits mailing list

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

2014-12-03 Thread Stephan Bergmann
 vcl/inc/osx/saldata.hxx  |2 +-
 vcl/osx/DragSource.cxx   |2 +-
 vcl/osx/DropTarget.cxx   |2 +-
 vcl/osx/a11ytextattributeswrapper.mm |2 +-
 vcl/osx/saldata.cxx  |4 ++--
 vcl/osx/salframe.cxx |2 +-
 vcl/osx/salframeview.mm  |6 +++---
 vcl/osx/salmenu.cxx  |8 
 vcl/osx/salnativewidgets.cxx |6 +++---
 vcl/quartz/ctfonts.cxx   |7 +++
 vcl/quartz/ctlayout.cxx  |4 ++--
 11 files changed, 22 insertions(+), 23 deletions(-)

New commits:
commit 083f517ca3c037a1d36e6f5ea830366f24659f22
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Dec 4 08:47:31 2014 +0100

vcl (Mac): loplugin:cstylecast

Change-Id: Ic46623380f026a8dfcc74c895db35a06bcea1ead

diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index 413754b..86667ac 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -59,7 +59,7 @@ struct FrameHash : public boost::hashsal_IntPtr
 { return boost::hashsal_IntPtr::operator()( reinterpret_castconst 
sal_IntPtr(frame) ); }
 };
 
-#define INVALID_CURSOR_PTR (NSCursor*)0xdeadbeef
+#define INVALID_CURSOR_PTR reinterpret_castNSCursor*(0xdeadbeef)
 
 // Singleton, instantiated from Application::Application() in
 // vcl/source/app/svapp.cxx through InitSalData().
diff --git a/vcl/osx/DragSource.cxx b/vcl/osx/DragSource.cxx
index 593bf8b..5601d25 100644
--- a/vcl/osx/DragSource.cxx
+++ b/vcl/osx/DragSource.cxx
@@ -172,7 +172,7 @@ void SAL_CALL DragSource::initialize(const Sequence Any  
aArguments)
   Any pNSView = aArguments[1];
   sal_uInt64 tmp = 0;
   pNSView = tmp;
-  mView = (NSView*)tmp;
+  mView = reinterpret_castNSView*(tmp);
 
   /* All SalFrameView the base class for all VCL system views inherits from
  NSView in order to get mouse and other events. This is the only way to
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index 7ee0f5b..a6721a6 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -352,7 +352,7 @@ void SAL_CALL DropTarget::initialize(const Sequence Any  
aArguments)
 Any pNSView = aArguments[0];
 sal_uInt64 tmp = 0;
 pNSView = tmp;
-mView = (id)tmp;
+mView = reinterpret_castid(tmp);
 mpFrame = [(SalFrameView*)mView getSalFrame];
 
 mDropTargetHelper = [[DropTargetHelper alloc] initWithDropTarget: this];
diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index 4b18234..3ac368e 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -178,7 +178,7 @@ using namespace ::com::sun::star::uno;
 return;
 const RGBAColor aRGBAColor( nSalColor);
 CGColorRef aColorRef = CGColorCreate ( CGColorSpaceCreateWithName ( 
kCGColorSpaceGenericRGB ), aRGBAColor.AsArray() );
-[ string addAttribute: attribute value: (id) aColorRef range: range ];
+[ string addAttribute: attribute value: reinterpret_castid(aColorRef) 
range: range ];
 CGColorRelease( aColorRef );
 }
 
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index f4dc179..a2a8b85 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -30,7 +30,7 @@ oslThreadKey SalData::s_aAutoReleaseKey = 0;
 static void SAL_CALL releasePool( void* pPool )
 {
 if( pPool )
-[(NSAutoreleasePool*)pPool release];
+[static_castNSAutoreleasePool*(pPool) release];
 }
 
 SalData::SalData()
@@ -230,7 +230,7 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle )
 CFURLRef hURL = CFBundleCopyResourceURL( hMain, pCursorName, 
CFSTR(png), CFSTR(cursors) );
 if( hURL )
 {
-pCurs = [[NSCursor alloc] initWithImage: [[NSImage alloc] 
initWithContentsOfURL: (NSURL*)hURL] hotSpot: aHotSpot];
+pCurs = [[NSCursor alloc] initWithImage: [[NSImage alloc] 
initWithContentsOfURL: const_castNSURL*(static_castNSURL const *(hURL))] 
hotSpot: aHotSpot];
 CFRelease( hURL );
 }
 CFRelease( pCursorName );
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 0f266db..7591c69 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1497,7 +1497,7 @@ void AquaSalFrame::SetParent( SalFrame* pNewParent )
 bool bShown = mbShown;
 // remove from child list
 Show( FALSE );
-mpParent = (AquaSalFrame*)pNewParent;
+mpParent = static_castAquaSalFrame*(pNewParent);
 // insert to correct parent and paint
 Show( bShown );
 }
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index add9891..248c8eb 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -189,13 +189,13 @@ static AquaSalFrame* getMouseContainerFrame()
 if( bAllowFullScreen  [pNSWindow respondsToSelector: 
setCollectionBehavior])
 {
 const int bMode= (bAllowFullScreen ? 
NSWindowCollectionBehaviorFullScreenPrimary : 

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

2014-02-28 Thread Tor Lillqvist
 vcl/inc/osx/a11yfocustracker.hxx  |   14 ++---
 vcl/inc/osx/a11ylistener.hxx  |4 -
 vcl/inc/osx/salframe.h|   98 ++
 vcl/inc/osx/salinst.h |   82 +++
 vcl/inc/osx/salmenu.h |   35 ++---
 vcl/inc/osx/salobj.h  |   16 +++---
 vcl/inc/osx/salprn.h  |   36 ++---
 vcl/inc/osx/salsys.h  |8 +--
 vcl/osx/DataFlavorMapping.cxx |   20 +++
 vcl/osx/DragSource.hxx|   18 +++---
 vcl/osx/DragSourceContext.hxx |8 +--
 vcl/osx/DropTarget.hxx|   44 -
 vcl/osx/OSXTransferable.hxx   |6 +-
 vcl/osx/a11yfocuslistener.hxx |6 +-
 vcl/osx/clipboard.hxx |   20 +++
 vcl/osx/documentfocuslistener.hxx |4 -
 vcl/osx/salframe.cxx  |   21 
 vcl/osx/salinst.cxx   |   32 +---
 vcl/osx/salnativewidgets.cxx  |2 
 vcl/quartz/salbmp.cxx |   42 
 20 files changed, 233 insertions(+), 283 deletions(-)

New commits:
commit ce433069f1b1c39ba368d5d2fc8008b6e9148324
Author: Tor Lillqvist t...@collabora.com
Date:   Fri Feb 28 14:27:15 2014 +0200

Add SAL_OVERRIDE markup for the vcl OS X and iOS code, and follow-up cleanup

Thanks to SAL_OVERRIDE, I found a couple of unused functions and
several that were virtual even if they did not override anything and
were not overridden in any derived class.

Change-Id: I598d2fc38f75a384c52359546a973e772393

diff --git a/vcl/inc/osx/a11yfocustracker.hxx b/vcl/inc/osx/a11yfocustracker.hxx
index f1bae09..2b5e96f 100644
--- a/vcl/inc/osx/a11yfocustracker.hxx
+++ b/vcl/inc/osx/a11yfocustracker.hxx
@@ -55,25 +55,25 @@ public:
 protected:
 
 // received a WINDOW_GETFOCUS event for this window
-virtual void window_got_focus(Window *pWindow);
+void window_got_focus(Window *pWindow);
 
 // received a TOOLBOX_HIGHLIGHT event for this window
-virtual void toolbox_highlight_on(Window *pWindow);
+void toolbox_highlight_on(Window *pWindow);
 
 // received a TOOLBOX_HIGHLIGHTOFF event for this window
-virtual void toolbox_highlight_off(Window *pWindow);
+void toolbox_highlight_off(Window *pWindow);
 
 // received a TABPAGE_ACTIVATE event for this window
-virtual void tabpage_activated(Window *pWindow);
+void tabpage_activated(Window *pWindow);
 
 // received a MENU_HIGHLIGHT event for this window
-virtual void menu_highlighted(const ::VclMenuEvent *pEvent);
+void menu_highlighted(const ::VclMenuEvent *pEvent);
 
 // toolbox items are widgets in gtk+ and Cocoa
-virtual void notify_toolbox_item_focus(ToolBox *pToolBox);
+void notify_toolbox_item_focus(ToolBox *pToolBox);
 
 // toolbox item opened a floating window (e.g. color chooser)
-virtual void toolbox_open_floater(Window *pWindow);
+void toolbox_open_floater(Window *pWindow);
 
 // callback function for Application::addEventListener
 static long WindowEventHandler(AquaA11yFocusTracker *pFocusTracker, 
::VclSimpleEvent const *pEvent);
diff --git a/vcl/inc/osx/a11ylistener.hxx b/vcl/inc/osx/a11ylistener.hxx
index 7d15345..503e986 100644
--- a/vcl/inc/osx/a11ylistener.hxx
+++ b/vcl/inc/osx/a11ylistener.hxx
@@ -42,11 +42,11 @@ public:
 
 // XEventListener
 virtual void SAL_CALL disposing( const 
::com::sun::star::lang::EventObject Source )
-throw (::com::sun::star::uno::RuntimeException, std::exception);
+throw (::com::sun::star::uno::RuntimeException, std::exception) 
SAL_OVERRIDE;
 
 // XAccessibleEventListener
 virtual void SAL_CALL notifyEvent( const 
::com::sun::star::accessibility::AccessibleEventObject aEvent )
-throw( ::com::sun::star::uno::RuntimeException, std::exception );
+throw( ::com::sun::star::uno::RuntimeException, std::exception ) 
SAL_OVERRIDE;
 
 private:
 const id m_wrapperObject;
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index bbd638b..ff7c972 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -112,62 +112,60 @@ public:
 
 virtual ~AquaSalFrame();
 
-virtual SalGraphics*GetGraphics();
-virtual voidReleaseGraphics( SalGraphics* pGraphics );
-virtual boolPostEvent( void* pData );
-virtual voidSetTitle( const OUString rTitle );
-virtual voidSetIcon( sal_uInt16 nIcon );
-virtual voidSetRepresentedURL( const OUString );
-virtual voidSetMenu( SalMenu* pSalMenu );
-virtual voidDrawMenuBar();
-virtual voidShow( bool bVisible, bool bNoActivate = false 
);
-virtual voidEnable( bool bEnable );
-virtual voidSetMinClientSize( long nWidth, long nHeight );
-virtual voidSetMaxClientSize( long nWidth, long 

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

2014-02-21 Thread Stephan Bergmann
 vcl/inc/osx/salframe.h   |6 +++---
 vcl/inc/osx/salmenu.h|2 +-
 vcl/inc/osx/salprn.h |   16 
 vcl/inc/quartz/salgdi.h  |   18 +-
 vcl/inc/quartz/salvd.h   |2 +-
 vcl/osx/salframe.cxx |6 +++---
 vcl/osx/salmenu.cxx  |2 +-
 vcl/osx/salnativewidgets.cxx |8 
 vcl/osx/salprn.cxx   |   16 
 vcl/quartz/salgdicommon.cxx  |   10 +-
 vcl/quartz/salvd.cxx |2 +-
 11 files changed, 44 insertions(+), 44 deletions(-)

New commits:
commit d6dfeb95885a03e6f255c0be75b2dfa9258c61cc
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Feb 21 13:08:35 2014 +0100

Mac OS X vcl: sal_Bool - bool fixup

Change-Id: I77a2e7957351ca6da44948e5a28d08116e1cd14d

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 464a54a..ed9f61c 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -110,7 +110,7 @@ public:
 
 virtual SalGraphics*GetGraphics();
 virtual voidReleaseGraphics( SalGraphics* pGraphics );
-virtual sal_BoolPostEvent( void* pData );
+virtual boolPostEvent( void* pData );
 virtual voidSetTitle( const OUString rTitle );
 virtual voidSetIcon( sal_uInt16 nIcon );
 virtual voidSetRepresentedURL( const OUString );
@@ -125,7 +125,7 @@ public:
 virtual voidGetWorkArea( Rectangle rRect );
 virtual SalFrame*   GetParent() const;
 virtual voidSetWindowState( const SalFrameState* pState );
-virtual sal_BoolGetWindowState( SalFrameState* pState );
+virtual boolGetWindowState( SalFrameState* pState );
 virtual voidShowFullScreen( sal_Bool bFullScreen, 
sal_Int32 nDisplay );
 virtual voidStartPresentation( sal_Bool bStart );
 virtual voidSetAlwaysOnTop( sal_Bool bOnTop );
@@ -139,7 +139,7 @@ public:
 virtual voidSetInputContext( SalInputContext* pContext );
 virtual voidEndExtTextInput( sal_uInt16 nFlags );
 virtual OUString  GetKeyName( sal_uInt16 nKeyCode );
-virtual sal_BoolMapUnicodeToKeyCode( sal_Unicode aUnicode, 
LanguageType aLangType, KeyCode rKeyCode );
+virtual boolMapUnicodeToKeyCode( sal_Unicode aUnicode, 
LanguageType aLangType, KeyCode rKeyCode );
 virtual LanguageTypeGetInputLanguage();
 virtual voidUpdateSettings( AllSettings rSettings );
 virtual voidBeep();
diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index 925a339..6bd9b72 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -56,7 +56,7 @@ public:
 AquaSalMenu( bool bMenuBar );
 virtual ~AquaSalMenu();
 
-virtual sal_Bool VisibleMenuBar();  // must return TRUE to actually 
DISPLAY native menu bars
+virtual bool VisibleMenuBar();  // must return TRUE to actually DISPLAY 
native menu bars
 // otherwise only menu messages are 
processed (eg, OLE on Windows)
 
 virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index 906a61d..d2ac588 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -73,9 +73,9 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 
 virtual SalGraphics*GetGraphics();
 virtual voidReleaseGraphics( SalGraphics* i_pGraphics );
-virtual sal_BoolSetup( SalFrame* i_pFrame, ImplJobSetup* 
i_pSetupData );
-virtual sal_BoolSetPrinterData( ImplJobSetup* pSetupData );
-virtual sal_BoolSetData( sal_uLong i_nFlags, ImplJobSetup* 
i_pSetupData );
+virtual boolSetup( SalFrame* i_pFrame, ImplJobSetup* 
i_pSetupData );
+virtual boolSetPrinterData( ImplJobSetup* pSetupData );
+virtual boolSetData( sal_uLong i_nFlags, ImplJobSetup* 
i_pSetupData );
 virtual voidGetPageInfo( const ImplJobSetup* i_pSetupData,
  long o_rOutWidth, long 
o_rOutHeight,
  long o_rPageOffX, long 
o_rPageOffY,
@@ -127,7 +127,7 @@ class AquaSalPrinter : public SalPrinter
 AquaSalPrinter( AquaSalInfoPrinter* i_pInfoPrinter );
 virtual ~AquaSalPrinter();
 
-virtual sal_BoolStartJob( const OUString* i_pFileName,
+virtual boolStartJob( const OUString* i_pFileName,
   const OUString i_rJobName,
   const OUString i_rAppName,
   sal_uLong i_nCopies,
@@ -135,16 +135,16 @@ class 

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

2013-12-18 Thread Tor Lillqvist
 vcl/inc/headless/svpgdi.hxx |4 
 vcl/inc/quartz/salgdi.h |8 ++--
 vcl/osx/salprn.cxx  |2 +-
 vcl/quartz/ctfonts.cxx  |   10 +-
 vcl/quartz/salgdi.cxx   |4 +---
 vcl/quartz/salgdicommon.cxx |7 ++-
 vcl/quartz/salgdiutils.cxx  |3 +--
 7 files changed, 12 insertions(+), 26 deletions(-)

New commits:
commit 0d9c4baf86c502e7cc2b6072a530c6fad2179abe
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Dec 19 00:04:55 2013 +0200

The fake DPI scale was always 1

Thanks to kendy for noticing.

Change-Id: I6b62d5a0c1dc5df374629a8f7c6e7d2f7cd7ffbd

diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 1135c7d..c3ffc65 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -74,10 +74,6 @@ class SvpSalGraphics : public SalGraphics
 int mnWidth;
 int mnHeight;
 int  mnBitmapDepth;  // zero unless bitmap
-/// some graphics implementations (e.g. AquaSalInfoPrinter) scale
-/// everything down by a factor (see SetupPrinterGraphics for details)
-/// so we have to compensate for it with the inverse factor
-double   mfFakeDPIScale;
 
 /// path representing current clip region
 CGMutablePathRefmxClipPath;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 49140fa..e0b86c3 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -92,7 +92,7 @@ public:
 
 SalLayout* GetTextLayout( void ) const;
 
-void   GetFontMetric( float fPDIY, ImplFontMetricData ) const;
+void   GetFontMetric( ImplFontMetricData ) const;
 bool   GetGlyphBoundRect( sal_GlyphId, Rectangle ) const;
 bool   GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon ) const;
 
@@ -156,10 +156,6 @@ protected:
 /// device resolution of this graphics
 longmnRealDPIX;
 longmnRealDPIY;
-/// some graphics implementations (e.g. AquaSalInfoPrinter) scale
-/// everything down by a factor (see SetupPrinterGraphics for details)
-/// so we have to compensate for it with the inverse factor
-double  mfFakeDPIScale;
 
 /// path representing current clip region
 CGMutablePathRefmxClipPath;
@@ -194,7 +190,7 @@ public:
 boolIsBrushVisible() const  { return 
maFillColor.IsVisible(); }
 
 voidSetWindowGraphics( AquaSalFrame* pFrame );
-voidSetPrinterGraphics( CGContextRef, long nRealDPIX, long 
nRealDPIY, double fFakeScale );
+voidSetPrinterGraphics( CGContextRef, long nRealDPIX, long 
nRealDPIY );
 voidSetVirDevGraphics( CGLayerRef, CGContextRef, int 
nBitDepth = 0 );
 
 voidinitResolution( NSWindow* );
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 082fa1c..37fa0ec 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -139,7 +139,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef 
i_rContext ) const
 // scale to be top/down and reflect our virtual DPI
 CGContextScaleCTM( i_rContext, -(72.0/double(nDPIY)), 
(72.0/double(nDPIX)) );
 }
-mpGraphics-SetPrinterGraphics( i_rContext, nDPIX, nDPIY, 1.0 );
+mpGraphics-SetPrinterGraphics( i_rContext, nDPIX, nDPIY );
 }
 else
 OSL_FAIL( no print info in SetupPrinterGraphics );
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index d93d4b5..8211b9f 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -112,20 +112,20 @@ CoreTextStyle::~CoreTextStyle( void )
 
 // ---
 
-void CoreTextStyle::GetFontMetric( float fPixelSize, ImplFontMetricData 
rMetric ) const
+void CoreTextStyle::GetFontMetric( ImplFontMetricData rMetric ) const
 {
 // get the matching CoreText font handle
 // TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it 
here?
 CTFontRef aCTFontRef = (CTFontRef)CFDictionaryGetValue( mpStyleDict, 
kCTFontAttributeName );
 
-rMetric.mnAscent   = lrint( CTFontGetAscent( aCTFontRef ) * 
fPixelSize);
-rMetric.mnDescent  = lrint( CTFontGetDescent( aCTFontRef ) * 
fPixelSize);
-rMetric.mnExtLeading   = lrint( CTFontGetLeading( aCTFontRef ) * 
fPixelSize);
+rMetric.mnAscent   = CTFontGetAscent( aCTFontRef );
+rMetric.mnDescent  = CTFontGetDescent( aCTFontRef );
+rMetric.mnExtLeading   = CTFontGetLeading( aCTFontRef );
 rMetric.mnIntLeading   = 0;
 // since ImplFontMetricData::mnWidth is only used for stretching/squeezing 
fonts
 // setting this width to the pixel height of the fontsize is