27#include <sfx2/sfxsids.hrc>
36bool lcl_ParseText(OUString
const& rText,
size_t& rLineNr)
43 OUString aText(rText.replaceAll(
" ",
""));
47 if (cFirst !=
'#' && (cFirst < '0' || cFirst >
'9'))
50 aText = aText.copy(1);
52 sal_Int32
n = aText.toInt32();
55 rLineNr =
static_cast<size_t>(
n);
62 : GenericDialogController(pParent,
"modules/BasicIDE/ui/managebreakpoints.ui",
63 "ManageBreakpointsDialog")
64 , m_rOriginalBreakPointList(rBrkPntList)
65 , m_aModifiedBreakPointList(rBrkPntList)
66 , m_xComboBox(m_xBuilder->weld_entry_tree_view(
"entriesgrid",
"entries",
"entrieslist"))
68 , m_xNewButton(m_xBuilder->weld_button(
"new"))
69 , m_xDelButton(m_xBuilder->weld_button(
"delete"))
70 , m_xCheckBox(m_xBuilder->weld_check_button(
"active"))
71 , m_xNumericField(m_xBuilder->weld_spin_button(
"pass"))
80 OUString aEntryStr(
"# " + OUString::number(rBrk.
nLine));
111 OUString
aStr(
"# " + OUString::number(rBrk.
nLine));
122 if (lcl_ParseText(
m_xComboBox->get_active_text(), nLine)
143 pBrk->
bEnabled = rButton.get_active();
150 int nEntry = rBox.find_text(rBox.get_active_text());
153 BreakPoint& rBrk = m_aModifiedBreakPointList.at(nEntry);
166 if (m_xDelButton->get_sensitive())
167 ButtonHdl(*m_xDelButton);
175 m_rOriginalBreakPointList.transfer(m_aModifiedBreakPointList);
178 else if (&rButton == m_xNewButton.get())
181 OUString aText(m_xComboBox->get_active_text());
183 bool bValid = lcl_ParseText(aText, nLine);
187 aBrk.
bEnabled = m_xCheckBox->get_active();
188 aBrk.
nStopAfter =
static_cast<size_t>(m_xNumericField->get_value());
189 m_aModifiedBreakPointList.InsertSorted(aBrk);
190 OUString aEntryStr(
"# " + OUString::number(aBrk.
nLine));
191 m_xComboBox->append_text(aEntryStr);
193 pDispatcher->Execute(SID_BASICIDE_BRKPNTSCHANGED);
197 m_xComboBox->set_active_text(aText);
198 m_xComboBox->grab_focus();
202 else if (&rButton == m_xDelButton.get())
204 int nEntry = m_xComboBox->find_text(m_xComboBox->get_active_text());
207 m_aModifiedBreakPointList.remove(nEntry);
208 m_xComboBox->remove(nEntry);
209 if (nEntry && nEntry >= m_xComboBox->get_count())
211 m_xComboBox->set_active_text(m_xComboBox->get_text(nEntry));
213 pDispatcher->Execute(SID_BASICIDE_BRKPNTSCHANGED);
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::SpinButton > m_xNumericField
BreakPointDialog(weld::Window *pParent, BreakPointList &rBrkList)
std::unique_ptr< weld::Button > m_xDelButton
std::unique_ptr< weld::Button > m_xNewButton
void SetCurrentBreakPoint(BreakPoint const &rBrk)
virtual ~BreakPointDialog() override
std::unique_ptr< weld::EntryTreeView > m_xComboBox
void UpdateFields(BreakPoint const &rBrk)
BreakPointList m_aModifiedBreakPointList
std::unique_ptr< weld::CheckButton > m_xCheckBox
std::unique_ptr< weld::Button > m_xOKButton
BreakPoint * GetSelectedBreakPoint()
BreakPoint * FindBreakPoint(sal_uInt16 nLine)
BreakPoint & at(size_t i)
std::shared_ptr< weld::Dialog > m_xDialog
std::unique_ptr< weld::Button > m_xOKButton
#define LINK(Instance, Class, Member)
SfxDispatcher * GetDispatcher()
IMPL_LINK(AccessibleDialogWindow, WindowEventListener, VclWindowEvent &, rEvent, void)
IMPL_LINK_NOARG(EditorWindow, SetSourceInBasicHdl, void *, void)