[ooo-build-commit] Branch 'ooo/master' - 2 commits - svtools/inc svtools/source vcl/aqua vcl/inc vcl/source vcl/unx

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Jun 4 18:10:20 PDT 2009


 svtools/inc/svtools/undo.hxx           |   11 ++
 svtools/source/undo/makefile.mk        |    1 
 svtools/source/undo/undo.cxx           |  152 ++++++++++++++++++++++++---------
 vcl/aqua/source/a11y/aqua11ywrapper.mm |    8 +
 vcl/aqua/source/gdi/salgdi.cxx         |   98 ++++++++++++---------
 vcl/inc/vcl/window.hxx                 |    2 
 vcl/source/window/keycod.cxx           |   40 ++++----
 vcl/source/window/menu.cxx             |   19 ----
 vcl/source/window/toolbox.cxx          |    2 
 vcl/source/window/window.cxx           |   52 +++++++++--
 vcl/unx/kde/kdedata.cxx                |    2 
 11 files changed, 254 insertions(+), 133 deletions(-)

New commits:
commit ba607cfbde79d03b2cb527cc49b749ecf485f910
Author: Kurt Zenker <kz at openoffice.org>
Date:   Thu Jun 4 16:21:29 2009 +0000

    CWS-TOOLING: integrate CWS clnoundo
    2009-05-18 09:40:22 +0200 wg  r271998 : i102011
    2009-04-28 12:20:24 +0200 cl  r271318 : CWS-TOOLING: rebase CWS clnoundo to trunk at 270723 (milestone: DEV300:m46)
    2009-04-02 11:37:14 +0200 cl  r270388 : #i100371# check valid positions all the time to avoid crashes during model lock
    2009-03-30 13:02:27 +0200 cl  r270219 : #i100371# do not create undo actions in drawing layer during load
    2009-03-30 12:59:41 +0200 cl  r270218 : #i100371# do not create undo actions in drawing layer during load
    2009-03-30 12:55:06 +0200 cl  r270217 : #i100371# do not create undo actions in drawing layer during load
    2009-03-30 12:53:27 +0200 cl  r270216 : #i100371# do not create undo actions in drawing layer during load
    2009-03-30 12:49:28 +0200 cl  r270215 : #i100371# added EnableUndo() and IsUndoEnabled()

diff --git a/svtools/inc/svtools/undo.hxx b/svtools/inc/svtools/undo.hxx
index 306b2fb..7796965 100644
--- a/svtools/inc/svtools/undo.hxx
+++ b/svtools/inc/svtools/undo.hxx
@@ -143,6 +143,7 @@ class SVT_DLLPUBLIC SfxUndoManager
     SfxUndoArray			*pActUndoArray;
     SfxUndoArray			*pFatherUndoArray;
 
+    bool					mbUndoEnabled;
 public:
                             SfxUndoManager( USHORT nMaxUndoActionCount = 20 );
     virtual 				~SfxUndoManager();
@@ -182,6 +183,16 @@ public:
 
     /** clears the redo stack and removes the top undo action */
     void					RemoveLastUndoAction();
+
+    // enables (true) or disables (false) recording of undo actions
+    // If undo actions are added while undo is disabled, they are deleted.
+    // Disabling undo does not clear the current undo buffer!
+    void					EnableUndo( bool bEnable );
+
+    // returns true if undo is currently enabled
+    // This returns false if undo was disabled using EnableUndo( false ) and
+    // also during the runtime of the Undo() and Redo() methods.
+    bool					IsUndoEnabled() const { return mbUndoEnabled; }
 };
 
 //=========================================================================
diff --git a/svtools/source/undo/makefile.mk b/svtools/source/undo/makefile.mk
index 92a4069..b277fa3 100644
--- a/svtools/source/undo/makefile.mk
+++ b/svtools/source/undo/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..
 
 PRJNAME=svtools
 TARGET=undo
+ENABLE_EXCEPTIONS=TRUE
 
 # --- Settings -----------------------------------------------------
 
