Anonymous avatar Anonymous committed d4f6507 Merge

CWS-TOOLING: integrate CWS vcl115

Comments (0)

Files changed (13)

forms/source/component/Currency.cxx

 		try
 		{
 			// get the system international informations
-			const LocaleDataWrapper& aLocaleInfo = SvtSysLocale().GetLocaleData();
+            const SvtSysLocale aSysLocale;
+			const LocaleDataWrapper& aLocaleInfo = aSysLocale.GetLocaleData();
 
 			::rtl::OUString sCurrencySymbol;
 			sal_Bool bPrependCurrencySymbol;

svtools/source/filter.vcl/filter/exportdialog.cxx

 			}
 		}
 	}
-	return awt::Size( aShapesRange.getWidth(), aShapesRange.getHeight() );
+	return awt::Size( static_cast<sal_Int32>(aShapesRange.getWidth()), static_cast<sal_Int32>(aShapesRange.getHeight()) );
 }
 
 void ExportDialog::GetGraphicSource()
 		if ( fXRatio > 1.0 )
 		{
 			aSize.Width() =  maSize.Width > aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
-			aSize.Width() /= fXRatio;
+			aSize.Width() /= static_cast<long int>(fXRatio);
 		}
 		else
 		{
 			aSize.Width() =  maSize.Width < aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width();
-			aSize.Width() /= fXRatio;
+			aSize.Width() /= static_cast<long int>(fXRatio);
 		}
 
 		if ( fYRatio > 1.0 )
 		{
 			aSize.Height() =  maSize.Height > aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
-			aSize.Height() /= fYRatio;
+			aSize.Height() /= static_cast<long int>(fYRatio);
 		}
 		else
 		{
 			aSize.Height() =  maSize.Height < aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height();
-			aSize.Height() /= fYRatio;
+			aSize.Height() /= static_cast<long int>(fYRatio);
 		}
 
 		if ( aSize.Width() < maSize.Width )
 		Bitmap aCroppedBitmap( maBitmap );
 		aCroppedBitmap.Crop( Rectangle( aPos, aSize ) );
 		aSize = aCroppedBitmap.GetSizePixel();
-		aSize = Size( aSize.Width() * fXRatio, aSize.Height() * fYRatio );
+		aSize = Size( static_cast<long int>(aSize.Width() * fXRatio), static_cast<long int>(aSize.Height() * fYRatio) );
 		aCroppedBitmap.Scale( aSize );
 
 		if ( aSize.Width() > aFixedBitmapSize.Width() )
 		case 0 : nResolution = maResolution.Width / 100; break;		// pixels / cm
 		case 2 : nResolution = maResolution.Width; break;			// pixels / meter
 		default:
-		case 1 : nResolution = maResolution.Width * 0.0254; break;	// pixels / inch
+		case 1 : nResolution = static_cast< sal_Int32 >(maResolution.Width * 0.0254); break;	// pixels / inch
 	}
 	maNfResolution.SetValue( nResolution );
 

sw/source/ui/ribbar/inputwin.cxx

     SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl ));
 
 	Size	aSizeTbx = CalcWindowSizePixel();
+	Size 	aEditSize = aEdit.GetSizePixel();
+	Rectangle aItemRect( GetItemRect(FN_FORMULA_CALC) );
+	long nMaxHeight = (aEditSize.Height() > aItemRect.GetHeight()) ? aEditSize.Height() : aItemRect.GetHeight();
+	if( nMaxHeight+2 > aSizeTbx.Height() )
+	    aSizeTbx.Height() = nMaxHeight+2;
 	Size aSize = GetSizePixel();
 	aSize.Height() = aSizeTbx.Height();
 	SetSizePixel( aSize );
+
+	// align edit and item vcentered
 	Size 	aPosSize = aPos.GetSizePixel();
-	Size 	aEditSize = aEdit.GetSizePixel();
-	aPosSize.Height() = aEditSize.Height() = GetItemRect(FN_FORMULA_CALC).GetHeight() - 2;
-
-	Point aPosPos = aPos.GetPosPixel();
-	Point aEditPos= aEdit.GetPosPixel();
-	aPosPos.Y() = aEditPos.Y() = GetItemRect( FN_FORMULA_CALC ).TopLeft().Y() + 1;
+	aPosSize.Height()  = nMaxHeight;
+	aEditSize.Height() = nMaxHeight;
+	Point aPosPos  = aPos.GetPosPixel();
+	Point aEditPos = aEdit.GetPosPixel();
+	aPosPos.Y()    = (aSize.Height() - nMaxHeight)/2 + 1;
+	aEditPos.Y()   = (aSize.Height() - nMaxHeight)/2 + 1;
 	aPos.SetPosSizePixel( aPosPos, aPosSize );
 	aEdit.SetPosSizePixel( aEditPos, aEditSize );
 

