[ooo-build-commit] .: 4 commits - rsc/inc rsc/source tools/inc vcl/inc vcl/source vcl/unx

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Sep 14 05:20:24 PDT 2010


 rsc/inc/rscdb.hxx                        |    1 
 rsc/inc/vclrsc.hxx                       |    5 +++
 rsc/source/parser/rscicpx.cxx            |    1 
 rsc/source/parser/rscinit.cxx            |    2 +
 tools/inc/tools/wintypes.hxx             |    2 +
 vcl/inc/vcl/brdwin.hxx                   |    3 +-
 vcl/inc/vcl/floatwin.hxx                 |    3 +-
 vcl/source/app/settings.cxx              |    2 -
 vcl/source/gdi/bitmap2.cxx               |   18 ++++++++----
 vcl/source/window/brdwin.cxx             |   46 ++++++++++++++++++++++++-------
 vcl/source/window/floatwin.cxx           |    8 ++++-
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |    6 ++--
 vcl/unx/kde/salnativewidgets-kde.cxx     |    9 ++++--
 vcl/unx/kde4/KDESalFrame.cxx             |   14 ++++-----
 vcl/unx/source/plugadapt/salplug.cxx     |    8 +++--
 15 files changed, 93 insertions(+), 35 deletions(-)

New commits:
commit fe8cc3e5e63a98b863056c68f92f4bc967c7f3b9
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Sep 14 11:47:36 2010 +0200

    toolbar-decorations-vcl.diff: Improved toolbar popups.

diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index 343a795..87a9bbe 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -193,6 +193,7 @@ typedef sal_Int64 WinBits;
 #define WB_OWNERDRAWDECORATION  ((WinBits)SAL_CONST_INT64(0x2000000000))
 #define WB_DEFAULTWIN           ((WinBits)SAL_CONST_INT64(0x4000000000))
 #define WB_NEEDSFOCUS           ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_POPUP                ((WinBits)SAL_CONST_INT64(0x20000000))
 
 #define WB_HSCROLL				WB_HORZ
 #define WB_VSCROLL				WB_VERT
@@ -272,6 +273,7 @@ typedef sal_Int64 WinBits;
 #define WB_STDMODAL 			(WB_STDDIALOG)
 #define WB_STDTABDIALOG 		(WB_STDDIALOG)
 #define WB_STDTABCONTROL		0
+#define WB_STDPOPUP				(WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL)
 
 // For TreeListBox
 #define WB_HASBUTTONS			((WinBits)0x00800000)
diff --git a/vcl/inc/vcl/brdwin.hxx b/vcl/inc/vcl/brdwin.hxx
index d5ea7f8..1202f9a 100644
--- a/vcl/inc/vcl/brdwin.hxx
+++ b/vcl/inc/vcl/brdwin.hxx
@@ -84,7 +84,8 @@ class ImplBorderWindowView;
 #define BORDERWINDOW_TITLE_NORMAL			((USHORT)0x0001)
 #define BORDERWINDOW_TITLE_SMALL			((USHORT)0x0002)
 #define BORDERWINDOW_TITLE_TEAROFF			((USHORT)0x0004)
-#define BORDERWINDOW_TITLE_NONE 			((USHORT)0x0008)
+#define BORDERWINDOW_TITLE_POPUP			((USHORT)0x0008)
+#define BORDERWINDOW_TITLE_NONE 			((USHORT)0x0010)
 
 // --------------------
 // - ImplBorderWindow -
diff --git a/vcl/inc/vcl/floatwin.hxx b/vcl/inc/vcl/floatwin.hxx
index c0cfd57..51f1953 100644
--- a/vcl/inc/vcl/floatwin.hxx
+++ b/vcl/inc/vcl/floatwin.hxx
@@ -65,7 +65,8 @@ class PopupModeEvent;
 
 #define FLOATWIN_TITLE_NORMAL					((USHORT)0x0001)
 #define FLOATWIN_TITLE_TEAROFF					((USHORT)0x0002)
-#define FLOATWIN_TITLE_NONE 					((USHORT)0x0004)
+#define FLOATWIN_TITLE_POPUP					((USHORT)0x0004)
+#define FLOATWIN_TITLE_NONE 					((USHORT)0x0008)
 
 // ------------------
 // - FloatingWindow -
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index edc25f4..a1a175f 100755
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -562,8 +562,8 @@ void ImplStyleData::SetStandardStyles()
     maPushButtonFont            = aStdFont;
     maFieldFont                 = aStdFont;
     maIconFont                  = aStdFont;
