diff options
Diffstat (limited to 'svx/source/fmcomp/fmgridif.cxx')
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 400e28e8b460..ea9a96ea0b27 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -962,6 +962,21 @@ sal_Bool SAL_CALL FmXGridControl::supportsMode(const OUString& Mode) return xPeer.is() && xPeer->supportsMode(Mode); } +void SAL_CALL FmXGridControl::setFocus() +{ + FmXGridPeer* pPeer = comphelper::getUnoTunnelImplementation<FmXGridPeer>(getPeer()); + if (pPeer) + { + VclPtr<FmGridControl> xGrid = pPeer->GetAs<FmGridControl>(); + bool bAlreadyHasFocus = xGrid->HasChildPathFocus() || xGrid->ControlHasFocus(); + // if the focus is already in the control don't grab focus again which + // would grab focus away from any native widgets hosted in the control + if (bAlreadyHasFocus) + return; + } + UnoControl::setFocus(); +} + // helper class which prevents that in the peer's header the FmGridListener must be known class FmXGridPeer::GridListenerDelegator : public FmGridListener { @@ -1055,7 +1070,6 @@ void FmXGridPeer::Create(vcl::Window* pParent, WinBits nStyle) getSupportedURLs(); } - FmXGridPeer::~FmXGridPeer() { setRowSet(Reference< XRowSet > ()); |