summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 12:48:11 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-13 15:11:13 +0100
commit6da61d5fa731fc34dc27607b6dc02b91928e4a54 (patch)
tree499df23c5ab574b94ba56fef9b884adc3d88c750 /basctl/source/basicide
parent65d6173152deab49f9c9ed138f6d9fa56008b800 (diff)
tdf#123936 Formatting files in module basctl with clang-format
Change-Id: I428d5642a19588456ff4af09e2f9f39ae17b2e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105644 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/basicmod.hxx6
-rw-r--r--basctl/source/basicide/brkdlg.cxx54
-rw-r--r--basctl/source/basicide/brkdlg.hxx12
-rw-r--r--basctl/source/basicide/linenumberwindow.cxx22
-rw-r--r--basctl/source/basicide/linenumberwindow.hxx11
-rw-r--r--basctl/source/basicide/textwindowpeer.hxx13
6 files changed, 51 insertions, 67 deletions
diff --git a/basctl/source/basicide/basicmod.hxx b/basctl/source/basicide/basicmod.hxx
index c15d53d85738..7a0175183dcb 100644
--- a/basctl/source/basicide/basicmod.hxx
+++ b/basctl/source/basicide/basicmod.hxx
@@ -17,19 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#pragma once
#include <sfx2/module.hxx>
namespace basctl
{
-
class Module : public SfxModule
{
public:
- Module(const OString& rResName, SfxObjectFactory *pObjFact)
- : SfxModule(rResName, {pObjFact})
+ Module(const OString& rResName, SfxObjectFactory* pObjFact)
+ : SfxModule(rResName, { pObjFact })
{
}
};
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index e5fafd545331..74d5be8542ca 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -28,22 +28,19 @@
namespace basctl
{
-
// FIXME Why does BreakPointDialog allow only sal_uInt16 for break-point line
// numbers, whereas BreakPoint supports sal_uLong?
namespace
{
-
-bool lcl_ParseText(OUString const &rText, size_t& rLineNr )
+bool lcl_ParseText(OUString const& rText, size_t& rLineNr)
{
// aText should look like "# n" where
// n > 0 && n < std::numeric_limits< sal_uInt16 >::max().
// All spaces are ignored, so there can even be spaces within the
// number n. (Maybe it would be better to ignore all whitespace instead
// of just spaces.)
- OUString aText(
- rText.replaceAll(" ", ""));
+ OUString aText(rText.replaceAll(" ", ""));
if (aText.isEmpty())
return false;
sal_Unicode cFirst = aText[0];
@@ -53,16 +50,17 @@ bool lcl_ParseText(OUString const &rText, size_t& rLineNr )
aText = aText.copy(1);
// XXX Assumes that sal_uInt16 is contained within sal_Int32:
sal_Int32 n = aText.toInt32();
- if ( n <= 0 )
+ if (n <= 0)
return false;
- rLineNr = static_cast< size_t >(n);
+ rLineNr = static_cast<size_t>(n);
return true;
}
} // namespace
BreakPointDialog::BreakPointDialog(weld::Window* pParent, BreakPointList& rBrkPntList)
- : GenericDialogController(pParent, "modules/BasicIDE/ui/managebreakpoints.ui", "ManageBreakpointsDialog")
+ : GenericDialogController(pParent, "modules/BasicIDE/ui/managebreakpoints.ui",
+ "ManageBreakpointsDialog")
, m_rOriginalBreakPointList(rBrkPntList)
, m_aModifiedBreakPointList(rBrkPntList)
, m_xComboBox(m_xBuilder->weld_entry_tree_view("entriesgrid", "entries", "entrieslist"))
@@ -76,10 +74,10 @@ BreakPointDialog::BreakPointDialog(weld::Window* pParent, BreakPointList& rBrkPn
m_xComboBox->set_height_request_by_rows(12);
m_xComboBox->freeze();
- for ( size_t i = 0, n = m_aModifiedBreakPointList.size(); i < n; ++i )
+ for (size_t i = 0, n = m_aModifiedBreakPointList.size(); i < n; ++i)
{
- BreakPoint& rBrk = m_aModifiedBreakPointList.at( i );
- OUString aEntryStr( "# " + OUString::number(rBrk.nLine) );
+ BreakPoint& rBrk = m_aModifiedBreakPointList.at(i);
+ OUString aEntryStr("# " + OUString::number(rBrk.nLine));
m_xComboBox->append_text(aEntryStr);
}
m_xComboBox->thaw();
@@ -101,20 +99,18 @@ BreakPointDialog::BreakPointDialog(weld::Window* pParent, BreakPointList& rBrkPn
m_xComboBox->set_active(0);
if (m_aModifiedBreakPointList.size())
- UpdateFields( m_aModifiedBreakPointList.at( 0 ) );
+ UpdateFields(m_aModifiedBreakPointList.at(0));
CheckButtons();
}
-BreakPointDialog::~BreakPointDialog()
-{
-}
+BreakPointDialog::~BreakPointDialog() {}
-void BreakPointDialog::SetCurrentBreakPoint( BreakPoint const & rBrk )
+void BreakPointDialog::SetCurrentBreakPoint(BreakPoint const& rBrk)
{
- OUString aStr( "# " + OUString::number(rBrk.nLine) );
+ OUString aStr("# " + OUString::number(rBrk.nLine));
m_xComboBox->set_entry_text(aStr);
- UpdateFields( rBrk );
+ UpdateFields(rBrk);
}
void BreakPointDialog::CheckButtons()
@@ -156,8 +152,8 @@ IMPL_LINK(BreakPointDialog, EditModifyHdl, weld::ComboBox&, rBox, void)
int nEntry = rBox.find_text(rBox.get_active_text());
if (nEntry == -1)
return;
- BreakPoint& rBrk = m_aModifiedBreakPointList.at( nEntry );
- UpdateFields( rBrk );
+ BreakPoint& rBrk = m_aModifiedBreakPointList.at(nEntry);
+ UpdateFields(rBrk);
}
IMPL_LINK(BreakPointDialog, FieldModifyHdl, weld::SpinButton&, rEdit, void)
@@ -186,17 +182,17 @@ IMPL_LINK(BreakPointDialog, ButtonHdl, weld::Button&, rButton, void)
// keep checkbox in mind!
OUString aText(m_xComboBox->get_active_text());
size_t nLine;
- bool bValid = lcl_ParseText( aText, nLine );
- if ( bValid )
+ bool bValid = lcl_ParseText(aText, nLine);
+ if (bValid)
{
- BreakPoint aBrk( nLine );
+ BreakPoint aBrk(nLine);
aBrk.bEnabled = m_xCheckBox->get_active();
aBrk.nStopAfter = static_cast<size_t>(m_xNumericField->get_value());
- m_aModifiedBreakPointList.InsertSorted( aBrk );
- OUString aEntryStr( "# " + OUString::number(aBrk.nLine) );
+ m_aModifiedBreakPointList.InsertSorted(aBrk);
+ OUString aEntryStr("# " + OUString::number(aBrk.nLine));
m_xComboBox->append_text(aEntryStr);
if (SfxDispatcher* pDispatcher = GetDispatcher())
- pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED );
+ pDispatcher->Execute(SID_BASICIDE_BRKPNTSCHANGED);
}
else
{
@@ -216,13 +212,13 @@ IMPL_LINK(BreakPointDialog, ButtonHdl, weld::Button&, rButton, void)
nEntry--;
m_xComboBox->set_active_text(m_xComboBox->get_text(nEntry));
if (SfxDispatcher* pDispatcher = GetDispatcher())
- pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED );
+ pDispatcher->Execute(SID_BASICIDE_BRKPNTSCHANGED);
CheckButtons();
}
}
}
-void BreakPointDialog::UpdateFields( BreakPoint const & rBrk )
+void BreakPointDialog::UpdateFields(BreakPoint const& rBrk)
{
m_xCheckBox->set_active(rBrk.bEnabled);
m_xNumericField->set_value(rBrk.nStopAfter);
@@ -233,7 +229,7 @@ BreakPoint* BreakPointDialog::GetSelectedBreakPoint()
int nEntry = m_xComboBox->find_text(m_xComboBox->get_active_text());
if (nEntry == -1)
return nullptr;
- return &m_aModifiedBreakPointList.at( nEntry );
+ return &m_aModifiedBreakPointList.at(nEntry);
}
} // namespace basctl
diff --git a/basctl/source/basicide/brkdlg.hxx b/basctl/source/basicide/brkdlg.hxx
index c0db6576ca9a..d3674c371a55 100644
--- a/basctl/source/basicide/brkdlg.hxx
+++ b/basctl/source/basicide/brkdlg.hxx
@@ -24,10 +24,9 @@
namespace basctl
{
-
class BreakPointDialog final : public weld::GenericDialogController
{
- BreakPointList & m_rOriginalBreakPointList;
+ BreakPointList& m_rOriginalBreakPointList;
BreakPointList m_aModifiedBreakPointList;
std::unique_ptr<weld::EntryTreeView> m_xComboBox;
@@ -37,21 +36,20 @@ class BreakPointDialog final : public weld::GenericDialogController
std::unique_ptr<weld::CheckButton> m_xCheckBox;
std::unique_ptr<weld::SpinButton> m_xNumericField;
- void CheckButtons();
+ void CheckButtons();
DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void);
DECL_LINK(EditModifyHdl, weld::ComboBox&, void);
DECL_LINK(FieldModifyHdl, weld::SpinButton&, void);
DECL_LINK(ButtonHdl, weld::Button&, void);
DECL_LINK(TreeModifyHdl, weld::TreeView&, bool);
- void UpdateFields( BreakPoint const & rBrk );
- BreakPoint* GetSelectedBreakPoint();
-
+ void UpdateFields(BreakPoint const& rBrk);
+ BreakPoint* GetSelectedBreakPoint();
public:
BreakPointDialog(weld::Window* pParent, BreakPointList& rBrkList);
virtual ~BreakPointDialog() override;
- void SetCurrentBreakPoint( BreakPoint const & rBrk );
+ void SetCurrentBreakPoint(BreakPoint const& rBrk);
};
} // namespace basctl
diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx
index 196339cb1b33..be9fe3752045 100644
--- a/basctl/source/basicide/linenumberwindow.cxx
+++ b/basctl/source/basicide/linenumberwindow.cxx
@@ -16,21 +16,17 @@
namespace basctl
{
-
-LineNumberWindow::LineNumberWindow (vcl::Window* pParent, ModulWindow* pModulWindow) :
- Window(pParent, WB_BORDER),
- m_pModulWindow(pModulWindow),
- m_nCurYOffset(0)
+LineNumberWindow::LineNumberWindow(vcl::Window* pParent, ModulWindow* pModulWindow)
+ : Window(pParent, WB_BORDER)
+ , m_pModulWindow(pModulWindow)
+ , m_nCurYOffset(0)
{
SetBackground(Wallpaper(GetSettings().GetStyleSettings().GetFieldColor()));
m_nBaseWidth = GetTextWidth("8");
m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2;
}
-LineNumberWindow::~LineNumberWindow()
-{
- disposeOnce();
-}
+LineNumberWindow::~LineNumberWindow() { disposeOnce(); }
void LineNumberWindow::dispose()
{
@@ -38,9 +34,9 @@ void LineNumberWindow::dispose()
Window::dispose();
}
-void LineNumberWindow::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle&)
+void LineNumberWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- if(SyncYOffset())
+ if (SyncYOffset())
return;
ExtTextEngine* txtEngine = m_pModulWindow->GetEditEngine();
@@ -86,7 +82,7 @@ void LineNumberWindow::Paint( vcl::RenderContext& rRenderContext, const tools::R
rRenderContext.DrawText(Point(0, y - m_nCurYOffset), OUString::number(n));
}
-void LineNumberWindow::DataChanged(DataChangedEvent const & rDCEvt)
+void LineNumberWindow::DataChanged(DataChangedEvent const& rDCEvt)
{
Window::DataChanged(rDCEvt);
if (rDCEvt.GetType() == DataChangedEventType::SETTINGS
@@ -108,7 +104,6 @@ void LineNumberWindow::DoScroll(tools::Long nVertScroll)
Window::Scroll(0, nVertScroll);
}
-
bool LineNumberWindow::SyncYOffset()
{
TextView* pView = m_pModulWindow->GetEditView();
@@ -124,7 +119,6 @@ bool LineNumberWindow::SyncYOffset()
return true;
}
-
} // namespace basctl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/linenumberwindow.hxx b/basctl/source/basicide/linenumberwindow.hxx
index 4125672689e1..14305116ef10 100644
--- a/basctl/source/basicide/linenumberwindow.hxx
+++ b/basctl/source/basicide/linenumberwindow.hxx
@@ -13,7 +13,6 @@
namespace basctl
{
-
class ModulWindow;
class LineNumberWindow : public vcl::Window
@@ -23,22 +22,22 @@ private:
int m_nWidth;
tools::Long m_nCurYOffset;
int m_nBaseWidth;
- virtual void DataChanged (DataChangedEvent const& rDCEvt) override;
+ virtual void DataChanged(DataChangedEvent const& rDCEvt) override;
protected:
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
public:
- LineNumberWindow (vcl::Window* pParent, ModulWindow* pModulWin);
+ LineNumberWindow(vcl::Window* pParent, ModulWindow* pModulWin);
virtual ~LineNumberWindow() override;
virtual void dispose() override;
- void DoScroll( tools::Long nVertScroll );
+ void DoScroll(tools::Long nVertScroll);
bool SyncYOffset();
- tools::Long& GetCurYOffset() { return m_nCurYOffset;}
+ tools::Long& GetCurYOffset() { return m_nCurYOffset; }
- int GetWidth() const { return m_nWidth;}
+ int GetWidth() const { return m_nWidth; }
};
} // namespace basctl
diff --git a/basctl/source/basicide/textwindowpeer.hxx b/basctl/source/basicide/textwindowpeer.hxx
index c5f87048d88f..8be9186f9f43 100644
--- a/basctl/source/basicide/textwindowpeer.hxx
+++ b/basctl/source/basicide/textwindowpeer.hxx
@@ -24,16 +24,15 @@
#include <com/sun/star/uno/Reference.hxx>
-namespace com::sun::star::awt {
- class XWindowPeer;
+namespace com::sun::star::awt
+{
+class XWindowPeer;
}
class TextView;
-namespace basctl {
-
-css::uno::Reference<css::awt::XWindowPeer> createTextWindowPeer(
- TextView & view);
-
+namespace basctl
+{
+css::uno::Reference<css::awt::XWindowPeer> createTextWindowPeer(TextView& view);
}
#endif