vcl/aqua/source/dtrans/aqua_clipboard.cxx

 
 void AquaClipboard::provideDataForType(NSPasteboard* sender, NSString* type)
 {
-  DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent);
-  NSData* pBoardData = NULL;
-  
-  if (dp.get() != NULL)
-  {
-      pBoardData = (NSData*)dp->getSystemData();      
-      [sender setData: pBoardData forType: type];
-  }
+    if( mXClipboardContent.is() )
+    {
+        DataProviderPtr_t dp = mpDataFlavorMapper->getDataProvider(type, mXClipboardContent);
+        NSData* pBoardData = NULL;
+        
+        if (dp.get() != NULL)
+        {
+            pBoardData = (NSData*)dp->getSystemData();      
+            [sender setData: pBoardData forType: type];
+        }
+    }
 }
 
 
 void SAL_CALL AquaClipboard::flushClipboard() 
   throw(RuntimeException)
 {
-  if (mXClipboardContent.is())
+    if (mXClipboardContent.is())
 	{
 	  	Sequence<DataFlavor> flavorList = mXClipboardContent->getTransferDataFlavors();	
 		sal_uInt32 nFlavors = flavorList.getLength();
 		
 		for (sal_uInt32 i = 0; i < nFlavors; i++)
-		  {
+		{
 			NSString* sysType = mpDataFlavorMapper->openOfficeToSystemFlavor(flavorList[i]);
 			
 			if (sysType != NULL)
-			  {
+			{
 				provideDataForType(mPasteboard, sysType);
-			  }
-		  }
+			}
+		}
+		mXClipboardContent.clear();
 	}
 }
 

vcl/source/control/ilstbox.cxx

 
 IMPL_LINK( ImplListBox, LBWindowScrolled, void*, EMPTYARG )
 {
+    long nSet = GetTopEntry();
+    if( nSet > mpVScrollBar->GetRangeMax() )
+        mpVScrollBar->SetRangeMax( GetEntryList()->GetEntryCount() );
 	mpVScrollBar->SetThumbPos( GetTopEntry() );
+	
 	mpHScrollBar->SetThumbPos( GetLeftIndent() );
 
 	maScrollHdl.Call( this );
 		mbVScroll = TRUE;
 
 		// Ueberpruefung des rausgescrollten Bereichs
-		SetTopEntry( GetTopEntry() );	// MaxTop wird geprueft...
+        if( GetEntryList()->GetSelectEntryCount() == 1 &&
+            GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+		    ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+		else
+		    SetTopEntry( GetTopEntry() );	// MaxTop wird geprueft...
 	}
 	else
 	{
 					mbVScroll = TRUE;
 
 					// Ueberpruefung des rausgescrollten Bereichs
-					SetTopEntry( GetTopEntry() );	// MaxTop wird geprueft...
+                    if( GetEntryList()->GetSelectEntryCount() == 1 &&
+                        GetEntryList()->GetSelectEntryPos( 0 ) != LISTBOX_ENTRY_NOTFOUND )
+                        ShowProminentEntry( GetEntryList()->GetSelectEntryPos( 0 ) );
+                    else
+                        SetTopEntry( GetTopEntry() );	// MaxTop wird geprueft...
 				}
 			}
 

vcl/source/gdi/outdev3.cxx

 
         // add font alias if available
         // a font alias should never win against an original font with similar quality
-        if( aMapNames.Len() >= nMapNameIndex )
+        if( aMapNames.Len() <= nMapNameIndex )
             break;
         if( bKeepNewData ) // try to recycle obsoleted object
             pNewData = pNewData->CreateAlias();

vcl/source/glyphs/graphite_layout.cxx

             mvCharDxs[i] = FRound( fXFactor * mvCharDxs[i] );
         }
     }
+    mnWidth = rArgs.mnLayoutWidth;
 }
 
 void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDeltaWidth)

vcl/unx/gtk/app/gtkinst.cxx

 
 #include <rtl/strbuf.hxx>
 
