33 OUString _sPropertyName,
const OUString& _rPropertyUIName)
34 : GenericDialogController(pParent,
"modules/spropctrlr/ui/listselectdialog.ui",
"ListSelectDialog")
35 , m_xListBox ( _rxListBox )
36 , m_sPropertyName(
std::move( _sPropertyName ))
37 ,
m_xFrame(m_xBuilder->weld_frame(
"frame"))
38 , m_xEntries(m_xBuilder->weld_tree_view(
"treeview"))
40 OSL_PRECOND(
m_xListBox.is(),
"ListSelectionDialog::ListSelectionDialog: invalid list box!" );
45 m_xFrame->set_label(_rPropertyUIName);
56 short nResult = GenericDialogController::run();
73 bool bMultiSelection =
false;
75 m_xEntries->set_selection_mode(bMultiSelection ? SelectionMode::Single : SelectionMode::Multiple);
78 Sequence< OUString > aListEntries;
83 Sequence< sal_Int16 > aSelection;
98 std::vector< sal_Int16 > aSelection;
115 for (
auto const & entry : _rListEntries)
122 auto aSelection =
m_xEntries->get_selected_rows();
123 _rSelection.resize(aSelection.size());
124 for (
auto row : aSelection)
125 _rSelection.push_back(row);
131 for (
auto const & selection : _rSelection)
css::uno::Reference< css::lang::XComponent > m_xFrame
css::uno::Reference< css::beans::XPropertySet > m_xListBox
virtual short run() override
std::unique_ptr< weld::Frame > m_xFrame
void collectSelection(std::vector< sal_Int16 > &_rSelection)
ListSelectionDialog(weld::Window *_pParent, const css::uno::Reference< css::beans::XPropertySet > &_rxListBox, OUString _sPropertyName, const OUString &_rPropertyUIName)
void selectEntries(const css::uno::Sequence< sal_Int16 > &_rSelection)
std::unique_ptr< weld::TreeView > m_xEntries
void fillEntryList(const css::uno::Sequence< OUString > &_rListEntries)
virtual ~ListSelectionDialog() override
std::shared_ptr< weld::Dialog > m_xDialog
#define TOOLS_WARN_EXCEPTION(area, stream)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
a property handler for any virtual string properties