-    maFloatTitleFont            = aStdFont;
     aStdFont.SetWeight( WEIGHT_BOLD );
+    maFloatTitleFont            = aStdFont;
     maTitleFont                 = aStdFont;
 
     maFaceColor                 = Color( COL_LIGHTGRAY );
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 1b5e03b..cb43ab8 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -211,7 +211,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData )
 {
     ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
 
-    if ( !(pBorderWindow->GetStyle() & WB_MOVEABLE) ||
+    if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) ||
           (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
     {
         pData->mnTitleType	 = BORDERWINDOW_TITLE_NONE;
@@ -276,7 +276,7 @@ USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Poin
 
         // no corner resize for floating toolbars, which would lead to jumps while formatting
         // setting nSizeWidth = 0 will only return pure left,top,right,bottom
-        if( pBorderWindow->GetStyle() & WB_OWNERDRAWDECORATION )
+        if( pBorderWindow->GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP) )
             nSizeWidth = 0;
 
         if ( rPos.X() < pData->mnLeftBorder )
@@ -1494,7 +1494,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
     pData->mnTitleType		= pBorderWindow->mnTitleType;
     pData->mbFloatWindow	= pBorderWindow->mbFloatWindow;
 
-    if ( !(pBorderWindow->GetStyle() & WB_MOVEABLE) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
+    if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
         pData->mnBorderSize = 0;
     else if ( pData->mnTitleType == BORDERWINDOW_TITLE_TEAROFF )
         pData->mnBorderSize = 0;
@@ -1519,7 +1519,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
 
         // set a proper background for drawing
         // highlighted buttons in the title
-        pBorderWindow->SetBackground( rStyleSettings.GetWindowColor() );
+        pBorderWindow->SetBackground( rStyleSettings.GetFaceColor() );
 
         pData->maTitleRect.Left()	 = pData->mnLeftBorder;
         pData->maTitleRect.Right()	 = nWidth-pData->mnRightBorder-1;
@@ -1662,19 +1662,43 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
     Rectangle				aInRect( aTmpPoint, Size( pData->mnWidth, pData->mnHeight ) );
     const StyleSettings&	rStyleSettings = pData->mpOutDev->GetSettings().GetStyleSettings();
     DecorationView			aDecoView( pDev );
-    Color                   aFrameColor( rStyleSettings.GetFaceColor() );
+    Color                   aFaceColor( rStyleSettings.GetFaceColor() );
+    Color                   aFrameColor( aFaceColor );
 
     aFrameColor.DecreaseContrast( (UINT8) (0.50 * 255));
 
     // Draw Frame
     if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME )
     {
+        Region oldClipRgn( pDev->GetClipRegion( ) );
+
+        // for popups, don't draw part of the frame
+        if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP )
+        {
+            FloatingWindow *pWin = dynamic_cast< FloatingWindow* >( pData->mpBorderWindow->GetWindow( WINDOW_CLIENT ) );
+            if ( pWin )
+            {
+                Region aClipRgn( aInRect );
+                Rectangle aItemClipRect( pWin->ImplGetItemEdgeClipRect() );
+                if( !aItemClipRect.IsEmpty() )
+                {
+                    aItemClipRect.SetPos( pData->mpBorderWindow->AbsoluteScreenToOutputPixel( aItemClipRect.TopLeft() ) );
+                    aClipRgn.Exclude( aItemClipRect );
+                    pDev->SetClipRegion( aClipRgn );
+                }
+            }
+        }
+
         // single line frame
         pDev->SetLineColor( aFrameColor );
         pDev->SetFillColor();
         pDev->DrawRect( aInRect );
         aInRect.nLeft++; aInRect.nRight--;
         aInRect.nTop++; aInRect.nBottom--;
+
+        // restore
+        if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP )
+            pDev->SetClipRegion( oldClipRgn );
     }
     else
         aInRect = aDecoView.DrawFrame( aInRect, FRAME_DRAW_DOUBLEOUT | FRAME_DRAW_NODRAW);
@@ -1701,7 +1725,11 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD
         aInRect = pData->maTitleRect;
 
         // use no gradient anymore, just a static titlecolor