+#include <rtl/uri.hxx>
+
 #if OSL_DEBUG_LEVEL > 1
 #include <stdio.h>
 #endif
 
 void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
 {
+    rtl::OString sGtkURL;
+    rtl_TextEncoding aSystemEnc = osl_getThreadTextEncoding();
+    if ((aSystemEnc == RTL_TEXTENCODING_UTF8) || (rFileUrl.compareToAscii( "file://", 7 ) !=  0))
+        sGtkURL = rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8);
+    else
+    {
+        //Non-utf8 locales are a bad idea if trying to work with non-ascii filenames
+        //Decode %XX components
+        rtl::OUString sDecodedUri = Uri::decode(rFileUrl.copy(7), rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
+        //Convert back to system locale encoding
+        rtl::OString sSystemUrl = rtl::OUStringToOString(sDecodedUri, aSystemEnc);
+        //Encode to an escaped ASCII-encoded URI
+        gchar *g_uri = g_filename_to_uri(sSystemUrl.getStr(), NULL, NULL);
+        sGtkURL = rtl::OString(g_uri);
+        g_free(g_uri);
+    }
 #if GTK_CHECK_VERSION(2,10,0)
     GtkRecentManager *manager = gtk_recent_manager_get_default ();
-    gtk_recent_manager_add_item (manager, rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
+    gtk_recent_manager_add_item (manager, sGtkURL);
     (void)rMimeType;
 #else
     static getDefaultFnc sym_gtk_recent_manager_get_default =
     static addItemFnc sym_gtk_recent_manager_add_item = 
         (addItemFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_add_item");
     if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item)
-    {
-        sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(),
-            rtl::OUStringToOString(rFileUrl, RTL_TEXTENCODING_UTF8).getStr());
-    }
+        sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), sGtkURL);
     else
         X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
 #endif

vcl/unx/gtk/window/gtkframe.cxx

             //
             // i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused.
             // awesome.
-            bool bHack =
-                getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") ||
-                getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz")
-                ;
-            if( nUserTime == 0 && bHack )
+            if( nUserTime == 0 )
             {
                 /* #i99360# ugly workaround an X11 library bug */
                 nUserTime= getDisplay()->GetLastUserEventTime( true );
             }
             lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime );
             
-            if( bHack && ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
+            if( ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
                 m_bSetFocusOnMap = true;
 
             gtk_widget_show( m_pWindow );
                 aHints |= GDK_HINT_MAX_SIZE;
             }
         }
+        if( m_bFullscreen && m_aMaxSize.Width() && m_aMaxSize.Height() )
+        {
+            aGeo.max_width = m_aMaxSize.Width();
+            aGeo.max_height = m_aMaxSize.Height();
+            aHints |= GDK_HINT_MAX_SIZE;
+        }
         if( aHints )
             gtk_window_set_geometry_hints( GTK_WINDOW(m_pWindow),
                                            NULL,

vcl/unx/source/fontmanager/fontcache.cxx

                     xub_StrLen nLastIndex = nIndex+1;
                     for( nIndex = nLastIndex ; nIndex < nLen && pLine[nIndex] != ';'; nIndex++ )
                         ;
-                    if( nIndex - nLastIndex > 1 )
+                    if( nIndex - nLastIndex )
                     {
-                        OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex-1, RTL_TEXTENCODING_UTF8 );
+                        OUString aAlias( pLine+nLastIndex, nIndex-nLastIndex, RTL_TEXTENCODING_UTF8 );
                         pFont->m_aAliases.push_back( pAtoms->getAtom( ATOM_FAMILYNAME, aAlias, sal_True ) );
                     }
                 }

vcl/unx/source/fontmanager/fontconfig.cxx

     FcResult		(*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*);
     void			(*m_pFcDefaultSubstitute)(FcPattern *);
     FcPattern*		(*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*);    
+    FcPattern*		(*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*);    
     FcBool			(*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*);
     FcBool			(*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
     FcBool			(*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool);
+    FcBool			(*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
 
-    FcBool			(*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
+    FcPattern*		(*m_pFcPatternDuplicate)(const FcPattern*);
     FcBool			(*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
     FcBool                    (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
     FcBool                    (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
     FcBool                    (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
     FcBool			(*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
-    FT_UInt         (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
+    FcBool                    (*m_pFcPatternDel)(FcPattern*,const char*);
+
+	FT_UInt         (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32);
 
     oslGenericFunction loadSymbol( const char* );
     void addFontSet( FcSetName );
     { m_pFcDefaultSubstitute( pPattern ); }
     FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult )
     { return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; }
+    FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult )
+    { return m_pFcFontMatch( pConfig, pPattern, pResult ); }
     FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind )
     { return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
+
+    FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const
+    { return m_pFcPatternDuplicate( pPattern ); }
     FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
     { return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
     FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
     { return m_pFcPatternAddBool( pPattern, pObject, nValue ); }
     FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet)
     { return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); }
+	FcBool FcPatternDel(FcPattern* pPattern, const char* object)
+	{ return m_pFcPatternDel( pPattern, object); }
 
     FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 )
     { return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
         loadSymbol( "FcDefaultSubstitute" );
     m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*))
         loadSymbol( "FcFontSetMatch" );
+    m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*))
+        loadSymbol( "FcFontMatch" );
     m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind))
         loadSymbol( "FcConfigSubstitute" );