diff --git a/svtools/source/undo/undo.cxx b/svtools/source/undo/undo.cxx
index 667ae90..68a770b 100644
--- a/svtools/source/undo/undo.cxx
+++ b/svtools/source/undo/undo.cxx
@@ -31,11 +31,14 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_svtools.hxx"
 
+#include <com/sun/star/uno/Exception.hpp>
 
 #include <tools/debug.hxx>
 
 #include <svtools/undo.hxx>
 
+using ::com::sun::star::uno::Exception;
+
 // STATIC DATA -----------------------------------------------------------
 
 DBG_NAME(SfxUndoAction)
@@ -153,6 +156,7 @@ BOOL SfxUndoAction::CanRepeat(SfxRepeatTarget&) const
 
 SfxUndoManager::SfxUndoManager( USHORT nMaxUndoActionCount )
  : pFatherUndoArray(0)
+ , mbUndoEnabled( true )
 {
     pUndoArray=new SfxUndoArray(nMaxUndoActionCount);
     pActUndoArray=pUndoArray;
@@ -167,6 +171,12 @@ SfxUndoManager::~SfxUndoManager()
     delete pUndoArray;
 }
 
+//------------------------------------------------------------------------
+
+void SfxUndoManager::EnableUndo( bool bEnable )
+{
+    mbUndoEnabled = bEnable;
+}
 
 //------------------------------------------------------------------------
 
@@ -252,41 +262,43 @@ void SfxUndoManager::ClearRedo()
 
 void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge )
 {
-    // Redo-Actions loeschen
-    for ( USHORT nPos = pActUndoArray->aUndoActions.Count();
-          nPos > pActUndoArray->nCurUndoAction; --nPos )
-        delete pActUndoArray->aUndoActions[nPos-1];
-
-    pActUndoArray->aUndoActions.Remove(
-        pActUndoArray->nCurUndoAction,
-        pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction );
-
-    if ( pActUndoArray->nMaxUndoActions )
+    if( mbUndoEnabled )
     {
-        SfxUndoAction *pTmpAction = pActUndoArray->nCurUndoAction ?
-            pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1] : 0;
+        // Redo-Actions loeschen
+        for ( USHORT nPos = pActUndoArray->aUndoActions.Count();
+              nPos > pActUndoArray->nCurUndoAction; --nPos )
+            delete pActUndoArray->aUndoActions[nPos-1];
+
+        pActUndoArray->aUndoActions.Remove(
+            pActUndoArray->nCurUndoAction,
+            pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction );
 
-        if ( !bTryMerge || !(pTmpAction && pTmpAction->Merge(pAction)) )
+        if ( pActUndoArray->nMaxUndoActions )
         {
-            // auf Max-Anzahl anpassen
-            if( pActUndoArray == pUndoArray )
-                while( pActUndoArray->aUndoActions.Count() >=
-                       pActUndoArray->nMaxUndoActions &&
-                       !pActUndoArray->aUndoActions[0]->IsLinked() )
-                {
-                    delete pActUndoArray->aUndoActions[0];
-                    pActUndoArray->aUndoActions.Remove(0);
-                    --pActUndoArray->nCurUndoAction;
-                }
+            SfxUndoAction *pTmpAction = pActUndoArray->nCurUndoAction ?
+                pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1] : 0;
 
-            // neue Action anh"angen
-            const SfxUndoAction* pTemp = pAction;
-            pActUndoArray->aUndoActions.Insert(
-                pTemp, pActUndoArray->nCurUndoAction++ );
-            return;
+            if ( !bTryMerge || !(pTmpAction && pTmpAction->Merge(pAction)) )
+            {
+                // auf Max-Anzahl anpassen
+                if( pActUndoArray == pUndoArray )
+                    while( pActUndoArray->aUndoActions.Count() >=
+                           pActUndoArray->nMaxUndoActions &&
+                           !pActUndoArray->aUndoActions[0]->IsLinked() )
+                    {
+                        delete pActUndoArray->aUndoActions[0];
+                        pActUndoArray->aUndoActions.Remove(0);
+                        --pActUndoArray->nCurUndoAction;
+                    }
+
+                // neue Action anh"angen
+                const SfxUndoAction* pTemp = pAction;
+                pActUndoArray->aUndoActions.Insert(
+                    pTemp, pActUndoArray->nCurUndoAction++ );
+                return;
+            }
         }
     }
