diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2009-11-13 15:46:58 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2009-11-13 15:46:58 +0100 |
commit | 0b93d9ef2d826b697ea9f27bb8b22b153a1533a4 (patch) | |
tree | b4d72a987a26bd77b111c8fedbf1a35772b76c4c | |
parent | d2b148f667115467247e985816595fd951f9bd7b (diff) | |
parent | 24534f00dd8799b3c2b2365ccd8c0009e19cddd5 (diff) |
merge with DEV300_m64
-rwxr-xr-x | canvas/source/directx/dx_9rm.cxx | 42 | ||||
-rwxr-xr-x | canvas/source/directx/dx_surfacegraphics.cxx | 5 | ||||
-rw-r--r-- | comphelper/source/misc/uieventslogger.cxx | 30 | ||||
-rw-r--r-- | i18npool/source/calendar/calendar_gregorian.cxx | 25 | ||||
-rw-r--r-- | rsc/inc/rscerror.h | 14 | ||||
-rw-r--r-- | rsc/source/parser/erscerr.cxx | 13 | ||||
-rw-r--r-- | rsc/source/parser/rscyacc.cxx | 2 | ||||
-rw-r--r-- | rsc/source/prj/gui.cxx | 16 | ||||
-rw-r--r-- | rsc/source/prj/start.cxx | 88 | ||||
-rw-r--r-- | rsc/source/rsc/rsc.cxx | 51 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 9 | ||||
-rw-r--r-- | vcl/inc/vcl/window.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/region.cxx | 13 | ||||
-rw-r--r-- | vcl/source/window/makefile.mk | 6 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 51 | ||||
-rw-r--r-- | vcl/unx/inc/plugins/gtk/gtkframe.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/source/gdi/makefile.mk | 4 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 12 |
19 files changed, 270 insertions, 116 deletions
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index 932a15e1f5c1..acef323ddc1b 100755 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -956,11 +956,43 @@ namespace dxcanvas { if(hr != D3DERR_DEVICELOST) return false; - hr = mpDevice->Reset(&mad3dpp); - if(SUCCEEDED(hr)) - return true; - if(hr == D3DERR_DEVICELOST) - return true; + + // interestingly enough, sometimes the Reset() below + // *still* causes DeviceLost errors. So, cycle until + // DX was kind enough to really reset the device... + do + { + mpVertexBuffer.reset(); + hr = mpDevice->Reset(&mad3dpp); + if(SUCCEEDED(hr)) + { + IDirect3DVertexBuffer9 *pVB(NULL); + DWORD aFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1); + if( FAILED(mpDevice->CreateVertexBuffer(sizeof(dxvertex)*maNumVertices, + D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, + aFVF, + D3DPOOL_DEFAULT, + &pVB, + NULL)) ) + { + throw lang::NoSupportException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "Could not create DirectX device - out of memory!")),NULL); + } + mpVertexBuffer=COMReference<IDirect3DVertexBuffer9>(pVB); + + // retry after the restore + if(SUCCEEDED(mpSwapChain->Present(&aRect,&aRect,NULL,NULL,0))) + return true; + } + + TimeValue aTimeout; + aTimeout.Seconds=1; + aTimeout.Nanosec=0; + osl_waitThread(&aTimeout); + } + while(hr == D3DERR_DEVICELOST); + return false; } diff --git a/canvas/source/directx/dx_surfacegraphics.cxx b/canvas/source/directx/dx_surfacegraphics.cxx index 128095c1315d..8b9af6be6827 100755 --- a/canvas/source/directx/dx_surfacegraphics.cxx +++ b/canvas/source/directx/dx_surfacegraphics.cxx @@ -34,6 +34,8 @@ #include "dx_surfacegraphics.hxx" #include "dx_impltools.hxx" +using namespace ::com::sun::star; + namespace dxcanvas { namespace @@ -75,11 +77,12 @@ namespace dxcanvas tools::setupGraphics( *pGraphics ); pRet.reset(pGraphics, GraphicsDeleter(rSurface, aHDC)); + return pRet; } else rSurface->ReleaseDC( aHDC ); } - return pRet; + throw uno::RuntimeException(); } } diff --git a/comphelper/source/misc/uieventslogger.cxx b/comphelper/source/misc/uieventslogger.cxx index ae351340bc7a..b88abff17f4a 100644 --- a/comphelper/source/misc/uieventslogger.cxx +++ b/comphelper/source/misc/uieventslogger.cxx @@ -383,6 +383,16 @@ namespace comphelper logdata[3] = URL_FILE; else logdata[3] = url.Main; + OSL_TRACE("UiEventsLogger Logging: %s,%s,%s,%s,%s,%s,%s,%s", + OUStringToOString(logdata[0],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[1],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[2],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[3],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[4],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[5],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[6],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[7],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[8],RTL_TEXTENCODING_UTF8).getStr()); m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata)); m_SessionLogEventCount++; } @@ -391,6 +401,16 @@ namespace comphelper { Sequence<OUString> logdata = Sequence<OUString>(COLUMNS); logdata[0] = ETYPE_ROTATED; + OSL_TRACE("UiEventsLogger Logging: %s,%s,%s,%s,%s,%s,%s,%s", + OUStringToOString(logdata[0],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[1],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[2],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[3],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[4],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[5],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[6],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[7],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[8],RTL_TEXTENCODING_UTF8).getStr()); m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata)); } @@ -412,6 +432,16 @@ namespace comphelper logdata[6] = id; logdata[7] = method; logdata[8] = param; + OSL_TRACE("UiEventsLogger Logging: %s,%s,%s,%s,%s,%s,%s,%s", + OUStringToOString(logdata[0],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[1],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[2],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[3],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[4],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[5],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[6],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[7],RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(logdata[8],RTL_TEXTENCODING_UTF8).getStr()); m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata)); m_SessionLogEventCount++; } diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 50b61eae5cf1..e52cd4938f2a 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -531,8 +531,8 @@ void Calendar_gregorian::setValue() throw(RuntimeException) bool bNeedZone = !(fieldSet & (1 << CalendarFieldIndex::ZONE_OFFSET)); bool bNeedDST = !(fieldSet & (1 << CalendarFieldIndex::DST_OFFSET)); - sal_Int32 nZone1, nDST1, nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone, nDST; - nZone1 = nDST1 = nZone = nDST = 0; + sal_Int32 nZone1, nDST1, nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone0, nDST0; + nZone1 = nDST1 = nZone0 = nDST0 = 0; nYear = nMonth = nDay = nHour = nMinute = nSecond = nMilliSecond = -1; if ( bNeedZone || bNeedDST ) { @@ -581,19 +581,19 @@ void Calendar_gregorian::setValue() throw(RuntimeException) } if ( !(fieldSet & (1 << CalendarFieldIndex::ZONE_OFFSET)) ) { - nZone = body->get( UCAL_ZONE_OFFSET, status = U_ZERO_ERROR); + nZone0 = body->get( UCAL_ZONE_OFFSET, status = U_ZERO_ERROR); if ( !U_SUCCESS(status) ) - nZone = 0; + nZone0 = 0; } if ( !(fieldSet & (1 << CalendarFieldIndex::DST_OFFSET)) ) { - nDST = body->get( UCAL_DST_OFFSET, status = U_ZERO_ERROR); + nDST0 = body->get( UCAL_DST_OFFSET, status = U_ZERO_ERROR); if ( !U_SUCCESS(status) ) - nDST = 0; + nDST0 = 0; } // Submit values to obtain a time zone and DST corresponding to the date/time. - submitValues( nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone, nDST); + submitValues( nYear, nMonth, nDay, nHour, nMinute, nSecond, nMilliSecond, nZone0, nDST0); DUMP_ICU_CAL_MSG(("%s\n","setValue() in bNeedZone||bNeedDST after submitValues()")); DUMP_I18N_CAL_MSG(("%s\n","setValue() in bNeedZone||bNeedDST after submitValues()")); @@ -605,7 +605,8 @@ void Calendar_gregorian::setValue() throw(RuntimeException) nDST1 = 0; } - // The original submission, may lead to a different zone/DST. + // The original submission, may lead to a different zone/DST and + // different date. submitFields(); DUMP_ICU_CAL_MSG(("%s\n","setValue() after original submission")); DUMP_I18N_CAL_MSG(("%s\n","setValue() after original submission")); @@ -619,7 +620,7 @@ void Calendar_gregorian::setValue() throw(RuntimeException) sal_Int32 nDST2 = body->get( UCAL_DST_OFFSET, status = U_ZERO_ERROR); if ( !U_SUCCESS(status) ) nDST2 = nDST1; - if ( nZone2 != nZone1 || nDST2 != nDST1 ) + if ( nZone0 != nZone1 || nZone2 != nZone1 || nDST0 != nDST1 || nDST2 != nDST1 ) { // Due to different DSTs, resulting date values may differ if // DST is onset at 00:00 and the very onsetRule date was @@ -627,6 +628,12 @@ void Calendar_gregorian::setValue() throw(RuntimeException) // is not what we want. // Resubmit all values, this time including DST => date 01:00 // Similar for zone differences. + // If already the first full submission with nZone0 and nDST0 + // lead to date-1 23:00, the original submission was based on + // that date if it wasn't a full date (nDST0 set, nDST1 not + // set, nDST2==nDST1). If it was January 1st without year we're + // even off by one year now. Resubmit all values including new + // DST => date 00:00. // Set field values accordingly in case they were used. if (!bNeedZone) diff --git a/rsc/inc/rscerror.h b/rsc/inc/rscerror.h index 0e81066cbca8..a957e2c7b202 100644 --- a/rsc/inc/rscerror.h +++ b/rsc/inc/rscerror.h @@ -120,9 +120,17 @@ public: class RscId; class RscTop; +enum RscVerbosity +{ + RscVerbositySilent = 0, + RscVerbosityNormal = 1, + RscVerbosityVerbose = 2 +}; + class RscError { FILE * fListing; + RscVerbosity m_verbosity; void WriteError( const ERRTYPE& rError, const char * pMessage ); void StdLstOut( const char * pStr ); @@ -131,9 +139,10 @@ class RscError const RscId & aId ); public: sal_uInt32 nErrors;// Anzahl der Fehler - RscError(){ + RscError( RscVerbosity _verbosity ) { fListing = NULL; nErrors = 0; + m_verbosity = _verbosity; }; void SetListFile( FILE * fList ){ fListing = fList; @@ -141,7 +150,8 @@ public: FILE * GetListFile(){ return fListing; }; - virtual void StdOut( const char * ); + RscVerbosity GetVerbosity() const { return m_verbosity; } + virtual void StdOut( const char *, const RscVerbosity _verbosityLevel = RscVerbosityNormal ); virtual void StdErr( const char * ); virtual void LstOut( const char * ); virtual void Error( const ERRTYPE& rError, RscTop* pClass, const RscId &aId, diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx index c889001735fe..818e2066c221 100644 --- a/rsc/source/parser/erscerr.cxx +++ b/rsc/source/parser/erscerr.cxx @@ -69,14 +69,15 @@ ERRTYPE& ERRTYPE::operator = ( const ERRTYPE & rError ) |* Letzte Aenderung MM 06.05.91 |* *************************************************************************/ -void RscError::StdOut( const char * pStr ) +void RscError::StdOut( const char * pStr, const RscVerbosity _verbosityLevel ) { -#ifndef WIN - if( pStr ){ - printf( "%s", pStr ); - fflush( stdout ); + if ( m_verbosity >= _verbosityLevel ) + { + if( pStr ){ + printf( "%s", pStr ); + fflush( stdout ); + } } -#endif } /************************************************************************* diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx index 93628f381bec..8da3de9bf2b3 100644 --- a/rsc/source/parser/rscyacc.cxx +++ b/rsc/source/parser/rscyacc.cxx @@ -190,7 +190,7 @@ BOOL DoClassHeader( RSCHEADER * pHeader, BOOL bMember ) ObjNode * pNode = new ObjNode( aName1, S.Top().pData, pFI->GetFileIndex() ); - pTC->pEH->StdOut( "." ); + pTC->pEH->StdOut( ".", RscVerbosityVerbose ); if( !aName1.IsId() ) pTC->pEH->Error( ERR_IDEXPECTED, pHeader->pClass, aName1 ); diff --git a/rsc/source/prj/gui.cxx b/rsc/source/prj/gui.cxx index 036494c3bb9d..6bf466348d1b 100644 --- a/rsc/source/prj/gui.cxx +++ b/rsc/source/prj/gui.cxx @@ -57,6 +57,20 @@ static RscCompiler * pRscCompiler = NULL; delete pRscCompiler; } +RscVerbosity lcl_determineVerbosity( int argc, char ** argv ) +{ + for ( int i = 0; i < argc; ++i ) + { + if ( argv[i] == NULL ) + continue; + if ( rsc_stricmp( argv[i], "-verbose" ) == 0 ) + return RscVerbosityVerbose; + if ( rsc_stricmp( argv[i], "-quiet" ) == 0 ) + return RscVerbositySilent; + } + return RscVerbosityNormal; +} + #if defined( UNX ) || ( defined( OS2 ) && ( defined( CSET ) || defined ( GCC ))) || defined (WTC) || defined(ICC) || defined(__MINGW32__) int main ( int argc, char ** argv) { #else @@ -80,7 +94,7 @@ int cdecl main ( int argc, char ** argv) { ERRTYPE aError; InitRscCompiler(); - RscError* pErrHdl = new RscError(); + RscError* pErrHdl = new RscError( lcl_determineVerbosity( argc, argv ) ); #ifdef MTW RscCmdLine* pCmdLine = new RscCmdLine( argc, (char **)argv, pErrHdl ); #else diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx index c43879020a8e..df4ce12200c5 100644 --- a/rsc/source/prj/start.cxx +++ b/rsc/source/prj/start.cxx @@ -56,6 +56,7 @@ #endif // UNX #include <rsctools.hxx> +#include <rscerror.h> #include <tools/fsys.hxx> /*************** C O D E ************************************************/ @@ -111,25 +112,38 @@ static BOOL CallPrePro( const ByteString& rPrePro, if( !fRspFile ) aNewCmdL.Append( rsc_strdup( rPrePro.GetBuffer() ) ); - for( i = 1; i < int(pCmdLine->GetCount() -1); i++ ){ - if( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-u", 2 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-i", 2 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-d", 2 ) ) + + bool bVerbose = false; + for( i = 1; i < int(pCmdLine->GetCount() -1); i++ ) + { + if ( 0 == rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-verbose" ) ) + { + bVerbose = true; + continue; + } + if ( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-u", 2 ) + || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-i", 2 ) + || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-d", 2 ) + ) { aNewCmdL.Append( rsc_strdup( (char *)pCmdLine->GetEntry( i ) ) ); } - }; + } + aNewCmdL.Append( rsc_strdup( rInput.GetBuffer() ) ); aNewCmdL.Append( rsc_strdup( rOutput.GetBuffer() ) ); aNewCmdL.Append( (void *)0 ); - printf( "Preprocessor commandline: " ); - for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + if ( bVerbose ) { - printf( " " ); - printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + printf( "Preprocessor commandline: " ); + for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + { + printf( " " ); + printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + } + printf( "\n" ); } - printf( "\n" ); if( fRspFile ) { @@ -150,13 +164,16 @@ static BOOL CallPrePro( const ByteString& rPrePro, } fclose( fRspFile ); - printf( "Preprocessor startline: " ); - for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + if ( bVerbose ) { - printf( " " ); - printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + printf( "Preprocessor startline: " ); + for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + { + printf( " " ); + printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + } + printf( "\n" ); } - printf( "\n" ); } #if ((defined OS2 || defined WNT) && (defined TCPP || defined tcpp)) || defined UNX || defined OS2 @@ -194,7 +211,6 @@ static BOOL CallRsc2( ByteString aRsc2Name, ByteString aSrsName, RscPtrPtr * pCmdLine ) { - RscPtrPtr aNewCmdL; // Kommandozeile int i, nExit; ByteString* pString; ByteString aRspFileName; // Response-Datei @@ -203,21 +219,21 @@ static BOOL CallRsc2( ByteString aRsc2Name, aRspFileName = ::GetTmpFileName(); fRspFile = fopen( aRspFileName.GetBuffer(), "w" ); - printf( "Rsc2 commandline: " ); - aNewCmdL.Append( rsc_strdup( aRsc2Name.GetBuffer() ) ); - printf( "%s", (const char *)aNewCmdL.GetEntry( aNewCmdL.GetCount() -1 ) ); - printf( " " ); - ByteString aTmpStr( '@' ); - aTmpStr += aRspFileName; - aNewCmdL.Append( rsc_strdup( aTmpStr.GetBuffer() ) ); - printf( "%s", (const char *)aNewCmdL.GetEntry( aNewCmdL.GetCount() -1 ) ); - aNewCmdL.Append( (void *)0 ); - printf( "\n" ); - + RscVerbosity eVerbosity = RscVerbosityNormal; if( fRspFile ) { for( i = 1; i < (int)(pCmdLine->GetCount() -1); i++ ) { + if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-verbose" ) ) + { + eVerbosity = RscVerbosityVerbose; + continue; + } + if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-quiet" ) ) + { + eVerbosity = RscVerbositySilent; + continue; + } if( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fp=", 4 ) || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fo=", 4 ) || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-pp=", 4 ) @@ -261,6 +277,22 @@ static BOOL CallRsc2( ByteString aRsc2Name, fclose( fRspFile ); }; + RscPtrPtr aNewCmdL; // Kommandozeile + aNewCmdL.Append( rsc_strdup( aRsc2Name.GetBuffer() ) ); + ByteString aTmpStr( '@' ); + aTmpStr += aRspFileName; + aNewCmdL.Append( rsc_strdup( aTmpStr.GetBuffer() ) ); + aNewCmdL.Append( (void *)0 ); + + if ( eVerbosity >= RscVerbosityVerbose ) + { + printf( "Rsc2 commandline: " ); + printf( "%s", (const char *)aNewCmdL.GetEntry( 0 ) ); + printf( " " ); + printf( "%s", (const char *)aNewCmdL.GetEntry( 1 ) ); + printf( "\n" ); + } + #if ((defined OS2 || defined WNT) && (defined TCPP || defined tcpp)) || defined UNX || defined OS2 nExit = spawnvp( P_WAIT, aRsc2Name.GetBuffer(), (char* const*)aNewCmdL.GetBlock() ); #elif defined CSET @@ -328,8 +360,6 @@ int cdecl main ( int argc, char ** argv) aRsc2Name += aDelim; aRsc2Name += ByteString("rsc2"); - printf( "VCL Resource Compiler 3.0\n" ); - pStr = ::ResponseFile( &aCmdLine, argv, argc ); if( pStr ) { diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index 953b837055de..934c41d5e9a9 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -520,15 +520,18 @@ printf( "khg\n" ); } }; - pTC->pEH->StdOut( "Files: " ); - pFName = pTC->aFileTab.First(); - while( pFName ) + if ( pTC->pEH->GetVerbosity() >= RscVerbosityVerbose ) { - pTC->pEH->StdOut( pFName->aFileName.GetBuffer() ); - pTC->pEH->StdOut( " " ); - pFName = pTC->aFileTab.Next(); - }; - pTC->pEH->StdOut( "\n" ); + pTC->pEH->StdOut( "Files: " ); + pFName = pTC->aFileTab.First(); + while( pFName ) + { + pTC->pEH->StdOut( pFName->aFileName.GetBuffer() ); + pTC->pEH->StdOut( " " ); + pFName = pTC->aFileTab.Next(); + }; + pTC->pEH->StdOut( "\n" ); + } if( aError.IsOk() ) aError = Link(); @@ -554,9 +557,9 @@ void RscCompiler::EndCompile() { if( pCL->aOutputSrs.Len() && (pCL->nCommands & NOLINK_FLAG) ) { - pTC->pEH->StdOut( "Writing file " ); - pTC->pEH->StdOut( pCL->aOutputSrs.GetBuffer() ); - pTC->pEH->StdOut( ".\n" ); + pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputSrs.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen unlink( pCL->aOutputSrs.GetBuffer() ); // Zieldatei loeschen @@ -588,9 +591,9 @@ void RscCompiler::EndCompile() if ( aTmpOutputHxx.Len() ) { - pTC->pEH->StdOut( "Writing file " ); - pTC->pEH->StdOut( pCL->aOutputHxx.GetBuffer() ); - pTC->pEH->StdOut( ".\n" ); + pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputHxx.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen unlink( pCL->aOutputHxx.GetBuffer() ); // Zieldatei loeschen @@ -601,9 +604,9 @@ void RscCompiler::EndCompile() if( aTmpOutputCxx.Len() ) { - pTC->pEH->StdOut( "Writing file " ); - pTC->pEH->StdOut( pCL->aOutputCxx.GetBuffer() ); - pTC->pEH->StdOut( ".\n" ); + pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputCxx.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen unlink( pCL->aOutputCxx.GetBuffer() ); // Zieldatei loeschen @@ -614,9 +617,9 @@ void RscCompiler::EndCompile() if( aTmpOutputRcCtor.Len() ) { - pTC->pEH->StdOut( "Writing file " ); - pTC->pEH->StdOut( pCL->aOutputRcCtor.GetBuffer() ); - pTC->pEH->StdOut( ".\n" ); + pTC->pEH->StdOut( "Writing file ", RscVerbosityVerbose ); + pTC->pEH->StdOut( pCL->aOutputRcCtor.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( ".\n", RscVerbosityVerbose ); // kopiere von TMP auf richtigen Namen unlink( pCL->aOutputRcCtor.GetBuffer() ); // Zieldatei loeschen @@ -776,14 +779,14 @@ ERRTYPE RscCompiler :: ParseOneFile( ULONG lFileKey, { RscFileInst aFileInst( pTC, lFileKey, lFileKey, finput ); - pTC->pEH->StdOut( "reading file " ); - pTC->pEH->StdOut( aParseFile.GetBuffer() ); - pTC->pEH->StdOut( " " ); + pTC->pEH->StdOut( "reading file ", RscVerbosityVerbose ); + pTC->pEH->StdOut( aParseFile.GetBuffer(), RscVerbosityVerbose ); + pTC->pEH->StdOut( " ", RscVerbosityVerbose ); aError = ::parser( &aFileInst ); if( aError.IsError() ) pTC->Delete( lFileKey );//Resourceobjekte loeschen - pTC->pEH->StdOut( "\n" ); + pTC->pEH->StdOut( "\n", RscVerbosityVerbose ); fclose( finput ); }; diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index a8c0912a583e..9ca21c5fb36b 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2506,7 +2506,14 @@ void VCLXWindow::setZoom( float fZoomX, float /*fZoomY*/ ) throw(::com::sun::sta ::vos::OGuard aGuard( GetMutex() ); if ( GetWindow() ) - GetWindow()->SetZoom( Fraction( fZoomX ) ); + { + // Fraction::Fraction takes a double, but we have a float only. + // The implicit conversion from float to double can result in a precision loss, i.e. 1.2 is converted to + // 1.200000000047something. To prevent this, we convert explicitly to double, and round it. + double nZoom( fZoomX ); + nZoom = ::rtl::math::round( nZoom, 4 ); + GetWindow()->SetZoom( Fraction( nZoom ) ); + } } // ::com::sun::star::lang::XEventListener diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 3f05383d4f80..eba46362d94e 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -165,6 +165,7 @@ namespace vcl { struct ControlLayoutData; } #define SHOW_NOPARENTUPDATE ((USHORT)0x0001) #define SHOW_NOFOCUSCHANGE ((USHORT)0x0002) #define SHOW_NOACTIVATE ((USHORT)0x0004) +#define SHOW_FOREGROUNDTASK ((USHORT)0x0008) // Flags for SetZOrder() #define WINDOW_ZORDER_BEFOR ((USHORT)0x0001) diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index b98712419cf1..43bb224aaa94 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -153,7 +153,8 @@ void ImplAddMissingBands ( // We still have to cover two cases: // 1. The region does not yet contain any bands. // 2. The intervall nTop->nBottom extends past the bottom most band. - if (nCurrentTop < nBottom && (pBand==NULL || nBottom>pBand->mnYBottom)) + if (nCurrentTop <= nBottom + && (pBand==NULL || nBottom>pBand->mnYBottom)) { // When there is no previous band then the new one will be the // first. Otherwise the new band is inserted behind the last band. @@ -232,8 +233,9 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly) ImplRegionBand* pTopBand = pBand; // If necessary split the band at nTop so that nTop is contained // in the lower band. - if ( // Prevent the current band from becoming 0 pixel high - pBand->mnYTop<nTop + if (pBand!=NULL + // Prevent the current band from becoming 0 pixel high + && pBand->mnYTop<nTop // this allows the lowest pixel of the band to be split off && pBand->mnYBottom>=nTop // do not split a band that is just one pixel high @@ -248,8 +250,9 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly) pBand = pBand->mpNextBand; // The lowest band may have to be split at nBottom so that // nBottom itself remains in the upper band. - if ( // allow the current band becoming 1 pixel high - pBand->mnYTop<=nBottom + if (pBand!=NULL + // allow the current band becoming 1 pixel high + && pBand->mnYTop<=nBottom // prevent splitting off a band that is 0 pixel high && pBand->mnYBottom>nBottom // do not split a band that is just one pixel high diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk index 4d1c3d60816b..21b8efe4c586 100644 --- a/vcl/source/window/makefile.mk +++ b/vcl/source/window/makefile.mk @@ -98,10 +98,10 @@ SLOFILES= \ $(INCCOM)$/cuilib.hxx: makefile.mk .IF "$(GUI)"=="UNX" - $(RM) $@ - echo \#define DLL_NAME \"libcui$(DLLPOSTFIX)$(DLLPOST)\" >$@ + @$(RM) $@ + @echo \#define DLL_NAME \"libcui$(DLLPOSTFIX)$(DLLPOST)\" >$@ .ELSE - echo $(EMQ)#define DLL_NAME $(EMQ)"cui$(DLLPOSTFIX)$(DLLPOST)$(EMQ)" >$@ + @echo $(EMQ)#define DLL_NAME $(EMQ)"cui$(DLLPOSTFIX)$(DLLPOST)$(EMQ)" >$@ .ENDIF $(SLO)$/abstdlg.obj : $(INCCOM)$/cuilib.hxx diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b6e071766412..0768595a7224 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -6518,7 +6518,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) // nach vorne, wenn es gewuenscht ist if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) ) { - ImplStartToTop( 0 ); + ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 ); ImplFocusToTop( 0, FALSE ); } diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 8963ac2e3643..eff7319d6efc 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -70,9 +70,9 @@ #ifdef ENABLE_DBUS #include <dbus/dbus-glib.h> -#define GSS_DBUS_SERVICE "org.gnome.ScreenSaver" -#define GSS_DBUS_PATH "/org/gnome/ScreenSaver" -#define GSS_DBUS_INTERFACE "org.gnome.ScreenSaver" +#define GSM_DBUS_SERVICE "org.gnome.SessionManager" +#define GSM_DBUS_PATH "/org/gnome/SessionManager" +#define GSM_DBUS_INTERFACE "org.gnome.SessionManager" #endif // make compile on gtk older than 2.10 @@ -565,7 +565,7 @@ void GtkSalFrame::InitCommon() m_pIMHandler = NULL; m_hBackgroundPixmap = None; m_nSavedScreenSaverTimeout = 0; - m_nGSSCookie = 0; + m_nGSMCookie = 0; m_nExtStyle = 0; m_pRegion = NULL; m_ePointerStyle = 0xffff; @@ -1904,8 +1904,9 @@ void GtkSalFrame::setAutoLock( bool bLock ) #ifdef ENABLE_DBUS /** cookie is returned as an unsigned integer */ static guint -dbus_inhibit_gss (const gchar *appname, - const gchar *reason) +dbus_inhibit_gsm (const gchar *appname, + const gchar *reason, + guint xid) { gboolean res; guint cookie; @@ -1921,20 +1922,22 @@ dbus_inhibit_gss (const gchar *appname, return -1; } - /* get the proxy with gnome-screensaver */ + /* get the proxy with gnome-session-manager */ proxy = dbus_g_proxy_new_for_name (session_connection, - GSS_DBUS_SERVICE, - GSS_DBUS_PATH, - GSS_DBUS_INTERFACE); + GSM_DBUS_SERVICE, + GSM_DBUS_PATH, + GSM_DBUS_INTERFACE); if (proxy == NULL) { - g_warning ("Could not get DBUS proxy: %s", GSS_DBUS_SERVICE); + g_warning ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); return -1; } res = dbus_g_proxy_call (proxy, "Inhibit", &error, G_TYPE_STRING, appname, + G_TYPE_UINT, xid, G_TYPE_STRING, reason, + G_TYPE_UINT, 8, //Inhibit the session being marked as idle G_TYPE_INVALID, G_TYPE_UINT, &cookie, G_TYPE_INVALID); @@ -1957,15 +1960,14 @@ dbus_inhibit_gss (const gchar *appname, } static void -dbus_uninhibit_gss (guint cookie) +dbus_uninhibit_gsm (guint cookie) { gboolean res; GError *error = NULL; DBusGProxy *proxy = NULL; DBusGConnection *session_connection = NULL; - /* cookies have to be positive as unsigned */ - if (cookie < 0) { + if (cookie == guint(-1)) { g_warning ("Invalid cookie"); return; } @@ -1978,18 +1980,18 @@ dbus_uninhibit_gss (guint cookie) return; } - /* get the proxy with gnome-screensaver */ + /* get the proxy with gnome-session-manager */ proxy = dbus_g_proxy_new_for_name (session_connection, - GSS_DBUS_SERVICE, - GSS_DBUS_PATH, - GSS_DBUS_INTERFACE); + GSM_DBUS_SERVICE, + GSM_DBUS_PATH, + GSM_DBUS_INTERFACE); if (proxy == NULL) { - g_warning ("Could not get DBUS proxy: %s", GSS_DBUS_SERVICE); + g_warning ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE); return; } res = dbus_g_proxy_call (proxy, - "UnInhibit", + "Uninhibit", &error, G_TYPE_UINT, cookie, G_TYPE_INVALID, @@ -1997,12 +1999,12 @@ dbus_uninhibit_gss (guint cookie) /* check the return value */ if (! res) { - g_warning ("UnInhibit method failed"); + g_warning ("Uninhibit method failed"); } /* check the error value */ if (error != NULL) { - g_warning ("Inhibit problem : %s", error->message); + g_warning ("Uninhibit problem : %s", error->message); g_error_free (error); cookie = -1; } @@ -2030,7 +2032,8 @@ void GtkSalFrame::StartPresentation( BOOL bStart ) bPreferBlanking, bAllowExposures ); } #ifdef ENABLE_DBUS - m_nGSSCookie = dbus_inhibit_gss(g_get_application_name(), "presentation"); + m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation", + GDK_WINDOW_XID(m_pWindow->window)); #endif } else @@ -2041,7 +2044,7 @@ void GtkSalFrame::StartPresentation( BOOL bStart ) bAllowExposures ); m_nSavedScreenSaverTimeout = 0; #ifdef ENABLE_DBUS - dbus_uninhibit_gss(m_nGSSCookie); + dbus_uninhibit_gsm(m_nGSMCookie); #endif } } diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx index 74394c71e4b2..a8fc6f65d4ee 100644 --- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx +++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx @@ -180,7 +180,7 @@ class GtkSalFrame : public SalFrame GdkVisibilityState m_nVisibility; PointerStyle m_ePointerStyle; int m_nSavedScreenSaverTimeout; - guint m_nGSSCookie; + guint m_nGSMCookie; int m_nWorkArea; bool m_bFullscreen; bool m_bSingleAltPress; diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk index bdd400baa8ad..fb513a66a841 100644 --- a/vcl/unx/source/gdi/makefile.mk +++ b/vcl/unx/source/gdi/makefile.mk @@ -107,8 +107,8 @@ ALLTAR : $(MACOSXRC) XSALSETLIBNAME=$(DLLPRE)spa$(DLLPOSTFIX)$(DLLPOST) $(INCCOM)$/rtsname.hxx: - rm -f $(INCCOM)$/rtsname.hxx ; \ - echo "#define _XSALSET_LIBNAME "\"$(XSALSETLIBNAME)\" > $(INCCOM)$/rtsname.hxx + @rm -f $(INCCOM)$/rtsname.hxx ; \ + echo "#define _XSALSET_LIBNAME "\"$(XSALSETLIBNAME)\" > $(INCCOM)$/rtsname.hxx $(SLO)$/salpimpl.obj : $(INCCOM)$/rtsname.hxx $(SLO)$/salprnpsp.obj : $(INCCOM)$/rtsname.hxx diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 4a49d83918da..78c4e4e6ddcc 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2157,7 +2157,17 @@ static void ImplSalToTop( HWND hWnd, USHORT nFlags ) BringWindowToTop( hWnd ); if ( nFlags & SAL_FRAME_TOTOP_FOREGROUNDTASK ) - SetForegroundWindow( hWnd ); + { + // This magic code is necessary to connect the input focus of the
+ // current window thread and the thread which owns the window that
+ // should be the new foreground window.
+ HWND hCurrWnd = GetForegroundWindow();
+ DWORD myThreadID = GetCurrentThreadId();
+ DWORD currThreadID = GetWindowThreadProcessId(hCurrWnd,NULL);
+ AttachThreadInput(myThreadID, currThreadID,TRUE);
+ SetForegroundWindow(hWnd);
+ AttachThreadInput(myThreadID,currThreadID,FALSE);
+ } if ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN ) { |