+
+    m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*))
+        loadSymbol( "FcPatternDuplicate" );
     m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
         loadSymbol( "FcPatternAddInteger" );
     m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
         loadSymbol( "FcPatternAddCharSet" );
     m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*))
         loadSymbol( "FcPatternAddString" );
+    m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*))
+		loadSymbol( "FcPatternDel" );
+
     m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32))
         loadSymbol( "FcFreeTypeCharIndex" );
 
             m_pFcConfigAppFontAddFile				&&
             m_pFcConfigAppFontAddDir				&&
             m_pFcConfigParseAndLoad				&&
+            m_pFcFontMatch					&&
             m_pFcDefaultSubstitute			&&
             m_pFcConfigSubstitute			&&
+            m_pFcPatternDuplicate			&&
             m_pFcPatternAddInteger			&&
             m_pFcPatternAddDouble                     &&
             m_pFcPatternAddCharSet			&&
             m_pFcPatternAddBool 			&&
-            m_pFcPatternAddString
+            m_pFcPatternAddString 			&&
+            m_pFcPatternDel
             ) )
     {
         osl_unloadModule( (oslModule)m_pLib );
     if( !pOrig )
         return;
 
-    for( int i = 0; i < pOrig->nfont; ++i )
-    {
-        FcBool outline = false;
-        FcPattern *pOutlinePattern = pOrig->fonts[i];
-        FcResult eOutRes = 
-                 FcPatternGetBool( pOutlinePattern, FC_OUTLINE, 0, &outline );
-        if( (eOutRes != FcResultMatch) || (outline != FcTrue) )
-            continue;
-        FcPatternReference(pOutlinePattern);
-        FcFontSetAdd(m_pOutlineSet, pOutlinePattern);
-    }
-    // TODO: FcFontSetDestroy( pOrig );
+	// filter the font sets to remove obsolete or duplicate faces
+	for( int i = 0; i < pOrig->nfont; ++i )
+	{
+		FcPattern* pOrigPattern = pOrig->fonts[i];
+		// create a pattern to find eventually better alternatives
+		FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern );
+		FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue );
+		// TODO: use pattern->ImplFontAttr->pattern to filter out
+		//       all attribute that are not interesting for finding dupes
+		FcPatternDel( pTestPattern, FC_FONTVERSION );
+		FcPatternDel( pTestPattern, FC_CHARSET );
+		FcPatternDel( pTestPattern, FC_FILE );
+		// find the font face for the dupe-search pattern
+		FcResult eFcResult = FcResultMatch;
+		FcPattern* pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult );
+		FcPatternDestroy( pTestPattern );
+		if( eFcResult != FcResultMatch )
+			continue;
+		// insert best found pattern for the dupe-search pattern
+		// TODO: skip inserting patterns that are already known in the target fontset
+		FcPatternReference( pBetterPattern );
+		FcFontSetAdd( m_pOutlineSet, pBetterPattern );
+	}
+
+    // TODO?: FcFontSetDestroy( pOrig );
     #else
     (void)eSetName; // prevent compiler warning about unused parameter
     #endif

vcl/win/source/gdi/winlayout.cxx

         // move the visual item by having an offset
         pVI->mnXOffset += nDelta;
     }
+    // move subsequent items - this often isn't necessary because subsequent
+    // moves will correct subsequent items. However, if there is a contiguous
+    // range not involving fallback which spans items, this will be needed
+    while (++pVI - mpVisualItems < mnItemCount)
+    {
+        pVI->mnXOffset += nDelta;
+    }
 }
 
 // -----------------------------------------------------------------------
         if( rVisualItem.IsEmpty() )
             continue;
 
+        if (mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK)
+        {
+            nXPos = rVisualItem.mnXOffset;
+        }
         // get glyph positions
         // TODO: handle when rVisualItem's glyph range is only partially used
         for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i )
         }
     }
 
-    // fixup unknown character positions to neighbor
-    for( i = 0; i < nMaxIdx; ++i )
+    if (!(mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK))
     {
-        if( pCaretXArray[ i ] >= 0 )
-            nXPos = pCaretXArray[ i ];
-        else
-            pCaretXArray[ i ] = nXPos;
+        nXPos = 0;
+        // fixup unknown character positions to neighbor
+        for( i = 0; i < nMaxIdx; ++i )
+        {
+            if( pCaretXArray[ i ] >= 0 )
+                nXPos = pCaretXArray[ i ];
+            else
+                pCaretXArray[ i ] = nXPos;
+        }
     }
 }
 