-
     delete pAction;
 }
 
@@ -368,20 +380,46 @@ void SfxUndoManager::RemoveLastUndoAction()
 
 BOOL SfxUndoManager::Undo( USHORT )
 {
-    DBG_ASSERT( pActUndoArray == pUndoArray, "svtools::SfxUndoManager::Undo(), LeaveListAction() not yet called!" );
-    if ( pActUndoArray->nCurUndoAction )
+    bool bUndoWasEnabled = 	mbUndoEnabled;
+    mbUndoEnabled = false;
+    
+    BOOL bRet = FALSE;
+
+    try
     {
-        Undo( *pActUndoArray->aUndoActions[ --pActUndoArray->nCurUndoAction ] );
-        return TRUE;
+        DBG_ASSERT( pActUndoArray == pUndoArray, "svtools::SfxUndoManager::Undo(), LeaveListAction() not yet called!" );
+        if ( pActUndoArray->nCurUndoAction )
+        {
+            Undo( *pActUndoArray->aUndoActions[ --pActUndoArray->nCurUndoAction ] );
+            bRet = TRUE;
+        }
     }
-    return FALSE;
+    catch( Exception& e )
+    {
+        mbUndoEnabled = bUndoWasEnabled;
+        throw e;
+    }
+    mbUndoEnabled = bUndoWasEnabled;
+    return bRet;
 }
 
 //------------------------------------------------------------------------
 
 void SfxUndoManager::Undo( SfxUndoAction &rAction )
 {
-    rAction.Undo();
+    bool bUndoWasEnabled = 	mbUndoEnabled;
+    mbUndoEnabled = false;
+    try
+    {
+        rAction.Undo();
+    }
+    catch( Exception& e )
+    {
+        mbUndoEnabled = bUndoWasEnabled;
+        throw e;
+    }
+
+    mbUndoEnabled = bUndoWasEnabled;
 }
 
 //------------------------------------------------------------------------
@@ -409,20 +447,47 @@ USHORT SfxUndoManager::GetRedoActionId( USHORT nNo ) const
 
 BOOL SfxUndoManager::Redo( USHORT )
 {
-    if ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
+    bool bUndoWasEnabled = 	mbUndoEnabled;
+    mbUndoEnabled = false;
+    
+    BOOL bRet = FALSE;
+
+    try
     {
-        Redo( *pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction++] );
-        return TRUE;
+        if ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
+        {
+            Redo( *pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction++] );
+            bRet = TRUE;
+        }
+    }
+    catch( Exception& e )
+    {
+        mbUndoEnabled = bUndoWasEnabled;
+        throw e;
     }
 
-    return FALSE;
+    mbUndoEnabled = bUndoWasEnabled;
+    return bRet;
 }
 
 //------------------------------------------------------------------------
 
 void SfxUndoManager::Redo( SfxUndoAction &rAction )
 {
-    rAction.Redo();
+    bool bUndoWasEnabled = 	mbUndoEnabled;
+    mbUndoEnabled = false;
+
+    try
+    {
+        rAction.Redo();
+    }
+    catch( Exception& e )
+    {
+        mbUndoEnabled = bUndoWasEnabled;
+        throw e;
+    }
+
+    mbUndoEnabled = bUndoWasEnabled;
 }
 
 //------------------------------------------------------------------------
