Commits

Anonymous committed a45693d

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

  • Participants
  • Parent commits cfbbd05

Comments (0)

Files changed (10)

filter/source/pdf/pdffilter.cxx

         aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Magnification" ) ), 0 );
         aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PageLayout" ) ), 0 );
         aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "FirstPageOnLeft" ) ), sal_False );
+        aCfgItem.ReadBool(  String( RTL_CONSTASCII_USTRINGPARAM( "IsAddStream" ) ), sal_False );
 //
 // the encryption is not available when exporting directly, since the encryption is off by default and the selection
 // (encrypt or not) is not persistent; it's available through macro though,

shell/source/backends/gconfbe/gconflayer.cxx

 
         case SETTING_WORK_DIRECTORY:
         {
-            osl::Security aSecurity;
-            rtl::OUString aDocumentsDirURL;
-            if ( aSecurity.getHomeDir( aDocumentsDirURL ) )
-            {
-                aDocumentsDirURL += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/Documents" ) );
-                osl::Directory aDocumentsDir( aDocumentsDirURL );
+            rtl::OUString aDocumentsDirURL = xdg_user_dir_lookup("DOCUMENTS");
+            osl::Directory aDocumentsDir( aDocumentsDirURL );
 
-                if( osl::FileBase::E_None == aDocumentsDir.open() )
-                    return sal_True;
-            }
+            if( osl::FileBase::E_None == aDocumentsDir.open() )
+                return sal_True;
         }
             break;
 

vcl/aqua/source/a11y/aqua11ywrapper.mm

 
 -(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 > ();
 }

vcl/aqua/source/gdi/salgdi.cxx

 
 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 )
+    SalData* pSalData = GetSalData();
+    if( pSalData->mnDPIX == 0 || pSalData->mnDPIY == 0 )
+    {
+        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 )
-    {
-        NSArray* pScreens = [NSScreen screens];
-        if( pScreens )
-            pScreen = [pScreens objectAtIndex: 0];
-    }
-    
-    mnRealDPIX = mnRealDPIY = 96;
-    if( pScreen )
-    {
-        NSDictionary* pDev = [pScreen deviceDescription];
-        if( pDev )
+        */
+        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;
 }
 

vcl/inc/vcl/window.hxx

     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 );

vcl/source/window/keycod.cxx

 
 
 // =======================================================================
-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
 };
 
 // -----------------------------------------------------------------------

vcl/source/window/menu.cxx

     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 );
     }
 }
 

vcl/source/window/toolbox.cxx

     }
 
     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 )

vcl/source/window/window.cxx

 
 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();
     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;
         aSelectionBorderCol = aSelectionFillCol;
     }
 
+    if( bRoundEdges )
+    {
+        if( aSelectionBorderCol.IsDark() )
+            aSelectionBorderCol.IncreaseLuminance( 128 );
+        else
+            aSelectionBorderCol.DecreaseLuminance( 128 );
+    }
+
     Rectangle aRect( rRect );
     if( bDrawExtBorderOnly )
     {
 		if( bDark )
 			aSelectionFillCol = COL_BLACK;
 		else
-			nPercent = 80;              // just checked (light)
+			nPercent = bRoundEdges ? 90 : 80;  // just checked (light)
 	}
     else
     {
                 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 )
 		{
                 nPercent = 0;
             }
             else
-                nPercent = 35;          // selected, pressed or checked ( very dark )
+                nPercent = bRoundEdges ? 70 : 35;          // selected, pressed or checked ( very dark )
 		}
         else
 		{
                     nPercent = 0;
             }
             else
-                nPercent = 70;          // selected ( dark )
+                nPercent = bRoundEdges ? 80 : 70;          // selected ( dark )
 		}
     }
 
 	}
 	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 );

vcl/unx/kde/kdedata.cxx

         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;
         }