From 98e9b844f2f2038d69ae159ee67cc6c3ba7d1a76 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 13 Dec 2010 13:42:14 +0100 Subject: vcl118: #i116048# improve shutdown behavior of unix clipboard (thanks sb !) --- vcl/source/app/session.cxx | 36 +++++++++++++++++++++--------------- vcl/source/app/svapp.cxx | 5 ++++- vcl/source/app/svdata.cxx | 13 ++++++++++--- vcl/source/app/svmain.cxx | 16 +++++++++------- 4 files changed, 44 insertions(+), 26 deletions(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx index c65eb13224e1..4a9ea98ae3e8 100644 --- a/vcl/source/app/session.cxx +++ b/vcl/source/app/session.cxx @@ -39,6 +39,12 @@ #include +namespace { + +namespace css = com::sun::star; + +} + using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::frame; @@ -52,12 +58,12 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient { struct Listener { - Reference< XSessionManagerListener > m_xListener; + css::uno::Reference< XSessionManagerListener > m_xListener; bool m_bInteractionRequested; bool m_bInteractionDone; bool m_bSaveDone; - Listener( const Reference< XSessionManagerListener >& xListener ) + Listener( const css::uno::Reference< XSessionManagerListener >& xListener ) : m_xListener( xListener ), m_bInteractionRequested( false ), m_bInteractionDone( false ), @@ -84,11 +90,11 @@ public: VCLSession(); virtual ~VCLSession(); - virtual void SAL_CALL addSessionManagerListener( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); - virtual void SAL_CALL removeSessionManagerListener( const Reference< XSessionManagerListener>& xListener ) throw( RuntimeException ); - virtual void SAL_CALL queryInteraction( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); - virtual void SAL_CALL interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); - virtual void SAL_CALL saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL addSessionManagerListener( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL removeSessionManagerListener( const css::uno::Reference< XSessionManagerListener>& xListener ) throw( RuntimeException ); + virtual void SAL_CALL queryInteraction( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); + virtual void SAL_CALL saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ); virtual sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException ); }; @@ -212,7 +218,7 @@ void VCLSession::callQuit() ULONG nAcquireCount = Application::ReleaseSolarMutex(); for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it ) { - Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY ); + css::uno::Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY ); if( xListener2.is() ) xListener2->doQuit(); } @@ -244,14 +250,14 @@ void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent ) } } -void SAL_CALL VCLSession::addSessionManagerListener( const Reference& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::addSessionManagerListener( const css::uno::Reference& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); m_aListeners.push_back( Listener( xListener ) ); } -void SAL_CALL VCLSession::removeSessionManagerListener( const Reference& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Reference& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); @@ -268,7 +274,7 @@ void SAL_CALL VCLSession::removeSessionManagerListener( const Reference& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference& xListener ) throw( RuntimeException ) { if( m_bInteractionGranted ) { @@ -295,7 +301,7 @@ void SAL_CALL VCLSession::queryInteraction( const Reference& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); int nRequested = 0, nDone = 0; @@ -318,7 +324,7 @@ void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListe } } -void SAL_CALL VCLSession::saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ) +void SAL_CALL VCLSession::saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); @@ -359,11 +365,11 @@ Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames() return aRet; } -Reference< XInterface > SAL_CALL vcl_session_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ ) +css::uno::Reference< XInterface > SAL_CALL vcl_session_createInstance( const css::uno::Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ ) { ImplSVData* pSVData = ImplGetSVData(); if( ! pSVData->xSMClient.is() ) pSVData->xSMClient = new VCLSession(); - return Reference< XInterface >(pSVData->xSMClient, UNO_QUERY ); + return css::uno::Reference< XInterface >(pSVData->xSMClient, UNO_QUERY ); } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index e503172eb2c6..759d28e30bb1 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1761,9 +1761,12 @@ void Application::SetUnoWrapper( UnoWrapperBase* pWrapper ) ImplSVData* pSVData = ImplGetSVData(); if( !pSVData->mxDisplayConnection.is() ) + { pSVData->mxDisplayConnection.set( new ::vcl::DisplayConnection ); + pSVData->mxDisplayConnection->start(); + } - return pSVData->mxDisplayConnection; + return pSVData->mxDisplayConnection.get(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 935d2c1894ea..01647af81f7f 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -53,6 +53,7 @@ #include "vcl/salimestatus.hxx" #include "vcl/salsys.hxx" #include "vcl/svids.hrc" +#include "vcl/xconnection.hxx" #include "unotools/fontcfg.hxx" @@ -71,6 +72,12 @@ #include +namespace { + +namespace css = com::sun::star; + +} + using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::awt; @@ -362,12 +369,12 @@ bool ImplInitAccessBridge(BOOL bAllowCancel, BOOL &rCancelled) ImplSVData* pSVData = ImplGetSVData(); if( ! pSVData->mxAccessBridge.is() ) { - Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); + css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); if( xFactory.is() ) { - Reference< XExtendedToolkit > xToolkit = - Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); + css::uno::Reference< XExtendedToolkit > xToolkit = + css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); Sequence< Any > arguments(1); arguments[0] = makeAny(xToolkit); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 4efa2b659e7c..2da07db443fd 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -89,6 +89,12 @@ #include "rtl/strbuf.hxx" #endif +namespace { + +namespace css = com::sun::star; + +} + using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -171,7 +177,7 @@ BOOL ImplSVMain() DBG_ASSERT( pSVData->mpApp, "no instance of class Application" ); - Reference xMS; + css::uno::Reference xMS; BOOL bInit = InitVCL( xMS ); @@ -186,11 +192,7 @@ BOOL ImplSVMain() if( pSVData->mxDisplayConnection.is() ) { - vcl::DisplayConnection* pConnection = - dynamic_cast(pSVData->mxDisplayConnection.get()); - - if( pConnection ) - pConnection->dispatchDowningEvent(); + pSVData->mxDisplayConnection->terminate(); pSVData->mxDisplayConnection.clear(); } @@ -199,7 +201,7 @@ BOOL ImplSVMain() // be some events in the AWT EventQueue, which need the SolarMutex which // - on the other hand - is destroyed in DeInitVCL(). So empty the queue // here .. - Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY); + css::uno::Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY); if( xComponent.is() ) { ULONG nCount = Application::ReleaseSolarMutex(); -- cgit From e73cc303e5201dc04c61a30572b80d3da13a2699 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 11 Jan 2011 13:35:20 +0100 Subject: gridsort: Help::ShowQuickHelp: new flag QUICKHELP_FORCE_REPOSITION, which re-positions the window even if the quick help text didn't change. Use this in the table control, this prevents the help text appearing too far from the mouse position --- vcl/source/app/help.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 2c7ad2fa9c3e..37e7917d5e78 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -590,10 +590,14 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle, { DBG_ASSERT( pHelpWin != pParent, "HelpInHelp ?!" ); - if ( (( pHelpWin->GetHelpText() != rHelpText ) || - ( pHelpWin->GetWinStyle() != nHelpWinStyle ) || - ( pHelpArea && ( pHelpWin->GetHelpArea() != *pHelpArea ) ) ) - && pSVData->maHelpData.mbRequestingHelp ) + if ( ( ( pHelpWin->GetHelpText() != rHelpText ) + || ( pHelpWin->GetWinStyle() != nHelpWinStyle ) + || ( pHelpArea + && ( pHelpWin->GetHelpArea() != *pHelpArea ) + ) + ) + && pSVData->maHelpData.mbRequestingHelp + ) { // remove help window if no HelpText or other HelpText or // other help mode. but keep it if we are scrolling, ie not requesting help @@ -605,8 +609,8 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle, } else { - bool bTextChanged = rHelpText != pHelpWin->GetHelpText(); - if( bTextChanged ) + bool const bTextChanged = rHelpText != pHelpWin->GetHelpText(); + if ( bTextChanged || ( ( nStyle & QUICKHELP_FORCE_REPOSITION ) != 0 ) ) { Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow(); Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) ); -- cgit From 69e0e16e0e50074127c6a4bef1f45dd6323b0164 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 11 Jan 2011 21:45:01 +0100 Subject: gridsort: +QUICKHELP_NO_DELAY --- vcl/source/app/help.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 37e7917d5e78..46f5e2132e5c 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -629,7 +629,9 @@ void ImplShowHelpWindow( Window* pParent, USHORT nHelpWinStyle, USHORT nStyle, if ( !pHelpWin && rHelpText.Len() ) { ULONG nCurTime = Time::GetSystemTicks(); - if( (nCurTime - pSVData->maHelpData.mnLastHelpHideTime) < pParent->GetSettings().GetHelpSettings().GetTipDelay() ) + if ( ( ( nCurTime - pSVData->maHelpData.mnLastHelpHideTime ) < pParent->GetSettings().GetHelpSettings().GetTipDelay() ) + || ( ( nStyle & QUICKHELP_NO_DELAY ) != 0 ) + ) nDelayMode = HELPDELAY_NONE; DBG_ASSERT( !pHelpWin, "Noch ein HelpWin ?!" ); -- cgit From d0cdc38a6771473b81f002da6769b7b723d657ff Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 14 Jan 2011 12:23:42 +0100 Subject: gridsort: TableDataWindow: use Help::ShowTip instead of Help::ShowQuickHelp. This means it doesn't interfere with the "normal" quick help (which is a singleton really dedicated to, well, quickly displaying help). Also, it means we do not need the QUICKHELP_NO_DELAY flag. To prevent flickering when repeatedly showing such a tip, introduced Help::UpdateTip, which updates an existing tip, instead of destroying the old tip window, and creating a new one. Used this new UpdateTip also in the BrowseBox, means means some less flickering there, too. --- vcl/source/app/help.cxx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 46f5e2132e5c..09650cee9231 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -36,6 +36,7 @@ #include "vcl/help.hxx" #include "vcl/helpwin.hxx" #include "tools/debug.hxx" +#include "tools/diagnose_ex.h" #include "tools/time.hxx" // ======================================================================= @@ -274,18 +275,30 @@ BOOL Help::ShowQuickHelp( Window* pParent, // ----------------------------------------------------------------------- -ULONG Help::ShowTip( Window* pParent, const Rectangle& rRect, +ULONG Help::ShowTip( Window* pParent, const Rectangle& rScreenRect, const XubString& rText, USHORT nStyle ) { USHORT nHelpWinStyle = HELPWINSTYLE_QUICK; HelpTextWindow* pHelpWin = new HelpTextWindow( pParent, rText, nHelpWinStyle, nStyle ); + ULONG nId = reinterpret_cast< ULONG >( pHelpWin ); + UpdateTip( nId, pParent, rScreenRect, rText ); + + pHelpWin->ShowHelp( HELPDELAY_NONE ); + return nId; +} + +// ----------------------------------------------------------------------- + +void Help::UpdateTip( ULONG nId, Window* pParent, const Rectangle& rScreenRect, const XubString& rText ) +{ + HelpTextWindow* pHelpWin = reinterpret_cast< HelpTextWindow* >( nId ); + ENSURE_OR_RETURN_VOID( pHelpWin != NULL, "Help::UpdateTip: invalid ID!" ); + Size aSz = pHelpWin->CalcOutSize(); pHelpWin->SetOutputSizePixel( aSz ); - ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, - pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rRect ); - pHelpWin->ShowHelp( HELPDELAY_NONE ); - return (ULONG)pHelpWin; + ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(), + pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect ); } // ----------------------------------------------------------------------- -- cgit From f64fd0b4a2b5c1e8fe4f5742d8ef530b02cd9f22 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 14 Jan 2011 13:56:26 +0100 Subject: gridsort: +QUICKHELP_TIP_STYLE_BALLOON, to be used with ShowTip, to force a tip to appear in balloon-style --- vcl/source/app/help.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 09650cee9231..7e58a7cc4dc8 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -278,7 +278,7 @@ BOOL Help::ShowQuickHelp( Window* pParent, ULONG Help::ShowTip( Window* pParent, const Rectangle& rScreenRect, const XubString& rText, USHORT nStyle ) { - USHORT nHelpWinStyle = HELPWINSTYLE_QUICK; + USHORT nHelpWinStyle = ( ( nStyle & QUICKHELP_TIP_STYLE_BALLOON ) != 0 ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK; HelpTextWindow* pHelpWin = new HelpTextWindow( pParent, rText, nHelpWinStyle, nStyle ); ULONG nId = reinterpret_cast< ULONG >( pHelpWin ); -- cgit From 9c169fd0b2c6dc4961177b49d21d6e51dcb40701 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 17 Jan 2011 09:13:00 +0100 Subject: gridsort: UpdateTip: don't ignore the given text --- vcl/source/app/help.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl/source/app') diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 7e58a7cc4dc8..6f432e046a3b 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -299,6 +299,8 @@ void Help::UpdateTip( ULONG nId, Window* pParent, const Rectangle& rScreenRect, pHelpWin->SetOutputSizePixel( aSz ); ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(), pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect ); + + pHelpWin->SetHelpText( rText ); } // ----------------------------------------------------------------------- -- cgit From cc01ab8a817f6badf4b9631097a43e0ea11d0f8a Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 19 Jan 2011 16:33:54 +0100 Subject: vcl118: #i115048# revert brochure printing in writer to old behavior taking the paper size form the printer driver, add paper name to print preview --- vcl/source/app/svdata.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vcl/source/app') diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 01647af81f7f..f0e1652cde17 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -179,6 +179,8 @@ void ImplDeInitSVData() delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL; if( pSVData->maCtrlData.mpCleanUnitStrings ) delete pSVData->maCtrlData.mpCleanUnitStrings, pSVData->maCtrlData.mpCleanUnitStrings = NULL; + if( pSVData->mpPaperNames ) + delete pSVData->mpPaperNames, pSVData->mpPaperNames = NULL; } // ----------------------------------------------------------------------- -- cgit