@@ -492,6 +557,9 @@ void SfxUndoManager::EnterListAction(
 */
 
 {
+    if( !mbUndoEnabled )
+        return;
+
     if ( !pUndoArray->nMaxUndoActions )
         return;
 
@@ -511,6 +579,9 @@ void SfxUndoManager::LeaveListAction()
     Verlaesst die aktuelle ListAction und geht eine Ebene nach oben.
 */
 {
+    if ( !mbUndoEnabled )
+        return;
+
     if ( !pUndoArray->nMaxUndoActions )
         return;
 
@@ -745,3 +816,4 @@ USHORT SfxLinkUndoAction::GetId() const
 }
 
 
+
commit 27e117928e82510762ab2a524b056c107e7afd24
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Thu Jun 4 15:06:14 2009 +0000

    CWS-TOOLING: integrate CWS vcl102
    pl: resync to m49
    pl: #i102082# correct index access
    pl: #i102082# correct index access
    pl: merge tag
    pl: #i101674# update selection background markers for toolbars and menus
    pl: fix debug compile
    pl: #i101461# improve xdg functionality (thanks oblin)
    pl: #i100501# get IsAddStream from configuration setting in direct export case
    pl: #i100725# check for null ptr
    pl: #i100617# fix got lost in merge

diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm
index 066748c..d6f99c7 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm
@@ -178,9 +178,11 @@ static MacOSBOOL isPopupMenuOpen = NO;
 
 -(Reference < XAccessible >)getFirstRadioButtonInGroup {
     Reference < XAccessibleRelationSet > rxAccessibleRelationSet = [ self accessibleContext ] -> getAccessibleRelationSet();
-    AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF );
-    if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) {
-        return Reference < XAccessible > ( relationMemberOf.TargetSet[0], UNO_QUERY );
+    if( rxAccessibleRelationSet.is() )
+    {
+        AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF );
+        if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() )
+            return Reference < XAccessible > ( relationMemberOf.TargetSet[0], UNO_QUERY );
     }
     return Reference < XAccessible > ();
 }
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 77aab2e..582e090 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -346,64 +346,80 @@ void AquaSalGraphics::updateResolution()
 
 void AquaSalGraphics::initResolution( NSWindow* pWin )
 {
-    NSScreen* pScreen = nil;
+    // #i100617# read DPI only once; there is some kind of weird caching going on
+    // if the main screen changes
+    // FIXME: this is really unfortunate and needs to be investigated
     
-    /* #i91301#
-       many woes went into the try to have different resolutions
-       on different screens. The result of these trials is that OOo is not ready
-       for that yet, vcl and applications would need to be adapted.
-       
-       Unfortunately this is not possible in the 3.0 timeframe.
-       So let's stay with one resolution for all Windows and VirtualDevices
-       which is the resolution of the main screen
-       
-       This of course also means that measurements are exact only on the main screen.
-       For activating different resolutions again just comment out the two lines below.
-
-    if( pWin )
-        pScreen = [pWin screen];
-    */
-    if( pScreen == nil )
-    {
-        NSArray* pScreens = [NSScreen screens];
-        if( pScreens )
-            pScreen = [pScreens objectAtIndex: 0];
-    }
-    
-    mnRealDPIX = mnRealDPIY = 96;
-    if( pScreen )
+    SalData* pSalData = GetSalData();
+    if( pSalData->mnDPIX == 0 || pSalData->mnDPIY == 0 )
     {
-        NSDictionary* pDev = [pScreen deviceDescription];
-        if( pDev )
+        NSScreen* pScreen = nil;
+        
+        /* #i91301#
+        many woes went into the try to have different resolutions
+        on different screens. The result of these trials is that OOo is not ready
+        for that yet, vcl and applications would need to be adapted.
+        
+        Unfortunately this is not possible in the 3.0 timeframe.
+        So let's stay with one resolution for all Windows and VirtualDevices
+        which is the resolution of the main screen
+        
+        This of course also means that measurements are exact only on the main screen.
+        For activating different resolutions again just comment out the two lines below.
+        
+        if( pWin )
+        pScreen = [pWin screen];
+        */
+        if( pScreen == nil )
         {
-            NSNumber* pVal = [pDev objectForKey: @"NSScreenNumber"];
-            if( pVal )
+            NSArray* pScreens = [NSScreen screens];
+            if( pScreens )
+                pScreen = [pScreens objectAtIndex: 0];
+        }
+        
+        mnRealDPIX = mnRealDPIY = 96;
+        if( pScreen )
+        {
+            NSDictionary* pDev = [pScreen deviceDescription];
+            if( pDev )
             {
-                // FIXME: casting a long to CGDirectDisplayID is evil, but
-                // Apple suggest to do it this way
-                const CGDirectDisplayID nDisplayID = (CGDirectDisplayID)[pVal longValue];
-                const CGSize aSize = CGDisplayScreenSize( nDisplayID ); // => result is in millimeters
-                mnRealDPIX = static_cast<long>((CGDisplayPixelsWide( nDisplayID ) * 25.4) / aSize.width);
-                mnRealDPIY = static_cast<long>((CGDisplayPixelsHigh( nDisplayID ) * 25.4) / aSize.height);
+                NSNumber* pVal = [pDev objectForKey: @"NSScreenNumber"];
+                if( pVal )
+                {
+                    // FIXME: casting a long to CGDirectDisplayID is evil, but
+                    // Apple suggest to do it this way
+                    const CGDirectDisplayID nDisplayID = (CGDirectDisplayID)[pVal longValue];
+                    const CGSize aSize = CGDisplayScreenSize( nDisplayID ); // => result is in millimeters
+                    mnRealDPIX = static_cast<long>((CGDisplayPixelsWide( nDisplayID ) * 25.4) / aSize.width);
+                    mnRealDPIY = static_cast<long>((CGDisplayPixelsHigh( nDisplayID ) * 25.4) / aSize.height);
+                }
+                else
+                {
+                    DBG_ERROR( "no resolution found in device description" );
+                }
             }
             else
             {
-                DBG_ERROR( "no resolution found in device description" );
+                DBG_ERROR( "no device description" );
             }
         }
         else
         {
-            DBG_ERROR( "no device description" );
+            DBG_ERROR( "no screen found" );
         }
+        
+        // for OSX any anisotropy reported for the display resolution is best ignored (e.g. TripleHead2Go)
+        mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2;
+        
+        pSalData->mnDPIX = mnRealDPIX;
+        pSalData->mnDPIY = mnRealDPIY;
     }
     else
     {
-        DBG_ERROR( "no screen found" );
+        mnRealDPIX = pSalData->mnDPIX;
+        mnRealDPIY = pSalData->mnDPIY;
     }
 
-    // for OSX any anisotropy reported for the display resolution is best ignored (e.g. TripleHead2Go)
-    mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2;
-
     mfFakeDPIScale = 1.0;
 }
 
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 42bc06f..d927ab0 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -983,6 +983,8 @@ public:
     void                DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly );
     // the same, but fills a passed Color with a text color complementing the selection background
     void                DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor );
