Resolves tdf#166186 Showing the context menu for in-place editing
ends in-place editing (x11 only) Fixing this revealed that ESC ends in-place editing when the popup menu is active. Esc a second time ends the popup menu. This patch fixes this issue as well. Change-Id: Ia617d27fcdf7221263bc9b2ae96d8a8ebf934fc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184400 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
This commit is contained in:
@@ -243,6 +243,8 @@ public:
|
||||
|
||||
bool IsPassword() const { return mbPassword; }
|
||||
|
||||
bool IsActivePopup() const { return mbActivePopup; }
|
||||
|
||||
virtual void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override;
|
||||
};
|
||||
|
||||
|
@@ -88,8 +88,10 @@ public:
|
||||
void StopEditing( bool bCancel );
|
||||
void Hide();
|
||||
const VclPtr<Edit> & GetEditWidget() const { return pEdit; };
|
||||
};
|
||||
|
||||
void RemoveEscapeAccel() { Application::RemoveAccel(&aAccEscape); }
|
||||
void InsertEscapeAccel() { Application::InsertAccel(&aAccEscape); }
|
||||
};
|
||||
// ***************************************************************
|
||||
|
||||
namespace {
|
||||
@@ -103,6 +105,7 @@ public:
|
||||
virtual void dispose() override { pOwner = nullptr; Edit::dispose(); }
|
||||
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
||||
virtual void LoseFocus() override;
|
||||
virtual void Command(const CommandEvent& rCEvt) override;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -128,6 +131,16 @@ void MyEdit_Impl::LoseFocus()
|
||||
pOwner->LoseFocus();
|
||||
}
|
||||
|
||||
void MyEdit_Impl::Command(const CommandEvent& rCEvt)
|
||||
{
|
||||
if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
|
||||
{
|
||||
pOwner->RemoveEscapeAccel(); // so escape ends the popup
|
||||
Edit::Command(rCEvt);
|
||||
pOwner->InsertEscapeAccel();
|
||||
}
|
||||
}
|
||||
|
||||
SvInplaceEdit2::SvInplaceEdit2
|
||||
(
|
||||
vcl::Window* pParent, const Point& rPos,
|
||||
@@ -233,9 +246,8 @@ void SvInplaceEdit2::StopEditing( bool bCancel )
|
||||
|
||||
void SvInplaceEdit2::LoseFocus()
|
||||
{
|
||||
if ( !bAlreadyInCallBack
|
||||
&& ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) )
|
||||
)
|
||||
if (!bAlreadyInCallBack && !pEdit->IsActivePopup()
|
||||
&& ((!Application::GetFocusWindow()) || !pEdit->IsChild(Application::GetFocusWindow())))
|
||||
{
|
||||
bCanceled = false;
|
||||
aIdle.SetPriority(TaskPriority::REPAINT);
|
||||
|
Reference in New Issue
Block a user