-        pDev->SetFillColor( aFrameColor );
+        if ( pData->mnTitleType != BORDERWINDOW_TITLE_POPUP )
+            pDev->SetFillColor( aFrameColor );
+        else
+            pDev->SetFillColor( aFaceColor );
+
         pDev->SetTextColor( rStyleSettings.GetButtonTextColor() );
         Rectangle aTitleRect( pData->maTitleRect );
         if( pOffset )
@@ -1836,7 +1864,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
 {
     // Alle WindowBits entfernen, die wir nicht haben wollen
     WinBits nOrgStyle = nStyle;
-    WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW  | WB_NEEDSFOCUS);
+    WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW  | WB_NEEDSFOCUS | WB_POPUP);
     if ( nTypeStyle & BORDERWINDOW_STYLE_APP )
         nTestStyle |= WB_APP;
     nStyle &= nTestStyle;
@@ -1851,7 +1879,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
             mpWindowImpl->mbFrame       = TRUE;
             mbFrameBorder               = FALSE;
         }
-        else if( (nStyle & WB_OWNERDRAWDECORATION) )
+        else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
         {
             mpWindowImpl->mbOverlapWin	= TRUE;
             mpWindowImpl->mbFrame 		= TRUE;
@@ -2103,7 +2131,7 @@ void ImplBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
          ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
           (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
     {
-        if ( !mpWindowImpl->mbFrame || (GetStyle() & WB_OWNERDRAWDECORATION) )
+        if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
             UpdateView( TRUE, ImplGetWindow()->GetOutputSizePixel() );
     }
 
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 00785a6..394deb5 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -138,7 +138,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
     mpNextFloat             = NULL;
     mpFirstPopupModeWin     = NULL;
     mnPostId                = 0;
-    mnTitle                 = (nStyle & WB_MOVEABLE) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
+    mnTitle                 = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
     mnOldTitle              = mnTitle;
     mnPopupModeFlags        = 0;
     mbInPopupMode           = FALSE;
@@ -652,6 +652,8 @@ void FloatingWindow::SetTitleType( USHORT nTitle )
             nTitleStyle = BORDERWINDOW_TITLE_SMALL;
         else if ( nTitle == FLOATWIN_TITLE_TEAROFF )
             nTitleStyle = BORDERWINDOW_TITLE_TEAROFF;
+        else if ( nTitle == FLOATWIN_TITLE_POPUP )
+            nTitleStyle = BORDERWINDOW_TITLE_POPUP;
         else // nTitle == FLOATWIN_TITLE_NONE
             nTitleStyle = BORDERWINDOW_TITLE_NONE;
         ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetTitleType( nTitleStyle, aOutSize );
@@ -672,7 +674,9 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
 
     // remove title 
     mnOldTitle = mnTitle;
-    if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF )
+    if ( ( mpWindowImpl->mnStyle & WB_POPUP ) && GetText().Len() )
+        SetTitleType( FLOATWIN_TITLE_POPUP );
+    else if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF )
         SetTitleType( FLOATWIN_TITLE_TEAROFF );
     else
         SetTitleType( FLOATWIN_TITLE_NONE );
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index b35afa6..5ca3223 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3571,8 +3571,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
 
     aStyleSet.SetAppFont( aFont );
     aStyleSet.SetHelpFont( aFont );
-    aStyleSet.SetTitleFont( aFont );
-    aStyleSet.SetFloatTitleFont( aFont );
     aStyleSet.SetMenuFont( aFont );
     aStyleSet.SetToolFont( aFont );
     aStyleSet.SetLabelFont( aFont );
@@ -3583,6 +3581,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
     aStyleSet.SetIconFont( aFont );
     aStyleSet.SetGroupFont( aFont );
 
+    aFont.SetWeight( WEIGHT_BOLD );
+    aStyleSet.SetTitleFont( aFont );
+    aStyleSet.SetFloatTitleFont( aFont );
+
     // get cursor blink time
     GtkSettings *pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gEditBoxWidget );
     gboolean blink = false;
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 9226666..a9c3f69 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1943,9 +1943,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
 
     aStyleSettings.SetAppFont( aFont );
     aStyleSettings.SetHelpFont( aFont );
