core.git: vcl/osx

2024-05-31 Thread Patrick Luby (via logerrit)
 vcl/osx/DataFlavorMapping.cxx |3 ---
 vcl/osx/a11yactionwrapper.mm  |2 +-
 vcl/osx/a11ywrapper.mm|   12 +++-
 3 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 29ef1d698c7f8bb38c0af21215a24577ced656ff
Author: Patrick Luby 
AuthorDate: Thu May 30 17:28:41 2024 -0400
Commit: Noel Grandin 
CommitDate: Fri May 31 09:55:59 2024 +0200

Fix some macOS memory leaks due to overretaining Objective-C objects

Change-Id: If826476ad6c6692d22519f4eb0fb45621240fdbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168271
Reviewed-by: Patrick Luby 
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 96dd5501e355..d02582653f6d 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -732,10 +732,7 @@ NSArray* 
DataFlavorMapper::flavorSequenceToTypesArray(const css::uno::Sequence 
getAccessibleActionDescription ( cnt ) ) autorelease ] ] ];
 }
 }
-return actionNames;
+return [actionNames autorelease];
 }
 
 +(void)doAction:(NSString *)action ofElement:(AquaA11yWrapper *)wrapper {
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 292fb6dcc6d1..c35f02cdae53 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -352,14 +352,15 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 }
 }
 }
-return children;
+return [children autorelease];
 } else if ( [ self accessibleTable ] )
 {
 AquaA11yTableWrapper* pTable = [self isKindOfClass: 
[AquaA11yTableWrapper class]] ? static_cast(self) : nil;
 return [ AquaA11yTableWrapper childrenAttributeForElement: pTable ];
 } else {
+NSMutableArray * children = [ [ NSMutableArray alloc ] init ];
+
 try {
-NSMutableArray * children = [ [ NSMutableArray alloc ] init ];
 Reference< XAccessibleContext > xContext( [ self accessibleContext 
] );
 
 try {
@@ -397,12 +398,13 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 }
 }
 
-[ children autorelease ];
-return NSAccessibilityUnignoredChildren( children );
+return NSAccessibilityUnignoredChildren( [ children autorelease ] 
);
 } catch (const Exception &) {
 // TODO: Log
-return nil;
 }
+
+[ children autorelease ];
+return [NSArray array];
 }
 }
 


core.git: vcl/osx

2024-05-31 Thread Stephan Bergmann (via logerrit)
 vcl/osx/a11ywrapper.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9e1ada2c6b85e9c6413084840939ca835ec84964
Author: Stephan Bergmann 
AuthorDate: Thu May 30 09:26:57 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Fri May 31 08:01:03 2024 +0200

loplugin:fakebool

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

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index cdfb8979f9ac..292fb6dcc6d1 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -749,7 +749,7 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 if ( isPopupMenuOpen ) {
 return NO;
 }