+    // support rounded edges in the selection rect
+    void                DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
 
     void                ShowTracking( const Rectangle& rRect,
                                       USHORT nFlags = SHOWTRACK_SMALL );
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index e356b34..52d503c 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -49,27 +49,27 @@
 
 
 // =======================================================================
-static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*3] =
+static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
 {
-    0, 0, 0,												// KEYFUNC_DONTKNOW
-    KEY_N | KEY_MOD1, 0, 0, 								// KEYFUNC_NEW
-    KEY_O | KEY_MOD1, KEY_OPEN, 0,							// KEYFUNC_OPEN
-    KEY_S | KEY_MOD1, 0, 0, 								// KEYFUNC_SAVE
-    0, 0, 0,												// KEYFUNC_SAVEAS
-    KEY_P | KEY_MOD1, 0, 0, 								// KEYFUNC_PRINT
-    KEY_W | KEY_MOD1, KEY_F4 | KEY_MOD1, 0, 				// KEYFUNC_CLOSE
-    KEY_Q | KEY_MOD1, KEY_F4 | KEY_MOD2, 0, 				// KEYFUNC_QUIT
-    KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT,		// KEYFUNC_CUT
-    KEY_C | KEY_MOD1, KEY_INSERT | KEY_MOD1, KEY_COPY,		// KEYFUNC_COPY
-    KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE,	// KEYFUNC_PASTE
-    KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO,	// KEYFUNC_UNDO
-    0, 0, 0,												// KEYFUNC_REDO
-    KEY_DELETE, 0, 0,										// KEYFUNC_DELETE
-    KEY_REPEAT, 0, 0,										// KEYFUNC_REPEAT
-    KEY_F | KEY_MOD1, KEY_FIND, 0,							// KEYFUNC_FIND
-    KEY_F | KEY_SHIFT | KEY_MOD1, KEY_SHIFT | KEY_FIND, 0,	// KEYFUNC_FINDBACKWARD
-    KEY_RETURN | KEY_MOD2, 0, 0,							// KEYFUNC_PROPERTIES
-    0, 0, 0 												// KEYFUNC_FRONT
+    0, 0, 0, 0,                                                    // KEYFUNC_DONTKNOW
+    KEY_N | KEY_MOD1, 0, 0, 0,                                     // KEYFUNC_NEW
+    KEY_O | KEY_MOD1, KEY_OPEN, 0, 0,                              // KEYFUNC_OPEN
+    KEY_S | KEY_MOD1, 0, 0, 0,                                     // KEYFUNC_SAVE
+    0, 0, 0, 0,                                                    // KEYFUNC_SAVEAS
+    KEY_P | KEY_MOD1, 0, 0, 0,                                     // KEYFUNC_PRINT
+    KEY_W | KEY_MOD1, KEY_F4 | KEY_MOD1, 0, 0,                     // KEYFUNC_CLOSE
+    KEY_Q | KEY_MOD1, KEY_F4 | KEY_MOD2, 0, 0,                     // KEYFUNC_QUIT
+    KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT, 0,          // KEYFUNC_CUT
+    KEY_C | KEY_MOD1, KEY_INSERT | KEY_MOD1, KEY_COPY, 0,          // KEYFUNC_COPY
+    KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE, 0,        // KEYFUNC_PASTE
+    KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO, 0,       // KEYFUNC_UNDO
+    0, 0, 0, 0,                                                    // KEYFUNC_REDO
+    KEY_DELETE, 0, 0, 0,                                           // KEYFUNC_DELETE
+    KEY_REPEAT, 0, 0, 0,                                           // KEYFUNC_REPEAT
+    KEY_F | KEY_MOD1, KEY_FIND, 0, 0,                              // KEYFUNC_FIND
+    KEY_F | KEY_SHIFT | KEY_MOD1, KEY_SHIFT | KEY_FIND, 0, 0,      // KEYFUNC_FINDBACKWARD
+    KEY_RETURN | KEY_MOD2, 0, 0, 0,                                // KEYFUNC_PROPERTIES
+    0, 0, 0, 0                                                     // KEYFUNC_FRONT
 };
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index b0893db..5f8043f 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2487,23 +2487,8 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
     if( ! bNativeOk )
     {
         const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings();
-        if( i_bHighlight )
-        {
-            i_pWindow->Push( PUSH_ALL );
-            Color aCol = rSettings.GetMenuHighlightTextColor();
-            i_pWindow->SetFillColor( rSettings.GetMenuHighlightTextColor() );
-            if( aCol.IsDark() )
-                aCol.IncreaseLuminance( 128 );
-            else
-                aCol.DecreaseLuminance( 128 );
-            i_pWindow->SetLineColor( aCol );
-            Polygon aPoly( i_rRect );
-            PolyPolygon aPolyPoly( aPoly );
-            i_pWindow->DrawTransparent( aPolyPoly, 20 );
-            i_pWindow->Pop();
-        }
-        else
-            i_pWindow->DrawSelectionBackground( i_rRect, 1, FALSE, TRUE, FALSE );
+        Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() );
+        i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor );
     }
 }
 
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 1b79b37..920816b 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3378,7 +3378,7 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl
     }
 
     if( !bNativeOk )