vcl/win/source/window/salframe.cxx

 // =======================================================================
 
 static void UpdateFrameGeometry( HWND hWnd, WinSalFrame* pFrame );
-static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame );
+static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect = NULL );
 
 static void ImplSaveFrameState( WinSalFrame* pFrame )
 {
             if ( bVisible )
                 pFrame->mnShowState = SW_SHOWMAXIMIZED;
             pFrame->mbRestoreMaximize = TRUE;
+            
+            WINDOWPLACEMENT aPlacement;
+            aPlacement.length = sizeof(aPlacement);
+            if( GetWindowPlacement( pFrame->mhWnd, &aPlacement ) )
+            {
+                RECT aRect = aPlacement.rcNormalPosition;
+                RECT aRect2 = aRect;
+                AdjustWindowRectEx( &aRect2, GetWindowStyle( pFrame->mhWnd ),
+                                    FALSE,  GetWindowExStyle( pFrame->mhWnd ) );
+                long nTopDeco = abs( aRect.top - aRect2.top );
+                long nLeftDeco = abs( aRect.left - aRect2.left );
+                long nBottomDeco = abs( aRect.bottom - aRect2.bottom );
+                long nRightDeco = abs( aRect.right - aRect2.right );
+                
+                pFrame->maState.mnX      = aRect.left + nLeftDeco;
+                pFrame->maState.mnY      = aRect.top + nTopDeco;
+                pFrame->maState.mnWidth  = aRect.right - aRect.left - nLeftDeco - nRightDeco;
+                pFrame->maState.mnHeight = aRect.bottom - aRect.top - nTopDeco - nBottomDeco;
+            }
         }
         else
         {
         }
     }
 
-    // Wenn Fenster nicht minimiert/maximiert ist oder nicht optisch
-    // umgesetzt werden muss, dann SetWindowPos() benutzen, da
-    // SetWindowPlacement() die TaskBar mit einrechnet
+    // if a window is neither minimized nor maximized or need not be
+    // positioned visibly (that is in visible state), do not use
+    // SetWindowPlacement since it calculates including the TaskBar
     if ( !IsIconic( mhWnd ) && !IsZoomed( mhWnd ) &&
          (!bVisible || (aPlacement.showCmd == SW_RESTORE)) )
     {
 		if( bUpdateHiddenFramePos )
 		{
+		    RECT aStateRect;
+		    aStateRect.left   = nX;
+		    aStateRect.top    = nY;
+		    aStateRect.right  = nX+nWidth;
+		    aStateRect.bottom = nY+nHeight;
 			// #96084 set a useful internal window size because
 			// the window will not be maximized (and the size updated) before show()
-            SetMaximizedFrameGeometry( mhWnd, this );
+            SetMaximizedFrameGeometry( mhWnd, this, &aStateRect );
+			SetWindowPos( mhWnd, 0,
+                          maGeometry.nX, maGeometry.nY, maGeometry.nWidth, maGeometry.nHeight,
+                          SWP_NOZORDER | SWP_NOACTIVATE | nPosSize );
 		}
 		else
 			SetWindowPos( mhWnd, 0,
 
 // -----------------------------------------------------------------------
 
-static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame )
+static void SetMaximizedFrameGeometry( HWND hWnd, WinSalFrame* pFrame, RECT* pParentRect )
 {
     // calculate and set frame geometry of a maximized window - useful if the window is still hidden
 
     // dualmonitor support:
     // Get screensize of the monitor whith the mouse pointer
 
-    POINT pt;
-    GetCursorPos( &pt );
     RECT aRectMouse;
-    aRectMouse.left = pt.x;
-    aRectMouse.top = pt.y;
-    aRectMouse.right = pt.x+2;
-    aRectMouse.bottom = pt.y+2;
+    if( ! pParentRect )
+    {
+        POINT pt;
+        GetCursorPos( &pt );
+        aRectMouse.left = pt.x;
+        aRectMouse.top = pt.y;
+        aRectMouse.right = pt.x+2;
+        aRectMouse.bottom = pt.y+2;
+        pParentRect = &aRectMouse;
+    }
 
     RECT aRect;
-    ImplSalGetWorkArea( hWnd, &aRect, &aRectMouse );
+    ImplSalGetWorkArea( hWnd, &aRect, pParentRect );
 
     // a maximized window has no other borders than the caption
     pFrame->maGeometry.nLeftDecoration = pFrame->maGeometry.nRightDecoration = pFrame->maGeometry.nBottomDecoration = 0;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.