if (nAccept != DND_ACTION_NONE)
{ // to enable the autoscroll when we're close to the edges
weld::TreeView& rWidget = m_rTreeView.GetWidget();
rWidget.get_dest_row_at_pos(rEvt.maPosPixel, nullptr, true);
}
std::unique_ptr<weld::TreeIter> TreeListBox::GetEntryPosByName(std::u16string_view aName, const weld::TreeIter* pStart, const IEntryFilter* _pFilter) const
{ auto xEntry(m_xTreeView->make_iterator(pStart)); if (pStart)
{ if (!m_xTreeView->iter_children(*xEntry)) return nullptr;
} else
{ if (!m_xTreeView->get_iter_first(*xEntry)) return nullptr;
}
do
{ if (m_xTreeView->get_text(*xEntry) == aName)
{ if (!_pFilter || _pFilter->includeEntry(weld::fromId<void*>(m_xTreeView->get_id(*xEntry))))
{ // found return xEntry;
}
}
} while (m_xTreeView->iter_next_sibling(*xEntry));
if (m_pActionListener)
{
m_xDragedEntry = m_xTreeView->make_iterator(); if (!m_xTreeView->get_selected(m_xDragedEntry.get()))
m_xDragedEntry.reset(); if (m_xDragedEntry && m_pActionListener->requestDrag(*m_xDragedEntry))
{ // if the (asynchronous) drag started, stop the selection timer
implStopSelectionTimer(); returnfalse;
}
}
// check if drag is on child entry, which is not allowed
std::unique_ptr<weld::TreeIter> xParent; if (rEvt.mnAction & DND_ACTION_MOVE)
{ if (!m_xDragedEntry) // no entry to move return m_pActionListener->queryDrop(rEvt, m_aDropTargetHelper.GetDataFlavorExVector());
if (xDropTarget)
{
xParent = m_xTreeView->make_iterator(xDropTarget.get()); if (!m_xTreeView->iter_parent(*xParent))
xParent.reset();
} while (xParent && m_xTreeView->iter_compare(*xParent, *m_xDragedEntry) != 0)
{ if (!m_xTreeView->iter_parent(*xParent))
xParent.reset();
}
}
if (!xParent)
{
nDropOption = m_pActionListener->queryDrop(rEvt, m_aDropTargetHelper.GetDataFlavorExVector()); // check if move is allowed if ( nDropOption & DND_ACTION_MOVE )
{ if (!m_xDragedEntry || !xDropTarget ||
m_xTreeView->iter_compare(*m_xDragedEntry, *xDropTarget) == 0 ||
GetEntryPosByName(m_xTreeView->get_text(*m_xDragedEntry), xDropTarget.get()))
{
nDropOption = nDropOption & ~DND_ACTION_MOVE;//DND_ACTION_NONE;
}
}
}
}
sal_Bool SAL_CALL SelectionSupplier::select( const Any& /*_Selection*/ )
{ throw IllegalArgumentException(); // API bug: this should be a NoSupportException
}
Any SAL_CALL SelectionSupplier::getSelection( )
{ return m_aSelection;
}
void SAL_CALL SelectionSupplier::addSelectionChangeListener( const Reference< XSelectionChangeListener >& /*_Listener*/ )
{
OSL_FAIL( "SelectionSupplier::removeSelectionChangeListener: no support!" ); // API bug: this should be a NoSupportException
}
void SAL_CALL SelectionSupplier::removeSelectionChangeListener( const Reference< XSelectionChangeListener >& /*_Listener*/ )
{
OSL_FAIL( "SelectionSupplier::removeSelectionChangeListener: no support!" ); // API bug: this should be a NoSupportException
}
}
// adjust pos relative to m_xTreeView to relative to xMenuParent
m_pContextMenuProvider->adjustMenuPosition(*m_xTreeView, aPos);
// do action for selected entry in popup menu
css::uno::Reference<css::awt::XWindowPeer> xParent(xSourceWindow, css::uno::UNO_QUERY);
xPopupMenu->execute(xParent, css::awt::Rectangle(aPos.X(), aPos.Y(), 1, 1), css::awt::PopupMenuDirection::EXECUTE_DOWN);
css::uno::Reference<css::lang::XComponent> xComponent(xMenuController, css::uno::UNO_QUERY); if (xComponent.is())
xComponent->dispose();
xMenuController.clear();
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.20Bemerkung:
(vorverarbeitet am 2026-10-02)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.