-        pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow );
+        pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow, 2, NULL, NULL );
 }
 
 void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLayout )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 7e23f7d..57e03a4 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9240,19 +9240,34 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
 
 void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly )
 {
-    DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, NULL );
+    DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL );
 }
 
 void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor )
 {
+    DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, pSelectionTextColor, NULL );
+}
+
+void Window::DrawSelectionBackground( const Rectangle& rRect,
+                                      USHORT highlight,
+                                      BOOL bChecked,
+                                      BOOL bDrawBorder,
+                                      BOOL bDrawExtBorderOnly,
+                                      long nCornerRadius,
+                                      Color* pSelectionTextColor,
+                                      Color* pPaintColor
+                                      )
+{
     if( rRect.IsEmpty() )
         return;
+    
+    bool bRoundEdges = nCornerRadius > 0;
 
     const StyleSettings& rStyles = GetSettings().GetStyleSettings();
 
 
     // colors used for item highlighting
-    Color aSelectionBorderCol( rStyles.GetHighlightColor() );
+    Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() );
     Color aSelectionFillCol( aSelectionBorderCol );
 
     BOOL bDark = rStyles.GetFaceColor().IsDark();
@@ -9261,7 +9276,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
     int c1 = aSelectionBorderCol.GetLuminance();
     int c2 = GetDisplayBackground().GetColor().GetLuminance();
 
