[Libreoffice-commits] core.git: vcl/headless
Tor Lillqvist
tml at collabora.com
Sun Oct 27 15:25:24 PDT 2013
vcl/headless/svpframe.cxx | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 8c94f0ef7e42434934dc93a04ff7886002d9ca16
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Oct 28 00:24:31 2013 +0200
Shortcut when the SvpSalFrame already has the "focus"
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 2ce3074..bfe0259 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -79,6 +79,7 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
m_nMaxWidth( 0 ),
m_nMaxHeight( 0 )
{
+ // SAL_DEBUG("SvpSalFrame::SvpSalFrame: " << this);
// fast and easy cross-platform wiping of the data
memset( (void *)&m_aSystemChildData, 0, sizeof( SystemEnvData ) );
m_aSystemChildData.nSize = sizeof( SystemEnvData );
@@ -114,6 +115,7 @@ SvpSalFrame::~SvpSalFrame()
if( s_pFocusFrame == this )
{
+ // SAL_DEBUG("SvpSalFrame::~SvpSalFrame: losing focus: " << this);
s_pFocusFrame = NULL;
// call directly here, else an event for a destroyed frame would be dispatched
CallCallback( SALEVENT_LOSEFOCUS, NULL );
@@ -142,10 +144,14 @@ SvpSalFrame::~SvpSalFrame()
void SvpSalFrame::GetFocus()
{
+ if( s_pFocusFrame == this )
+ return;
+
if( (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION | SAL_FRAME_STYLE_FLOAT)) == 0 )
{
if( s_pFocusFrame )
s_pFocusFrame->LoseFocus();
+ // SAL_DEBUG("SvpSalFrame::GetFocus(): " << this);
s_pFocusFrame = this;
m_pInstance->PostEvent( this, NULL, SALEVENT_GETFOCUS );
}
@@ -155,6 +161,7 @@ void SvpSalFrame::LoseFocus()
{
if( s_pFocusFrame == this )
{
+ // SAL_DEBUG("SvpSalFrame::LoseFocus: " << this);
m_pInstance->PostEvent( this, NULL, SALEVENT_LOSEFOCUS );
s_pFocusFrame = NULL;
}
More information about the Libreoffice-commits
mailing list