diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-06 18:50:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-07 11:41:51 +0200 |
commit | 8fe31ee550bd6f127b4c1ea335ef8177ccafa747 (patch) | |
tree | fa8df6ca3df1b0c29284c00e501d9819070ebe95 /reportdesign | |
parent | 65eb1595fc320b71937052da70bfc717ff34b18b (diff) |
ONavigator doesn't need a pimpl
it is module private
Change-Id: I21779fe8ac50aa4602e4c3d7798d0ced1ddab066
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139541
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/dlg/Navigator.cxx | 33 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/Navigator.hxx | 8 |
2 files changed, 12 insertions, 29 deletions
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 586494bbe2b9..2c4512470733 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -24,7 +24,6 @@ #include <ReportController.hxx> #include <UITools.hxx> #include <reportformula.hxx> -#include <com/sun/star/report/XReportDefinition.hpp> #include <com/sun/star/report/XFixedText.hpp> #include <com/sun/star/report/XFixedLine.hpp> #include <com/sun/star/report/XFormattedField.hpp> @@ -98,8 +97,6 @@ static OUString lcl_getName(const uno::Reference< beans::XPropertySet>& _xElemen return sName.makeStringAndClear(); } -namespace { - class NavigatorTree : public ::cppu::BaseMutex , public reportdesign::ITraverseReport , public comphelper::OSelectionChangeListener @@ -207,8 +204,6 @@ public: } }; -} - NavigatorTree::NavigatorTree(std::unique_ptr<weld::TreeView> xTreeView, OReportController& rController) : OPropertyChangeListener(m_aMutex) , m_xTreeView(std::move(xTreeView)) @@ -789,20 +784,10 @@ void NavigatorTree::UserData::_disposing(const lang::EventObject& _rSource) m_pTree->_disposing( _rSource ); } -class ONavigatorImpl -{ -public: - ONavigatorImpl(OReportController& rController, weld::Builder& rBuilder); - ONavigatorImpl(const ONavigatorImpl&) = delete; - ONavigatorImpl& operator=(const ONavigatorImpl&) = delete; - - uno::Reference< report::XReportDefinition> m_xReport; - std::unique_ptr<NavigatorTree> m_xNavigatorTree; -}; - -ONavigatorImpl::ONavigatorImpl(OReportController& rController, weld::Builder& rBuilder) - : m_xReport(rController.getReportDefinition()) - , m_xNavigatorTree(std::make_unique<NavigatorTree>(rBuilder.weld_tree_view("treeview"), rController)) +ONavigator::ONavigator(weld::Window* pParent, OReportController& rController) + : GenericDialogController(pParent, "modules/dbreport/ui/floatingnavigator.ui", "FloatingNavigator") + , m_xReport(rController.getReportDefinition()) + , m_xNavigatorTree(std::make_unique<NavigatorTree>(m_xBuilder->weld_tree_view("treeview"), rController)) { reportdesign::OReportVisitor aVisitor(m_xNavigatorTree.get()); aVisitor.start(m_xReport); @@ -811,13 +796,7 @@ ONavigatorImpl::ONavigatorImpl(OReportController& rController, weld::Builder& rB m_xNavigatorTree->expand_row(*xScratch); lang::EventObject aEvent(rController); m_xNavigatorTree->_selectionChanged(aEvent); -} - -ONavigator::ONavigator(weld::Window* pParent, OReportController& rController) - : GenericDialogController(pParent, "modules/dbreport/ui/floatingnavigator.ui", "FloatingNavigator") -{ - m_pImpl.reset(new ONavigatorImpl(rController, *m_xBuilder)); - m_pImpl->m_xNavigatorTree->grab_focus(); + m_xNavigatorTree->grab_focus(); m_xDialog->connect_container_focus_changed(LINK(this, ONavigator, FocusChangeHdl)); } @@ -829,7 +808,7 @@ ONavigator::~ONavigator() IMPL_LINK_NOARG(ONavigator, FocusChangeHdl, weld::Container&, void) { if (m_xDialog->has_toplevel_focus()) - m_pImpl->m_xNavigatorTree->grab_focus(); + m_xNavigatorTree->grab_focus(); } } // rptui diff --git a/reportdesign/source/ui/inc/Navigator.hxx b/reportdesign/source/ui/inc/Navigator.hxx index eed3e529c00d..f201472147f5 100644 --- a/reportdesign/source/ui/inc/Navigator.hxx +++ b/reportdesign/source/ui/inc/Navigator.hxx @@ -19,15 +19,19 @@ #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_NAVIGATOR_HXX #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_NAVIGATOR_HXX +#include <com/sun/star/report/XReportDefinition.hpp> #include <vcl/weld.hxx> #include <memory> + namespace rptui { + class NavigatorTree; class OReportController; - class ONavigatorImpl; class ONavigator : public weld::GenericDialogController { - ::std::unique_ptr<ONavigatorImpl> m_pImpl; + css::uno::Reference< css::report::XReportDefinition> m_xReport; + std::unique_ptr<NavigatorTree> m_xNavigatorTree; + ONavigator(const ONavigator&) = delete; void operator =(const ONavigator&) = delete; |