-    if( !bDark && !bBright && abs( c2-c1 ) < 75 )
+    if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) )
     {
         // constrast too low
         USHORT h,s,b;
@@ -9272,6 +9287,14 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
         aSelectionBorderCol = aSelectionFillCol;
     }
 
+    if( bRoundEdges )
+    {
+        if( aSelectionBorderCol.IsDark() )
+            aSelectionBorderCol.IncreaseLuminance( 128 );
+        else
+            aSelectionBorderCol.DecreaseLuminance( 128 );
+    }
+
     Rectangle aRect( rRect );
     if( bDrawExtBorderOnly )
     {
@@ -9294,7 +9317,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
         if( bDark )
             aSelectionFillCol = COL_BLACK;
         else
-            nPercent = 80;              // just checked (light)
+            nPercent = bRoundEdges ? 90 : 80;  // just checked (light)
     }
     else
     {
@@ -9309,7 +9332,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
                 nPercent = 0;
             }
             else
-                nPercent = 20;          // selected, pressed or checked ( very dark )
+                nPercent = bRoundEdges ? 50 : 20;          // selected, pressed or checked ( very dark )
         }
         else if( bChecked || highlight == 1 )
         {
@@ -9322,7 +9345,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
                 nPercent = 0;
             }
             else
-                nPercent = 35;          // selected, pressed or checked ( very dark )
+                nPercent = bRoundEdges ? 70 : 35;          // selected, pressed or checked ( very dark )
         }
         else
         {
@@ -9338,7 +9361,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
                     nPercent = 0;
             }
             else
-                nPercent = 70;          // selected ( dark )
+                nPercent = bRoundEdges ? 80 : 70;          // selected ( dark )
         }
     }
 
@@ -9368,9 +9391,18 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
     }
     else
     {
-        Polygon aPoly( aRect );
-        PolyPolygon aPolyPoly( aPoly );
-        DrawTransparent( aPolyPoly, nPercent );
+        if( bRoundEdges )
+        {
+            Polygon aPoly( aRect, nCornerRadius, nCornerRadius );
+            PolyPolygon aPolyPoly( aPoly );
+            DrawTransparent( aPolyPoly, nPercent );
+        }
+        else
+        {
+            Polygon aPoly( aRect );
+            PolyPolygon aPolyPoly( aPoly );
+            DrawTransparent( aPolyPoly, nPercent );
+        }
     }
 
     SetFillColor( oldFillCol );
diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx
index cca2354..22f1c5a 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -248,7 +248,7 @@ extern "C" {
         if( nMajor != 3 || nMinor < 2 || (nMinor == 2 && nMicro < 2) )
         {
 #if OSL_DEBUG_LEVEL > 1
-            fprintf( stderr, "unsuitable qt version %d.%d.%d\n", (int)nMajor, (int)nMinor, (int)nMicro );
+            fprintf( stderr, "unsuitable qt version %"SAL_PRIdINT32".%"SAL_PRIdINT32".%"SAL_PRIdINT32"\n", nMajor, nMinor, nMicro );
 #endif
             return NULL;
         }


More information about the ooo-build-commit mailing list