-BOOL ignored = false;
+bool ignored = false;
 try {
 sal_Int16 nRole = [ self accessibleContext ] -> getAccessibleRole();
 switch ( nRole ) {


core.git: vcl/osx

2024-05-31 Thread Stephan Bergmann (via logerrit)
 vcl/osx/a11ywrapper.mm |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b8b7a0936d5860e56239d60b0b5073d983df32f7
Author: Stephan Bergmann 
AuthorDate: Thu May 30 09:26:42 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Fri May 31 08:00:46 2024 +0200

loplugin:rangedforcopy

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

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 3793b3232d7d..cdfb8979f9ac 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -341,7 +341,7 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 Reference < XAccessibleRelationSet > rxAccessibleRelationSet = [ self 
accessibleContext ] -> getAccessibleRelationSet();
 AccessibleRelation const relationMemberOf = rxAccessibleRelationSet -> 
getRelationByType ( AccessibleRelationType::MEMBER_OF );
 if ( relationMemberOf.RelationType == 
AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) 
{
-for (Reference  rMateAccessible : 
relationMemberOf.TargetSet ) {
+for (Reference  const & rMateAccessible : 
relationMemberOf.TargetSet ) {
 if ( rMateAccessible.is() ) {
 Reference< XAccessibleContext > rMateAccessibleContext( 
rMateAccessible -> getAccessibleContext() );
 if ( rMateAccessibleContext.is() ) {
@@ -1140,7 +1140,7 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 if ( relationSet.is() && relationSet -> containsRelation ( 
AccessibleRelationType::SUB_WINDOW_OF )) {
 // we have a valid relation to the parent element
 AccessibleRelation const relation = relationSet -> 
getRelationByType ( AccessibleRelationType::SUB_WINDOW_OF );
-for (Reference rxAccessible : 
relation.TargetSet) {
+for (Reference const & rxAccessible : 
relation.TargetSet) {
 if ( rxAccessible.is() && rxAccessible -> 
getAccessibleContext().is() ) {
 // hit test for children of parent
 hitChild = hitTestRunner ( hitPoint, rxAccessible 
-> getAccessibleContext() );


core.git: vcl/osx

2024-05-07 Thread Patrick Luby (via logerrit)
 vcl/osx/salinst.cxx |   17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 92815f3a464b447898ecf52492247335228e4a72
Author: Patrick Luby 
AuthorDate: Tue May 7 17:41:10 2024 -0400
Commit: Patrick Luby 
CommitDate: Wed May 8 01:39:44 2024 +0200

tdf#160767 skip fix for tdf#155266 when the event hasn't changed

When scrolling in Writer with automatic spellchecking enabled,
the current event never changes because the fix for tdf#155266
causes Writer to get stuck in a loop. So, if the current event
has not changed since the last pass through this code, skip
the fix for tdf#155266.

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index db2b2c605677..e8543fcda19c 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -750,7 +750,22 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
 // not NSEventTypeScrollWheel.
 NSEvent* pCurrentEvent = [NSApp currentEvent];
 if( pCurrentEvent && [pCurrentEvent type] == NSEventTypeScrollWheel )
-nEventMask &= ~NSEventMaskScrollWheel;
+{
+// tdf#160767 skip fix for tdf#155266 when the event hasn't changed
+// When scrolling in Writer with automatic spellchecking enabled,
+// the current event never changes because the fix for tdf#155266
+// causes Writer to get stuck in a loop. So, if the current event
+// has not changed since the last pass through this code, skip
+// the fix for tdf#155266.
+static NSEvent *pLastCurrentEvent = nil;
+if( pLastCurrentEvent != pCurrentEvent )
+{
+if( pLastCurrentEvent )
+[pLastCurrentEvent release];
+pLastCurrentEvent = [pCurrentEvent retain];
+nEventMask &= ~NSEventMaskScrollWheel;
+}
+}
 }
 
 if( nType & VclInputFlags::KEYBOARD)


core.git: vcl/osx

2024-02-23 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit ef57aeb9ed190e18ebc034b9a45e190aea3f8f1d
Author: Patrick Luby 
AuthorDate: Fri Feb 23 17:45:19 2024 -0500
Commit: Patrick Luby 
CommitDate: Sat Feb 24 02:09:42 2024 +0100

tdf#158124 KEY_DELETE events do not need an ExtTextInput event

When using various Japanese input methods, the last event will be a
repeating key down event with a single delete character while the
Backspace key, Delete key, or Fn-Delete keys are pressed. These key
events are now ignored since setting mbTextInputWantsNonRepeatKeyDown
to YES for these events will trigger an assert or crash when saving a
.docx document.

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 995eeb574999..dba377899838 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -2062,7 +2062,15 @@ static void updateWinDataInLiveResize(bool bInLiveResize)
 // and then dispatch a SalEvent::EndExtTextInput event.
 NSString *pNewMarkedText = nullptr;
 NSString *pChars = [mpLastEvent characters];
-bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] );
+
+// tdf#158124 KEY_DELETE events do not need an ExtTextInput event
+// When using various Japanese input methods, the last event will be a
+// repeating key down event with a single delete character while the
+// Backspace key, Delete key, or Fn-Delete keys are pressed. These key
+// events are now ignored since setting mbTextInputWantsNonRepeatKeyDown
+// to YES for these events will trigger an assert or crash when saving a
+// .docx document.
+bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] && ImplMapKeyCode( [mpLastEvent keyCode] ) != KEY_DELETE );
 if ( bNeedsExtTextInput )
 {
 // tdf#154708 Preserve selection for repeating Shift-arrow on Japanese 
keyboard


core.git: vcl/osx

2024-02-23 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salnsmenu.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fda653f6e1e7a7e3c0db037cb2d0046a1790e641
Author: Stephan Bergmann 
AuthorDate: Fri Feb 23 15:49:06 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Feb 23 17:34:02 2024 +0100

loplugin:fakebool

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

diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm
index 31627a35ea87..516101f8f79d 100644
--- a/vcl/osx/salnsmenu.mm
+++ b/vcl/osx/salnsmenu.mm
@@ -321,7 +321,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 - (BOOL)performKeyEquivalent:(NSEvent*)pEvent
 {
-BOOL bRet = [super performKeyEquivalent: pEvent];
+bool bRet = [super performKeyEquivalent: pEvent];
 
 // tdf#126638 dispatch key shortcut events to modal windows
 // Some modal windows, such as the native Open and Save dialogs,


core.git: vcl/osx

2023-12-27 Thread Patrick Luby (via logerrit)
 vcl/osx/clipboard.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit cefd36db5f9389dd6f7e605eca6711762a784966
Author: Patrick Luby 
AuthorDate: Tue Dec 26 19:15:22 2023 -0500
Commit: Patrick Luby 
CommitDate: Wed Dec 27 13:58:54 2023 +0100

tdf#144124 Detect if ownership has been lost

The shortcut assumes that lost ownership notifications from the
system clipboard will happen elsewhere. They do under normal
conditions, but do not when some clipboard managers are running.
So, explicitly check ownership to catch such cases.

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

diff --git a/vcl/osx/clipboard.cxx b/vcl/osx/clipboard.cxx
index 5d925b3b1954..f5be6f86c339 100644
--- a/vcl/osx/clipboard.cxx
+++ b/vcl/osx/clipboard.cxx
@@ -140,6 +140,14 @@ uno::Reference SAL_CALL 
AquaClipboard::getContents(
 {
 osl::MutexGuard aGuard(m_aMutex);
 
+// tdf#144124 Detect if ownership has been lost
+// The shortcut assumes that lost ownership notifications from the
+// system clipboard will happen elsewhere. They do under normal
+// conditions, but do not when some clipboard managers are running.
+// So, explicitly check ownership to catch such cases.
+if (mIsSystemPasteboard)
+applicationDidBecomeActive(nullptr);
+
 // Shortcut: If we are clipboard owner already we don't need
 // to drag the data through the system clipboard
 if (mXClipboardContent.is())


core.git: vcl/osx

2023-12-26 Thread Patrick Luby (via logerrit)
 vcl/osx/DataFlavorMapping.cxx |   25 ++---
 vcl/osx/DataFlavorMapping.hxx |4 ++--
 vcl/osx/clipboard.cxx |2 +-
 3 files changed, 25 insertions(+), 6 deletions(-)

New commits:
commit 3d9ee9375d28f0131949ee3c1f86f22dcea41d19
Author: Patrick Luby 
AuthorDate: Tue Dec 26 10:45:08 2023 -0500
Commit: Patrick Luby 
CommitDate: Tue Dec 26 17:48:08 2023 +0100

tdf#151679 Do not push FLAVOR_LINK to macOS general pasteboard

When copying text from a Writer document and the
FLAVOR_LINK flavor is pasted, Writer will edit the
copied text in order to create a bookmark for DDE.

The problem is that many macOS clipboard managers
fetch *all* available flavors that are available in
the macOS general pasteboard instead of just one
flavor and this triggers the FLAVOR_LINK flavor's
unusual editing behavor in Writer every time the
user copies Writer text.

Users have reported in tdf#1515679 that on macOS,
Microsoft Writer, Excel, and PowerPoint do not
recognize this flavor like is done on Windows so,
in theory, we can just filter out this flavor when
adding flavors to the macOS general pasteboard.

With this change, the FLAVOR_LINK flavor will still
be visible when copying and pasting within a single
LibreOffice instance as well as when dragging from
LibreOffice to other applications.

Change-Id: Ia391398286fa8795ac65b4702a15caf59fb3ae70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161305
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 274a2b4a4be7..361e268bcd6d 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -545,7 +545,7 @@ DataFlavor DataFlavorMapper::systemToOpenOfficeFlavor( 
const NSString* systemDat
 return oOOFlavor;
 }
 
-const NSString* DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& 
oOOFlavor, bool& rbInternal) const
+const NSString* DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& 
oOOFlavor, bool& rbInternal, bool bIsSystemClipboard ) const
 {
 const NSString* sysFlavor = nullptr;
 rbInternal = false;
@@ -554,6 +554,25 @@ const NSString* 
DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& oO
 {
 if 
(oOOFlavor.MimeType.startsWith(OUString::createFromAscii(flavorMap[i].OOoFlavor)))
 {
+// tdf#151679 Do not push FLAVOR_LINK to macOS general pasteboard
+// When copying text from a Writer document and the FLAVOR_LINK
+// flavor is pasted, Writer will edit the copied text in order
+// to create a bookmark for DDE.
+// The problem is that many macOS clipboard managers fetch *all*
+// available flavors that are available in the macOS general
+// pasteboard instead of just one flavor and this triggers the
+// FLAVOR_LINK flavor's unusual editing behavor in Writer every
+// time the user copies Writer text.
+// Users have reported in tdf#1515679 that on macOS, Microsoft
+// Writer, Excel, and PowerPoint do not recognize this flavor
+// like is done on Windows so, in theory, we can just filter out
+// this flavor when adding flavors to the macOS general pasteboard.
+// With this change, the FLAVOR_LINK flavor will still be visible
+// when copying and pasting within a single LibreOffice instance
+// as well as when dragging from LibreOffice to other applications.
+if (bIsSystemClipboard && !strcmp(FLAVOR_LINK, 
flavorMap[i].OOoFlavor))
+return nullptr;
+
 if (flavorMap[i].SystemFlavor != nil)
 sysFlavor = flavorMap[i].SystemFlavor;
 else
@@ -695,7 +714,7 @@ bool DataFlavorMapper::isValidMimeContentType(const 
OUString& contentType) const
   return result;
 }
 
-NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const 
css::uno::Sequence& flavors) const
+NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const 
css::uno::Sequence& flavors, bool 
bIsSystemClipboard) const
 {
   sal_uInt32 nFlavors = flavors.getLength();
   NSMutableArray* array = [[NSMutableArray alloc] initWithCapacity: 1];
@@ -710,7 +729,7 @@ NSArray* DataFlavorMapper::flavorSequenceToTypesArray(const 
css::uno::Sequence& flavors) const;
+  NSArray* flavorSequenceToTypesArray(const 
css::uno::Sequence& flavors, bool 
bIsSystemClipboard = false) const;
 
   /* Translate an NSArray of system types into a sequence of DataFlavors.
  Only those types for which a suitable mapping to a DataFlavor
diff --git a/vcl/osx/clipboard.cxx b/vcl/osx/clipboard.cxx
index 2dc2d5eef888..5d925b3b1954 100644
--- a/vcl/osx/clipboard.cxx
+++ b/vcl/osx/clipboard.cxx
@@ -158,7 +158,7 @@ void SAL_CALL AquaClipboard::setContents(
 

core.git: vcl/osx

2023-12-20 Thread Patrick Luby (via logerrit)
 vcl/osx/salinst.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 9f92a39234dfae40fe19ab6fa47caf8b21dd8847
Author: Patrick Luby 
AuthorDate: Wed Dec 20 09:32:06 2023 -0500
Commit: Patrick Luby 
CommitDate: Wed Dec 20 23:47:53 2023 +0100

Related: tdf#155266 stop delaying painting timer while swiping

After fixing several flushing issues in tdf#155266, scrollbars
still will not redraw until swiping has ended or paused when
using Skia/Raster or Skia disabled. So, stop the delay by only
including NSEventMaskScrollWheel if the current event type is
not NSEventTypeScrollWheel.

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 62ec90dd0005..7f755bb618b3 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -733,6 +733,7 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
 
 unsigned/*NSUInteger*/ nEventMask = 0;
 if( nType & VclInputFlags::MOUSE)
+{
 nEventMask |=
 NSEventMaskLeftMouseDown| NSEventMaskRightMouseDown| 
NSEventMaskOtherMouseDown|
 NSEventMaskLeftMouseUp  | NSEventMaskRightMouseUp  | 
NSEventMaskOtherMouseUp  |
@@ -740,6 +741,18 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
 NSEventMaskScrollWheel  |
 // NSEventMaskMouseMoved|
 NSEventMaskMouseEntered | NSEventMaskMouseExited;
+
+// Related: tdf#155266 stop delaying painting timer while swiping
+// After fixing several flushing issues in tdf#155266, scrollbars
+// still will not redraw until swiping has ended or paused when
+// using Skia/Raster or Skia disabled. So, stop the delay by only
+// including NSEventMaskScrollWheel if the current event type is
+// not NSEventTypeScrollWheel.
+NSEvent* pCurrentEvent = [NSApp currentEvent];
+if( pCurrentEvent && [pCurrentEvent type] == NSEventTypeScrollWheel )
+nEventMask &= ~NSEventMaskScrollWheel;
+}
+
 if( nType & VclInputFlags::KEYBOARD)
 nEventMask |= NSEventMaskKeyDown | NSEventMaskKeyUp | 
NSEventMaskFlagsChanged;
 if( nType & VclInputFlags::OTHER)


core.git: vcl/osx

2023-12-09 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f7e81a321bc3e4880fc652e7ba24867bba557007
Author: Patrick Luby 
AuthorDate: Sat Dec 9 16:19:18 2023 -0500
Commit: Patrick Luby 
CommitDate: Sat Dec 9 23:07:58 2023 +0100

tdf#158461 eliminate flicker during live resizing

When using Skia/Metal, the window content will flicker while
live resizing a window if we don't send a paint event.

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 4fd5913efc05..c0b23f80a7d6 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -465,8 +465,12 @@ static void updateWinDataInLiveResize(bool bInLiveResize)
 else
 {
 [self clearLiveResizeTimer];
-mpFrame->SendPaintEvent();
 }
+
+// tdf#158461 eliminate flicker during live resizing
+// When using Skia/Metal, the window content will flicker while
+// live resizing a window if we don't send a paint event.
+mpFrame->SendPaintEvent();
 }
 
 mbInWindowDidResize = NO;


core.git: vcl/osx

2023-12-08 Thread Patrick Luby (via logerrit)
 vcl/osx/salnativewidgets.cxx |   16 
 1 file changed, 16 deletions(-)

New commits:
commit 898d5d470e24a6f2fb244fec24df33ba8855
Author: Patrick Luby 
AuthorDate: Fri Dec 8 14:34:46 2023 +0100
Commit: Patrick Luby 
CommitDate: Fri Dec 8 15:39:24 2023 +0100

Revert "Related: tdf#155266 force flush after drawing native scrollbars"

This reverts commit 5ff701226b00963312cb2a78e77966d012b79c82.

Reason for revert: Tester reports no change in behavior after the commit.

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

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index a50735bf4628..8a7e81fd5d86 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -757,22 +757,6 @@ bool 
AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType,
 
 CGContextRestoreGState(context);
 
-// Related: tdf#155266 force flush after drawing native 
scrollbars
-// When scrolling on some Intel Macs either via dragging
-// the scrollbar thumb or via swiping the trackpad with two
-// fingers, final repaint of scrollbars doesn't appear to
-// get flushed to the screen. It appears that scrollbars
-// aren't updated and repainted until after a batch of
-// native scroll events have been dispatched. On slower
-// machines, this lag is long enough that any pending
-// forced flushes have already been done so when the timer
-// that repaints scrollbars finally fires, the repainted
-// scrollbars won't get flushed to the native window until
-// the next normal flush which may not occur until seconds
-// later.
-if (mpFrame && nType == ControlType::Scrollbar)
-mpFrame->mbForceFlush = true;
-
 bOK = true;
 
 [pBar release];


core.git: vcl/osx

2023-12-07 Thread Patrick Luby (via logerrit)
 vcl/osx/salnativewidgets.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 5ff701226b00963312cb2a78e77966d012b79c82
Author: Patrick Luby 
AuthorDate: Thu Dec 7 14:20:16 2023 -0500
Commit: Patrick Luby 
CommitDate: Thu Dec 7 22:36:22 2023 +0100

Related: tdf#155266 force flush after drawing native scrollbars

When scrolling on some Intel Macs either via dragging
the scrollbar thumb or via swiping the trackpad with two
fingers, final repaint of scrollbars doesn't appear to
get flushed to the screen. It appears that scrollbars
aren't updated and repainted until after a batch of
native scroll events have been dispatched. On slower
machines, this lag is long enough that any pending
forced flushes have already been done so when the timer
that repaints scrollbars finally fires, the repainted
scrollbars won't get flushed to the native window until
the next normal flush which may not occur until seconds
later.

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

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 8a7e81fd5d86..a50735bf4628 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -757,6 +757,22 @@ bool 
AquaGraphicsBackendBase::performDrawNativeControl(ControlType nType,
 
 CGContextRestoreGState(context);
 
+// Related: tdf#155266 force flush after drawing native 
scrollbars
+// When scrolling on some Intel Macs either via dragging
+// the scrollbar thumb or via swiping the trackpad with two
+// fingers, final repaint of scrollbars doesn't appear to
+// get flushed to the screen. It appears that scrollbars
+// aren't updated and repainted until after a batch of
+// native scroll events have been dispatched. On slower
+// machines, this lag is long enough that any pending
+// forced flushes have already been done so when the timer
+// that repaints scrollbars finally fires, the repainted
+// scrollbars won't get flushed to the native window until
+// the next normal flush which may not occur until seconds
+// later.
+if (mpFrame && nType == ControlType::Scrollbar)
+mpFrame->mbForceFlush = true;
+
 bOK = true;
 
 [pBar release];


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

2023-12-06 Thread Patrick Luby (via logerrit)
 vcl/osx/salframe.cxx |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc
Author: Patrick Luby 
AuthorDate: Wed Dec 6 11:11:38 2023 -0500
Commit: Patrick Luby 
CommitDate: Wed Dec 6 23:52:49 2023 +0100

Related: tdf#155266 skip redisplay of the view when forcing flush

It appears that calling -[NSView display] overwhelms some Intel Macs
so only flush the graphics and skip immediate redisplay of the view.

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 2240de319860..b02dbc59585e 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1035,7 +1035,11 @@ void AquaSalFrame::Flush()
 {
 mbForceFlush = false;
 mpGraphics->Flush();
-[mpNSView display];
+// Related: tdf#155266 skip redisplay of the view when forcing flush
+// It appears that calling -[NSView display] overwhelms some Intel Macs
+// so only flush the graphics and skip immediate redisplay of the view.
+if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
+[mpNSView display];
 }
 }
 
@@ -1057,7 +1061,11 @@ void AquaSalFrame::Flush( const tools::Rectangle& rRect )
 {
 mbForceFlush = false;
 mpGraphics->Flush( rRect );
-[mpNSView display];
+// Related: tdf#155266 skip redisplay of the view when forcing flush
+// It appears that calling -[NSView display] overwhelms some Intel Macs
+// so only flush the graphics and skip immediate redisplay of the view.
+if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
+[mpNSView display];
 }
 }
 


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

2023-11-29 Thread Patrick Luby (via logerrit)
 vcl/osx/salgdiutils.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 3b942f6efa8ffd11374031e4af8dbcb48a8962d1
Author: Patrick Luby 
AuthorDate: Wed Nov 29 17:51:19 2023 -0500
Commit: Patrick Luby 
CommitDate: Thu Nov 30 01:10:36 2023 +0100

Related: tdf#155092 translate Y coordinate for height differences

When in live resize, the NSView's height may have changed before
the CGLayer has been resized. This causes the CGLayer's content
to be drawn just above or below the top left corner of the view
so translate the Y coordinate by any difference between the
NSView's height and the CGLayer's height.

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

diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index 7e4bd23baac9..a9445293211c 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -311,6 +311,22 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
 
 rCGContextHolder.saveState();
 
+// Related: tdf#155092 translate Y coordinate for height differences
+// When in live resize, the NSView's height may have changed before
+// the CGLayer has been resized. This causes the CGLayer's content
+// to be drawn just above or below the top left corner of the view
+// so translate the Y coordinate by any difference between the
+// NSView's height and the CGLayer's height.
+NSView *pView = maShared.mpFrame->mpNSView;
+if (pView)
+{
+// Use the NSView's bounds, not its frame, to properly handle
+// any rotation and/or scaling that might have been already
+// applied to the view
+CGFloat fTranslateY = [pView bounds].size.height - 
maShared.maLayer.getSizePoints().height;
+CGContextTranslateCTM(rCGContextHolder.get(), 0, fTranslateY);
+}
+
 CGMutablePathRef rClip = maShared.mpFrame->getClipPath();
 if (rClip)
 {


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

2023-11-18 Thread Taichi Haradaguchi (via logerrit)
 vcl/osx/a11yactionwrapper.h |5 +
 vcl/osx/a11ycomponentwrapper.h  |5 +
 vcl/osx/a11yrolehelper.h|5 +
 vcl/osx/a11yselectionwrapper.h  |5 +
 vcl/osx/a11ytablewrapper.h  |4 +---
 vcl/osx/a11ytextattributeswrapper.h |4 +---
 vcl/osx/a11ytextwrapper.h   |5 +
 vcl/osx/a11yutil.h  |4 +---
 vcl/osx/a11yvaluewrapper.h  |5 +
 vcl/osx/a11ywrapperbutton.h |5 +
 vcl/osx/a11ywrappercheckbox.h   |5 +
 vcl/osx/a11ywrappercombobox.h   |5 +
 vcl/osx/a11ywrappergroup.h  |5 +
 vcl/osx/a11ywrapperlist.h   |5 +
 vcl/osx/a11ywrapperradiobutton.h|5 +
 vcl/osx/a11ywrapperradiogroup.h |5 +
 vcl/osx/a11ywrapperrow.h|5 +
 vcl/osx/a11ywrapperscrollarea.h |5 +
 vcl/osx/a11ywrapperscrollbar.h  |5 +
 vcl/osx/a11ywrappersplitter.h   |5 +
 vcl/osx/a11ywrapperstatictext.h |5 +
 vcl/osx/a11ywrappertabgroup.h   |5 +
 vcl/osx/a11ywrappertextarea.h   |5 +
 vcl/osx/a11ywrappertoolbar.h|5 +
 24 files changed, 24 insertions(+), 93 deletions(-)

New commits:
commit a688f401980646577d353e96d271499b9b720667
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Sun Nov 19 10:58:51 2023 +0900
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Sun Nov 19 06:42:30 2023 +0100

tdf#143148: Use pragma once instead of include guards in vcl/osx

Change-Id: I0f6edb1f4ed5310bf0bb7d051852a4c86205431f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159647
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/vcl/osx/a11yactionwrapper.h b/vcl/osx/a11yactionwrapper.h
index 9afc08b6b970..eb0141c805d1 100644
--- a/vcl/osx/a11yactionwrapper.h
+++ b/vcl/osx/a11yactionwrapper.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_A11YACTIONWRAPPER_H
-#define INCLUDED_VCL_OSX_A11YACTIONWRAPPER_H
+#pragma once
 
 #include 
 #include 
@@ -31,6 +30,4 @@
 + (NSAccessibilityActionName)actionNameForSelector:(SEL)aSelector;
 @end
 
-#endif // INCLUDED_VCL_OSX_A11YACTIONWRAPPER_H
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/a11ycomponentwrapper.h b/vcl/osx/a11ycomponentwrapper.h
index 3d8b16929279..a63f327e43bb 100644
--- a/vcl/osx/a11ycomponentwrapper.h
+++ b/vcl/osx/a11ycomponentwrapper.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_A11YCOMPONENTWRAPPER_H
-#define INCLUDED_VCL_OSX_A11YCOMPONENTWRAPPER_H
+#pragma once
 
 #include 
 #include 
@@ -34,6 +33,4 @@
 + (void)setFocusedAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
 @end
 
-#endif // INCLUDED_VCL_OSX_A11YCOMPONENTWRAPPER_H
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/a11yrolehelper.h b/vcl/osx/a11yrolehelper.h
index 7a4df6dbe967..db349ad38ddd 100644
--- a/vcl/osx/a11yrolehelper.h
+++ b/vcl/osx/a11yrolehelper.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_A11YROLEHELPER_H
-#define INCLUDED_VCL_OSX_A11YROLEHELPER_H
+#pragma once
 
 #include 
 
@@ -30,6 +29,4 @@
 +(id)getRoleDescriptionFrom: (NSString *) role with: (NSString *) subRole;
 @end
 
-#endif // INCLUDED_VCL_OSX_A11YROLEHELPER_H
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/a11yselectionwrapper.h b/vcl/osx/a11yselectionwrapper.h
index 880281a114ed..3b62fbd903a8 100644
--- a/vcl/osx/a11yselectionwrapper.h
+++ b/vcl/osx/a11yselectionwrapper.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_A11YSELECTIONWRAPPER_H
-#define INCLUDED_VCL_OSX_A11YSELECTIONWRAPPER_H
+#pragma once
 
 #include 
 #include 
@@ -32,6 +31,4 @@
 + (void)setSelectedChildrenAttributeForElement:(AquaA11yWrapper*)wrapper 
to:(id)value;
 @end
 
-#endif // INCLUDED_VCL_OSX_A11YSELECTIONWRAPPER_H
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/a11ytablewrapper.h b/vcl/osx/a11ytablewrapper.h
index ae2c454a81f0..bc8ce4f39ff1 100644
--- a/vcl/osx/a11ytablewrapper.h
+++ b/vcl/osx/a11ytablewrapper.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_A11YTABLEWRAPPER_H
-#define INCLUDED_VCL_OSX_A11YTABLEWRAPPER_H
+#pragma once
 
 #include 
 
@@ -33,6 +32,5 @@
 - (id)rowsAttribute;
 - (id)columnsAttribute;
 @end
-#endif // INCLUDED_VCL_OSX_A11YTABLEWRAPPER_H
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/a11ytextattributeswrapper.h 
b/vcl/osx/a11ytextattributeswrapper.h
index 4170f5f8a8cc..7df60a93833a 100644
--- a/vcl/osx/a11ytextattributeswrapper.h
+++ b/vcl/osx/a11ytextattributeswrapper.h
@@ 

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

2023-11-06 Thread Patrick Luby (via logerrit)
 vcl/osx/salframe.cxx |   38 ++
 1 file changed, 2 insertions(+), 36 deletions(-)

New commits:
commit 55a0fba06086436260aca1f7367da376683afdaa
Author: Patrick Luby 
AuthorDate: Mon Nov 6 08:31:41 2023 -0500
Commit: Patrick Luby 
CommitDate: Mon Nov 6 18:28:44 2023 +0100

tdf#155266 revert commit 9c0803edd1f42b2d29115674795c7c674fea1a35

While commit 9c0803edd1f42b2d29115674795c7c674fea1a35 fixed tdf#155266
on Mac Silicon, it didn't fix that bug on Mac Intel.

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 211b288f3b79..d20e6e3d8422 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1018,24 +1018,7 @@ void AquaSalFrame::Flush()
 // outside of the application's event loop (e.g. IntroWindow)
 // nothing would trigger paint event handling
 // => fall back to synchronous painting
-bool bFlush = ( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 );
-
-// tdf#155266 flush when scrolling or dragging
-// Delaying flushing until the dispatch level returns to zero causes
-// scrolling via the scrollwheel or mouse drag to appear laggy and
-// jerky.
-if( !bFlush )
-{
-NSEvent *pEvent = [NSApp currentEvent];
-if ( pEvent )
-{
-NSEventType nType = [pEvent type];
-if ( nType == NSEventTypeScrollWheel || nType == 
NSEventTypeLeftMouseDragged )
-bFlush = true;
-}
-}
-
-if( bFlush )
+if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
 {
 mpGraphics->Flush();
 [mpNSView display];
@@ -1056,24 +1039,7 @@ void AquaSalFrame::Flush( const tools::Rectangle& rRect )
 // outside of the application's event loop (e.g. IntroWindow)
 // nothing would trigger paint event handling
 // => fall back to synchronous painting
-bool bFlush = ( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 );
-
-// tdf#155266 flush when scrolling or dragging
-// Delaying flushing until the dispatch level returns to zero causes
-// scrolling via the scrollwheel or mouse drag to appear laggy and
-// jerky.
-if( !bFlush )
-{
-NSEvent *pEvent = [NSApp currentEvent];
-if ( pEvent )
-{
-NSEventType nType = [pEvent type];
-if ( nType == NSEventTypeScrollWheel || nType == 
NSEventTypeLeftMouseDragged )
-bFlush = true;
-}
-}
-
-if( bFlush )
+if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
 {
 mpGraphics->Flush( rRect );
 [mpNSView display];


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

2023-11-03 Thread Patrick Luby (via logerrit)
 vcl/osx/salframe.cxx |   38 --
 1 file changed, 36 insertions(+), 2 deletions(-)

New commits:
commit 9c0803edd1f42b2d29115674795c7c674fea1a35
Author: Patrick Luby 
AuthorDate: Thu Nov 2 20:05:21 2023 -0400
Commit: Patrick Luby 
CommitDate: Fri Nov 3 20:55:04 2023 +0100

tdf#155266 flush when scrolling or dragging

Delaying flushing until the dispatch level returns to zero causes
scrolling via the scrollwheel or mouse drag to appear laggy and
jerky.

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index d20e6e3d8422..211b288f3b79 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1018,7 +1018,24 @@ void AquaSalFrame::Flush()
 // outside of the application's event loop (e.g. IntroWindow)
 // nothing would trigger paint event handling
 // => fall back to synchronous painting
-if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
+bool bFlush = ( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 );
+
+// tdf#155266 flush when scrolling or dragging
+// Delaying flushing until the dispatch level returns to zero causes
+// scrolling via the scrollwheel or mouse drag to appear laggy and
+// jerky.
+if( !bFlush )
+{
+NSEvent *pEvent = [NSApp currentEvent];
+if ( pEvent )
+{
+NSEventType nType = [pEvent type];
+if ( nType == NSEventTypeScrollWheel || nType == 
NSEventTypeLeftMouseDragged )
+bFlush = true;
+}
+}
+
+if( bFlush )
 {
 mpGraphics->Flush();
 [mpNSView display];
@@ -1039,7 +1056,24 @@ void AquaSalFrame::Flush( const tools::Rectangle& rRect )
 // outside of the application's event loop (e.g. IntroWindow)
 // nothing would trigger paint event handling
 // => fall back to synchronous painting
-if( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 )
+bool bFlush = ( ImplGetSVData()->maAppData.mnDispatchLevel <= 0 );
+
+// tdf#155266 flush when scrolling or dragging
+// Delaying flushing until the dispatch level returns to zero causes
+// scrolling via the scrollwheel or mouse drag to appear laggy and
+// jerky.
+if( !bFlush )
+{
+NSEvent *pEvent = [NSApp currentEvent];
+if ( pEvent )
+{
+NSEventType nType = [pEvent type];
+if ( nType == NSEventTypeScrollWheel || nType == 
NSEventTypeLeftMouseDragged )
+bFlush = true;
+}
+}
+
+if( bFlush )
 {
 mpGraphics->Flush( rRect );
 [mpNSView display];


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

2023-11-03 Thread Michael Weghorn (via logerrit)
 vcl/osx/a11ytextattributeswrapper.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e6d34f00a5c408d64168d84c718ae5071feea4fd
Author: Michael Weghorn 
AuthorDate: Thu Nov 2 17:10:52 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Nov 3 07:30:39 2023 +0100

macOS a11y: Drop obsolete TODO to implement spelling error attr

Handling for `NSAccessibilityMisspelledTextAttribute` and the newer
`NSAccessibilityMarkedMisspelledTextAttribute` [1] has been added in

commit db0fa92637a1b2edf26da9917c9dce050ebc8a78
Author: Boris Dušek 
Date:   Sun Aug 11 16:37:48 2013 +0200

fdo#67980 - VoiceOver does not inform about misspelled text

and VoiceOver announces misspelled Writer text as such, so drop the
obsolete TODO.

[1] 
https://developer.apple.com/documentation/appkit/nsaccessibilitymarkedmisspelledtextattribute

Change-Id: Id8ae1ee660e87c06ac7f559b5cdf1b31e22aef90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158840
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index 8a8afe9a154b..4404dc646365 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -199,7 +199,7 @@ using namespace ::com::sun::star::uno;
 bool underlineHasColor = false;
 // add attributes to string
 for ( const PropertyValue& property : attributes ) {
-// TODO: NSAccessibilityMisspelledTextAttribute, 
NSAccessibilityAttachmentTextAttribute, NSAccessibilityLinkTextAttribute
+// TODO: NSAccessibilityAttachmentTextAttribute, 
NSAccessibilityLinkTextAttribute
 // NSAccessibilityStrikethroughColorTextAttribute is unsupported by 
UNP-API
 if ( property.Value.hasValue() ) {
 if ( property.Name == "CharUnderline" ) {


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

2023-11-01 Thread Michael Weghorn (via logerrit)
 vcl/osx/a11ywrapper.mm |8 
 1 file changed, 8 insertions(+)

New commits:
commit 64d7bb1917c38ad8e256a482778df647904f5502
Author: Michael Weghorn 
AuthorDate: Tue Oct 31 17:45:57 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Nov 1 21:21:01 2023 +0100

macOS a11y: Don't report (non-)expanded state when not expandable

When the a11y object is not expandable, also don't
report a true/false value for the expanded state on
macOS.

Otherwise, the CrossOver screen reader on macOS
will explicitly announce "collapsed" for these
objects, e.g. when moving focus between paragraphs
in Writer (as reported on the a11y mailing list [1])
or between toolbar butons, since
`isAccessibilityExpanded` gets called and
returns false, so it is assumed that this
is an expandable item that is currently
not expanded, i.e. it is collapsed.

Quoting from the NSAccessibilityProtocol doc [2]:

> You can control which accessor methods the assistive app can
> use by overriding isAccessibilitySelectorAllowed(_:).
> Return true if the assistive app can call the selector;
> otherwise, return false."

[1] https://listarchives.libreoffice.org/global/accessibility/msg01068.html
[2] 
https://developer.apple.com/documentation/appkit/nsaccessibilityprotocol:

Change-Id: Iac9027a598e5793d6bd0da79212d7b07448a4c34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158733
Tested-by: Jenkins
Reviewed-by: Patrick Luby 
Reviewed-by: Michael Weghorn 

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 887ea024ca44..df1d3690df6d 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -1575,6 +1575,14 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 if ( ! aSelector )
 return NO;
 
+// don't explicitly report (non-)expanded state when not expandable
+if (aSelector == @selector(isAccessibilityExpanded))
+{
+const sal_Int64 nStateSet = [ self accessibleContext ] -> 
getAccessibleStateSet();
+if (!( nStateSet & AccessibleStateType::EXPANDABLE))
+return false;
+}
+
 if ( [ self respondsToSelector: aSelector ] ) {
 // Ignore actions if action is not supported
 NSAccessibilityActionName pActionName = [ AquaA11yActionWrapper 
actionNameForSelector: aSelector ];


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

2023-10-19 Thread Patrick Luby (via logerrit)
 vcl/osx/salframe.cxx |   25 +++--
 1 file changed, 23 insertions(+), 2 deletions(-)

New commits:
commit fb68f0761c3cfadf73f261d2d44de7b4e277e0af
Author: Patrick Luby 
AuthorDate: Thu Oct 19 16:32:33 2023 -0400
Commit: Patrick Luby 
CommitDate: Fri Oct 20 02:20:42 2023 +0200

tdf#157565 show tooltip if any parent window is the key window

Commit b69db38a38b09e158e8d46d8b717db85860ca874 caused tooltips
to fail to appear if their immediate parent window was not the
key window. So, look through the parent window's parent windows
and, if any of those windows are the kwy window, show the tooltip.

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 98c165d9659f..d20e6e3d8422 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -468,8 +468,29 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
 // Also, don't display tooltips when mousing over non-key windows even if
 // the application is active as the tooltip window will pull the non-key
 // window in front of the key window.
-if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP) && (![NSApp 
isActive] || (mpParent && ![ mpParent->mpNSWindow isKeyWindow])))
-return;
+if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP))
+{
+if (![NSApp isActive])
+return;
+
+if (mpParent)
+{
+// tdf#157565 show tooltip if any parent window is the key window
+bool bKeyWindowFound = false;
+NSWindow *pParent = mpParent->mpNSWindow;
+while (pParent)
+{
+if ([pParent isKeyWindow])
+{
+bKeyWindowFound = true;
+break;
+}
+pParent = [pParent parentWindow];
+}
+if (!bKeyWindowFound)
+return;
+}
+}
 
 mbShown = bVisible;
 if(bVisible)


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

2023-09-12 Thread Patrick Luby (via logerrit)
 vcl/osx/salinst.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 26313599b0eae3b397bb341c63d185f8771af82d
Author: Patrick Luby 
AuthorDate: Mon Sep 11 10:37:07 2023 -0400
Commit: Patrick Luby 
CommitDate: Tue Sep 12 14:09:40 2023 +0200

attempt to fix macos jenkins hangs - part 3

oox::xls::WorkbookFragment::finalizeImport() calls
AquaSalInstance::DoYield() with bWait set to true. But
since unit tests generally have no expected user generated
events, we can end up blocking and waiting forever so
don't block and wait when running unit tests.

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 412aacd3d27b..8177c2c8309f 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -630,8 +630,14 @@ bool AquaSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 {
 SolarMutexReleaser aReleaser;
 
+// attempt to fix macos jenkins hangs - part 3
+// oox::xls::WorkbookFragment::finalizeImport() calls
+// AquaSalInstance::DoYield() with bWait set to true. But
+// since unit tests generally have no expected user generated
+// events, we can end up blocking and waiting forever so
+// don't block and wait when running unit tests.
 pEvent = [NSApp nextEventMatchingMask: NSEventMaskAny
-untilDate: [NSDate distantFuture]
+untilDate: SalInstance::IsRunningUnitTest() ? 
[NSDate distantPast] : [NSDate distantFuture]
 inMode: NSDefaultRunLoopMode
 dequeue: YES];
 if( pEvent )


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

2023-09-10 Thread Patrick Luby (via logerrit)
 vcl/osx/salinst.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit be9d7bee88eff89c0d361f23abb447ac2086c3b4
Author: Patrick Luby 
AuthorDate: Sun Sep 10 14:22:55 2023 -0400
Commit: Patrick Luby 
CommitDate: Sun Sep 10 23:25:06 2023 +0200

attempt to fix macos jenkins hangs - part 2

Commit a1174a5f1e312ebb98c3941d35287a8ffcb368e9 attempts to fix
sporadic blocking and waiting when fetching a native event so
use the same fix in AquaSalInstance::AnyInput() just to be safe.

Change-Id: I1505b6089f11be825bd13e0219a305159dfc324f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156803
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 645e82b0b59c..412aacd3d27b 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -732,7 +732,7 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
 if( !bool(nType) )
 return false;
 
-NSEvent* pEvent = [NSApp nextEventMatchingMask: nEventMask untilDate: nil
+NSEvent* pEvent = [NSApp nextEventMatchingMask: nEventMask untilDate: 
[NSDate distantPast]
 inMode: NSDefaultRunLoopMode dequeue: NO];
 return (pEvent != nullptr);
 }


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

2023-09-10 Thread Noel Grandin (via logerrit)
 vcl/osx/salinst.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a1174a5f1e312ebb98c3941d35287a8ffcb368e9
Author: Noel Grandin 
AuthorDate: Sun Sep 10 16:19:59 2023 +0200
Commit: Noel Grandin 
CommitDate: Sun Sep 10 18:07:50 2023 +0200

attempt to fix macos jenkins hangs

I see sporadic hangs, and the backtrace indicates that the process
is locked up inside _nextEventMatchingEventMask. Try an
alternative formulation of this method.

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 446bb32ae910..645e82b0b59c 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -594,7 +594,7 @@ bool AquaSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 SolarMutexReleaser aReleaser;
 
 pEvent = [NSApp nextEventMatchingMask: NSEventMaskAny
-untilDate: nil
+untilDate: [NSDate distantPast]
 inMode: NSDefaultRunLoopMode
 dequeue: YES];
 if( pEvent )


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

2023-08-08 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salmenu.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9fabf47aba423d74d8cfa2dc2cb28d24df83a8ea
Author: Stephan Bergmann 
AuthorDate: Mon Aug 7 17:16:36 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 8 09:07:28 2023 +0200

loplugin:redundantfcast

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

diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 7606df69ce80..bc2c5bed7cce 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -301,7 +301,7 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * 
pWin, const tools::Rectan
 // do the same strange semantics as vcl popup windows to arrive at a frame 
geometry
 // in mirrored UI case; best done by actually executing the same code
 sal_uInt16 nArrangeIndex;
-pWin->SetPosPixel( ::Point(FloatingWindow::ImplCalcPos( pWin, rRect, 
nFlags, nArrangeIndex )) );
+pWin->SetPosPixel( FloatingWindow::ImplCalcPos( pWin, rRect, nFlags, 
nArrangeIndex ) );
 displayPopupFrame.origin.x = pWin->ImplGetFrame()->maGeometry.x() - 
pParentAquaSalFrame->maGeometry.x() + offset;
 displayPopupFrame.origin.y = pWin->ImplGetFrame()->maGeometry.y() - 
pParentAquaSalFrame->maGeometry.y() + offset;
 pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false);


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

2023-06-26 Thread Noel Grandin (via logerrit)
 vcl/osx/salinst.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 633be9b03c870d9f242279e7f8617ae6daaef460
Author: Noel Grandin 
AuthorDate: Mon Jun 26 16:03:26 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Jun 26 20:56:48 2023 +0200

attempted fix for sporadic hang on macos

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index f2ba3b59fb25..446bb32ae910 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -588,6 +588,7 @@ bool AquaSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 NSTimeInterval now = [[NSProcessInfo processInfo] systemUptime];
 mbTimerProcessed = false;
 
+int noLoops = 0;
 do
 {
 SolarMutexReleaser aReleaser;
@@ -608,6 +609,12 @@ bool AquaSalInstance::DoYield(bool bWait, bool 
bHandleAllCurrentEvents)
 
 if ( !bHandleAllCurrentEvents || !pEvent || now < [pEvent 
timestamp] )
 break;
+// noelgrandin: I see sporadic hangs on the macos jenkins boxes, 
and the backtrace
+// points to the this loop - let us see if breaking out of here 
after too many
+// trips around helps.
+noLoops++;
+if (noLoops == 100)
+break;
 }
 while( true );
 


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

2023-06-20 Thread Stephan Bergmann (via logerrit)
 vcl/osx/a11ywrapper.mm  |4 ++--
 vcl/osx/salframeview.mm |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 783851f99c25ba53331fafc03523d3537617cd2b
Author: Stephan Bergmann 
AuthorDate: Tue Jun 20 09:19:47 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 20 10:49:58 2023 +0200

loplugin:cstylecast

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

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 0ca256a7552f..887ea024ca44 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -1266,7 +1266,7 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 {
 NSNumber *pNumber = [ self accessibilityAttributeValue: 
NSAccessibilityOrientationAttribute ];
 if ( pNumber )
-return (NSAccessibilityOrientation)[ pNumber integerValue ];
+return NSAccessibilityOrientation([ pNumber integerValue ]);
 else
 return NSAccessibilityOrientationUnknown;
 }
@@ -1555,7 +1555,7 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 com::sun::star::awt::Point location = 
pAccessibleComponent->getLocationOnScreen();
 com::sun::star::awt::Size size = pAccessibleComponent->getSize();
 NSRect screenRect = sal::aqua::getTotalScreenBounds();
-NSRect frame = NSMakeRect( (float)location.X, (float)( 
screenRect.size.height - size.Height - location.Y ), (float)size.Width, 
(float)size.Height );
+NSRect frame = NSMakeRect( float(location.X), float( 
screenRect.size.height - size.Height - location.Y ), float(size.Width), 
float(size.Height) );
 return frame;
 }
 } catch ( DisposedException& ) {
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 0ccdb048d190..f8608f62c2f7 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -2549,7 +2549,7 @@ static NSArray *getMergedAccessibilityChildren(NSArray 
*pDefaultChildren, NSArra
 
 if (pObject && [pObject isKindOfClass:[SalFrameView class]])
 {
-mpParentView = (SalFrameView *)pObject;
+mpParentView = static_cast(pObject);
 [mpParentView retain];
 }
 


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

2023-06-11 Thread Patrick Luby (via logerrit)
 vcl/osx/a11yselectionwrapper.mm |   12 
 1 file changed, 12 insertions(+)

New commits:
commit ca060dac4beb944ac6994ba9c050ab4eba4fc44e
Author: Patrick Luby 
AuthorDate: Sun Jun 11 07:04:16 2023 -0400
Commit: Patrick Luby 
CommitDate: Mon Jun 12 02:02:11 2023 +0200

Fix hanging when selecting a column or row in Calc

When a Calc column is selected, the child count will be
at least a million. Constructing that many C++ Calc objects
takes several minutes even on a fast Silicon Mac so apply
the maximum table cell limit here.

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

diff --git a/vcl/osx/a11yselectionwrapper.mm b/vcl/osx/a11yselectionwrapper.mm
index dfddce4b3b79..9d3beee2d3aa 100644
--- a/vcl/osx/a11yselectionwrapper.mm
+++ b/vcl/osx/a11yselectionwrapper.mm
@@ -22,6 +22,7 @@
 #include 
 
 #include "a11yselectionwrapper.h"
+#include "a11ytablewrapper.h"
 
 using namespace ::com::sun::star::accessibility;
 using namespace ::com::sun::star::uno;
@@ -36,6 +37,17 @@ using namespace ::com::sun::star::uno;
 NSMutableArray * children = [ [ NSMutableArray alloc ] init ];
 try {
 sal_Int64 n = xAccessibleSelection -> 
getSelectedAccessibleChildCount();
+
+// Fix hanging when selecting a column or row in Calc
+// When a Calc column is selected, the child count will be
+// at least a million. Constructing that many C++ Calc objects
+// takes several minutes even on a fast Silicon Mac so apply
+// the maximum table cell limit here.
+if ( n < 0 )
+n = 0;
+else if ( n > MAXIMUM_ACCESSIBLE_TABLE_CELLS )
+n = MAXIMUM_ACCESSIBLE_TABLE_CELLS;
+
 for ( sal_Int64 i=0 ; i < n ; ++i ) {
 [ children addObject: [ AquaA11yFactory wrapperForAccessible: 
xAccessibleSelection -> getSelectedAccessibleChild( i ) ] ];
 }


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

2023-05-28 Thread Patrick Luby (via logerrit)
 vcl/osx/a11ytextattributeswrapper.mm |1 +
 vcl/osx/a11ywrapper.mm   |2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cb4fb9e31e42ed719f435919d1ca671ba2d66863
Author: Patrick Luby 
AuthorDate: Sun May 28 09:49:52 2023 -0300
Commit: Patrick Luby 
CommitDate: Mon May 29 01:10:01 2023 +0200

Related tdf#tdf155376 fix minor memory leaks

Change-Id: I9cdc5fb38ffba113e3d069d9d766dbe1a82c492d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152352
Tested-by: Jenkins
Reviewed-by: Patrick Luby 
(cherry picked from commit 7ae89a2ad89c9e7702fbd2b31269ee4c61fe5bcb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152316

diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index 9db1ba91307d..8a8afe9a154b 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -315,6 +315,7 @@ using namespace ::com::sun::star::uno;
 try {
 NSString * myString = CreateNSString ( [ wrapper accessibleText ] -> 
getText() ); // TODO: dirty fix for i87817
 string = [ [ NSMutableAttributedString alloc ] initWithString: 
CreateNSString ( [ wrapper accessibleText ] -> getTextRange ( loc, loc + len ) 
) ];
+[ string autorelease ];
 if ( [ wrapper accessibleTextAttributes ] && [myString 
characterAtIndex:0] != 57361) { // TODO: dirty fix for i87817
 [ string beginEditing ];
 // add default attributes for whole string
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index cb6fca0a9e29..96de29e07f77 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -855,7 +855,7 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 SolarMutexGuard aGuard;
 
 SAL_INFO("vcl.a11y", "[" << self << " 
accessibilityParameterizedAttributeNames]");
-NSMutableArray * attributeNames = [ [ NSMutableArray alloc ] init ];
+NSMutableArray * attributeNames = [ NSMutableArray array ];
 // Special Attributes depending on interface
 if ( [ self accessibleText ] ) {
 [ AquaA11yTextWrapper addParameterizedAttributeNamesTo: attributeNames 
];


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

2023-05-28 Thread Patrick Luby (via logerrit)
 vcl/osx/a11ywrapper.mm |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 1bf7da609848652ad99d9bde844b90d37de80ffa
Author: Patrick Luby 
AuthorDate: Sun May 28 17:37:46 2023 -0300
Commit: Patrick Luby 
CommitDate: Mon May 29 00:24:26 2023 +0200

Partial fix tdf#146626 Catch uncaught DisposedException

Fix crash due to an uncaught DisposedException thrown by
SwAccessibleParagraph::getTextRange() by using the same try/catch
block in -[A11yWrapper accessibilityAttributeValue:] in
-[A11yWrapper accessibilityAttributeValue:forParameter].

Change-Id: Ifcaec3eb2d76f32bddc56a1242f6d86f8b90f782
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152361
Tested-by: Jenkins
Reviewed-by: Patrick Luby 
(cherry picked from commit f8cc6f960e8aeb37547d447fed2b2c6e6ddc02e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152317

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index c4beeb5b0567..cb6fca0a9e29 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -870,7 +870,15 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 SAL_INFO("vcl.a11y", "[" << self << " accessibilityAttributeValue:" << 
attribute << " forParameter:" << (static_cast(parameter)) << "]");
 SEL methodSelector = [ self selectorForAttribute: attribute asGetter: YES 
withGetterParameter: YES ];
 if ( [ self respondsToSelector: methodSelector ] ) {
-return [ self performSelector: methodSelector withObject: parameter ];
+try {
+return [ self performSelector: methodSelector withObject: 
parameter ];
+} catch ( const DisposedException & ) {
+mIsTableCell = NO; // just to be sure
+[ AquaA11yFactory removeFromWrapperRepositoryFor: [ self 
accessibleContext ] ];
+return nil;
+} catch ( const Exception & ) {
+// empty
+}
 }
 return nil; // TODO: to be completed
 }


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

2023-05-10 Thread Patrick Luby (via logerrit)
 vcl/osx/salframe.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit bf2cf747303d1485fac44e0d7250541094fe9724
Author: Patrick Luby 
AuthorDate: Wed May 10 16:15:03 2023 -0400
Commit: Patrick Luby 
CommitDate: Wed May 10 23:26:59 2023 +0200

tdf#152173 Don't display tooltip windows when mousing over non-key windows

Don't display tooltips when mousing over non-key windows even if the
application is active as the tooltip window will pull the non-key
window in front of the key window.

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 686f346fb54f..ea514b786ada 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -462,7 +462,10 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
 // parent window (to ensure that the tooltip is above the parent window),
 // displaying a tooltip pulls the parent window in front of the windows
 // of all other inactive applications.
-if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP) && ![NSApp 
isActive])
+// Also, don't display tooltips when mousing over non-key windows even if
+// the application is active as the tooltip window will pull the non-key
+// window in front of the key window.
+if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP) && (![NSApp 
isActive] || (mpParent && ![ mpParent->mpNSWindow isKeyWindow])))
 return;
 
 mbShown = bVisible;


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

2023-05-04 Thread Patrick Luby (via logerrit)
 vcl/osx/salframe.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 3bc7cc14706f47d740dfc5715970054922ca470c
Author: Patrick Luby 
AuthorDate: Thu May 4 09:45:09 2023 -0400
Commit: Patrick Luby 
CommitDate: Thu May 4 22:48:48 2023 +0200

tdf#152173 Don't display tooltip windows when application is inactive

Starting with macOS 13 Ventura, inactive applications receive mouse
move events so when LibreOffice is inactive, a mouse move event causes
a tooltip to be displayed. Since the tooltip window is attached to its
parent window (to ensure that the tooltip is above the parent window),
displaying a tooltip pulls the parent window in front of the windows
of all other inactive applications.

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 6288c44b2ab1..686f346fb54f 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -455,6 +455,16 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
 
 OSX_SALDATA_RUNINMAIN( Show(bVisible, bNoActivate) )
 
+// tdf#152173 Don't display tooltip windows when application is inactive
+// Starting with macOS 13 Ventura, inactive applications receive mouse
+// move events so when LibreOffice is inactive, a mouse move event causes
+// a tooltip to be displayed. Since the tooltip window is attached to its
+// parent window (to ensure that the tooltip is above the parent window),
+// displaying a tooltip pulls the parent window in front of the windows
+// of all other inactive applications.
+if (bVisible && (mnStyle & SalFrameStyleFlags::TOOLTIP) && ![NSApp 
isActive])
+return;
+
 mbShown = bVisible;
 if(bVisible)
 {


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

2023-04-12 Thread Patrick Luby (via logerrit)
 vcl/osx/a11ywrapper.mm |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 127eacf630e1712fd5addcabed404b2d33752311
Author: Patrick Luby 
AuthorDate: Wed Apr 12 17:17:12 2023 -0400
Commit: Patrick Luby 
CommitDate: Thu Apr 13 02:09:19 2023 +0200

Related: tdf#153374 Don't release autoreleased attributeNames

Also, return an autoreleased empty array instead of a retained array.

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

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 73abb6050733..c4beeb5b0567 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -807,8 +807,13 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 if ( [ self accessibleValue ] ) {
 [ AquaA11yValueWrapper addAttributeNamesTo: attributeNames ];
 }
-[ nativeSubrole release ];
-[ title release ];
+if ( nativeSubrole ) {
+[ nativeSubrole release ];
+}
+if ( title ) {
+[ title release ];
+}
+// Related: tdf#153374 Don't release autoreleased attributeNames
 return attributeNames;
 } catch ( DisposedException & ) { // Object is no longer available
 if ( nativeSubrole ) {
@@ -817,11 +822,10 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 if ( title ) {
 [ title release ];
 }
-if ( attributeNames ) {
-[ attributeNames release ];
-}
+// Related: tdf#153374 Don't release autoreleased attributeNames
+// Also, return an autoreleased empty array instead of a retained 
array.
 [ AquaA11yFactory removeFromWrapperRepositoryFor: [ self 
accessibleContext ] ];
-return [ [ NSArray alloc ] init ];
+return [ NSArray array ];
 }
 }
 


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

2023-04-11 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   35 ++-
 1 file changed, 30 insertions(+), 5 deletions(-)

New commits:
commit 1b06f35de68a555b85bceb5fc29d1a5f426f4bb7
Author: Patrick Luby 
AuthorDate: Tue Apr 11 19:13:51 2023 -0400
Commit: Patrick Luby 
CommitDate: Wed Apr 12 02:18:34 2023 +0200

tdf#154708 Preserve selection for repeating Shift-arrow on Japanese keyboard

Skip the posting of SalEvent::ExtTextInput and SalEvent::EndExtTextInput
events for private use area characters.

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index ae9528306cfa..3b2341a33fe4 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1149,7 +1149,8 @@ static AquaSalFrame* getMouseContainerFrame()
 if ( !mbKeyHandled && !mpLastMarkedText && mpLastEvent && 
[mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] )
 {
 NSString *pChars = [mpLastEvent characters];
-[self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
+if ( pChars )
+[self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
 }
 // tdf#42437 Enable press-and-hold special character input method
 // Emulate the press-and-hold behavior of the TextEdit application
@@ -1965,7 +1966,32 @@ static AquaSalFrame* getMouseContainerFrame()
 // the returned position won't be anywhere near the text cursor. So,
 // dispatch an empty SalEvent::ExtTextInput event, fetch the position,
 // and then dispatch a SalEvent::EndExtTextInput event.
-bool bNeedsExtTextInput = ( mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] );
+NSString *pNewMarkedText = nullptr;
+NSString *pChars = [mpLastEvent characters];
+bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] );
+if ( bNeedsExtTextInput )
+{
+// tdf#154708 Preserve selection for repeating Shift-arrow on Japanese 
keyboard
+// Skip the posting of SalEvent::ExtTextInput and
+// SalEvent::EndExtTextInput events for private use area characters.
+NSUInteger nLen = [pChars length];
+unichar pBuf[ nLen + 1 ];
+NSUInteger nBufLen = 0;
+for ( NSUInteger i = 0; i < nLen; i++ )
+{
+unichar aChar = [pChars characterAtIndex:i];
+if ( aChar >= 0xf700 && aChar < 0xf780 )
+continue;
+
+pBuf[nBufLen++] = aChar;
+}
+pBuf[nBufLen] = 0;
+
+pNewMarkedText = [NSString stringWithCharacters:pBuf length:nBufLen];
+if (!pNewMarkedText || ![pNewMarkedText length])
+bNeedsExtTextInput = false;
+}
+
 if ( bNeedsExtTextInput )
 {
 SalExtTextInputEvent aInputEvent;
@@ -1993,11 +2019,10 @@ static AquaSalFrame* getMouseContainerFrame()
 // input method so set the mbTextInputWantsNonRepeatKeyDown flag to
 // indicate that the characters need to be deleted if the input method
 // replaces the committed characters.
-NSString *pChars = [mpLastEvent characters];
-if ( pChars )
+if ( pNewMarkedText )
 {
 [self unmarkText];
-mpLastMarkedText = [[NSAttributedString alloc] 
initWithString:pChars];
+mpLastMarkedText = [[NSAttributedString alloc] 
initWithString:pNewMarkedText];
 mSelectedRange = mMarkedRange = NSMakeRange( 0, [mpLastMarkedText 
length] );
 mbTextInputWantsNonRepeatKeyDown = YES;
 }


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

2023-03-10 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 57b88be1e10e131aea429e205fd426b7dab2ba2d
Author: Patrick Luby 
AuthorDate: Thu Mar 9 19:37:13 2023 -0500
Commit: Patrick Luby 
CommitDate: Fri Mar 10 12:34:03 2023 +

Reset dark mode colors in HITheme controls after printing

In dark mode, after an NSPrintOperation has completed, macOS draws
HITheme controls with light mode colors so reset all dark mode
colors when an NSWindow gains focus.

Change-Id: Ifdbb7d2eff8157ed0d711cf975c2ad1fdcf63495
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148570
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-by: Patrick Luby 

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 9eded8a40fe8..ae9528306cfa 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -277,6 +277,12 @@ static AquaSalFrame* getMouseContainerFrame()
 SalFrameStyleFlags::SIZEABLE|
 SalFrameStyleFlags::CLOSEABLE;
 
+// Reset dark mode colors in HITheme controls after printing
+// In dark mode, after an NSPrintOperation has completed, macOS draws
+// HITheme controls with light mode colors so reset all dark mode
+// colors when an NSWindow gains focus.
+mpFrame->UpdateDarkMode();
+
 if( mpFrame->mpMenu )
 mpFrame->mpMenu->setMainMenu();
 else if( ! mpFrame->mpParent &&


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

2023-02-09 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salframe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6031935412efbd610486af11561b8818d3e4d1bf
Author: Stephan Bergmann 
AuthorDate: Thu Feb 9 09:12:47 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 9 12:41:46 2023 +

loplugin:staticaccess

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index dd3b9fa1d411..bf2257be9fac 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1262,7 +1262,7 @@ void AquaSalFrame::UpdateDarkMode()
 {
 if (@available(macOS 10.14, iOS 13, *))
 {
-switch (Application::GetSettings().GetMiscSettings().GetDarkMode())
+switch (MiscSettings::GetDarkMode())
 {
 case 0: // auto
 default:


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

2023-01-20 Thread Patrick Luby (via logerrit)
 vcl/osx/a11ytextattributeswrapper.mm |6 +-
 vcl/osx/a11ywrapper.mm   |   33 +
 vcl/osx/a11ywrapperbutton.mm |4 
 vcl/osx/a11ywrappercheckbox.mm   |7 +++
 vcl/osx/a11ywrappercombobox.mm   |   10 ++
 vcl/osx/a11ywrappergroup.mm  |4 
 vcl/osx/a11ywrapperlist.mm   |4 
 vcl/osx/a11ywrapperradiobutton.mm|7 +++
 vcl/osx/a11ywrapperradiogroup.mm |4 
 vcl/osx/a11ywrapperrow.mm|4 
 vcl/osx/a11ywrapperscrollarea.mm |4 
 vcl/osx/a11ywrapperscrollbar.mm  |4 
 vcl/osx/a11ywrappersplitter.mm   |4 
 vcl/osx/a11ywrapperstatictext.mm |4 
 vcl/osx/a11ywrappertabgroup.mm   |4 
 vcl/osx/a11ywrappertextarea.mm   |4 
 vcl/osx/a11ywrappertoolbar.mm|4 
 17 files changed, 110 insertions(+), 1 deletion(-)

New commits:
commit de1d75a0cd25f239cdc751dec75c9019fbcabd8e
Author: Patrick Luby 
AuthorDate: Tue Jan 17 09:51:10 2023 -0500
Commit: Patrick Luby 
CommitDate: Fri Jan 20 19:36:14 2023 +

tdf#148453 Fix crash by turning off optimization for Objective-C selector

The default attributes sequence sometimes crashes when it is released but
only when compiler optimization is enabled, so disable optimization for the
+[AquaA11yTextAttributesWrapper createAttributedStringForElement] selector.

Also, disabling optimization by itself is apparently not enough to stop
the crashing. Acquiring the solar mutex during native accessibility calls
is also needed. Native accessibility calls are called from native input
sources in [NSApp nextEventMatchingMask:untilDate:inMode:dequeue:]. Since
AquaSalInstance::DoYield() releases the solar mutex before calling
[NSApp nextEventMatchingMask:untilDate:inMode:dequeue:], we need to
always acquire the solar mutex during all NSAccessibility selectors (both
the old informal protocol and the newer formal protocol) that we implement.

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

diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index 84a9b27e54cc..9db1ba91307d 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -300,7 +300,11 @@ using namespace ::com::sun::star::uno;
 [AquaA11yTextAttributesWrapper addMarkup:markup 
withType:css::text::TextMarkupType::SPELLCHECK toString:string inRange:range];
 }
 
-+(NSMutableAttributedString 
*)createAttributedStringForElement:(AquaA11yWrapper *)wrapper 
inOrigRange:(id)origRange {
+// tdf#148453 Fix crash by turning off optimization for Objective-C selector
+// The default attributes sequence sometimes crashes when it is released but
+// only when compiler optimization is enabled, so disable optimization for the
+// +[AquaA11yTextAttributesWrapper createAttributedStringForElement] selector.
++(NSMutableAttributedString 
*)createAttributedStringForElement:(AquaA11yWrapper *)wrapper 
inOrigRange:(id)origRange __attribute__((optnone)) {
 static const Sequence < OUString > emptySequence;
 // vars
 NSMutableAttributedString * string = nil;
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index beb40f8851b3..73abb6050733 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -682,6 +682,9 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 #pragma mark Accessibility Protocol
 
 -(id)accessibilityAttributeValue:(NSString *)attribute {
+// Related: tdf#148453 Acquire solar mutex during native accessibility 
calls
+SolarMutexGuard aGuard;
+
 SAL_INFO("vcl.a11y", "[" << self << " accessibilityAttributeValue:" << 
attribute << "]");
 // #i90575# guard NSAccessibility protocol against unwanted access
 if ( isPopupMenuOpen ) {
@@ -712,6 +715,9 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 }
 
 -(BOOL)accessibilityIsIgnored {
+// Related: tdf#148453 Acquire solar mutex during native accessibility 
calls
+SolarMutexGuard aGuard;
+
 SAL_INFO("vcl.a11y", "[" << self << " accessibilityIsIgnored]");
 // #i90575# guard NSAccessibility protocol against unwanted access
 if ( isPopupMenuOpen ) {
@@ -736,6 +742,9 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 }
 
 -(NSArray *)accessibilityAttributeNames {
+// Related: tdf#148453 Acquire solar mutex during native accessibility 
calls
+SolarMutexGuard aGuard;
+
 SAL_INFO("vcl.a11y", "[" << self << " accessibilityAttributeNames]");
 // #i90575# guard NSAccessibility protocol against unwanted access
 if ( isPopupMenuOpen ) {
@@ -817,6 +826,9 @@ static std::ostream <<(std::ostream , NSObject 
*obj) {
 }
 
 -(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+// Related: 

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

2023-01-17 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit ef558d0aab44421ad5cd8362724ff1410af1b480
Author: Patrick Luby 
AuthorDate: Tue Jan 17 16:26:00 2023 -0500
Commit: Patrick Luby 
CommitDate: Tue Jan 17 22:21:04 2023 +

Related: tdf#42437 Skip special press-and-hold handling for action keys

Pressing and holding action keys such as arrow keys must not be handled
like pressing and holding a character key as it will insert unexpected
text.

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 98765c761969..b36cd23721ea 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1115,7 +1115,11 @@ static AquaSalFrame* getMouseContainerFrame()
 // Handle repeat key events by explicitly inserting the text if
 // -[NSResponder interpretKeyEvents:] does not insert or mark any
 // text. Note: do not do this step if there is uncommitted text.
-if ( !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == 
NSEventTypeKeyDown && [mpLastEvent isARepeat] )
+// Related: tdf#42437 Skip special press-and-hold handling for 
action keys
+// Pressing and holding action keys such as arrow keys must not be
+// handled like pressing and holding a character key as it will
+// insert unexpected text.
+if ( !mbKeyHandled && !mpLastMarkedText && mpLastEvent && 
[mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] )
 {
 NSString *pChars = [mpLastEvent characters];
 [self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
@@ -1264,9 +1268,13 @@ static AquaSalFrame* getMouseContainerFrame()
 mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
 
 }
-mbKeyHandled = true;
 [self unmarkText];
 }
+
+// Mark event as handled even if the frame isn't valid like is done in
+// [self setMarkedText:selectedRange:replacementRange:] and
+// [self doCommandBySelector:]
+mbKeyHandled = true;
 }
 
 -(void)insertTab: (id)aSender


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

2023-01-17 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salframeview.mm |1 -
 1 file changed, 1 deletion(-)

New commits:
commit ea70cf3ca06a5b101d51ca1f4d4a106747a884ae
Author: Stephan Bergmann 
AuthorDate: Tue Jan 17 15:47:10 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 17 16:14:15 2023 +

loplugin:casttovoid ("unnecessary cast to void")

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index b14d87eb7a37..98765c761969 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -333,7 +333,6 @@ static AquaSalFrame* getMouseContainerFrame()
 
 -(void)windowDidResize: (NSNotification*)pNotification
 {
-(void)pNotification;
 SolarMutexGuard aGuard;
 
 if ( mbInWindowDidResize )


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

2023-01-09 Thread Patrick Luby (via logerrit)
 vcl/osx/a11ytablewrapper.mm |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit d96c98647511b6c1f1d1d9a969df39f859cc0696
Author: Patrick Luby 
AuthorDate: Mon Jan 9 18:00:11 2023 -0500
Commit: Noel Grandin 
CommitDate: Tue Jan 10 06:53:53 2023 +

tdf#152648 Handle overflow when multiplying rows and columns

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

diff --git a/vcl/osx/a11ytablewrapper.mm b/vcl/osx/a11ytablewrapper.mm
index 0cd98c7863dd..6f8775f0a4b5 100644
--- a/vcl/osx/a11ytablewrapper.mm
+++ b/vcl/osx/a11ytablewrapper.mm
@@ -39,8 +39,10 @@ using namespace ::com::sun::star::uno;
 {
 sal_Int32 nRows = accessibleTable->getAccessibleRowCount();
 sal_Int32 nCols = accessibleTable->getAccessibleColumnCount();
-
-if( nRows * nCols < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
+
+// tdf#152648 Handle overflow when multiplying rows and columns
+sal_Int64 nCells = static_cast(nRows) * 
static_cast(nCols);
+if( nCells >= 0 && nCells < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
 {
 // make all children visible to the hierarchy
 for ( sal_Int32 rowCount = 0; rowCount < nRows; rowCount++ )
@@ -111,9 +113,10 @@ using namespace ::com::sun::star::uno;
 {
 sal_Int32 nRows = accessibleTable->getAccessibleRowCount();
 sal_Int32 nCols = accessibleTable->getAccessibleColumnCount();
-
-
-if( nRows*nCols < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
+
+// tdf#152648 Handle overflow when multiplying rows and columns
+sal_Int64 nCells = static_cast(nRows) * 
static_cast(nCols);
+if( nCells >= 0 && nCells < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
 {
 [ attributeNames addObject: NSAccessibilityRowsAttribute ];
 [ attributeNames addObject: NSAccessibilityColumnsAttribute ];
@@ -130,7 +133,10 @@ using namespace ::com::sun::star::uno;
 {
 sal_Int32 nRows = accessibleTable->getAccessibleRowCount();
 sal_Int32 nCols = accessibleTable->getAccessibleColumnCount();
-if( nRows * nCols < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
+
+// tdf#152648 Handle overflow when multiplying rows and columns
+sal_Int64 nCells = static_cast(nRows) * 
static_cast(nCols);
+if( nCells >= 0 && nCells < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
 {
 NSMutableArray * cells = [ [ NSMutableArray alloc ] init ];
 try
@@ -168,7 +174,10 @@ using namespace ::com::sun::star::uno;
 {
 sal_Int32 nRows = accessibleTable->getAccessibleRowCount();
 sal_Int32 nCols = accessibleTable->getAccessibleColumnCount();
-if( nRows * nCols < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
+
+// tdf#152648 Handle overflow when multiplying rows and columns
+sal_Int64 nCells = static_cast(nRows) * 
static_cast(nCols);
+if( nCells >= 0 && nCells < MAXIMUM_ACCESSIBLE_TABLE_CELLS )
 {
 NSMutableArray * cells = [ [ NSMutableArray alloc ] init ];
 try


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

2023-01-09 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salframeview.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9cc91e17172709c65742c092d3f312bce48ac6d9
Author: Stephan Bergmann 
AuthorDate: Mon Jan 9 15:48:27 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Jan 9 18:54:13 2023 +

loplugin:fakebool

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index c5136b9359bc..4833af8fda9e 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -323,7 +323,7 @@ static AquaSalFrame* getMouseContainerFrame()
 mpFrame->UpdateFrameGeometry();
 mpFrame->CallCallback( SalEvent::Resize, nullptr );
 
-BOOL bInLiveResize = [self inLiveResize];
+bool bInLiveResize = [self inLiveResize];
 if ( bInLiveResize || mbInLiveResize )
 {
 mbInLiveResize = bInLiveResize;


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

2023-01-05 Thread Andrea Gelmini (via logerrit)
 vcl/osx/salframeview.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit eefc323cd592c7958b13062e3f08e105d24055b1
Author: Andrea Gelmini 
AuthorDate: Thu Jan 5 23:24:49 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 6 05:50:04 2023 +

Fix typo

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 43260a7d5077..c5136b9359bc 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -355,7 +355,7 @@ static AquaSalFrame* getMouseContainerFrame()
 // events and firing any pending timers.
 // Also, Application::Reschedule() can potentially display a
 // modal dialog which will cause a hang so temporarily disable
-// live resize by clampiing the window's minimum and maximum sizes
+// live resize by clamping the window's minimum and maximum sizes
 // to the current frame size which in Application::Reschedule().
 NSRect aFrame = [self frame];
 NSSize aMinSize = [self minSize];


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

2023-01-05 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   74 +---
 vcl/skia/gdiimpl.cxx|5 +++
 2 files changed, 50 insertions(+), 29 deletions(-)

New commits:
commit 2d1a0d86d2d0c00fcfee61c39f2221e786e4245b
Author: Patrick Luby 
AuthorDate: Wed Jan 4 16:22:46 2023 -0500
Commit: Noel Grandin 
CommitDate: Thu Jan 5 18:32:49 2023 +

Related: tdf#152703 Prevent possible hang when live resizing a window

Application::Reschedule() can potentially display a modal dialog which
will cause a hang so temporarily disable live resize by clampiing the
window's minimum and maximum sizes to the current frame size which in
Application::Reschedule().

Also, eliminate flickering during live resizing of a window when using
Skia/Metal. When in live resize, the SkiaSalGraphicsImpl class does not
detect that the window size has changed until after the flush has been
called so call checkSurface() to recreate the SkSurface if needed before
flushing. Flushing had to be moved during [self windowDidResize:] to 
eliminate
flicker. Flushing in [self displayIfNeeded] does not eliminate flicker so
apparently [self windowDidResize:] is called earlier.

Change-Id: Id3de838d2e17fee85cb583b6c4e862b571d47142
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145053
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
Reviewed-by: Noel Grandin 

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 61061253a2da..43260a7d5077 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -220,22 +220,6 @@ static AquaSalFrame* getMouseContainerFrame()
 if( GetSalData() && GetSalData()->mpInstance )
 {
 SolarMutexGuard aGuard;
-
-#if HAVE_FEATURE_SKIA
-// Related: tdf#152703 Eliminate empty window with Skia/Metal while 
resizing
-// The window will clear its background so when Skia/Metal is enabled,
-// explicitly flush the Skia graphics to the window during live
-// resizing or else nothing will be drawn until after live resizing
-// has ended.
-// TODO: See if flickering when flushing can be eliminated somehow.
-if ( [self inLiveResize] && SkiaHelper::isVCLSkiaEnabled() && mpFrame 
&& AquaSalFrame::isAlive( mpFrame ) )
-{
-AquaSalGraphics* pGraphics = mpFrame->mpGraphics;
-if ( pGraphics )
-pGraphics->Flush();
-}
-#endif
-
 [super displayIfNeeded];
 }
 }
@@ -339,9 +323,29 @@ static AquaSalFrame* getMouseContainerFrame()
 mpFrame->UpdateFrameGeometry();
 mpFrame->CallCallback( SalEvent::Resize, nullptr );
 
-if ( [self inLiveResize] )
+BOOL bInLiveResize = [self inLiveResize];
+if ( bInLiveResize || mbInLiveResize )
 {
-mbInLiveResize = YES;
+mbInLiveResize = bInLiveResize;
+
+#if HAVE_FEATURE_SKIA
+// Related: tdf#152703 Eliminate empty window with Skia/Metal 
while resizing
+// The window will clear its background so when Skia/Metal is
+// enabled, explicitly flush the Skia graphics to the window
+// during live resizing or else nothing will be drawn until after
+// live resizing has ended.
+// Also, flushing during [self windowDidResize:] eliminates flicker
+// by forcing this window's SkSurface to recreate its underlying
+// CAMetalLayer with the new size. Flushing in
+// [self displayIfNeeded] does not eliminate flicker so apparently
+// [self windowDidResize:] is called earlier.
+if ( SkiaHelper::isVCLSkiaEnabled() )
+{
+AquaSalGraphics* pGraphics = mpFrame->mpGraphics;
+if ( pGraphics )
+pGraphics->Flush();
+}
+#endif
 
 // tdf#152703 Force relayout during live resizing of window
 // During a live resize, macOS floods the application with
@@ -349,23 +353,35 @@ static AquaSalFrame* getMouseContainerFrame()
 // not trigger redrawing with the new size.
 // Instead, force relayout by dispatching all pending internal
 // events and firing any pending timers.
+// Also, Application::Reschedule() can potentially display a
+// modal dialog which will cause a hang so temporarily disable
+// live resize by clampiing the window's minimum and maximum sizes
+// to the current frame size which in Application::Reschedule().
+NSRect aFrame = [self frame];
+NSSize aMinSize = [self minSize];
+NSSize aMaxSize = [self maxSize];
+[self setMinSize:aFrame.size];
+[self setMaxSize:aFrame.size];
 Application::Reschedule( true );
+[self setMinSize:aMinSize];
+[self setMaxSize:aMaxSize];
 
-// tdf#152703 Force 

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

2023-01-03 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salframeview.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 88ebc324a51f16df0248d6a0d53d2169b1995dda
Author: Stephan Bergmann 
AuthorDate: Tue Jan 3 08:23:26 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 3 08:14:47 2023 +

loplugin:fakebool

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index de996654bc1d..5a28f647c451 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1843,7 +1843,7 @@ static AquaSalFrame* getMouseContainerFrame()
 // the returned position won't be anywhere near the text cursor. So,
 // dispatch an empty SalEvent::ExtTextInput event, fetch the position,
 // and then dispatch a SalEvent::EndExtTextInput event.
-BOOL bNeedsExtTextInput = ( mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] );
+bool bNeedsExtTextInput = ( mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] );
 if ( bNeedsExtTextInput )
 {
 SalExtTextInputEvent aInputEvent;


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

2023-01-02 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

New commits:
commit d118be7ed4dd6596a8b4d766e8507b6dcaf2b7f7
Author: Patrick Luby 
AuthorDate: Mon Jan 2 19:53:46 2023 -0500
Commit: Noel Grandin 
CommitDate: Tue Jan 3 07:12:20 2023 +

Related: tdf#152703 Eliminate empty window with Skia/Metal while resizing

The window will clear its background in [SalFrameWindow displayIfNeeded]
so when Skia/Metal is enabled, explicitly flush the Skia graphics to the
window during live resizing or else nothing will be drawn until after live
resizing has ended.

Also, when Skia/Metal is enabled, rapidly resizing a window has a noticeable
amount of flicker so don't send any paint events during live resizing. Also,
it appears that most of the LibreOffice layouts do not change their layout
much during live resizing so apply this change when Skia is not enabled to
ensure consistent behavior whether Skia is enabled or not.

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 2f35d3a057b7..de996654bc1d 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -36,6 +36,10 @@
 #include 
 #include 
 
+#if HAVE_FEATURE_SKIA
+#include 
+#endif
+
 #define WHEEL_EVENT_FACTOR 1.5
 
 static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
@@ -215,6 +219,21 @@ static AquaSalFrame* getMouseContainerFrame()
 if( GetSalData() && GetSalData()->mpInstance )
 {
 SolarMutexGuard aGuard;
+
+#if HAVE_FEATURE_SKIA
+// Related: tdf#152703 Eliminate empty window with Skia/Metal while 
resizing
+// The window will clear its background so when Skia/Metal is enabled,
+// explicitly flush the Skia graphics to the window during live
+// resizing or else nothing will be drawn until after live resizing
+// has ended.
+if ( [self inLiveResize] && SkiaHelper::isVCLSkiaEnabled() && mpFrame 
&& AquaSalFrame::isAlive( mpFrame ) )
+{
+AquaSalGraphics* pGraphics = mpFrame->mpGraphics;
+if ( pGraphics )
+pGraphics->Flush();
+}
+#endif
+
 [super displayIfNeeded];
 }
 }
@@ -317,7 +336,17 @@ static AquaSalFrame* getMouseContainerFrame()
 {
 mpFrame->UpdateFrameGeometry();
 mpFrame->CallCallback( SalEvent::Resize, nullptr );
-mpFrame->SendPaintEvent();
+
+// Related: tdf#152703 Stop flicker with Skia/Metal while resizing
+// When Skia/Metal is enabled, rapidly resizing a window has a
+// noticeable amount of flicker so don't send any paint events during
+// live resizing.
+// Also, it appears that most of the LibreOffice layouts do not change
+// their layout much during live resizing so apply this change when
+// Skia is not enabled to ensure consistent behavior whether Skia is
+// enabled or not.
+if ( ![self inLiveResize] )
+mpFrame->SendPaintEvent();
 }
 }
 


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

2022-12-23 Thread Patrick Luby (via logerrit)
 vcl/osx/salframe.cxx |   27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

New commits:
commit 1b6acdc60bc284c3e78bb05f70c24a2e36b2ccc7
Author: Patrick Luby 
AuthorDate: Thu Dec 22 14:25:40 2022 -0500
Commit: Noel Grandin 
CommitDate: Fri Dec 23 13:49:00 2022 +

tdf#150177 Limit minimum blink cursor rate

This bug occurs when the values for NSTextInsertionPointBlinkPeriodOn or
NSTextInsertionPointBlinkPeriodOff are set to zero or close to zero.
LibreOffice becomes very sluggish opening documents when either is set
at 100 milliseconds or less so set the blink rate to the maximum of
500 milliseconds, NSTextInsertionPointBlinkPeriodOn, and
NSTextInsertionPointBlinkPeriodOff.

Change-Id: I953bddda757f8514221ac5cd9c04bd749a994fda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144775
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 330a6c041f6a..90dd38704bcd 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -56,6 +56,8 @@
 #include 
 
 
+const int nMinBlinkCursorDelay = 500;
+
 AquaSalFrame* AquaSalFrame::s_pCaptureFrame = nullptr;
 
 AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags 
salFrameStyle ) :
@@ -85,7 +87,7 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 mnTrackingRectTag( 0 ),
 mrClippingPath( nullptr ),
 mnICOptions( InputContextFlags::NONE ),
-mnBlinkCursorDelay ( 500 )
+mnBlinkCursorDelay ( nMinBlinkCursorDelay )
 {
 mpParent = dynamic_cast(pParent);
 
@@ -94,17 +96,24 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, 
SalFrameStyleFlags salFrameStyle
 SalData* pSalData = GetSalData();
 pSalData->mpInstance->insertFrame( this );
 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+
+// tdf#150177 Limit minimum blink cursor rate
+// This bug occurs when the values for NSTextInsertionPointBlinkPeriodOn or
+// NSTextInsertionPointBlinkPeriodOff are set to zero or close to zero.
+// LibreOffice becomes very sluggish opening documents when either is set
+// at 100 milliseconds or less so set the blink rate to the maximum of
+// nMinBlinkCursorDelay, NSTextInsertionPointBlinkPeriodOn, and
+// NSTextInsertionPointBlinkPeriodOff.
+mnBlinkCursorDelay = nMinBlinkCursorDelay;
 if (userDefaults != nil)
 {
 id setting = [userDefaults objectForKey: 
@"NSTextInsertionPointBlinkPeriodOn"];
-if (setting)
-mnBlinkCursorDelay = [setting intValue];
-else
-{
-setting = [userDefaults objectForKey: 
@"NSTextInsertionPointBlinkPeriodOff"];
-if (setting)
-mnBlinkCursorDelay = [setting intValue];
-}
+if (setting && [setting isKindOfClass:[NSNumber class]])
+mnBlinkCursorDelay = std::max(mnBlinkCursorDelay, [setting 
intValue]);
+
+setting = [userDefaults objectForKey: 
@"NSTextInsertionPointBlinkPeriodOff"];
+if (setting && [setting isKindOfClass:[NSNumber class]])
+mnBlinkCursorDelay = std::max(mnBlinkCursorDelay, [setting 
intValue]);
 }
 }
 


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

2022-12-23 Thread Andrea Gelmini (via logerrit)
 vcl/osx/salframeview.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d56d76a4204aad18f75463b0c9aa6130d558e0ef
Author: Andrea Gelmini 
AuthorDate: Thu Dec 22 22:33:25 2022 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 23 10:01:21 2022 +

Fix typo

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 8b7a2e8c565c..2f35d3a057b7 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1981,7 +1981,7 @@ static AquaSalFrame* getMouseContainerFrame()
 mbInCommitMarkedText = YES;
 if (nFlags & EndExtTextInputFlags::Complete)
 {
-// Retain the last marked text as it will be releasd in
+// Retain the last marked text as it will be released in
 // [self insertText:replacementText:]
 NSAttributedString *pText = [mpLastMarkedText retain];
 [self insertText:pText replacementRange:NSMakeRange(0, 
[mpLastMarkedText length])];


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

2022-12-22 Thread Andrea Gelmini (via logerrit)
 vcl/osx/salinst.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dcc6d0936460a4ad42062ab91fa0f0b30575ef97
Author: Andrea Gelmini 
AuthorDate: Tue Dec 13 08:58:25 2022 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 22 08:29:25 2022 +

Fix typo

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index e8a4a94efc08..3d1b66baac3b 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -819,7 +819,7 @@ OUString AquaSalInstance::GetDefaultPrinter()
 {
 // Related: tdf#151700 Return the name of the fake printer if
 // there are no printers so that the LibreOffice printing code
-// will be able to find the the fake printer returned by
+// will be able to find the fake printer returned by
 // AquaSalInstance::GetPrinterQueueInfo()
 NSString* pDefName = [pPr name];
 SAL_WARN_IF( !pDefName, "vcl", "printer has no name" );


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

2022-12-16 Thread Andrea Gelmini (via logerrit)
 vcl/osx/a11yfactory.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d6d15a2a4fd05af0cb66a69a789fcb1e81b59c05
Author: Andrea Gelmini 
AuthorDate: Fri Dec 16 22:15:10 2022 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 16 21:31:15 2022 +

Fix typo

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

diff --git a/vcl/osx/a11yfactory.mm b/vcl/osx/a11yfactory.mm
index d4b0e25047fb..56ffa9f7e008 100644
--- a/vcl/osx/a11yfactory.mm
+++ b/vcl/osx/a11yfactory.mm
@@ -176,7 +176,7 @@ static bool enabled = false;
 // -[AquaA11yWrapper childrenAttribute] is called by a
 // wrapper that is already attached to an NSWindow. That is
 // normal. What isn't normal is that the child wrapper's
-// unignored accessible parent is a differnt wrapper than
+// unignored accessible parent is a different wrapper than
 // the caller and that different wrapper is not yet
 // attached to an NSWindow.
 // TODO: switch the AquaA11yWrapper class to inherit the


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

2022-12-16 Thread Patrick Luby (via logerrit)
 vcl/osx/a11yfactory.mm |   21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 07f9f22e68a3caebe67d89c0b209059ba40be482
Author: Patrick Luby 
AuthorDate: Thu Dec 15 16:25:00 2022 -0500
Commit: Noel Grandin 
CommitDate: Fri Dec 16 16:19:29 2022 +

tdf#146765 Fix infinite recursion in -[NSView visibleRect]

HACK: Adding a subview to an NSView that is not attached
to an NSWindow leads to infinite recursion in the native
NSViewGetVisibleRect() function. This seems to be a new
behavior starting with macOS 12.6.2.

In the case of tdf#146765, we end up here because
-[AquaA11yWrapper childrenAttribute] is called by a
wrapper that is already attached to an NSWindow. That is
normal. What isn't normal is that the child wrapper's
unignored accessible parent is a differnt wrapper than
the caller and that different wrapper is not yet
attached to an NSWindow.

TODO: switch the AquaA11yWrapper class to inherit the
lightweight NSAccessibilityElement class instead of the
NSView class to possibly avoid the need for this hack.

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

diff --git a/vcl/osx/a11yfactory.mm b/vcl/osx/a11yfactory.mm
index c5aa64308010..d4b0e25047fb 100644
--- a/vcl/osx/a11yfactory.mm
+++ b/vcl/osx/a11yfactory.mm
@@ -166,7 +166,26 @@ static bool enabled = false;
 if (parent) {
 if ([parent isKindOfClass:[NSView class]]) {
 NSView *parentView = static_cast(parent);
-[parentView addSubview:aWrapper positioned:NSWindowBelow 
relativeTo:nil];
+
+// tdf#146765 Fix infinite recursion in -[NSView 
visibleRect]
+// HACK: Adding a subview to an NSView that is not attached
+// to an NSWindow leads to infinite recursion in the native
+// NSViewGetVisibleRect() function. This seems to be a new
+// behavior starting with macOS 12.6.2.
+// In the case of tdf#146765, we end up here because
+// -[AquaA11yWrapper childrenAttribute] is called by a
+// wrapper that is already attached to an NSWindow. That is
+// normal. What isn't normal is that the child wrapper's
+// unignored accessible parent is a differnt wrapper than
+// the caller and that different wrapper is not yet
+// attached to an NSWindow.
+// TODO: switch the AquaA11yWrapper class to inherit the
+// lightweight NSAccessibilityElement class instead of the
+// NSView class to possibly avoid the need for this hack.
+NSWindow *window = [parentView window];
+SAL_WARN_IF(!window, "vcl.a11y","Can't add subview. Parent 
view's window is nil!");
+if (window)
+[parentView addSubview:aWrapper 
positioned:NSWindowBelow relativeTo:nil];
 } else if ([parent 
isKindOfClass:NSClassFromString(@"SalFrameWindow")]) {
 NSWindow *window = static_cast(parent);
 NSView *salView = [window contentView];


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

2022-12-08 Thread Andrea Gelmini (via logerrit)
 vcl/osx/salframeview.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 24eabdbebcbc3b9189bbb9809205ead9f903a0cb
Author: Andrea Gelmini 
AuthorDate: Thu Dec 8 22:50:57 2022 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 9 07:00:06 2022 +

Fix typo

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 289f74aad3c6..e6fda362f927 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1614,7 +1614,7 @@ static AquaSalFrame* getMouseContainerFrame()
 else
  mSelectedRange = NSMakeRange( selRange.location, 
selRange.location + selRange.length > mMarkedRange.length ? mMarkedRange.length 
- selRange.location : selRange.length );
 
-// If we are going to post uncommitted text, cache the string paramater
+// If we are going to post uncommitted text, cache the string parameter
 // as is needed in both [self endExtTextInput] and
 // [self attributedSubstringForProposedRange:actualRange:]
 mpLastMarkedText = [aString retain];


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

2022-12-07 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salinst.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit d193d65635de197efe32d97a99540a31a5455c41
Author: Stephan Bergmann 
AuthorDate: Thu Sep 8 17:30:38 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Dec 7 11:05:35 2022 +

tdf#151894 Pre-init NSSpellCHecker to avoid SolarMutex deadlock

Besides the deadlock scenario documented at
 "FILEOPEN a 
Base
Document with customized event for open a startform by 'open document' LO 
stuck"
there is at least one other known scenario documented at
 "Fix hang during
JunitTest_framework_complex on macOS" (which even carries a true fix, for 
just
that one scenario, which wouldn't require this hack).

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 3512a9a16142..e7f202ae7ae5 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -190,6 +190,28 @@ void AquaSalInstance::AfterAppInit()
name: @"AppleRemoteWillResignActive"
object: nil ];
 #endif
+
+// HACK: When the first call to [NSSpellChecker sharedSpellChecker] (in
+// lingucomponent/source/spellcheck/macosxspell/macspellimp.mm) is done 
both on a thread other
+// than the main thread and with the SolarMutex erroneously locked, then 
that can lead to
+// deadlock as [NSSpellChecker sharedSpellChecker] internally calls
+//   AppKit`-[NSSpellChecker init] ->
+//   AppKit`-[NSSpellChecker _fillSpellCheckerPopupButton:] ->
+//   AppKit`-[NSApplication(NSServicesMenuPrivate) 
_fillSpellCheckerPopupButton:] ->
+//   AppKit`-[NSMenu insertItem:atIndex:] ->
+//   Foundation`-[NSNotificationCenter 
postNotificationName:object:userInfo:] ->
+//   CoreFoundation`_CFXNotificationPost ->
+//   Foundation`-[NSOperation waitUntilFinished]
+// waiting for work to be done on the main thread, but the main thread is 
typically already
+// blocked (in some event handling loop) waiting to acquire the 
SolarMutex.  The real solution
+// would be to fix all the cases where a call to [NSSpellChecker 
sharedSpellChecker] in
+// lingucomponent/source/spellcheck/macosxspell/macspellimp.mm is done 
while the SolarMutex is
+// locked (somewhere up the call chain), but that appears to be rather 
difficult (see e.g.
+//  "FILEOPEN 
a Base Document with
+// customized event for open a startform by 'open document' LO stuck").  
So, at least for now,
+// chicken out and do that first call to [NSSpellChecker 
sharedSpellChecker] upfront in a
+// controlled environment:
+[NSSpellChecker sharedSpellChecker];
 }
 
 SalYieldMutex::SalYieldMutex()


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

2022-11-30 Thread Caolán McNamara (via logerrit)
 vcl/osx/salframe.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 9d7c622a9159ae17eb80bd4f0f9a865bd29deae1
Author: Caolán McNamara 
AuthorDate: Wed Nov 30 17:05:24 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 30 22:19:59 2022 +0100

Resolves: tdf#152317 macOS Calc highlighted sheet name unreadable

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 93de74e6fa68..c738ce1e6217 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1289,6 +1289,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aStyleSettings.BatchSetBackgrounds( aWindowBackgroundColor, false );
 aStyleSettings.SetLightBorderColor( aWindowBackgroundColor );
 
+aStyleSettings.SetActiveTabColor(aWindowBackgroundColor);
 Color aInactiveTabColor( aWindowBackgroundColor );
 aInactiveTabColor.DecreaseLuminance( 32 );
 aStyleSettings.SetInactiveTabColor( aInactiveTabColor );


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

2022-11-28 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salframe.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 5cf1cc2343aaad47eb4c79972c29e1d97f43c418
Author: Stephan Bergmann 
AuthorDate: Mon Nov 28 14:46:06 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Nov 28 20:32:38 2022 +0100

Silence -Werror,-Wdeprecated-declarations for now

...that got introduced with e10e5981ca020af11d25d5756964c95d51dd1535 
"tdf#152183
update settings when dark/light system mode toggled",

> vcl/osx/salframe.cxx:1269:19: error: 'setCurrentAppearance:' is 
deprecated: first deprecated in macOS 12.0 - Use 
-performAsCurrentDrawingAppearance: to temporarily set the drawing appearance, 
or +currentDrawingAppearance to access the currently drawing appearance. 
[-Werror,-Wdeprecated-declarations]
> [NSAppearance setCurrentAppearance: mpNSView.effectiveAppearance];
>   ^
> 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAppearance.h:28:58:
 note: property 'currentAppearance' is declared deprecated here
> @property (class, null_resettable, strong) NSAppearance 
*currentAppearance API_DEPRECATED("Use -performAsCurrentDrawingAppearance: to 
temporarily set the drawing appearance, or +currentDrawingAppearance to access 
the currently drawing appearance.", macos(10.9, 12.0));
>  ^
> 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAppearance.h:28:58:
 note: 'setCurrentAppearance:' has been explicitly marked deprecated here

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 1b1d0eab1f6b..93de74e6fa68 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1260,7 +1260,12 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
 return;
 SAL_WNODEPRECATED_DECLARATIONS_POP
 
+SAL_WNODEPRECATED_DECLARATIONS_PUSH
+// "'setCurrentAppearance:' is deprecated: first deprecated in macOS 
12.0 - Use
+// -performAsCurrentDrawingAppearance: to temporarily set the drawing 
appearance, or
+// +currentDrawingAppearance to access the currently drawing 
appearance."
 [NSAppearance setCurrentAppearance: mpNSView.effectiveAppearance];
+SAL_WNODEPRECATED_DECLARATIONS_POP
 
 StyleSettings aStyleSettings = rSettings.GetStyleSettings();
 


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

2022-11-28 Thread Caolán McNamara (via logerrit)
 vcl/osx/salframe.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 254acd7c1d8fef437985c9b428a0edddede9d5a9
Author: Caolán McNamara 
AuthorDate: Mon Nov 28 10:26:00 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 28 12:57:12 2022 +0100

Resolves: tdf#152253 Text in calc Input Box unreadable in dark mode

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index df6413a8fe65..1b1d0eab1f6b 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1370,14 +1370,19 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow ));
 aStyleSettings.SetWindowColor(aWindowBackgroundColor);
 aStyleSettings.SetListBoxWindowBackgroundColor(aWindowBackgroundColor);
+
+aStyleSettings.SetDialogTextColor(aControlTextColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
-aStyleSettings.SetLabelTextColor(aControlTextColor);
+aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetRadioCheckTextColor(aControlTextColor);
+aStyleSettings.SetGroupTextColor(aControlTextColor);
+aStyleSettings.SetLabelTextColor(aControlTextColor);
+aStyleSettings.SetWindowTextColor(aControlTextColor);
 aStyleSettings.SetFieldTextColor(aControlTextColor);
+
 aStyleSettings.SetFieldRolloverTextColor(aControlTextColor);
 aStyleSettings.SetFieldColor(aControlBackgroundColor);
 
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
-aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
 
aStyleSettings.SetDefaultButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
@@ -1401,7 +1406,6 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 }
 
 aStyleSettings.SetWorkspaceColor(aUnderPageBackgroundColor);
-aStyleSettings.SetDialogTextColor(aControlTextColor);
 
 aStyleSettings.SetHelpColor(aControlBackgroundColor);
 aStyleSettings.SetHelpTextColor(aControlTextColor);


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

2022-11-22 Thread Bogdan B (via logerrit)
 vcl/osx/HtmlFmtFlt.hxx  |5 +
 vcl/osx/OSXTransferable.hxx |5 +
 vcl/osx/PictToBmpFlt.hxx|5 +
 3 files changed, 3 insertions(+), 12 deletions(-)

New commits:
commit f2daf6c28fea2b8a1c7c8638ed14f3c0e6c5a034
Author: Bogdan B 
AuthorDate: Mon Nov 21 20:11:31 2022 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Tue Nov 22 10:20:45 2022 +0100

tdf#143148 Use pragma once instead of include guards

Change-Id: I7ff944967188567ae00e09357fe83b8c3e639dcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143060
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/vcl/osx/HtmlFmtFlt.hxx b/vcl/osx/HtmlFmtFlt.hxx
index a50b72a6b32d..5286efb1deda 100644
--- a/vcl/osx/HtmlFmtFlt.hxx
+++ b/vcl/osx/HtmlFmtFlt.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_HTMLFMTFLT_HXX
-#define INCLUDED_VCL_OSX_HTMLFMTFLT_HXX
+#pragma once
 
 #include 
 
@@ -36,6 +35,4 @@ css::uno::Sequence HTMLFormatToTextHtml(const 
css::uno::Sequence& aHtmlSequence);
 
-#endif // INCLUDED_VCL_OSX_HTMLFMTFLT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/OSXTransferable.hxx b/vcl/osx/OSXTransferable.hxx
index 2e7056145dd1..e4a00b880eb6 100644
--- a/vcl/osx/OSXTransferable.hxx
+++ b/vcl/osx/OSXTransferable.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_OSXTRANSFERABLE_HXX
-#define INCLUDED_VCL_OSX_OSXTRANSFERABLE_HXX
+#pragma once
 
 #include 
 #include 
@@ -69,6 +68,4 @@ private:
   NSPasteboard* mPasteboard;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/PictToBmpFlt.hxx b/vcl/osx/PictToBmpFlt.hxx
index e0e111818d99..d43146e03fcb 100644
--- a/vcl/osx/PictToBmpFlt.hxx
+++ b/vcl/osx/PictToBmpFlt.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_PICTTOBMPFLT_HXX
-#define INCLUDED_VCL_OSX_PICTTOBMPFLT_HXX
+#pragma once
 
 #include 
 
@@ -32,6 +31,4 @@ bool ImageToPNG(css::uno::Sequence const& rImgData,
 bool PNGToImage(css::uno::Sequence const& rPngData,
 css::uno::Sequence& rImgData, NSBitmapImageFileType 
eOutFormat);
 
-#endif // INCLUDED_VCL_OSX_PICTTOBMPFLT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-11-21 Thread Bogdan B (via logerrit)
 vcl/osx/DataFlavorMapping.hxx |5 +
 vcl/osx/DragSource.hxx|5 +
 vcl/osx/DragSourceContext.hxx |5 +
 vcl/osx/DropTarget.hxx|5 +
 4 files changed, 4 insertions(+), 16 deletions(-)

New commits:
commit b813326ac01b8c8773b499afc9c5ec7dafcbf44f
Author: Bogdan B 
AuthorDate: Mon Nov 21 20:13:34 2022 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Tue Nov 22 07:43:28 2022 +0100

tdf#143148 Use pragma once instead of include guards

Change-Id: Ifa8ad8539ad2fb828b45b9242b9e8196c48f5a74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143061
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/vcl/osx/DataFlavorMapping.hxx b/vcl/osx/DataFlavorMapping.hxx
index 4720a7f73423..fb5c8070025f 100644
--- a/vcl/osx/DataFlavorMapping.hxx
+++ b/vcl/osx/DataFlavorMapping.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_DATAFLAVORMAPPING_HXX
-#define INCLUDED_VCL_OSX_DATAFLAVORMAPPING_HXX
+#pragma once
 
 #include 
 #include 
@@ -124,6 +123,4 @@ private:
 
 typedef std::shared_ptr DataFlavorMapperPtr_t;
 
-#endif // INCLUDED_VCL_OSX_DATAFLAVORMAPPING_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/DragSource.hxx b/vcl/osx/DragSource.hxx
index 9027ac455a7c..96a8fb48a833 100644
--- a/vcl/osx/DragSource.hxx
+++ b/vcl/osx/DragSource.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_DRAGSOURCE_HXX
-#define INCLUDED_VCL_OSX_DRAGSOURCE_HXX
+#pragma once
 
 #include 
 #include 
@@ -123,6 +122,4 @@ public:
 
 };
 
-#endif // INCLUDED_VCL_OSX_DRAGSOURCE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/DragSourceContext.hxx b/vcl/osx/DragSourceContext.hxx
index 3ebeb362b4d9..e1f986d3d476 100644
--- a/vcl/osx/DragSourceContext.hxx
+++ b/vcl/osx/DragSourceContext.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_DRAGSOURCECONTEXT_HXX
-#define INCLUDED_VCL_OSX_DRAGSOURCECONTEXT_HXX
+#pragma once
 
 #include 
 #include 
@@ -48,6 +47,4 @@ public:
   virtual void SAL_CALL transferablesFlavorsChanged(  ) override;
 };
 
-#endif // INCLUDED_VCL_OSX_DRAGSOURCECONTEXT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/DropTarget.hxx b/vcl/osx/DropTarget.hxx
index aafb6449599f..ffc53a4e17ec 100644
--- a/vcl/osx/DropTarget.hxx
+++ b/vcl/osx/DropTarget.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_DROPTARGET_HXX
-#define INCLUDED_VCL_OSX_DROPTARGET_HXX
+#pragma once
 
 #include "DataFlavorMapping.hxx"
 #include 
@@ -152,6 +151,4 @@ private:
   sal_Int8 mDefaultActions;
 };
 
-#endif // INCLUDED_VCL_OSX_DROPTARGET_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-11-03 Thread Caolán McNamara (via logerrit)
 vcl/osx/salframeview.mm |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6c0ac70a512c1789d26721bd1f7d01a8b24fa718
Author: Caolán McNamara 
AuthorDate: Thu Nov 3 10:30:44 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 3 20:48:53 2022 +0100

Related: tdf#149932 map NSUnderlineStyleDouble to new DoubleUnderline

and NSUnderlineStyleThick to ExtTextInputAttr::BoldUnderline

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 07d3c08a2960..40a06ddd54ad 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1578,10 +1578,10 @@ static AquaSalFrame* getMouseContainerFrame()
 aInputFlags[i] = ExtTextInputAttr::Underline;
 break;
 case NSUnderlineStyleThick:
-aInputFlags[i] = ExtTextInputAttr::Underline | 
ExtTextInputAttr::Highlight;
+aInputFlags[i] = ExtTextInputAttr::BoldUnderline;
 break;
 case NSUnderlineStyleDouble:
-aInputFlags[i] = ExtTextInputAttr::BoldUnderline;
+aInputFlags[i] = ExtTextInputAttr::DoubleUnderline;
 break;
 default:
 aInputFlags[i] = ExtTextInputAttr::Highlight;


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

2022-10-28 Thread Caolán McNamara (via logerrit)
 vcl/osx/salframe.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit be9c80322db80d7cd59145bf77541ab3361022cc
Author: Caolán McNamara 
AuthorDate: Fri Oct 28 17:15:33 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 28 21:17:40 2022 +0200

macos: set tooltext colors from something from the theme

e.g. the "Find All" label in the find toolbar

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 08d6339db062..b820ef338136 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1346,6 +1346,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 aStyleSettings.SetHelpColor(aControlBackgroundColor);
 aStyleSettings.SetHelpTextColor(aControlTextColor);
+aStyleSettings.SetToolTextColor(aControlTextColor);
 
 // Set text colors for tabs according to OS settings
 


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

2022-10-22 Thread Caolán McNamara (via logerrit)
 vcl/osx/salframe.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 66ac4d9171fee9d425d3301933c1eb8e85c25933
Author: Caolán McNamara 
AuthorDate: Fri Oct 21 21:36:29 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Oct 22 13:21:02 2022 +0200

macos: set Dialog and DialogText color explicitly from theme

noticeable in start center wrt dark/light logo variant
if experimentally enabling dark mode

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index ef79254de304..3af750df4c7a 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1336,6 +1336,9 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
 }
 
+aStyleSettings.SetDialogColor(aWindowBackgroundColor);
+aStyleSettings.SetDialogTextColor(aControlTextColor);
+
 // Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);


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

2022-10-21 Thread Caolán McNamara (via logerrit)
 vcl/osx/salframe.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit a09f6099d20f8ea6fa0e0ae22aa31124a290bd72
Author: Caolán McNamara 
AuthorDate: Fri Oct 21 15:50:17 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 21 20:21:08 2022 +0200

macos: set TabRolloverTextColor color explicitly from theme

noticeable if experimentally enabling dark mode

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 72d26b560597..ef79254de304 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1339,6 +1339,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);
+aStyleSettings.SetTabRolloverTextColor(aControlTextColor);
 if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
 aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 else


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

2022-10-21 Thread Caolán McNamara (via logerrit)
 vcl/osx/salframe.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit ab0958d5eb87a82cdd54245ca7aa18124b175a05
Author: Caolán McNamara 
AuthorDate: Thu Oct 20 19:37:41 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 21 10:36:05 2022 +0200

macos: set some more background colors explicitly from theme

noticeable if experimentally enabling dark mode

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 5be4d724430c..72d26b560597 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1298,12 +1298,20 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, 
mpNSWindow));
+Color aFaceColor(getColor([NSColor 
unemphasizedSelectedTextBackgroundColor], COL_LIGHTGRAY, mpNSWindow));
+Color aControlBackgroundColor(getColor([NSColor controlBackgroundColor], 
COL_WHITE, mpNSWindow));
+Color aWindowBackgroundColor(getColor([NSColor windowBackgroundColor], 
COL_WHITE, mpNSWindow));
 Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
 Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
+aStyleSettings.SetWindowColor(aWindowBackgroundColor);
+aStyleSettings.SetListBoxWindowBackgroundColor(aWindowBackgroundColor);
+aStyleSettings.SetFaceColor(aFaceColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
 aStyleSettings.SetLabelTextColor(aControlTextColor);
 aStyleSettings.SetRadioCheckTextColor(aControlTextColor);
 aStyleSettings.SetFieldTextColor(aControlTextColor);
+aStyleSettings.SetFieldRolloverTextColor(aControlTextColor);
+aStyleSettings.SetFieldColor(aControlBackgroundColor);
 
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonTextColor(aControlTextColor);


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

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

New commits:
commit a25ed05617f304858c6c4c8ced93722130aa1d58
Author: Caolán McNamara 
AuthorDate: Thu Oct 20 14:20:58 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 20 16:36:17 2022 +0200

macos: set some more text colors explicitly from theme

noticeable if experimentally enabling dark mode

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index c3729567425a..5be4d724430c 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1301,6 +1301,9 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
 Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
 aStyleSettings.SetButtonTextColor(aControlTextColor);
+aStyleSettings.SetLabelTextColor(aControlTextColor);
+aStyleSettings.SetRadioCheckTextColor(aControlTextColor);
+aStyleSettings.SetFieldTextColor(aControlTextColor);
 
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonTextColor(aControlTextColor);


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

2022-08-28 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5bf4f36b509ae2bdc507074d53af007b4852013d
Author: Thorsten Wagner 
AuthorDate: Tue Aug 23 21:25:23 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Aug 29 06:45:07 2022 +0200

Prevent rounding down fontheights depending on display resolution for macOS

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 2685705287c8..9003a8dbde99 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1181,7 +1181,7 @@ static vcl::Font getFont( NSFont* pFont, sal_Int32 nDPIY, 
const vcl::Font& rDefa
 if( pFont )
 {
 aResult.SetFamilyName( GetOUString( [pFont familyName] ) );
-aResult.SetFontHeight( static_cast(([pFont pointSize] * 72.0 / 
static_cast(nDPIY))+0.5) );
+aResult.SetFontHeight( static_cast(ceil([pFont pointSize] * 72.0 
/ static_cast(nDPIY))) );
 aResult.SetItalic( ([pFont italicAngle] != 0.0) ? ITALIC_NORMAL : 
ITALIC_NONE );
 // FIMXE: bold ?
 }


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

2022-08-27 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |   26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 87318da781b429abd8261a8b64bb8d72c79b9da2
Author: Thorsten Wagner 
AuthorDate: Thu Aug 25 10:16:50 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Aug 28 06:20:28 2022 +0200

Adjust button text colors for macOS Big Sur

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 574122a1a91d..2685705287c8 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1288,13 +1288,17 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aStyleSettings.SetListBoxWindowHighlightColor( aMenuHighlightColor );
 aStyleSettings.SetListBoxWindowHighlightTextColor( aMenuHighlightTextColor 
);
 
+// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
+// used for some button states and for selected tab text. As a workaround 
the current OS version has to be considered. This code
+// has to be reviewed once issue is covered by documentation.
+
 // Set text colors for buttons and their different status according to OS 
settings, typically white for selected buttons,
 // black otherwise
 
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, 
mpNSWindow));
 Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
 Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
-
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
 
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
@@ -1305,20 +1309,24 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
 
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
-
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
-
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
+if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
+{
+
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+}
+else
+{
+
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+}
 
 // Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);
-
-// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
-// used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
-// issue is covered by documentation.
-
-NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
 aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 else


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

2022-07-10 Thread ehsan (via logerrit)
 vcl/osx/DragActionConversion.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 2558bb6cfd7e3faf33b7b24cb056a8e44ba8297d
Author: ehsan 
AuthorDate: Sun Jul 10 18:52:30 2022 +0430
Commit: Julien Nabet 
CommitDate: Sun Jul 10 17:36:19 2022 +0200

tdf#143148 Use pragma once instead of include guards

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

diff --git a/vcl/osx/DragActionConversion.hxx b/vcl/osx/DragActionConversion.hxx
index 47e6ebed5041..4435f18ee412 100644
--- a/vcl/osx/DragActionConversion.hxx
+++ b/vcl/osx/DragActionConversion.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_DRAGACTIONCONVERSION_HXX
-#define INCLUDED_VCL_OSX_DRAGACTIONCONVERSION_HXX
+#pragma once
 
 #include 
 
@@ -38,6 +37,4 @@ unsigned int OfficeToSystemDragActions(sal_Int8 dragActions);
  */
 sal_Int8 SystemToOfficeDragActions(unsigned int dragActions);
 
-#endif // INCLUDED_VCL_OSX_DRAGACTIONCONVERSION_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-06-26 Thread Amir H (via logerrit)
 vcl/osx/cuidraw.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit e9d4fe965aa40496fb0e2107a3abf1e260a65c28
Author: Amir H 
AuthorDate: Sat Jun 25 11:29:24 2022 +0430
Commit: Julien Nabet 
CommitDate: Sun Jun 26 08:34:19 2022 +0200

tdf#143148 Use pragma once instead of the include guards

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

diff --git a/vcl/osx/cuidraw.hxx b/vcl/osx/cuidraw.hxx
index 02cd2cdc354c..de625ce0a8a9 100644
--- a/vcl/osx/cuidraw.hxx
+++ b/vcl/osx/cuidraw.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OSX_CUIDRAW_HXX
-#define INCLUDED_VCL_OSX_CUIDRAW_HXX
+#pragma once
 
 #include 
 
@@ -42,6 +41,5 @@ void CUIDraw(
 
 #endif
 
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-05-17 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salmenu.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bad6799603f7ec4c6566696c1104a8bcf9fcfdc7
Author: Stephan Bergmann 
AuthorDate: Mon May 16 15:31:21 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 17 11:17:44 2022 +0200

loplugin:unnecessaryparen

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

diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 92b1d44abdd4..ab6263cc84a7 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -856,7 +856,7 @@ AquaSalMenuItem::AquaSalMenuItem( const SalItemParams* 
pItemData ) :
 
 // peel mnemonics because on mac there are no such things for menu 
items
 // Delete CJK-style mnemonics for the dropdown menu of the 'New 
button' and lower menu of 'File > New'
-NSString* pString = 
CreateNSString(MnemonicGenerator::EraseAllMnemonicChars((pItemData->aText)));
+NSString* pString = 
CreateNSString(MnemonicGenerator::EraseAllMnemonicChars(pItemData->aText));
 if (pString)
 {
 [mpMenuItem setTitle: pString];


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

2022-05-08 Thread xuenhua (via logerrit)
 vcl/osx/salmenu.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e92536bac2545d7f2722fc2529d8c7a8ff7c85d8
Author: xuenhua 
AuthorDate: Sat May 7 16:53:54 2022 +0800
Commit: Caolán McNamara 
CommitDate: Sun May 8 10:57:11 2022 +0200

Delete CJK-style mnemonics on macOS

Delete CJK-style mnemonics for the dropdown menu of the 'New button' and 
lower menu of 'File > New' on macOS

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

diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 12291be3df83..92b1d44abdd4 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -855,7 +855,8 @@ AquaSalMenuItem::AquaSalMenuItem( const SalItemParams* 
pItemData ) :
 [mpMenuItem setEnabled: YES];
 
 // peel mnemonics because on mac there are no such things for menu 
items
-NSString* pString = CreateNSString( pItemData->aText.replaceAll( "~", 
"" ) );
+// Delete CJK-style mnemonics for the dropdown menu of the 'New 
button' and lower menu of 'File > New'
+NSString* pString = 
CreateNSString(MnemonicGenerator::EraseAllMnemonicChars((pItemData->aText)));
 if (pString)
 {
 [mpMenuItem setTitle: pString];


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

2022-05-02 Thread xuenhua (via logerrit)
 vcl/osx/salmenu.cxx |   19 +++
 1 file changed, 3 insertions(+), 16 deletions(-)

New commits:
commit 7fd1b0aa2ba741103a7d9ac835514ebbeae3bcff
Author: xuenhua 
AuthorDate: Fri Apr 29 01:01:32 2022 +0800
Commit: Caolán McNamara 
CommitDate: Mon May 2 18:54:20 2022 +0200

Delete mnemonics for CJK translations on macOS

'Cop~y' translated into Chinese is '复制(~Y)'
But the mnemonics '(Y)' is useless on macOS.
In English, 'Cop~y' with the '~' removed is the correct result.
But in CJK should remove along with '(' and ')',
not just only for mbMenuBar. Use the method 
MnemonicGenerator::EraseAllMnemonicChars
already defined in vcl/mnemonic.hxx

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

diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 3164ba873bae..12291be3df83 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace {
 
@@ -588,22 +589,8 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, 
SalMenuItem* i_pSalMenuItem,
 
 AquaSalMenuItem *pAquaSalMenuItem = static_cast(i_pSalMenuItem);
 
-// Delete mnemonics
-OUString aText = i_rText.replaceAll("~", "");
-
-/* #i90015# until there is a correct solution
-   strip out any appended (.*) in menubar entries
-*/
-if( mbMenuBar )
-{
-sal_Int32 nPos = aText.lastIndexOf( '(' );
-if( nPos != -1 )
-{
-sal_Int32 nPos2 = aText.indexOf( ')' );
-if( nPos2 != -1 )
-aText = aText.replaceAt( nPos, nPos2-nPos+1, u"" );
-}
-}
+// Delete all mnemonics of mbMenuBar and CJK-style mnemonic
+OUString aText = MnemonicGenerator::EraseAllMnemonicChars(i_rText);
 
 if (aText.endsWith("...", ))
 aText += u"\u2026";


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

2022-04-25 Thread Stephan Bergmann (via logerrit)
 vcl/osx/printaccessoryview.mm |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f12448ce5f6fdccdaccfeed76b1ec22cccdcddec
Author: Stephan Bergmann 
AuthorDate: Mon Apr 25 17:01:54 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Apr 25 23:23:12 2022 +0200

loplugin:stringview

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

diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index 92c09f7dd47f..95ace78d2816 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -21,6 +21,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -330,7 +331,7 @@ static OUString filterAccelerator( OUString const & rText )
 {
 OUStringBuffer aBuf( rText.getLength() );
 for( sal_Int32 nIndex = 0; nIndex != -1; )
-aBuf.append( rText.getToken( 0, '~', nIndex ) );
+aBuf.append( o3tl::getToken( rText, 0, '~', nIndex ) );
 return aBuf.makeStringAndClear();
 }
 


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

2022-02-01 Thread Stephan Bergmann (via logerrit)
 vcl/osx/OSXTransferable.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bca18a7269781542f8ec20509148af621af580a3
Author: Stephan Bergmann 
AuthorDate: Mon Jan 31 17:36:04 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 1 09:40:54 2022 +0100

loplugin:sallogareas

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

diff --git a/vcl/osx/OSXTransferable.cxx b/vcl/osx/OSXTransferable.cxx
index 493d5b44cc9a..e55141a6061e 100644
--- a/vcl/osx/OSXTransferable.cxx
+++ b/vcl/osx/OSXTransferable.cxx
@@ -163,7 +163,7 @@ void OSXTransferable::initClipboardItemList()
  static_cast(this));
   }
 
-  SAL_INFO("vcl.macos.clipboard", "Types on pasteboard: " << 
NSStringArrayToOUString(pboardFormats));
+  SAL_INFO("vcl.osx.clipboard", "Types on pasteboard: " << 
NSStringArrayToOUString(pboardFormats));
 
 
   mFlavorList = mDataFlavorMapper->typesArrayToFlavorSequence(pboardFormats);


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

2022-01-27 Thread Tor Lillqvist (via logerrit)
 vcl/osx/OSXTransferable.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 9a828b4d1fcd5bfa471df404dc40fe3ddfccfbb9
Author: Tor Lillqvist 
AuthorDate: Thu Jan 27 11:37:47 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Jan 27 13:14:26 2022 +0100

Add a SAL_INFO listing types on pasteboard

Change-Id: I6b1fa8da47f1140fc42287b05ee8d2afe5ee5d68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129031
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/OSXTransferable.cxx b/vcl/osx/OSXTransferable.cxx
index f3ed1ec83fae..493d5b44cc9a 100644
--- a/vcl/osx/OSXTransferable.cxx
+++ b/vcl/osx/OSXTransferable.cxx
@@ -19,6 +19,7 @@
 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -30,7 +31,8 @@
 
 #include "DataFlavorMapping.hxx"
 
-using namespace osl;
+#include 
+
 using namespace cppu;
 using namespace com::sun::star::uno;
 using namespace com::sun::star::datatransfer;
@@ -161,6 +163,9 @@ void OSXTransferable::initClipboardItemList()
  static_cast(this));
   }
 
+  SAL_INFO("vcl.macos.clipboard", "Types on pasteboard: " << 
NSStringArrayToOUString(pboardFormats));
+
+
   mFlavorList = mDataFlavorMapper->typesArrayToFlavorSequence(pboardFormats);
 }
 


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

2021-10-27 Thread Tor Lillqvist (via logerrit)
 vcl/osx/salframeview.mm |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit 05bf76c00209a5a5d64f760ed242eec365bff7c3
Author: Tor Lillqvist 
AuthorDate: Wed Oct 27 13:07:07 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Oct 27 13:16:03 2021 +0200

Remove lines that have been ifdeffed out since 2008

Change-Id: I56e17e876803a11047904187ae2fd40fbae01487
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124264
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index a9bed1fc5b4f..ee245af64820 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -262,13 +262,6 @@ static AquaSalFrame* getMouseContainerFrame()
 {
 AquaSalMenu::setDefaultMenu();
 }
-#if 0
-// FIXME: we should disable menus while in modal mode
-// however from down here there is currently no reliable way to
-// find out when to do this
-if( (mpFrame->mpParent && 
mpFrame->mpParent->GetWindow()->IsInModalMode()) )
-AquaSalMenu::enableMainMenu( false );
-#endif
 mpFrame->CallCallback( SalEvent::GetFocus, nullptr );
 mpFrame->SendPaintEvent(); // repaint controls as active
 }


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

2021-10-27 Thread Tor Lillqvist (via logerrit)
 vcl/osx/salframeview.mm |   55 +++-
 1 file changed, 13 insertions(+), 42 deletions(-)

New commits:
commit 6678b8123c9952c80a637d3a7f4e27511122009e
Author: Tor Lillqvist 
AuthorDate: Thu Oct 21 14:25:05 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Oct 27 11:11:14 2021 +0200

Use non-deprecated names for event types and flag bits

The deprecations were introduced in SDK 10.12 and we
require at least SDK 10.13 so this should not be
controversial in any way. (And seriously, I doubt LO
can be built with such an old SDK anyway.)

Change-Id: I5e2b18b61fa66a6b06f2c751fc9d6ea87b6cbe47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123990
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index cbe7befabf82..a9bed1fc5b4f 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -41,20 +41,14 @@
 static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
 {
 sal_uInt16 nRet = 0;
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
-// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
-// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
-// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
-if( (nMask & NSShiftKeyMask) != 0 )
+if( (nMask & NSEventModifierFlagShift) != 0 )
 nRet |= KEY_SHIFT;
-if( (nMask & NSControlKeyMask) != 0 )
+if( (nMask & NSEventModifierFlagControl) != 0 )
 nRet |= KEY_MOD3;
-if( (nMask & NSAlternateKeyMask) != 0 )
+if( (nMask & NSEventModifierFlagOption) != 0 )
 nRet |= KEY_MOD2;
-if( (nMask & NSCommandKeyMask) != 0 )
+if( (nMask & NSEventModifierFlagCommand) != 0 )
 nRet |= KEY_MOD1;
-SAL_WNODEPRECATED_DECLARATIONS_POP
 return nRet;
 }
 
@@ -818,10 +812,7 @@ static AquaSalFrame* getMouseContainerFrame()
 {
 dX += [pEvent deltaX];
 dY += [pEvent deltaY];
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-// 'NSScrollWheelMask' is deprecated: first deprecated in macOS 10.12
-NSEvent* pNextEvent = [NSApp nextEventMatchingMask: 
NSScrollWheelMask
-SAL_WNODEPRECATED_DECLARATIONS_POP
+NSEvent* pNextEvent = [NSApp nextEventMatchingMask: 
NSEventMaskScrollWheel
 untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
 if( !pNextEvent )
 break;
@@ -880,10 +871,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 {
 dX += [pEvent deltaX];
 dY += [pEvent deltaY];
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-// 'NSScrollWheelMask' is deprecated: first deprecated in macOS 10.12
-NSEvent* pNextEvent = [NSApp nextEventMatchingMask: 
NSScrollWheelMask
-SAL_WNODEPRECATED_DECLARATIONS_POP
+NSEvent* pNextEvent = [NSApp nextEventMatchingMask: 
NSEventMaskScrollWheel
 untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
 if( !pNextEvent )
 break;
@@ -970,12 +958,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
interpretKeyEvents (why?). Try to dispatch them here first,
if not successful continue normally
 */
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
-// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
-if( (mpFrame->mnLastModifierFlags & (NSAlternateKeyMask | 
NSCommandKeyMask))
-== (NSAlternateKeyMask | NSCommandKeyMask) )
-SAL_WNODEPRECATED_DECLARATIONS_POP
+if( (mpFrame->mnLastModifierFlags & (NSEventModifierFlagOption | 
NSEventModifierFlagCommand))
+== (NSEventModifierFlagOption | 
NSEventModifierFlagCommand) )
 {
 if( [self sendSingleCharacter: mpLastEvent] )
 return YES;
@@ -1028,14 +1012,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // #i99567#
 // find out the unmodified key code
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
-// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
-// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
-// 'NSKeyDown' is deprecated: first deprecated in macOS 10.12
-// 'NSKeyUp' is deprecated: first deprecated in macOS 10.12
 // sanity check
-if( mpLastEvent && ( [mpLastEvent type] == NSKeyDown || 
[mpLastEvent type] == NSKeyUp ) )
+if( mpLastEvent && ( [mpLastEvent type] == NSEventTypeKeyDown 
|| [mpLastEvent type] == NSEventTypeKeyUp ) )
 {
 // get unmodified string
 NSString* pUnmodifiedString = [mpLastEvent 
charactersIgnoringModifiers];
@@ -1052,12 +1030,11 

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

2021-10-17 Thread Julien Nabet (via logerrit)
 vcl/osx/vclnsapp.mm |6 ++
 vcl/source/app/salvtables.cxx   |6 ++
 vcl/source/control/throbber.cxx |   10 ++
 vcl/source/font/fontcharmap.cxx |3 +--
 vcl/source/fontsubset/sft.cxx   |3 +--
 vcl/source/window/floatwin.cxx  |6 --
 6 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit 43a9bf11203ed92096af34ab828501e0218832c7
Author: Julien Nabet 
AuthorDate: Sat Oct 16 22:46:30 2021 +0200
Commit: Julien Nabet 
CommitDate: Sun Oct 17 11:33:51 2021 +0200

Simplify vector initialization in vcl

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

diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 727f58ed391e..f420bfd83c5d 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -226,8 +226,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 -(BOOL)application: (NSApplication*)app openFile: (NSString*)pFile
 {
 (void)app;
-std::vector aFile;
-aFile.push_back( GetOUString( pFile ) );
+std::vector aFile { GetOUString( pFile ) };
 if( ! AquaSalInstance::isOnCommandLine( aFile[0] ) )
 {
 const ApplicationEvent* pAppEvent = new 
ApplicationEvent(ApplicationEvent::Type::Open, std::move(aFile));
@@ -272,8 +271,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 -(BOOL)application: (NSApplication*)app printFile: (NSString*)pFile
 {
 (void)app;
-std::vector aFile;
-aFile.push_back( GetOUString( pFile ) );
+std::vector aFile { GetOUString(pFile) };
 const ApplicationEvent* pAppEvent = new 
ApplicationEvent(ApplicationEvent::Type::Print, std::move(aFile));
 AquaSalInstance::aAppEventList.push_back( pAppEvent );
 AquaSalInstance *pInst = GetSalData()->mpInstance;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 58e1cba83ad6..f783841991c3 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3748,8 +3748,7 @@ void SalInstanceTreeView::thaw()
 
 void SalInstanceTreeView::set_column_fixed_widths(const std::vector& 
rWidths)
 {
-std::vector aTabPositions;
-aTabPositions.push_back(0);
+std::vector aTabPositions{ 0 };
 for (size_t i = 0; i < rWidths.size(); ++i)
 aTabPositions.push_back(aTabPositions[i] + rWidths[i]);
 m_xTreeView->SetTabs(aTabPositions.size(), aTabPositions.data(), 
MapUnit::MapPixel);
@@ -5096,8 +5095,7 @@ IMPL_LINK_NOARG(SalInstanceTreeView, DoubleClickHdl, 
SvTreeListBox*, bool)
 
 IMPL_LINK(SalInstanceTreeView, EndDragHdl, HeaderBar*, pHeaderBar, void)
 {
-std::vector aTabPositions;
-aTabPositions.push_back(0);
+std::vector aTabPositions{ 0 };
 for (int i = 0; i < pHeaderBar->GetItemCount() - 1; ++i)
 aTabPositions.push_back(aTabPositions[i]
 + 
pHeaderBar->GetItemSize(pHeaderBar->GetItemId(i)));
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
index e1faeb7c7af1..d7dc3e4a763d 100644
--- a/vcl/source/control/throbber.cxx
+++ b/vcl/source/control/throbber.cxx
@@ -99,10 +99,12 @@ void Throbber::initImages()
 {
 try
 {
-::std::vector< ::std::vector< Image > > aImageSets;
-aImageSets.push_back( lcl_loadImageSet( ImageSet::N16px ) );
-aImageSets.push_back( lcl_loadImageSet( ImageSet::N32px ) );
-aImageSets.push_back( lcl_loadImageSet( ImageSet::N64px ) );
+::std::vector< ::std::vector< Image > > aImageSets
+{
+lcl_loadImageSet( ImageSet::N16px ),
+lcl_loadImageSet( ImageSet::N32px ),
+lcl_loadImageSet( ImageSet::N64px )
+};
 
 // find the best matching image set (size-wise)
 const ::Size aWindowSizePixel = GetSizePixel();
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx
index 90a08d617a86..72a4feacd36e 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -176,9 +176,8 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, 
CmapResult& rResult )
 sal_UCS4* pCodePairs = nullptr;
 int* pStartGlyphs = nullptr;
 
-std::vector aGlyphIdArray;
+std::vector aGlyphIdArray { 0 };
 aGlyphIdArray.reserve( 0x1000 );
-aGlyphIdArray.push_back( 0 );
 
 // format 4, the most common 16bit char mapping table
 if( (nFormat == 4) && ((nOffset+16) < nLength) )
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 86946799a001..dfee625308b2 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -660,8 +660,7 @@ static int GetTTGlyphOutline(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, Cont
 }
 else
 {
-std::vector< sal_uInt32 > aPrivList;
-aPrivList.push_back( glyphID );
+std::vector< sal_uInt32 > aPrivList { glyphID };
 res = GetCompoundTTOutline(ttf, glyphID, pointArray, metrics, 
glyphlist ? 

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

2021-09-09 Thread Caolán McNamara (via logerrit)
 vcl/osx/salnativewidgets.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 905d7e3d9cff386a819faa6582cfb1700b529e34
Author: Caolán McNamara 
AuthorDate: Thu Sep 9 16:05:23 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 9 20:41:58 2021 +0200

tdf#144241 don't return a negative width for osx edit region

instead expand the region to the min osx width

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

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 5988cfe6a9d0..282a26ca0c60 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -994,13 +994,15 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType 
nType,
 break;
 case ControlType::Editbox:
 {
-w = aCtrlBoundRect.GetWidth();
+const tools::Long nBorderThickness = FOCUS_RING_WIDTH + 
EDITBOX_BORDER_WIDTH + EDITBOX_INSET_MARGIN;
+// tdf#144241 don't return a negative width, expand the region 
to the min osx width
+w = std::max(nBorderThickness * 2, aCtrlBoundRect.GetWidth());
 h = EDITBOX_HEIGHT + 2 * FOCUS_RING_WIDTH;
 rNativeBoundingRegion = tools::Rectangle(Point(x, y), Size(w, 
h));
-w -= 2 * (FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + 
EDITBOX_INSET_MARGIN);
-h -= 2 * (FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + 
EDITBOX_INSET_MARGIN);
-x += FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + 
EDITBOX_INSET_MARGIN;
-y += FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + 
EDITBOX_INSET_MARGIN;
+w -= 2 * nBorderThickness;
+h -= 2 * nBorderThickness;
+x += nBorderThickness;
+y += nBorderThickness;
 rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, 
h));
 toReturn = true;
 }


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

2021-08-01 Thread Noel Grandin (via logerrit)
 vcl/osx/documentfocuslistener.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d3a297110a1948ebc417717c78c489ddb58e2002
Author: Noel Grandin 
AuthorDate: Sun Aug 1 10:56:34 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 1 20:06:00 2021 +0200

o3tl::sorted_vector is better for small sets of pointers

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

diff --git a/vcl/osx/documentfocuslistener.hxx 
b/vcl/osx/documentfocuslistener.hxx
index 93bc8136a984..ae695d27c5e4 100644
--- a/vcl/osx/documentfocuslistener.hxx
+++ b/vcl/osx/documentfocuslistener.hxx
@@ -26,7 +26,7 @@
 
 #include 
 
-#include 
+#include 
 
 
 class DocumentFocusListener :
@@ -90,7 +90,7 @@ public:
 virtual void SAL_CALL notifyEvent( const 
css::accessibility::AccessibleEventObject& aEvent ) override;
 
 private:
-std::set< css::uno::Reference< css::uno::XInterface > > m_aRefList;
+o3tl::sorted_vector< css::uno::Reference< css::uno::XInterface > > 
m_aRefList;
 
 AquaA11yFocusTracker& m_aFocusTracker;
 };


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

2021-06-28 Thread Stephan Bergmann (via logerrit)
 vcl/osx/DataFlavorMapping.cxx |  102 +-
 vcl/osx/DragSource.cxx|   28 +--
 vcl/osx/HtmlFmtFlt.cxx|4 -
 vcl/osx/OSXTransferable.cxx   |   32 ++---
 vcl/osx/a11ywrapper.mm|   58 +++
 vcl/osx/clipboard.cxx |4 -
 vcl/osx/salnativewidgets.cxx  |2 
 7 files changed, 115 insertions(+), 115 deletions(-)

New commits:
commit efab07a370c52e57c4a4adaed1ab90e232caaf0b
Author: Stephan Bergmann 
AuthorDate: Mon Jun 28 16:09:24 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Jun 28 17:09:32 2021 +0200

loplugin:indentation (macOS)

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

diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 82065b2c88be..feecca3f663e 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -186,9 +186,9 @@ DataProviderBaseImpl::DataProviderBaseImpl(id data) :
 DataProviderBaseImpl::~DataProviderBaseImpl()
 {
   if (mSystemData)
-{
+  {
   [mSystemData release];
-}
+  }
 }
 
 namespace {
@@ -233,15 +233,15 @@ Any UniDataProvider::getOOoData()
   Any oOOData;
 
   if (mSystemData)
-{
+  {
   oOOData <<= OUString(static_cast([mSystemData bytes]),
  [mSystemData length],
  RTL_TEXTENCODING_UTF8);
-}
+  }
   else
-{
+  {
   oOOData = mData;
-}
+  }
 
   return oOOData;
 }
@@ -285,17 +285,17 @@ Any ByteSequenceDataProvider::getOOoData()
   Any oOOData;
 
   if (mSystemData)
-{
+  {
   unsigned int flavorDataLength = [mSystemData length];
   Sequence byteSequence;
   byteSequence.realloc(flavorDataLength);
   memcpy(byteSequence.getArray(), [mSystemData bytes], flavorDataLength);
   oOOData <<= byteSequence;
-}
+  }
   else
-{
+  {
   oOOData =  mData;
-}
+  }
 
   return oOOData;
 }
@@ -334,7 +334,7 @@ Any HTMLFormatDataProvider::getOOoData()
   Any oOOData;
 
   if (mSystemData)
-{
+  {
   unsigned int flavorDataLength = [mSystemData length];
   Sequence unkHtmlData;
 
@@ -345,17 +345,17 @@ Any HTMLFormatDataProvider::getOOoData()
   Sequence plainHtml;
 
   if (isHTMLFormat(unkHtmlData))
-{
+  {
   plainHtml = HTMLFormatToTextHtml(unkHtmlData);
   pPlainHtml = 
-}
+  }
 
   oOOData <<= *pPlainHtml;
-}
+  }
   else
-{
+  {
   oOOData = mData;
-}
+  }
 
   return oOOData;
 }
@@ -463,34 +463,34 @@ Any FileListDataProvider::getOOoData()
   Any oOOData;
 
   if (mSystemData)
-{
+  {
   size_t length = [mSystemData count];
   size_t lenSeqRequired = 0;
 
   for (size_t i = 0; i < length; i++)
-{
+  {
   NSString* fname = [mSystemData objectAtIndex: i];
   lenSeqRequired += [fname maximumLengthOfBytesUsingEncoding: 
NSUnicodeStringEncoding] + sizeof(unichar);
-}
+  }
 
   Sequence oOOFileList(lenSeqRequired);
   unichar* pBuffer = reinterpret_cast(oOOFileList.getArray());
   memset(pBuffer, 0, lenSeqRequired);
 
   for (size_t i = 0; i < length; i++)
-{
+  {
   NSString* fname = [mSystemData objectAtIndex: i];
   [fname getCharacters: pBuffer];
   size_t l = [fname length];
   pBuffer += l + 1;
-}
+  }
 
   oOOData <<= oOOFileList;
-}
+  }
   else
-{
+  {
   oOOData = mData;
-}
+  }
 
   return oOOData;
 }
@@ -553,7 +553,7 @@ const NSString* DataFlavorMapper::openOfficeToSystemFlavor( 
const DataFlavor& oO
 
 for( size_t i = 0; i < SIZE_FLAVOR_MAP; ++i )
 {
-   if 
(oOOFlavor.MimeType.startsWith(OUString::createFromAscii(flavorMap[i].OOoFlavor)))
+if 
(oOOFlavor.MimeType.startsWith(OUString::createFromAscii(flavorMap[i].OOoFlavor)))
 {
 if (flavorMap[i].SystemFlavor != nil)
 sysFlavor = flavorMap[i].SystemFlavor;
@@ -594,7 +594,7 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider( const 
NSString* systemFlavo
   Any data = rTransferable->getTransferData(oOOFlavor);
 
   if (isByteSequenceType(data.getValueType()))
-{
+  {
   /*
  the HTMLFormatDataProvider prepends segment information to HTML
  this is useful for exchange with MS Word (which brings this stuff 
from Windows)
@@ -608,29 +608,29 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider( 
const NSString* systemFlavo
   else
   */
   if ([systemFlavor caseInsensitiveCompare: NSPasteboardTypeTIFF] == 
NSOrderedSame)
-{
+  {
   dp = DataProviderPtr_t( new PNGDataProvider( data, 
NSBitmapImageFileTypeTIFF));
-}
+  }
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
   // 

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

2021-06-10 Thread Stephan Bergmann (via logerrit)
 vcl/osx/printaccessoryview.mm |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit e97a9211c08fe28d2b46d0a1371f0b391b5343b2
Author: Stephan Bergmann 
AuthorDate: Thu Jun 10 14:58:23 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jun 10 16:44:43 2021 +0200

-Werror,-Wunused-but-set-variable (Clang 13 trunk)

...ever since the code's introduction in
adf0066a17538a394550237a54f6fc0027f6ed29 "#i91478# aqua implementation
(continued)"

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

diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index 7656c1b9df06..92c09f7dd47f 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -1063,7 +1063,6 @@ static void addEdit( NSView* pCurParent, CGFloat rCurX, 
CGFloat& rCurY, CGFloat
 OUString aPropertyName;
 OUString aGroupHint;
 Sequence< OUString > aChoices;
-bool bEnabled = true;
 sal_Int64 nMinValue = 0, nMaxValue = 0;
 CGFloat nAttachOffset = 0;
 bool bIgnore = false;
@@ -1089,12 +1088,6 @@ static void addEdit( NSView* pCurParent, CGFloat rCurX, 
CGFloat& rCurY, CGFloat
 rEntry.Value >>= aVal;
 aPropertyName = aVal.Name;
 }
-else if( rEntry.Name == "Enabled" )
-{
-bool bValue = true;
-rEntry.Value >>= bValue;
-bEnabled = bValue;
-}
 else if( rEntry.Name == "MinValue" )
 {
 rEntry.Value >>= nMinValue;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-07 Thread Noel Grandin (via logerrit)
 vcl/osx/salnativewidgets.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 901fee94302e1b6366a5df2859f1f13ff0c4afca
Author: Noel Grandin 
AuthorDate: Sun Mar 7 17:58:53 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Mar 7 18:48:57 2021 +0100

tdf#140856 macOS listbox rendering

Change-Id: Ib5d4af162da7264d9e6da8742e36c194448bd1fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112132
Tested-by: Jenkins
Reviewed-by: Thorsten Wagner 
Reviewed-by: Noel Grandin 

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 5dd5929c2fc6..bc132ee88d16 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -735,10 +735,6 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
 aTextDrawInfo.kind = kHIThemeFrameListBox;
 aTextDrawInfo.state = kThemeStateActive;
 aTextDrawInfo.isFocused = false;
-rc.size.width += 2 * kThemeMetricListBoxFrameOutset - 2;
-rc.size.height += 2 * kThemeMetricListBoxFrameOutset - 2;
-rc.origin.x -= kThemeMetricListBoxFrameOutset - 1;
-rc.origin.y -= kThemeMetricListBoxFrameOutset - 1;
 HIThemeDrawFrame(, , 
maContextHolder.get(), kHIThemeOrientationNormal);
 bOK = true;
 break;
@@ -1046,10 +1042,10 @@ bool 
AquaSalGraphics::getNativeControlRegion(ControlType nType,
 }
 else if (nPart == ControlPart::ListboxWindow)
 {
-w = aCtrlBoundRect.GetWidth() - 2 * 
kThemeMetricListBoxFrameOutset;
-h = aCtrlBoundRect.GetHeight() - 2 * 
kThemeMetricListBoxFrameOutset;
-x += kThemeMetricListBoxFrameOutset;
-y += kThemeMetricListBoxFrameOutset;
+w = aCtrlBoundRect.GetWidth() - 2;
+h = aCtrlBoundRect.GetHeight() - 2;
+x += 1;
+y += 1;
 rNativeBoundingRegion = aCtrlBoundRect;
 rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, 
h));
 toReturn = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-05 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d8fc89cdfd0043838c4bc2d3b5a50bf5abfc6738
Author: Thorsten Wagner 
AuthorDate: Fri Mar 5 23:38:12 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Sat Mar 6 07:18:07 2021 +0100

tdf#138314 Change selected tab text color on macOS Big Sur

Change text color of selected tabs starting with macOS 10.16 (not with
macOS 11.0) to ensure compatibilty with macOS SDKs prior to 11 used
within LibreOffice build process

The version check used in commit 058ad4b900b5e0ee902f3e89ed121c2b5f8c58f1
is amended by this change.

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

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index c00a976db96a..650526ad08c6 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1328,7 +1328,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
 // issue is covered by documentation.
 
-NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion 
= 0, .patchVersion = 0 };
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
 aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-04 Thread Noel Grandin (via logerrit)
 vcl/osx/salnativewidgets.cxx   |   24 
 vcl/source/control/imp_listbox.cxx |3 +++
 vcl/source/window/brdwin.cxx   |8 +++-
 3 files changed, 26 insertions(+), 9 deletions(-)

New commits:
commit 5e75b7ca828954f9a23d7a3e8c3be3e0934210b3
Author: Noel Grandin 
AuthorDate: Wed Mar 3 21:10:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 4 14:07:31 2021 +0100

macOS: use HITheme to draw listbox window border

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

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 17d1744433f4..5dd5929c2fc6 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -732,16 +732,14 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
 case ControlPart::ListboxWindow:
 HIThemeFrameDrawInfo aTextDrawInfo;
 aTextDrawInfo.version = 0;
-aTextDrawInfo.kind = kHIThemeFrameTextFieldSquare;
-aTextDrawInfo.state = getState(nState);
+aTextDrawInfo.kind = kHIThemeFrameListBox;
+aTextDrawInfo.state = kThemeStateActive;
 aTextDrawInfo.isFocused = false;
-rc.size.width -= 2 * FOCUS_RING_WIDTH;
-rc.size.height -= 2 * FOCUS_RING_WIDTH;
-rc.origin.x += FOCUS_RING_WIDTH;
-rc.origin.y += FOCUS_RING_WIDTH;
+rc.size.width += 2 * kThemeMetricListBoxFrameOutset - 2;
+rc.size.height += 2 * kThemeMetricListBoxFrameOutset - 2;
+rc.origin.x -= kThemeMetricListBoxFrameOutset - 1;
+rc.origin.y -= kThemeMetricListBoxFrameOutset - 1;
 HIThemeDrawFrame(, , 
maContextHolder.get(), kHIThemeOrientationNormal);
-if (nState & ControlState::FOCUSED)
-HIThemeDrawFocusRect(, true, maContextHolder.get(), 
kHIThemeOrientationNormal);
 bOK = true;
 break;
 default:
@@ -1046,6 +1044,16 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType 
nType,
 rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, 
h));
 toReturn = true;
 }
+else if (nPart == ControlPart::ListboxWindow)
+{
+w = aCtrlBoundRect.GetWidth() - 2 * 
kThemeMetricListBoxFrameOutset;
+h = aCtrlBoundRect.GetHeight() - 2 * 
kThemeMetricListBoxFrameOutset;
+x += kThemeMetricListBoxFrameOutset;
+y += kThemeMetricListBoxFrameOutset;
+rNativeBoundingRegion = aCtrlBoundRect;
+rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, 
h));
+toReturn = true;
+}
 break;
 case ControlType::Spinbox:
 if (nPart == ControlPart::Entire)
diff --git a/vcl/source/control/imp_listbox.cxx 
b/vcl/source/control/imp_listbox.cxx
index ddff67bae584..0c5e8f1237f6 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -2792,6 +2792,9 @@ void ImplBtn::MouseButtonDown( const MouseEvent& )
 ImplListBoxFloatingWindow::ImplListBoxFloatingWindow( vcl::Window* pParent ) :
 FloatingWindow( pParent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW )// 
no drop shadow for list boxes
 {
+// for native widget rendering we must be able to detect this window type
+SetType( WindowType::LISTBOXWINDOW );
+
 mpImplLB = nullptr;
 mnDDLineCount = 0;
 mbAutoWidth = false;
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index b5bdd05d53d4..ec1e95c9db46 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -427,6 +427,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, 
tools::Long nWidth, to
 // for native widget drawing we must find out what
 // control this border belongs to
 ControlType aCtrlType = ControlType::Generic;
+ControlPart aCtrlPart = ControlPart::Entire;
 if (pCtrl)
 {
 switch( pCtrl->GetType() )
@@ -438,6 +439,11 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, 
tools::Long nWidth, to
 mbNWFBorder = true;
 }
 break;
+case WindowType::LISTBOXWINDOW:
+aCtrlType = ControlType::Listbox;
+aCtrlPart = ControlPart::ListboxWindow;
+mbNWFBorder = true;
+break;
 case WindowType::COMBOBOX:
 if( pCtrl->GetStyle() & WB_DROPDOWN )
 {

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

2021-03-01 Thread Stephan Bergmann (via logerrit)
 vcl/osx/service_entry.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 46d3370d6c5a571c3013e3a964e49f0997d4eabf
Author: Stephan Bergmann 
AuthorDate: Mon Mar 1 11:30:39 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Mar 1 12:29:04 2021 +0100

loplugin:redundantstatic (macOS)

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

diff --git a/vcl/osx/service_entry.cxx b/vcl/osx/service_entry.cxx
index 4263735422e7..22b28a2c4a1a 100644
--- a/vcl/osx/service_entry.cxx
+++ b/vcl/osx/service_entry.cxx
@@ -36,7 +36,7 @@ using namespace ::com::sun::star::datatransfer::clipboard;
 
 // We run unit tests in parallel, which is a problem when touching a shared 
resource
 // the system clipboard, so rather use the dummy GenericClipboard.
-static const bool bRunningUnitTest = getenv("LO_TESTNAME");
+const bool bRunningUnitTest = getenv("LO_TESTNAME");
 
 uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< 
Any >& i_rArguments )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-26 Thread Noel Grandin (via logerrit)
 vcl/osx/service_entry.cxx  |   10 +++---
 vcl/unx/generic/dtrans/X11_service.cxx |   13 +
 vcl/unx/gtk3/gtk3gtkinst.cxx   |   13 +
 vcl/win/dtrans/WinClipboard.cxx|   22 --
 4 files changed, 53 insertions(+), 5 deletions(-)

New commits:
commit 043c67e0f7358753a2007b7c2bb6cc68aeea7ecb
Author: Noel Grandin 
AuthorDate: Wed Feb 24 19:31:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 26 10:00:44 2021 +0100

dummy clipboard for unit tests

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

diff --git a/vcl/osx/service_entry.cxx b/vcl/osx/service_entry.cxx
index eebb675ce9d2..4263735422e7 100644
--- a/vcl/osx/service_entry.cxx
+++ b/vcl/osx/service_entry.cxx
@@ -34,9 +34,13 @@ using namespace ::cppu;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::datatransfer::clipboard;
 
+// We run unit tests in parallel, which is a problem when touching a shared 
resource
+// the system clipboard, so rather use the dummy GenericClipboard.
+static const bool bRunningUnitTest = getenv("LO_TESTNAME");
+
 uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< 
Any >& i_rArguments )
 {
-if ( Application::IsHeadlessModeEnabled() )
+if ( Application::IsHeadlessModeEnabled() || bRunningUnitTest )
 return SalInstance::CreateClipboard( i_rArguments );
 
 SalData* pSalData = GetSalData();
@@ -47,7 +51,7 @@ uno::Reference< XInterface > 
AquaSalInstance::CreateClipboard( const Sequence< A
 
 uno::Reference AquaSalInstance::CreateDragSource()
 {
-if ( Application::IsHeadlessModeEnabled() )
+if ( Application::IsHeadlessModeEnabled() || bRunningUnitTest )
 return SalInstance::CreateDragSource();
 
 return uno::Reference(static_cast< XInitialization* >(new 
DragSource()), UNO_QUERY);
@@ -55,7 +59,7 @@ uno::Reference AquaSalInstance::CreateDragSource()
 
 uno::Reference AquaSalInstance::CreateDropTarget()
 {
-if ( Application::IsHeadlessModeEnabled() )
+if ( Application::IsHeadlessModeEnabled() || bRunningUnitTest )
 return SalInstance::CreateDropTarget();
 
 return uno::Reference(static_cast< XInitialization* >(new 
DropTarget()), UNO_QUERY);
diff --git a/vcl/unx/generic/dtrans/X11_service.cxx 
b/vcl/unx/generic/dtrans/X11_service.cxx
index 2b9c1299be45..3d8ef3382a46 100644
--- a/vcl/unx/generic/dtrans/X11_service.cxx
+++ b/vcl/unx/generic/dtrans/X11_service.cxx
@@ -44,8 +44,15 @@ Sequence< OUString > 
x11::Xdnd_dropTarget_getSupportedServiceNames()
 return { "com.sun.star.datatransfer.dnd.X11DropTarget" };
 }
 
+// We run unit tests in parallel, which is a problem when touching a shared 
resource
+// the system clipboard, so rather use the dummy GenericClipboard.
+const bool bRunningUnitTest = getenv("LO_TESTNAME");
+
 css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const 
Sequence< Any >& arguments )
 {
+if ( bRunningUnitTest )
+return SalInstance::CreateClipboard( arguments );
+
 SelectionManager& rManager = SelectionManager::get();
 css::uno::Sequence mgrArgs(1);
 mgrArgs[0] <<= Application::GetDisplayConnection();
@@ -73,11 +80,17 @@ css::uno::Reference< XInterface > 
X11SalInstance::CreateClipboard( const Sequenc
 
 css::uno::Reference< XInterface > X11SalInstance::CreateDragSource()
 {
+if ( bRunningUnitTest )
+return SalInstance::CreateDragSource();
+
 return css::uno::Reference < XInterface >( static_cast(new 
SelectionManagerHolder()) );
 }
 
 css::uno::Reference< XInterface > X11SalInstance::CreateDropTarget()
 {
+if ( bRunningUnitTest )
+return SalInstance::CreateDropTarget();
+
 return css::uno::Reference < XInterface >( static_cast(new 
DropTarget()) );
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 9f1804a78791..1c9e284be0c3 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1145,8 +1145,15 @@ void VclGtkClipboard::removeClipboardListener( const 
Reference< datatransfer::cl
 m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), 
listener), m_aListeners.end());
 }
 
+// We run unit tests in parallel, which is a problem when touching a shared 
resource
+// the system clipboard, so rather use the dummy GenericClipboard.
+const bool bRunningUnitTest = getenv("LO_TESTNAME");
+
 Reference< XInterface > GtkInstance::CreateClipboard(const Sequence< Any >& 
arguments)
 {
+if ( bRunningUnitTest )
+return SalInstance::CreateClipboard( arguments );
+
 OUString sel;
 if (!arguments.hasElements()) {
 sel = "CLIPBOARD";
@@ -1312,6 +1319,9 @@ void GtkDropTarget::setDefaultActions(sal_Int8 
nDefaultActions)
 
 Reference< XInterface > GtkInstance::CreateDropTarget()
 {
+if ( 

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

2021-01-27 Thread Tor Lillqvist (via logerrit)
 vcl/osx/salinst.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 02bb41dd5197503d0d8b7d8be0a8cd220c0d1c85
Author: Tor Lillqvist 
AuthorDate: Wed Jan 27 14:36:00 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Jan 27 15:47:08 2021 +0100

NSApplication's appearance property exists in macOS 10.14 and later only

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index f44bf282a9cd..748655c86641 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -308,14 +308,16 @@ VCLPLUG_OSX_PUBLIC SalInstance* create_SalInstance()
 
 // TODO: After implementation of dark mode, this code has to be removed.
 
-if (getenv("VCL_MACOS_FORCE_DARK_MODE"))
+if (@available(macOS 10.14, iOS 13, *))
 {
-if (@available(macOS 10.14, iOS 13, *))
+if (getenv("VCL_MACOS_FORCE_DARK_MODE"))
+{
 [NSApp setAppearance: [NSAppearance appearanceNamed: 
NSAppearanceNameDarkAqua]];
+}
+else
+if (!getenv("VCL_MACOS_USE_SYSTEM_APPEARANCE"))
+[NSApp setAppearance: [NSAppearance appearanceNamed: 
NSAppearanceNameAqua]];
 }
-else
-if (!getenv("VCL_MACOS_USE_SYSTEM_APPEARANCE"))
-   [NSApp setAppearance: [NSAppearance appearanceNamed: 
NSAppearanceNameAqua]];
 
 // activate our delegate methods
 [NSApp setDelegate: NSApp];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-19 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salmenu.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 6ee7a3b2c0565c2871d32d704cb2899445b9f88d
Author: Stephan Bergmann 
AuthorDate: Tue Jan 19 17:31:46 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 19 23:17:10 2021 +0100

Avoid deadlock when macOS menu-related code is run on non-main thread

At least on macOS 11.1 on ARM64 (though not with an otherwise somewhat 
similar
build on macOS 10.15.7 on x86-64), CppunitTest_smoketest deadlocked the 
soffice
process for me, first while processing a remote call from cppunittester at

> thread #8, name = 'cppu_threadpool::ORequestThread'
>   frame #0: 0x000183c43488 libsystem_kernel.dylib`__psynch_cvwait + 8
>   frame #1: 0x000183c79568 libsystem_pthread.dylib`_pthread_cond_wait 
+ 1192
>   frame #2: 0x000184aeb0f0 Foundation`-[NSOperation 
waitUntilFinished] + 584
>   frame #3: 0x000183d370e0 CoreFoundation`_CFXNotificationPost + 800
>   frame #4: 0x000184aa0650 Foundation`-[NSNotificationCenter 
postNotificationName:object:userInfo:] + 64
>   frame #5: 0x00018653d3bc AppKit`-[NSMenu insertItem:atIndex:] + 624
>   frame #6: 0x00018653e66c AppKit`-[NSMenu 
insertItemWithTitle:action:keyEquivalent:atIndex:] + 144
>   frame #7: 0x000115d16a28 libvclplug_osxlo.dylib`initAppMenu() at 
vcl/osx/salmenu.cxx:126:16
>   frame #8: 0x000115d1691c 
libvclplug_osxlo.dylib`AquaSalInstance::CreateMenu(this=0x00013febbd10, 
bMenuBar=false, pVCLMenu=0x000299db67a0) at vcl/osx/salmenu.cxx:207:5
>   frame #9: 0x00010b1b8620 
libvcllo.dylib`PopupMenu::PopupMenu(this=0x000299db67a0) at 
vcl/source/window/menu.cxx:2718:45
[...]

and later while processing a remote call from cppunittester at

> thread #8, name = 'cppu_threadpool::ORequestThread'
>   frame #0: 0x000183c43488 libsystem_kernel.dylib`__psynch_cvwait + 8
>   frame #1: 0x000183c79568 libsystem_pthread.dylib`_pthread_cond_wait 
+ 1192
>   frame #2: 0x000184aeb0f0 Foundation`-[NSOperation 
waitUntilFinished] + 584
>   frame #3: 0x000183d370e0 CoreFoundation`_CFXNotificationPost + 800
>   frame #4: 0x000184aa0650 Foundation`-[NSNotificationCenter 
postNotificationName:object:userInfo:] + 64
>   frame #5: 0x00018653d3bc AppKit`-[NSMenu insertItem:atIndex:] + 624
>   frame #6: 0x000119858590 
libvclplug_osxlo.dylib`AquaSalMenu::InsertItem(this=0x00028be8cc20, 
pSalMenuItem=0x00028be67420, nPos=65535) at vcl/osx/salmenu.cxx:489:9
>   frame #7: 0x00010aa8a424 
libvcllo.dylib`Menu::NbcInsertItem(this=0x00028be78f90, nId=2, nBits=NONE, 
rStr=0x00028070ef70, pMenu=0x00028be78f90, nPos=65535, 
rIdent=0x00028070ef10) at vcl/source/window/menu.cxx:416:27
[...]

and the main thread in both cases in the main loop at

> thread #1, queue = 'com.apple.main-thread'
>   frame #0: 0x000183c43488 libsystem_kernel.dylib`__psynch_cvwait + 8
>   frame #1: 0x000183c79568 libsystem_pthread.dylib`_pthread_cond_wait 
+ 1192
>   frame #2: 0x0001013b0354 
libc++.1.0.dylib`std::__1::condition_variable::wait(std::__1::unique_lock&)
 [inlined] std::__1::__libcpp_condvar_wait(__cv=, 
__m=) at ~/llvm/build/include/c++/v1/__threading_support:436:10 
[opt]
>   frame #3: 0x0001013b0350 
libc++.1.0.dylib`std::__1::condition_variable::wait(this=, 
lk=) at 
~/github.com/llvm/llvm-project/libcxx/src/condition_variable.cpp:44 [opt]
>   frame #4: 0x000115d0a8fc libvclplug_osxlo.dylib`void 
std::__1::condition_variable::wait(this=0x00013fec8f50, __lk=0x00016f255bf8, __pred=(anonymous 
class) @ 0x00016f255b80)::$_0) at 
~/llvm/inst/include/c++/v1/__mutex_base:406:9
>   frame #5: 0x000115d0a71c 
libvclplug_osxlo.dylib`SalYieldMutex::doAcquire(this=0x00013fec8ef0, 
nLockCount=1) at vcl/osx/salinst.cxx:215:36
>   frame #6: 0x00010b15ec90 
libvcllo.dylib`comphelper::SolarMutex::acquire(this=0x00013fec8ef0, 
nLockCount=1) at include/comphelper/solarmutex.hxx:86:5
>   frame #7: 0x00010b8215c4 
libvcllo.dylib`SalInstance::AcquireYieldMutex(this=0x00013febbd10, 
nCount=1) at vcl/source/app/salvtables.cxx:121:73
>   frame #8: 0x00010b8c1d78 
libvcllo.dylib`Application::AcquireSolarMutex(nCount=1) at 
vcl/source/app/svapp.cxx:562:25
>   frame #9: 0x000115d1 
libvclplug_osxlo.dylib`SolarMutexReleaser::~SolarMutexReleaser(this=0x00016f255e28)
 at include/vcl/svapp.hxx:1421:29
>   frame #10: 0x000115d0c650 
libvclplug_osxlo.dylib`SolarMutexReleaser::~SolarMutexReleaser(this=0x00016f255e28)
 at include/vcl/svapp.hxx:1421:27
>   frame #11: 0x000115d0c2d8 
libvclplug_osxlo.dylib`AquaSalInstance::DoYield(this=0x00013febbd10, 
bWait=true, bHandleAllCurrentEvents=false) at vcl/osx/salinst.cxx:570:9
>   frame #12: 0x00010b8c1558 

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

2021-01-19 Thread Stephan Bergmann (via logerrit)
 vcl/osx/a11ytextattributeswrapper.mm |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 064ce013a161e1aa02241a3a65191ae96136ec1b
Author: Stephan Bergmann 
AuthorDate: Tue Jan 19 09:58:01 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 19 14:33:10 2021 +0100

loplugin:colorcheck (macOS)

as suggested by noelgrandin on IRC, "just add ColorTransparency as the first
param, since that will maintain whatever the code is doing currently 
(whether it
is actually correct is a different story)"

Change-Id: I3fd7f10ffadc343f3f9a532120e2a7bbb33244d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109616
Reviewed-by: Noel Grandin 
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/vcl/osx/a11ytextattributeswrapper.mm 
b/vcl/osx/a11ytextattributeswrapper.mm
index ac4cb7d2444d..a1a6d0350e4b 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -232,9 +232,9 @@ using namespace ::com::sun::star::uno;
 } else if ( property.Name == "CharUnderlineHasColor" ) {
 underlineHasColor = [ AquaA11yTextAttributesWrapper 
convertBoolean: property ];
 } else if ( property.Name == "CharColor" ) {
-[ AquaA11yTextAttributesWrapper addColor: 
property.Value.get() forAttribute: 
NSAccessibilityForegroundColorTextAttribute andRange: range toString: string ];
+[ AquaA11yTextAttributesWrapper addColor: 
Color(ColorTransparency, property.Value.get()) forAttribute: 
NSAccessibilityForegroundColorTextAttribute andRange: range toString: string ];
 } else if ( property.Name == "CharBackColor" ) {
-[ AquaA11yTextAttributesWrapper addColor: 
property.Value.get() forAttribute: 
NSAccessibilityBackgroundColorTextAttribute andRange: range toString: string ];
+[ AquaA11yTextAttributesWrapper addColor: 
Color(ColorTransparency, property.Value.get()) forAttribute: 
NSAccessibilityBackgroundColorTextAttribute andRange: range toString: string ];
 } else if ( property.Name == "CharEscapement" ) {
 // values < zero mean subscript
 // values > zero mean superscript
@@ -267,7 +267,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 }
 // add underline information
 if ( underlineHasColor ) {
-[ AquaA11yTextAttributesWrapper addColor: underlineColor forAttribute: 
NSAccessibilityUnderlineColorTextAttribute andRange: range toString: string ];
+[ AquaA11yTextAttributesWrapper addColor: Color(ColorTransparency, 
underlineColor) forAttribute: NSAccessibilityUnderlineColorTextAttribute 
andRange: range toString: string ];
 }
 // add font information
 NSFont * font = [fontDescriptor font];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-19 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salmacos.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 16fa5a56df6022bd042753a3ac9a4d64278d7890
Author: Stephan Bergmann 
AuthorDate: Tue Jan 19 09:31:02 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 19 11:22:52 2021 +0100

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

same as f9c6a153c95c4acc6ba02e660c6ca51166b4c79a
"-Werror,-Wdeprecated-anon-enum-enum-conversion"

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

diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx
index 9efe4dcb8003..bc91c2885339 100644
--- a/vcl/osx/salmacos.cxx
+++ b/vcl/osx/salmacos.cxx
@@ -345,7 +345,7 @@ bool AquaSalVirtualDevice::SetSize(tools::Long nDX, 
tools::Long nDY)
 mnBitmapDepth = 32;
 aColorSpace = GetSalData()->mxRGBSpace;
 
-nFlags = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host;
+nFlags = uint32_t(kCGImageAlphaNoneSkipFirst) | 
uint32_t(kCGBitmapByteOrder32Host);
 }
 
 // Allocate buffer for virtual device graphics as bitmap context to store 
graphics with highest required (scaled) resolution
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-17 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |   32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

New commits:
commit 058ad4b900b5e0ee902f3e89ed121c2b5f8c58f1
Author: Thorsten Wagner 
AuthorDate: Sun Jan 17 20:24:26 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Sun Jan 17 21:38:12 2021 +0100

tdf#138314 Change selected tab text color on macOS Big Sur

Starting with macOS Big Sur, coloring has changed. Currently there is
no documentation which system color should be used for selected tab
text. As a workaround text color is changed for macOS Big Sur and
newer only.

Change-Id: I2e8c83527775c17f95e5e4afe70577442e14715e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109479
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index b4168a2142e7..9d4f68827a06 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1302,27 +1302,37 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // black otherwise
 
 Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, 
mpNSWindow));
-Color aSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
-aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
+Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
+
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
-aStyleSettings.SetDefaultActionButtonTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
 
-// Set text colors for tabs according to OS settings, typically white for 
selected buttons, black otherwise
+// Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);
-aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+
+// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
+// used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
+// issue is covered by documentation.
+
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion 
= 0, .patchVersion = 0 };
+if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
+aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+else
+
aStyleSettings.SetTabHighlightTextColor(aAlternateSelectedControlTextColor);
 
 aStyleSettings.SetCursorBlinkTime( mnBlinkCursorDelay );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-16 Thread Tor Lillqvist (via logerrit)
 vcl/osx/DataFlavorMapping.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit a42fa14a1d48ca7a880171c16a395eadf07efcad
Author: Tor Lillqvist 
AuthorDate: Fri Jan 15 18:19:11 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Sat Jan 16 09:17:05 2021 +0100

Enable pasting of LINK data from the system pasteboard on macOS

Also add more documentation on how the flavorMap array works. The
interesting thing is that the code stores anything you throw at it on
the system pasteboard. But in another LibreOffice process, it won't
accept types not mentioned in the array even if it as such is a type
that other parts of the code would look for.

Thus, adding the
"application/x-openoffice-link;windows_formatname=\"Link\"" type to
the array means that if there is such data on the system pasteboard
(from an earlier or simultaneous run of LibreOffice), it will be
pasteable also in a different LibreOffice process from the one that
put it there.

(While at it, order the FLAVOR_FOO variable definitions to be in the
same order as their use in the array entries.)

Change-Id: I913cc732e4dfb32d4b098505aa10806976db6326
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109384
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 5659ce1e342b..82065b2c88be 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -74,7 +74,6 @@ namespace
 return [NSString stringWithCString: utf8Str.getStr() encoding: 
NSUTF8StringEncoding];
   }
 
-  const char* FLAVOR_SODX = 
"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object 
Descriptor (XML)\"";
   const char* FLAVOR_SESX = 
"application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed 
Source (XML)\"";
   const char* FLAVOR_SLSDX = 
"application/x-openoffice-linksrcdescriptor-xml;windows_formatname=\"Star Link 
Source Descriptor (XML)\"";
   const char* FLAVOR_ESX = 
"application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed 
Source (XML)\"";
@@ -84,7 +83,8 @@ namespace
   const char* FLAVOR_GDIMF = 
"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"";
   const char* FLAVOR_WMF = 
"application/x-openoffice-wmf;windows_formatname=\"Image WMF\"";
   const char* FLAVOR_EMF = 
"application/x-openoffice-emf;windows_formatname=\"Image EMF\"";
-
+  const char* FLAVOR_SODX = 
"application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object 
Descriptor (XML)\"";
+  const char* FLAVOR_LINK = 
"application/x-openoffice-link;windows_formatname=\"Link\"";
   const char* FLAVOR_DUMMY_INTERNAL = "application/x-openoffice-internal";
 
   struct FlavorMap
@@ -95,6 +95,16 @@ namespace
 bool DataTypeOUString; // sequence otherwise
   };
 
+  // This is a list of the bidirectional mapping between (internal) MIME types 
and (system)
+  // pasteboard types.
+
+  // Only pasteboard types mentioned here will be recognized, mapped, and 
available for pasting in a
+  // fresh LibreOffice process. When copy-pasting in-process, the situation is 
different.
+
+  // Also MIME types not mentioned here will be stored on the pasteboard 
(using the same type name),
+  // though. But that is IMHO a bit pointless as they in general won't then be 
pasteable anyway in a
+  // new LibreOffice process. See the use of the maOfficeOnlyTypes array.
+
   // The SystemFlavor member is nil for the cases where there is no predefined 
pasteboard type UTI
   // and we use the internal MIME type (media type) also on the pasteboard. 
That is OK in macOS,
   // there is no requirement that the types are well-formed UTIs. It is 
different on iOS, I think,
@@ -128,6 +138,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
   { nil, FLAVOR_WMF, "Windows MetaFile", false },
   { nil, FLAVOR_EMF, "Windows Enhanced MetaFile", false },
   { nil, FLAVOR_SODX, "Star Object Descriptor (XML)", false },
+  { nil, FLAVOR_LINK, "Dynamic Data Exchange (DDE link)", false },
   { nil, FLAVOR_DUMMY_INTERNAL, "internal data",false }
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-15 Thread Noel Grandin (via logerrit)
 vcl/osx/saldata.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 0665ec46aa099e556b7d1fc19f60efc90747e798
Author: Noel Grandin 
AuthorDate: Fri Jan 15 11:43:23 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Jan 15 10:54:09 2021 +0100

remove leftover code

from commit 0918eade90e19dd8e9a246446dcb9463c6c7f7cc
"remove unnecessary macos cursor code"

Change-Id: Ieab46070e8da83ab6c054a57006e7760d69a2a43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109326
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index 9c3f04dbbc7b..bf0659f0f0d8 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -135,7 +135,6 @@ NSImage* load_icon_by_name(const OUString& rIconName)
 auto length = xMemStm->TellEnd();
 NSData * byteData = [NSData dataWithBytes:data length:length];
 NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData:byteData];
-//NSSize imageSize = NSMakeSize(imageRep.size;
 
 NSImage * image = [[NSImage alloc] initWithSize:imageRep.size];
 [image addRepresentation:imageRep];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-13 Thread Noel Grandin (via logerrit)
 vcl/osx/saldata.cxx |   25 +++--
 1 file changed, 3 insertions(+), 22 deletions(-)

New commits:
commit 0918eade90e19dd8e9a246446dcb9463c6c7f7cc
Author: Noel Grandin 
AuthorDate: Wed Jan 13 20:25:11 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 14 07:46:51 2021 +0100

remove unnecessary macos cursor code

certainly on my Catalina macOS install it makes no difference
with or without this code. I could have sworn it was
necessary back when I added it, but since I'm going on
snippets of hacking scattered around the net (because Apple
's documentation is rather lacking), who knows.

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

diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index 7a9f7b42dcfe..9c3f04dbbc7b 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -135,9 +135,9 @@ NSImage* load_icon_by_name(const OUString& rIconName)
 auto length = xMemStm->TellEnd();
 NSData * byteData = [NSData dataWithBytes:data length:length];
 NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData:byteData];
-NSSize imageSize = NSMakeSize(CGImageGetWidth([imageRep CGImage]), 
CGImageGetHeight([imageRep CGImage]));
+//NSSize imageSize = NSMakeSize(imageRep.size;
 
-NSImage * image = [[NSImage alloc] initWithSize:imageSize];
+NSImage * image = [[NSImage alloc] initWithSize:imageRep.size];
 [image addRepresentation:imageRep];
 return image;
 }
@@ -248,26 +248,7 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle )
 }
 
 NSImage* theImage = load_icon_by_name(aIconName);
-assert ([theImage size].width == 256 || [theImage size].width == 128 || 
[theImage size].width == 32);
-if ([theImage size].width == 256 || [theImage size].width == 128)
-{
-// If we have a 256x256 or 128x128 image, generate scaled versions of 
it.
-// This will result in macOS picking a reasonably sized image for 
different screen dpi.
-NSSize cursorSize = NSMakeSize(32,32);
-NSImage *multiResImage = [[NSImage alloc] initWithSize:cursorSize];
-for (int scale = 1; scale <= 4; scale++) {
-NSAffineTransform *xform = [[NSAffineTransform alloc] init];
-[xform scaleBy:scale];
-id hints = @{ NSImageHintCTM: xform };
-CGImageRef rasterCGImage = [theImage 
CGImageForProposedRect:nullptr context:nil hints:hints];
-NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] 
initWithCGImage:rasterCGImage];
-[rep setSize:cursorSize];
-[multiResImage addRepresentation:rep];
-}
-pCurs = [[NSCursor alloc] initWithImage: multiResImage hotSpot: 
aHotSpot];
-}
-else
-pCurs = [[NSCursor alloc] initWithImage: theImage hotSpot: aHotSpot];
+pCurs = [[NSCursor alloc] initWithImage: theImage hotSpot: aHotSpot];
 
 maCursors[ i_eStyle ] = pCurs;
 return pCurs;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-11 Thread Tor Lillqvist (via logerrit)
 vcl/osx/saldata.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 27ed1e5232333f630aea05ac6c7d88bac3cc03aa
Author: Tor Lillqvist 
AuthorDate: Mon Jan 11 11:57:04 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Jan 11 14:21:25 2021 +0100

Avoid assertion failure related to cursor sizes on macOS

No idea why this assertion failure started to show up now (at least
when viewing a presentation slide show). Anyway, apparently the code
needs to handle 256x256 cursors, too, and not just 128x128 and 32x32
ones. Apparently the assertion failure is caused by
icon-themes/colibre/vcl/res/null.png.

Sadly I don't really understand the code around here, but this commit
gets rid of the assertion failure, and that is good enough for me for
now.

This problem was reported in a comment in the otherwise unrelated
tdf#138122, and the assertion failure caused a hang, which is not
good, reported as tdf#139535. That general problem is not fixed by
this commit.

Change-Id: I1390f00e03e0766d54969d9d62311a55da8e8945
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109083
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index 5235f657f8ca..7a9f7b42dcfe 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -248,10 +248,10 @@ NSCursor* SalData::getCursor( PointerStyle i_eStyle )
 }
 
 NSImage* theImage = load_icon_by_name(aIconName);
-assert ([theImage size].width == 128 || [theImage size].width == 32);
-if ([theImage size].width == 128)
+assert ([theImage size].width == 256 || [theImage size].width == 128 || 
[theImage size].width == 32);
+if ([theImage size].width == 256 || [theImage size].width == 128)
 {
-// If we have a 128x128 image, generate scaled versions of it.
+// If we have a 256x256 or 128x128 image, generate scaled versions of 
it.
 // This will result in macOS picking a reasonably sized image for 
different screen dpi.
 NSSize cursorSize = NSMakeSize(32,32);
 NSImage *multiResImage = [[NSImage alloc] initWithSize:cursorSize];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-14 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salinst.cxx|   13 -
 vcl/source/app/salplug.cxx |   23 +++
 vcl/win/app/salinst.cxx|   19 ---
 3 files changed, 23 insertions(+), 32 deletions(-)

New commits:
commit f5af2104fc490b90510e36bbf1d2adec8017c594
Author: Stephan Bergmann 
AuthorDate: Sun Dec 13 22:35:21 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 14 15:59:06 2020 +0100

Fix and clean up SalAbort implementations on macOS and Windows

Since "forever", SalAbort has been declared as non-exported in
vcl/inc/salinst.hxx and (only) called from Application::Abort
(vcl/source/app/svapp.cxx) in Library_vcl.  Its various implementations for
different platforms have always been scattered across Library_vcl.

For Windows, SalAbort was originally implemented in vcl/win/app/salinst.cxx,
until 1698debed2993fc5f262aa3ebbdb32fc112ac556 "Implement Windows VCL 
backend as
plugin" introduced an incompatible implementation in vcl/win/app/salplug.cxx
(which was added to Library_vcl) and moved the original implementation in
vcl/win/app/salinst.cxx from Library_vcl to Library_vclplug_win, where it 
thus
became dead code (and where it now gets removed).

For macOS, SalAbort was originally implemented in vcl/osx/salinst.cxx, until
3af4e1a0825c5b11ae4ef58fc411378aab669387 "Implement MacOSX VCL backend as
plugin" introduced a different implementation in vcl/osx/salplug.cxx (which 
was
added to Library_vcl) and moved the original implementation in
vcl/osx/salinst.cxx from Library_vcl to Library_vclplug_win, where it thus
became dead code (and where it now gets removed).

(In 0f3be2e19fa408d7069d586ccf04cb3f3eccd6b9 "Unify sal plugin loaders", 
the---
identical---new implementations in vcl/osx/salinst.cxx and
vcl/win/app/salinst.cxx where then consolidated with other---also 
identical---
implementations in vcl/source/app/salplug.cxx.)

For macOS, the original, now removed implementation in vcl/osx/salinst.cxx 
and
the consolidated implementation in vcl/source/app/salplug.cxx only differed 
in
an added

  CrashReporter::addKeyValue("AbortMessage", rErrorText, 
CrashReporter::Write);

which is presumably harmless to add.

But for Windows, the original, now removed implementation in
vcl/win/app/salinst.cxx differed substantially from the consolidated
implementation in vcl/source/app/salplug.cxx, which is updated here to 
reflect
those differences.  The one thing that cannot easily be updated, though, is 
the

  //TODO: ImplFreeSalGDI();

call, as ImplFreeSalGDI is defined in Library_vclplug_win.  I'll thus leave
fixing that TODO for another commit (if calling ImplFreeSalGDI from 
SalAbort is
even necessary, given that it ends in FatalAppExitW anyway)---my gut 
feeling is
that the whole 1698debed2993fc5f262aa3ebbdb32fc112ac556 "Implement Windows 
VCL
backend as plugin" was somewhat misguided.

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

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 91b22e9b77ec..bbe6d9d704f7 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -186,19 +186,6 @@ void AquaSalInstance::AfterAppInit()
 #endif
 }
 
-void SalAbort( const OUString& rErrorText, bool bDumpCore )
-{
-if( rErrorText.isEmpty() )
-fprintf( stderr, "Application Error " );
-else
-fprintf( stderr, "%s ",
-OUStringToOString( rErrorText, osl_getThreadTextEncoding() 
).getStr() );
-if( bDumpCore )
-abort();
-else
-_exit(1);
-}
-
 SalYieldMutex::SalYieldMutex()
 : m_aCodeBlock( nullptr )
 {
diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx
index 1868853e93b8..c3e4e666e9d3 100644
--- a/vcl/source/app/salplug.cxx
+++ b/vcl/source/app/salplug.cxx
@@ -36,6 +36,7 @@
 #include 
 #else
 #include 
+#include 
 #include 
 #endif
 
@@ -292,17 +293,39 @@ void DestroySalInstance( SalInstance *pInst )
 
 void SalAbort( const OUString& rErrorText, bool bDumpCore )
 {
+#if defined _WIN32
+//TODO: ImplFreeSalGDI();
+#endif
+
 if( rErrorText.isEmpty() )
+{
+#if defined _WIN32
+// make sure crash reporter is triggered
+RaiseException( 0, EXCEPTION_NONCONTINUABLE, 0, nullptr );
+FatalAppExitW( 0, L"Application Error" );
+#else
 std::fprintf( stderr, "Application Error\n" );
+#endif
+}
 else
 {
 CrashReporter::addKeyValue("AbortMessage", rErrorText, 
CrashReporter::Write);
+#if defined _WIN32
+// make sure crash reporter is triggered
+RaiseException( 0, EXCEPTION_NONCONTINUABLE, 0, nullptr );
+FatalAppExitW( 0, o3tl::toW(rErrorText.getStr()) );
+#else
 std::fprintf( stderr, "%s\n", OUStringToOString(rErrorText, 

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

2020-12-13 Thread Stephan Bergmann (via logerrit)
 vcl/osx/DataFlavorMapping.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 9231746301c99f26500ca26e841822b2c0d676b1
Author: Stephan Bergmann 
AuthorDate: Sun Dec 13 19:21:17 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Dec 13 22:25:20 2020 +0100

loplugin:stringviewparam (macOS)

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

diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 07534d0c893b..26724c5aed97 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -67,7 +68,7 @@ namespace
 return OUString(utf8Str, len, RTL_TEXTENCODING_UTF8);
   }
 
-  NSString* OUStringToNSString(const OUString& ustring)
+  NSString* OUStringToNSString(std::u16string_view ustring)
   {
 OString utf8Str = OUStringToOString(ustring, RTL_TEXTENCODING_UTF8);
 return [NSString stringWithCString: utf8Str.getStr() encoding: 
NSUTF8StringEncoding];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-07 Thread Stephan Bergmann (via logerrit)
 vcl/osx/printaccessoryview.mm |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 678c4fa103709588154371a35b74ebedbcef95f6
Author: Stephan Bergmann 
AuthorDate: Mon Dec 7 17:54:00 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 7 20:51:01 2020 +0100

loplugin:stringviewparam (macOS)

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

diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index 92ccbf686fe8..7656c1b9df06 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -41,6 +41,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 using namespace vcl;
@@ -845,7 +846,7 @@ static void addList( NSView* pCurParent, CGFloat& rCurX, 
CGFloat& rCurY, CGFloat
 }
 
 static void addEdit( NSView* pCurParent, CGFloat rCurX, CGFloat& rCurY, 
CGFloat nAttachOffset,
-const OUString& rCtrlType,
+std::u16string_view rCtrlType,
 const OUString& rText,
 const OUString& rProperty, const PropertyValue* pValue,
 sal_Int64 nMinValue, sal_Int64 nMaxValue,
@@ -898,7 +899,7 @@ static void addEdit( NSView* pCurParent, CGFloat rCurX, 
CGFloat& rCurY, CGFloat
 aFieldRect.origin.y = rCurY - aFieldRect.size.height;
 [pFieldView setFrame: aFieldRect];
 
-if( rCtrlType == "Range" )
+if( rCtrlType == u"Range" )
 {
 // add a stepper control
 NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 
5,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/osx/printaccessoryview.mm |   48 +-
 1 file changed, 24 insertions(+), 24 deletions(-)

New commits:
commit ecb4e19a3b133fd939b90deacd1f1b413738d27c
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 14:48:05 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 17:18:57 2020 +0100

CGFloat appears to be a more suitable type here

...interacting with NS data sructures and functions

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

diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index 110e30976c06..92ccbf686fe8 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -434,18 +434,18 @@ namespace {
 struct ColumnItem
 {
 NSControl*  pControl;
-longnOffset;
+CGFloat nOffset;
 NSControl*  pSubControl;
 
-ColumnItem( NSControl* i_pControl = nil, long i_nOffset = 0, NSControl* 
i_pSub = nil )
+ColumnItem( NSControl* i_pControl = nil, CGFloat i_nOffset = 0, NSControl* 
i_pSub = nil )
 : pControl( i_pControl )
 , nOffset( i_nOffset )
 , pSubControl( i_pSub )
 {}
 
-long getWidth() const
+CGFloat getWidth() const
 {
-long nWidth = 0;
+CGFloat nWidth = 0;
 if( pControl )
 {
 NSRect aCtrlRect = [pControl frame];
@@ -472,17 +472,17 @@ static void adjustViewAndChildren( NSView* pNSView, 
NSSize& rMaxSize,
 // balance columns
 
 // first get overall column widths
-long nLeftWidth = 0;
-long nRightWidth = 0;
+CGFloat nLeftWidth = 0;
+CGFloat nRightWidth = 0;
 for( size_t i = 0; i < rLeftColumn.size(); i++ )
 {
-long nW = rLeftColumn[i].getWidth();
+CGFloat nW = rLeftColumn[i].getWidth();
 if( nW > nLeftWidth )
 nLeftWidth = nW;
 }
 for( size_t i = 0; i < rRightColumn.size(); i++ )
 {
-long nW = rRightColumn[i].getWidth();
+CGFloat nW = rRightColumn[i].getWidth();
 if( nW > nRightWidth )
 nRightWidth = nW;
 }
@@ -493,7 +493,7 @@ static void adjustViewAndChildren( NSView* pNSView, NSSize& 
rMaxSize,
 if( rLeftColumn[i].pControl )
 {
 NSRect aCtrlRect = [rLeftColumn[i].pControl frame];
-long nX = nLeftWidth - aCtrlRect.size.width;
+CGFloat nX = nLeftWidth - aCtrlRect.size.width;
 if( rLeftColumn[i].pSubControl )
 {
 NSRect aSubRect = [rLeftColumn[i].pSubControl frame];
@@ -512,7 +512,7 @@ static void adjustViewAndChildren( NSView* pNSView, NSSize& 
rMaxSize,
 if( rRightColumn[i].pControl )
 {
 NSRect aCtrlRect = [rRightColumn[i].pControl frame];
-long nX = nLeftWidth + 3;
+CGFloat nX = nLeftWidth + 3;
 if( rRightColumn[i].pSubControl )
 {
 NSRect aSubRect = [rRightColumn[i].pSubControl frame];
@@ -647,7 +647,7 @@ static void linebreakCell( NSCell* pBtn, const OUString& 
i_rText )
 }
 }
 
-static void addSubgroup( NSView* pCurParent, long& rCurY, const OUString& 
rText )
+static void addSubgroup( NSView* pCurParent, CGFloat& rCurY, const OUString& 
rText )
 {
 NSControl* pTextView = createLabel( rText );
 [pCurParent addSubview: [pTextView autorelease]];
@@ -665,7 +665,7 @@ static void addSubgroup( NSView* pCurParent, long& rCurY, 
const OUString& rText
 rCurY = aTextRect.origin.y - 5;
 }
 
-static void addBool( NSView* pCurParent, long rCurX, long& rCurY, long 
nAttachOffset,
+static void addBool( NSView* pCurParent, CGFloat rCurX, CGFloat& rCurY, 
CGFloat nAttachOffset,
 const OUString& rText, bool bEnabled,
 const OUString& rProperty, bool bValue,
 std::vector& rRightColumn,
@@ -673,7 +673,7 @@ static void addBool( NSView* pCurParent, long rCurX, long& 
rCurY, long nAttachOf
 ControlTarget* pCtrlTarget
 )
 {
-NSRect aCheckRect = { { static_cast(rCurX + nAttachOffset), 0 }, 
{ 0, 15 } };
+NSRect aCheckRect = { { rCurX + nAttachOffset, 0 }, { 0, 15 } };
 NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
 [pBtn setButtonType: NSButtonTypeSwitch];
 [pBtn setState: bValue ? NSControlStateValueOn : NSControlStateValueOff];
@@ -708,7 +708,7 @@ static void addBool( NSView* pCurParent, long rCurX, long& 
rCurY, long nAttachOf
 rCurY = aCheckRect.origin.y - 5;
 }
 
-static void addRadio( NSView* pCurParent, long rCurX, long& rCurY, long 
nAttachOffset,
+static void addRadio( NSView* pCurParent, CGFloat rCurX, CGFloat& rCurY, 
CGFloat nAttachOffset,
  const OUString& rText,
  const OUString& rProperty, Sequence const & 
rChoices, 

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

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/osx/a11yvaluewrapper.mm |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit bbb8cbcd404e608f6016a812d47170080a4671a6
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 14:19:19 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 17:17:58 2020 +0100

Assumed UNOIDL long vs. C++ sal_Int32 confusion

UNOIDL css.accessibility.XAccessibleValue.getCurrentValue returning any is
documented:  "The exact return type is implementation dependent.  Typical 
types
are long and double."  So assume that this code meant to extract a UNOIDL 
long,
i.e., sal_Int32 in C++, value.  (And similarly for getMinimum/MaximumValue.
Also, the "TODO: Detect Type from Any" comments seem to imply that something
more elaborate is asked for, anyway?)

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

diff --git a/vcl/osx/a11yvaluewrapper.mm b/vcl/osx/a11yvaluewrapper.mm
index 4882cd2eff97..0cf3786fbe6e 100644
--- a/vcl/osx/a11yvaluewrapper.mm
+++ b/vcl/osx/a11yvaluewrapper.mm
@@ -31,7 +31,7 @@ using namespace ::com::sun::star::uno;
 +(id)valueAttributeForElement:(AquaA11yWrapper *)wrapper {
 // TODO: Detect Type from Any
 if ( [ wrapper accessibleValue ] ) {
-long value = 0;
+sal_Int32 value = 0;
 [ wrapper accessibleValue ] -> getCurrentValue() >>= value;
 return [ NSNumber numberWithLong: value ];
 }
@@ -41,7 +41,7 @@ using namespace ::com::sun::star::uno;
 +(id)minValueAttributeForElement:(AquaA11yWrapper *)wrapper {
 // TODO: Detect Type from Any
 if ( [ wrapper accessibleValue ] ) {
-long value = 0;
+sal_Int32 value = 0;
 [ wrapper accessibleValue ] -> getMinimumValue() >>= value;
 return [ NSNumber numberWithLong: value ];
 }
@@ -51,7 +51,7 @@ using namespace ::com::sun::star::uno;
 +(id)maxValueAttributeForElement:(AquaA11yWrapper *)wrapper {
 // TODO: Detect Type from Any
 if ( [ wrapper accessibleValue ] ) {
-long value = 0;
+sal_Int32 value = 0;
 [ wrapper accessibleValue ] -> getMaximumValue() >>= value;
 return [ NSNumber numberWithLong: value ];
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/osx/a11ytextwrapper.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f7b4030014f98070feb923c1d650cb98049db968
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 13:59:25 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 17:14:18 2020 +0100

UNOIDL long vs. C++ sal_Int32 confustion

UNOIDL css.accessibility.XAccessibleText.getCaretPosition returns long, 
i.e.,
sal_Int32 in C++

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

diff --git a/vcl/osx/a11ytextwrapper.mm b/vcl/osx/a11ytextwrapper.mm
index a39037f079b1..cfd4ae7c1c22 100644
--- a/vcl/osx/a11ytextwrapper.mm
+++ b/vcl/osx/a11ytextwrapper.mm
@@ -77,7 +77,7 @@ using namespace ::com::sun::star::uno;
 if ( start != end ) {
 return [ NSValue valueWithRange: NSMakeRange ( start, end - start ) ]; 
// true selection
 } else {
-long caretPos = [ wrapper accessibleText ] -> getCaretPosition();
+sal_Int32 caretPos = [ wrapper accessibleText ] -> getCaretPosition();
 if ( caretPos < 0 || caretPos > [ wrapper accessibleText ] -> 
getCharacterCount() ) {
 return nil;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-15 Thread Stephan Bergmann (via logerrit)
 vcl/osx/a11ywrapper.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bde51945e0624b7ce5d02144bbb60044db3284ab
Author: Stephan Bergmann 
AuthorDate: Thu Nov 12 14:11:06 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 15 17:14:51 2020 +0100

UNOIDL long vs. C++ sal_Int32 confustion

UNOIDL css.awt.Point members x, y are of type long, i.e., sal_Int32 in C++

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

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 6ed9774c24a2..acb254f59426 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -1032,7 +1032,7 @@ static Reference < XAccessibleContext > hitTestRunner ( 
css::awt::Point point,
 }
 Reference < XAccessibleContext > hitChild;
 NSRect screenRect = [ [ NSScreen mainScreen ] frame ];
-css::awt::Point hitPoint ( static_cast(point.x) , 
static_cast(screenRect.size.height - point.y) );
+css::awt::Point hitPoint ( static_cast(point.x) , 
static_cast(screenRect.size.height - point.y) );
 // check child windows first
 NSWindow * window = static_cast([ self 
accessibilityAttributeValue: NSAccessibilityWindowAttribute ]);
 NSArray * childWindows = [ window childWindows ];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   >