-    if( !bSetTitleFont )
-        aStyleSettings.SetTitleFont( aFont );
-    aStyleSettings.SetFloatTitleFont( aFont );
     aStyleSettings.SetMenuFont( aFont ); // will be changed according to pMenuBar
     aStyleSettings.SetToolFont( aFont ); // will be changed according to pToolBar
     aStyleSettings.SetLabelFont( aFont );
@@ -1955,6 +1952,12 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
     aStyleSettings.SetFieldFont( aFont );
     aStyleSettings.SetIconFont( aFont );
     aStyleSettings.SetGroupFont( aFont );
+
+    aFont.SetWeight( WEIGHT_BOLD );
+    if( !bSetTitleFont )
+        aStyleSettings.SetTitleFont( aFont );
+    aStyleSettings.SetFloatTitleFont( aFont );
+
     int flash_time = QApplication::cursorFlashTime();
     aStyleSettings.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
 
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 9e86bb4..b348ac2 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -288,12 +288,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
     style.SetAppFont( aFont );
     style.SetHelpFont( aFont );
     
-    if( !bSetTitleFont )
-    {
-        style.SetTitleFont( aFont );
-    }
-    
-    style.SetFloatTitleFont( aFont );
     style.SetMenuFont( aFont ); // will be changed according to pMenuBar
     //style.SetToolFont( aFont ); //already set above
     style.SetLabelFont( aFont );
@@ -303,6 +297,13 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
     style.SetFieldFont( aFont );
     style.SetIconFont( aFont );
     style.SetGroupFont( aFont );
+
+    aFont.SetWeight( WEIGHT_BOLD );
+    if( !bSetTitleFont )
+    {
+        style.SetTitleFont( aFont );
+    }
+    style.SetFloatTitleFont( aFont );
     
     int flash_time = QApplication::cursorFlashTime();
     style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
@@ -402,4 +403,4 @@ SalGraphics* KDESalFrame::GetGraphics()
     }
     
     return NULL;
-}
\ No newline at end of file
+}
commit e95610564f098bfb5bb5942d8ae05290d423f28c
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Sep 14 11:46:59 2010 +0200

    toolbar-decorations-rsc.diff: Improved toolbar popups.

diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index a5c60a3..3b6a235 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -97,6 +97,7 @@ class RscTypCont
     Atom				nMinimizeId;
     Atom				nMaximizeId;
     Atom				nCloseableId;
+    Atom				nStdPopupId;
     Atom				nAppId;
     Atom				nTabstopId;
     Atom				nGroupId;
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index d565984..6ffd933 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -84,6 +84,10 @@ typedef sal_Int64 WinBits;
 #define WB_AUTOVSCROLL          ((WinBits)0x40000000)
 
 #define WB_HIDE 				((WinBits)0x80000000)
+
+// system floating window
+#define WB_POPUP                ((WinBits)0x20000000)
+
 #define WB_HSCROLL				WB_HORZ
 #define WB_VSCROLL				WB_VERT
 #define WB_TOPIMAGE 			WB_TOP
@@ -152,6 +156,7 @@ typedef sal_Int64 WinBits;
 #define WB_STDMODAL 			(WB_STDDIALOG)
 #define WB_STDTABDIALOG 		(WB_STDDIALOG)
 #define WB_STDTABCONTROL		0
+#define WB_STDPOPUP				(WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL)
 
 // For TreeListBox
 #define WB_HASBUTTONS			((WinBits)0x00800000)
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 3fe30fb..ccebdb8 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -2218,6 +2218,7 @@ RscTop * RscTypCont::InitClassFloatingWindow( RscTop * pSuper,
     INS_WINBIT(pClassFloatingWindow,Zoomable)
     INS_WINBIT(pClassFloatingWindow,HideWhenDeactivate)
     INS_WINBIT(pClassFloatingWindow,EnableResizing)
+    INS_WINBIT(pClassFloatingWindow,StdPopup)
 
     return pClassFloatingWindow;
 }
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 0974729..7a57b4e 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -374,6 +374,8 @@ void RscTypCont::Init()
     aWinBits.SetConstant( nSingleLineId, sal::static_int_cast<INT32>(WB_SINGLELINE) );
     nSysWinId           = pHS->getID( "WB_SYSTEMWINDOW" );
     aWinBits.SetConstant( nSysWinId, sal::static_int_cast<INT32>(WB_SYSTEMWINDOW) );
+    nStdPopupId			= pHS->getID( "WB_STDPOPUP" );
+    aWinBits.SetConstant( nStdPopupId, sal::static_int_cast<INT32>(WB_STDPOPUP) );
 }
 {
     /********** I n i t   B a s i c   T y p e s **************************/
commit dfc0ee2aea3d17792513db8d12154b1d0087e585
Author: Florian Reuter <freuter at novell.com>
Date:   Tue Sep 14 11:34:48 2010 +0200

    vcl-bitmap2-negative-height.diff: Load bitmaps even when height is negative
    
    n#228839

diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index 44a2926..558aebc 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -172,7 +172,7 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset )
     {
         const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) );
 
-        const Size			aSizePixel( aHeader.nWidth, aHeader.nHeight );
+        const Size			aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) );
         BitmapPalette		aDummyPal;
         Bitmap				aNewBmp( aSizePixel, nBitCount, &aDummyPal );
         BitmapWriteAccess*	pAcc = aNewBmp.AcquireWriteAccess();
@@ -244,7 +244,7 @@ BOOL Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, ULONG nOffset )
                                       Fraction( 1000, aHeader.nYPelsPerMeter ) );
 
                     aNewBmp.SetPrefMapMode( aMapMode );
-                    aNewBmp.SetPrefSize( Size( aHeader.nWidth, aHeader.nHeight ) );
+                    aNewBmp.SetPrefSize( Size( aHeader.nWidth, abs(aHeader.nHeight) ) );
                 }
             }
 
@@ -365,7 +365,7 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal
         else
         {
             rIStm >> rHeader.nWidth;
-            rIStm >> rHeader.nHeight;
+            rIStm >> rHeader.nHeight; //rHeader.nHeight=abs(rHeader.nHeight);
             rIStm >> rHeader.nPlanes;
             rIStm >> rHeader.nBitCount;
             rIStm >> rHeader.nCompression;
@@ -461,7 +461,13 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
         if( rHeader.nColsUsed && rHeader.nBitCount > 8 )
             rIStm.SeekRel( rHeader.nColsUsed * ( ( rHeader.nSize != DIBCOREHEADERSIZE ) ? 4 : 3 ) );
 
-        rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth );
+        if ( rHeader.nHeight > 0 )
+            rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth );
+        else
+        {
+            for( int i = abs(rHeader.nHeight)-1; i >= 0; i-- )
+                rIStm.Read( ((char*)rAcc.GetBuffer()) + (nAlignedWidth*i), nAlignedWidth );
+        }
     }
     else
     {
@@ -504,7 +510,7 @@ BOOL Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWri
         else
         {
             const long	nWidth = rHeader.nWidth;
-            const long	nHeight = rHeader.nHeight;
+            const long	nHeight = abs(rHeader.nHeight);
             BYTE*		pBuf = new BYTE[ nAlignedWidth ];
 
             // true color DIB's can have a (optimization) palette
@@ -1061,7 +1067,7 @@ void Bitmap::ImplDecodeRLE( BYTE* pBuffer, DIBInfoHeader& rHeader,
                             BitmapWriteAccess& rAcc, BOOL bRLE4 )
 {
     Scanline	pRLE = pBuffer;
-    long		nY = rHeader.nHeight - 1L;
+    long		nY = abs(rHeader.nHeight) - 1L;
     const ULONG	nWidth = rAcc.Width();
     ULONG		nCountByte;
     ULONG		nRunByte;
commit 79ceee2d88d777bf4872ca4b9f4a669b0dab9530
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Sep 14 11:25:20 2010 +0200

    vcl-better-fallback.diff: Try all when some of the plugins are not available
    
    i#50857

diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx
index 683d8e2..a93b2fa 100644
--- a/vcl/unx/source/plugadapt/salplug.cxx
+++ b/vcl/unx/source/plugadapt/salplug.cxx
@@ -233,9 +233,11 @@ SalInstance *CreateSalInstance()
     if( ! pInst )
         pInst = autodetect_plugin();
     
-    // fallback to gen
-    if( ! pInst )
-        pInst = tryInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "gen" ) ) );
+    // fallback, try everything
+    const char* pPlugin[] = { "gtk", "kde", "gen", 0 };
+
+    for ( int i = 0; !pInst && pPlugin[ i ]; ++i )
+        pInst = tryInstance( OUString::createFromAscii( pPlugin[ i ] ) );
 
     if( ! pInst )
     {


More information about the ooo-build-commit mailing list