diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-26 13:14:14 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 21:38:43 +0100 |
commit | 074ef56bb08795bbf85082eab7907dc7f93d48b7 (patch) | |
tree | 66ec50b94b2b3d4747809a79860a7fc28884edee /reportdesign/source/ui/report | |
parent | a3cc3ce5a412112500606827fc99275e28898fff (diff) |
vcl: VclPtr conversion in reportdesign
Change-Id: Iadbd90bfe2cdf6afff3d745ac488036c3d031963
Diffstat (limited to 'reportdesign/source/ui/report')
-rw-r--r-- | reportdesign/source/ui/report/DesignView.cxx | 117 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportWindow.cxx | 141 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ScrollHelper.cxx | 129 | ||||
-rw-r--r-- | reportdesign/source/ui/report/SectionWindow.cxx | 132 | ||||
-rw-r--r-- | reportdesign/source/ui/report/StartMarker.cxx | 93 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/report/propbrw.cxx | 6 |
8 files changed, 347 insertions, 283 deletions
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 96953d86019a..ed975eb8fc28 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -84,9 +84,9 @@ ODesignView::ODesignView( vcl::Window* pParent, const Reference< XComponentContext >& _rxOrb, OReportController& _rController) : ODataView( pParent, _rController, _rxOrb, WB_DIALOGCONTROL ) - ,m_aSplitWin(this) + ,m_aSplitWin(new SplitWindow(this)) ,m_rReportController( _rController ) - ,m_aScrollWindow(this) + ,m_aScrollWindow(new rptui::OScrollWindowHelper(this)) ,m_pPropWin(NULL) ,m_pAddField(NULL) ,m_pCurrentView(NULL) @@ -109,14 +109,14 @@ ODesignView::ODesignView( vcl::Window* pParent, // now create the task pane on the right side :-) m_pTaskPane = new OTaskWindow(this); - m_aSplitWin.InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET ); - m_aSplitWin.InsertItem( REPORT_ID, &m_aScrollWindow, 100, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE); + m_aSplitWin->InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET ); + m_aSplitWin->InsertItem( REPORT_ID, m_aScrollWindow.get(), 100, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE); // Splitter einrichten - m_aSplitWin.SetSplitHdl(LINK(this, ODesignView,SplitHdl)); - m_aSplitWin.ShowAutoHideButton(); - m_aSplitWin.SetAlign(WINDOWALIGN_LEFT); - m_aSplitWin.Show(); + m_aSplitWin->SetSplitHdl(LINK(this, ODesignView,SplitHdl)); + m_aSplitWin->ShowAutoHideButton(); + m_aSplitWin->SetAlign(WINDOWALIGN_LEFT); + m_aSplitWin->Show(); m_aMarkIdle.SetPriority( SchedulerPriority::LOW ); m_aMarkIdle.SetIdleHdl( LINK( this, ODesignView, MarkTimeout ) ); @@ -125,9 +125,14 @@ ODesignView::ODesignView( vcl::Window* pParent, ODesignView::~ODesignView() { + dispose(); +} + +void ODesignView::dispose() +{ m_bDeleted = true; Hide(); - m_aScrollWindow.Hide(); + m_aScrollWindow->Hide(); m_aMarkIdle.Stop(); if ( m_pPropWin ) { @@ -155,13 +160,17 @@ ODesignView::~ODesignView() ::std::unique_ptr<vcl::Window> aTemp2(m_pTaskPane); m_pTaskPane = NULL; } + + m_aSplitWin.disposeAndClear(); + m_aScrollWindow.disposeAndClear(); + dbaui::ODataView::dispose(); } void ODesignView::initialize() { SetMapMode( MapMode( MAP_100TH_MM ) ); - m_aScrollWindow.initialize(); - m_aScrollWindow.Show(); + m_aScrollWindow->initialize(); + m_aScrollWindow->Show(); } void ODesignView::DataChanged( const DataChangedEvent& rDCEvt ) @@ -231,7 +240,7 @@ void ODesignView::resizeDocumentView(Rectangle& _rPlayground) } } - if ( m_aSplitWin.IsItemValid(TASKPANE_ID) ) + if ( m_aSplitWin->IsItemValid(TASKPANE_ID) ) { // normalize the split pos const long nSplitterWidth = GetSettings().GetStyleSettings().GetSplitSize(); @@ -248,15 +257,15 @@ void ODesignView::resizeDocumentView(Rectangle& _rPlayground) getController().setSplitPos(nSplitPos); const long nTaskPaneSize = static_cast<long>((aPlaygroundSize.Width() - aTaskPanePos.X())*100/aPlaygroundSize.Width()); - if ( m_aSplitWin.GetItemSize( TASKPANE_ID ) != nTaskPaneSize ) + if ( m_aSplitWin->GetItemSize( TASKPANE_ID ) != nTaskPaneSize ) { - m_aSplitWin.SetItemSize( REPORT_ID, 99 - nTaskPaneSize ); - m_aSplitWin.SetItemSize( TASKPANE_ID, nTaskPaneSize ); + m_aSplitWin->SetItemSize( REPORT_ID, 99 - nTaskPaneSize ); + m_aSplitWin->SetItemSize( TASKPANE_ID, nTaskPaneSize ); } } } // set the size of the report window - m_aSplitWin.SetPosSizePixel( _rPlayground.TopLeft(),aPlaygroundSize ); + m_aSplitWin->SetPosSizePixel( _rPlayground.TopLeft(),aPlaygroundSize ); } // just for completeness: there is no space left, we occupied it all ... _rPlayground.SetPos( _rPlayground.BottomRight() ); @@ -288,18 +297,18 @@ void ODesignView::SetMode( DlgEdMode _eNewMode ) if ( m_eMode == RPTUI_SELECT ) m_eActObj = OBJ_NONE; - m_aScrollWindow.SetMode(_eNewMode); + m_aScrollWindow->SetMode(_eNewMode); } void ODesignView::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType ) { m_eActObj = eObj; - m_aScrollWindow.SetInsertObj( eObj,_sShapeType ); + m_aScrollWindow->SetInsertObj( eObj,_sShapeType ); } OUString ODesignView::GetInsertObjString() const { - return m_aScrollWindow.GetInsertObjString(); + return m_aScrollWindow->GetInsertObjString(); } @@ -315,30 +324,30 @@ void ODesignView::Cut() void ODesignView::Copy() { - m_aScrollWindow.Copy(); + m_aScrollWindow->Copy(); } void ODesignView::Paste() { - m_aScrollWindow.Paste(); + m_aScrollWindow->Paste(); } void ODesignView::Delete() { - m_aScrollWindow.Delete(); + m_aScrollWindow->Delete(); } bool ODesignView::HasSelection() const { - return m_aScrollWindow.HasSelection(); + return m_aScrollWindow->HasSelection(); } bool ODesignView::IsPasteAllowed() const { - return m_aScrollWindow.IsPasteAllowed(); + return m_aScrollWindow->IsPasteAllowed(); } @@ -347,10 +356,10 @@ void ODesignView::UpdatePropertyBrowserDelayed(OSectionView& _rView) if ( m_pCurrentView != &_rView ) { if ( m_pCurrentView ) - m_aScrollWindow.setMarked(m_pCurrentView,false); + m_aScrollWindow->setMarked(m_pCurrentView,false); m_pCurrentView = &_rView; if ( m_pCurrentView ) - m_aScrollWindow.setMarked(m_pCurrentView,true); + m_aScrollWindow->setMarked(m_pCurrentView,true); m_xReportComponent.clear(); DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED ); Broadcast( aHint ); @@ -361,27 +370,27 @@ void ODesignView::UpdatePropertyBrowserDelayed(OSectionView& _rView) void ODesignView::toggleGrid(bool _bGridVisible) { - m_aScrollWindow.toggleGrid(_bGridVisible); + m_aScrollWindow->toggleGrid(_bGridVisible); } sal_uInt16 ODesignView::getSectionCount() const { - return m_aScrollWindow.getSectionCount(); + return m_aScrollWindow->getSectionCount(); } void ODesignView::showRuler(bool _bShow) { - m_aScrollWindow.showRuler(_bShow); + m_aScrollWindow->showRuler(_bShow); } void ODesignView::removeSection(sal_uInt16 _nPosition) { - m_aScrollWindow.removeSection(_nPosition); + m_aScrollWindow->removeSection(_nPosition); } void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const OUString& _sColorEntry,sal_uInt16 _nPosition) { - m_aScrollWindow.addSection(_xSection,_sColorEntry,_nPosition); + m_aScrollWindow->addSection(_xSection,_sColorEntry,_nPosition); } void ODesignView::GetFocus() @@ -390,7 +399,7 @@ void ODesignView::GetFocus() if ( !m_bDeleted ) { - ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aScrollWindow.getMarkedSection(); + ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aScrollWindow->getMarkedSection(); if ( pSectionWindow ) pSectionWindow->GrabFocus(); } @@ -406,12 +415,12 @@ void ODesignView::ImplInitSettings() IMPL_LINK( ODesignView, SplitHdl, void*, ) { const Size aOutputSize = GetOutputSizePixel(); - const long nTest = aOutputSize.Width() * m_aSplitWin.GetItemSize(TASKPANE_ID) / 100; + const long nTest = aOutputSize.Width() * m_aSplitWin->GetItemSize(TASKPANE_ID) / 100; long nMinWidth = static_cast<long>(0.1*aOutputSize.Width()); if ( m_pPropWin && m_pPropWin->IsVisible() ) nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width(); - if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow.getMaxMarkerWidth(false) ) + if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow->getMaxMarkerWidth(false) ) { long nOldSplitPos = getController().getSplitPos(); (void)nOldSplitPos; @@ -423,12 +432,12 @@ IMPL_LINK( ODesignView, SplitHdl, void*, ) void ODesignView::SelectAll(const sal_uInt16 _nObjectType) { - m_aScrollWindow.SelectAll(_nObjectType); + m_aScrollWindow->SelectAll(_nObjectType); } void ODesignView::unmarkAllObjects(OSectionView* _pSectionView) { - m_aScrollWindow.unmarkAllObjects(_pSectionView); + m_aScrollWindow->unmarkAllObjects(_pSectionView); } void ODesignView::togglePropertyBrowser(bool _bToogleOn) @@ -451,9 +460,9 @@ void ODesignView::togglePropertyBrowser(bool _bToogleOn) m_pTaskPane->Invalidate(); if ( bWillBeVisible ) - m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE); + m_aSplitWin->InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE); else - m_aSplitWin.RemoveItem(TASKPANE_ID); + m_aSplitWin->RemoveItem(TASKPANE_ID); if ( bWillBeVisible ) m_aMarkIdle.Start(); @@ -466,7 +475,7 @@ void ODesignView::showProperties(const uno::Reference< uno::XInterface>& _xRepor { m_xReportComponent = _xReportComponent; if ( m_pCurrentView ) - m_aScrollWindow.setMarked(m_pCurrentView,false); + m_aScrollWindow->setMarked(m_pCurrentView,false); m_pCurrentView = NULL; m_aMarkIdle.Start(); } @@ -553,27 +562,27 @@ uno::Reference< report::XReportComponent > ODesignView::getCurrentControlModel() ::boost::shared_ptr<OSectionWindow> ODesignView::getMarkedSection(NearSectionAccess nsa) const { - return m_aScrollWindow.getMarkedSection(nsa); + return m_aScrollWindow->getMarkedSection(nsa); } ::boost::shared_ptr<OSectionWindow> ODesignView::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const { - return m_aScrollWindow.getSectionWindow(_xSection); + return m_aScrollWindow->getSectionWindow(_xSection); } void ODesignView::markSection(const sal_uInt16 _nPos) { - m_aScrollWindow.markSection(_nPos); + m_aScrollWindow->markSection(_nPos); } void ODesignView::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const { - m_aScrollWindow.fillCollapsedSections(_rCollapsedPositions); + m_aScrollWindow->fillCollapsedSections(_rCollapsedPositions); } void ODesignView::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections) { - m_aScrollWindow.collapseSections(_aCollpasedSections); + m_aScrollWindow->collapseSections(_aCollpasedSections); } OUString ODesignView::getCurrentPage() const @@ -589,7 +598,7 @@ void ODesignView::setCurrentPage(const OUString& _sLastActivePage) void ODesignView::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects) { - m_aScrollWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects); + m_aScrollWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects); } bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent) @@ -600,12 +609,12 @@ bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent) return false; if ( (m_pReportExplorer && m_pReportExplorer->HasChildPathFocus()) ) return false; - return m_aScrollWindow.handleKeyEvent(_rEvent); + return m_aScrollWindow->handleKeyEvent(_rEvent); } void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,bool _bMark) { - m_aScrollWindow.setMarked(_xSection,_bMark); + m_aScrollWindow->setMarked(_xSection,_bMark); if ( _bMark ) UpdatePropertyBrowserDelayed(getMarkedSection()->getReportSection().getSectionView()); else @@ -614,7 +623,7 @@ void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,b void ODesignView::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes,bool _bMark) { - m_aScrollWindow.setMarked(_aShapes,_bMark); + m_aScrollWindow->setMarked(_aShapes,_bMark); if ( _aShapes.hasElements() && _bMark ) showProperties(_aShapes[0]); else @@ -655,18 +664,18 @@ uno::Any ODesignView::getCurrentlyShownProperty() const void ODesignView::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const { - m_aScrollWindow.fillControlModelSelection(_rSelection); + m_aScrollWindow->fillControlModelSelection(_rSelection); } void ODesignView::setGridSnap(bool bOn) { - m_aScrollWindow.setGridSnap(bOn); + m_aScrollWindow->setGridSnap(bOn); } void ODesignView::setDragStripes(bool bOn) { - m_aScrollWindow.setDragStripes(bOn); + m_aScrollWindow->setDragStripes(bOn); } bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const @@ -676,17 +685,17 @@ bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const sal_uInt32 ODesignView::getMarkedObjectCount() const { - return m_aScrollWindow.getMarkedObjectCount(); + return m_aScrollWindow->getMarkedObjectCount(); } void ODesignView::zoom(const Fraction& _aZoom) { - m_aScrollWindow.zoom(_aZoom); + m_aScrollWindow->zoom(_aZoom); } sal_uInt16 ODesignView::getZoomFactor(SvxZoomType _eType) const { - return m_aScrollWindow.getZoomFactor(_eType); + return m_aScrollWindow->getZoomFactor(_eType); } } // rptui diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 1a70619ecc33..fffd3c9d884b 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -111,6 +111,11 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re OReportSection::~OReportSection() { + dispose(); +} + +void OReportSection::dispose() +{ m_pPage = NULL; if ( m_pMulti.is() ) m_pMulti->dispose(); @@ -125,6 +130,7 @@ OReportSection::~OReportSection() m_pView->EndListening( *m_pModel ); m_pView = NULL; } + vcl::Window::dispose(); } void OReportSection::Paint( const Rectangle& rRect ) diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 74148f6700f3..42c346840c44 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -58,26 +58,26 @@ using namespace ::comphelper; OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView) : Window(_pParent,WB_DIALOGCONTROL) , ::comphelper::OPropertyChangeListener(m_aMutex) -,m_aHRuler(this) +,m_aHRuler(new Ruler(this)) ,m_pView(_pView) ,m_pParent(_pParent) -,m_aViewsWindow(this) +,m_aViewsWindow(new rptui::OViewsWindow(this)) ,m_pObjFac( new DlgEdFactory() ) { SetHelpId(UID_RPT_REPORTWINDOW); SetMapMode( MapMode( MAP_100TH_MM ) ); - m_aViewsWindow.Show(); + m_aViewsWindow->Show(); - m_aHRuler.Show(); - m_aHRuler.Activate(); - m_aHRuler.SetPagePos(0); - m_aHRuler.SetBorders(); - m_aHRuler.SetIndents(); - m_aHRuler.SetMargin1(); - m_aHRuler.SetMargin2(); + m_aHRuler->Show(); + m_aHRuler->Activate(); + m_aHRuler->SetPagePos(0); + m_aHRuler->SetBorders(); + m_aHRuler->SetIndents(); + m_aHRuler->SetMargin1(); + m_aHRuler->SetMargin2(); const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); - m_aHRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); + m_aHRuler->SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); ImplInitSettings(); m_pReportListener = addStyleListener(_pView->getController().getReportDefinition(),this); @@ -85,31 +85,38 @@ OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView) OReportWindow::~OReportWindow() { + dispose(); +} + +void OReportWindow::dispose() +{ if ( m_pReportListener.is() ) m_pReportListener->dispose(); + m_aHRuler.disposeAndClear(); + m_aViewsWindow.disposeAndClear(); + vcl::Window::dispose(); } void OReportWindow::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType ) { - m_aViewsWindow.SetInsertObj( eObj,_sShapeType); + m_aViewsWindow->SetInsertObj( eObj,_sShapeType); } - OUString OReportWindow::GetInsertObjString() const { - return m_aViewsWindow.GetInsertObjString(); + return m_aViewsWindow->GetInsertObjString(); } void OReportWindow::SetMode( DlgEdMode eNewMode ) { - m_aViewsWindow.SetMode(eNewMode); + m_aViewsWindow->SetMode(eNewMode); } void OReportWindow::removeSection(sal_uInt16 _nPosition) { - m_aViewsWindow.removeSection(_nPosition); + m_aViewsWindow->removeSection(_nPosition); m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight()); - m_aViewsWindow.Invalidate(INVALIDATE_TRANSPARENT); + m_aViewsWindow->Invalidate(INVALIDATE_TRANSPARENT); } void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const OUString& _sColorEntry,sal_uInt16 _nPosition) @@ -117,27 +124,27 @@ void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSecti if ( !_xSection.is() ) return; - m_aViewsWindow.addSection(_xSection,_sColorEntry,_nPosition); + m_aViewsWindow->addSection(_xSection,_sColorEntry,_nPosition); m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight()); } void OReportWindow::toggleGrid(bool _bVisible) { - m_aViewsWindow.toggleGrid(_bVisible); + m_aViewsWindow->toggleGrid(_bVisible); } void OReportWindow::showRuler(bool _bShow) { - m_aHRuler.Show(_bShow); + m_aHRuler->Show(_bShow); - m_aViewsWindow.showRuler(_bShow); + m_aViewsWindow->showRuler(_bShow); } sal_Int32 OReportWindow::getMaxMarkerWidth(bool _bWithEnd) const { Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); - aStartWidth *= m_aViewsWindow.GetMapMode().GetScaleX(); + aStartWidth *= m_aViewsWindow->GetMapMode().GetScaleX(); if ( _bWithEnd ) aStartWidth += Fraction(long(REPORT_ENDMARKER_WIDTH)); return sal_Int32((long)aStartWidth); @@ -146,7 +153,7 @@ sal_Int32 OReportWindow::getMaxMarkerWidth(bool _bWithEnd) const sal_Int32 OReportWindow::GetTotalWidth() const { sal_Int32 nWidth = 0; - if ( !m_aViewsWindow.empty() ) + if ( !m_aViewsWindow->empty() ) { Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH )); const Fraction aZoom(m_pView->getController().getZoomValue(),100); @@ -163,7 +170,7 @@ sal_Int32 OReportWindow::GetTotalWidth() const void OReportWindow::Resize() { Window::Resize(); - if ( !m_aViewsWindow.empty() ) + if ( !m_aViewsWindow->empty() ) { const Size aTotalOutputSize = GetOutputSizePixel(); Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100); @@ -174,26 +181,26 @@ void OReportWindow::Resize() const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width; sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN); sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN); - Size aPageSize = m_aViewsWindow.LogicToPixel(Size(nPaperWidth ,0)); - nLeftMargin = m_aViewsWindow.LogicToPixel(Size(nLeftMargin,0)).Width(); - nRightMargin = m_aViewsWindow.LogicToPixel(Size(nRightMargin,0)).Width(); + Size aPageSize = m_aViewsWindow->LogicToPixel(Size(nPaperWidth ,0)); + nLeftMargin = m_aViewsWindow->LogicToPixel(Size(nLeftMargin,0)).Width(); + nRightMargin = m_aViewsWindow->LogicToPixel(Size(nRightMargin,0)).Width(); - aPageSize.Height() = m_aHRuler.GetSizePixel().Height(); + aPageSize.Height() = m_aHRuler->GetSizePixel().Height(); - const long nTermp(m_aViewsWindow.getTotalHeight() + aPageSize.Height()); + const long nTermp(m_aViewsWindow->getTotalHeight() + aPageSize.Height()); long nSectionsHeight = ::std::max<long>(nTermp,aTotalOutputSize.Height()); - m_aHRuler.SetPosSizePixel(aStartPoint,aPageSize); - m_aHRuler.SetNullOffset(nLeftMargin); - m_aHRuler.SetMargin1(0); - m_aHRuler.SetMargin2(aPageSize.Width() - nLeftMargin - nRightMargin); + m_aHRuler->SetPosSizePixel(aStartPoint,aPageSize); + m_aHRuler->SetNullOffset(nLeftMargin); + m_aHRuler->SetMargin1(0); + m_aHRuler->SetMargin2(aPageSize.Width() - nLeftMargin - nRightMargin); aStartPoint.Y() += aPageSize.Height(); nSectionsHeight -= aStartPoint.Y(); aStartPoint.X() = aOffset.X(); - m_aViewsWindow.SetPosSizePixel(aStartPoint,Size(aTotalOutputSize.Width(),nSectionsHeight)); + m_aViewsWindow->SetPosSizePixel(aStartPoint,Size(aTotalOutputSize.Width(),nSectionsHeight)); } } @@ -221,26 +228,26 @@ void OReportWindow::DataChanged( const DataChangedEvent& rDCEvt ) sal_Int32 OReportWindow::GetTotalHeight() const { - return m_aViewsWindow.getTotalHeight(); + return m_aViewsWindow->getTotalHeight(); } void OReportWindow::ScrollChildren(const Point& _aThumbPos) { - MapMode aMap = m_aHRuler.GetMapMode(); + MapMode aMap = m_aHRuler->GetMapMode(); Point aOrg( aMap.GetOrigin() ); if ( aOrg.X() != (-_aThumbPos.X()) ) { aMap.SetOrigin( Point(- _aThumbPos.X(), aOrg.Y())); - m_aHRuler.SetMapMode( aMap ); - m_aHRuler.Scroll(-(aOrg.X() + _aThumbPos.X()),0); + m_aHRuler->SetMapMode( aMap ); + m_aHRuler->Scroll(-(aOrg.X() + _aThumbPos.X()),0); } - m_aViewsWindow.scrollChildren(_aThumbPos); + m_aViewsWindow->scrollChildren(_aThumbPos); } sal_uInt16 OReportWindow::getSectionCount() const { - return m_aViewsWindow.getSectionCount(); + return m_aViewsWindow->getSectionCount(); } void OReportWindow::notifySizeChanged() @@ -250,129 +257,129 @@ void OReportWindow::notifySizeChanged() bool OReportWindow::HasSelection() const { - return m_aViewsWindow.HasSelection(); + return m_aViewsWindow->HasSelection(); } void OReportWindow::Delete() { - m_aViewsWindow.Delete(); + m_aViewsWindow->Delete(); } void OReportWindow::Copy() { - m_aViewsWindow.Copy(); + m_aViewsWindow->Copy(); } void OReportWindow::Paste() { - m_aViewsWindow.Paste(); + m_aViewsWindow->Paste(); } bool OReportWindow::IsPasteAllowed() const { - return m_aViewsWindow.IsPasteAllowed(); + return m_aViewsWindow->IsPasteAllowed(); } void OReportWindow::SelectAll(const sal_uInt16 _nObjectType) { - m_aViewsWindow.SelectAll(_nObjectType); + m_aViewsWindow->SelectAll(_nObjectType); } void OReportWindow::unmarkAllObjects(OSectionView* _pSectionView) { - m_aViewsWindow.unmarkAllObjects(_pSectionView); + m_aViewsWindow->unmarkAllObjects(_pSectionView); } void OReportWindow::showProperties(const uno::Reference< report::XSection>& _xReportComponent) { - ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aViewsWindow.getSectionWindow( _xReportComponent ); + ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aViewsWindow->getSectionWindow( _xReportComponent ); m_pView->UpdatePropertyBrowserDelayed(pSectionWindow->getReportSection().getSectionView()); } bool OReportWindow::handleKeyEvent(const KeyEvent& _rEvent) { - return m_aViewsWindow.handleKeyEvent(_rEvent); + return m_aViewsWindow->handleKeyEvent(_rEvent); } void OReportWindow::setMarked(OSectionView* _pSectionView, bool _bMark) { if ( _pSectionView ) - m_aViewsWindow.setMarked(_pSectionView,_bMark); + m_aViewsWindow->setMarked(_pSectionView,_bMark); } void OReportWindow::setMarked(const uno::Reference< report::XSection>& _xSection, bool _bMark) { - m_aViewsWindow.setMarked(_xSection,_bMark); + m_aViewsWindow->setMarked(_xSection,_bMark); } void OReportWindow::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape, bool _bMark) { - m_aViewsWindow.setMarked(_xShape,_bMark); + m_aViewsWindow->setMarked(_xShape,_bMark); } ::boost::shared_ptr<OSectionWindow> OReportWindow::getMarkedSection(NearSectionAccess nsa) const { - return m_aViewsWindow.getMarkedSection(nsa); + return m_aViewsWindow->getMarkedSection(nsa); } ::boost::shared_ptr<OSectionWindow> OReportWindow::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const { - return m_aViewsWindow.getSectionWindow(_xSection); + return m_aViewsWindow->getSectionWindow(_xSection); } void OReportWindow::markSection(const sal_uInt16 _nPos) { - m_aViewsWindow.markSection(_nPos); + m_aViewsWindow->markSection(_nPos); } void OReportWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const { - m_aViewsWindow.fillCollapsedSections(_rCollapsedPositions); + m_aViewsWindow->fillCollapsedSections(_rCollapsedPositions); } void OReportWindow::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections) { - m_aViewsWindow.collapseSections(_aCollpasedSections); + m_aViewsWindow->collapseSections(_aCollpasedSections); } void OReportWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects) { - m_aViewsWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects); + m_aViewsWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects); } void OReportWindow::setGridSnap(bool bOn) { - m_aViewsWindow.setGridSnap(bOn); + m_aViewsWindow->setGridSnap(bOn); } void OReportWindow::setDragStripes(bool bOn) { - m_aViewsWindow.setDragStripes(bOn); + m_aViewsWindow->setDragStripes(bOn); } sal_uInt32 OReportWindow::getMarkedObjectCount() const { - return m_aViewsWindow.getMarkedObjectCount(); + return m_aViewsWindow->getMarkedObjectCount(); } void OReportWindow::zoom(const Fraction& _aZoom) { - m_aHRuler.SetZoom(_aZoom); - m_aHRuler.Invalidate(); + m_aHRuler->SetZoom(_aZoom); + m_aHRuler->Invalidate(); - m_aViewsWindow.zoom(_aZoom); + m_aViewsWindow->zoom(_aZoom); notifySizeChanged(); const Point aNewThumbPos( m_pParent->getThumbPos() ); @@ -385,7 +392,7 @@ void OReportWindow::zoom(const Fraction& _aZoom) void OReportWindow::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const { - m_aViewsWindow.fillControlModelSelection(_rSelection); + m_aViewsWindow->fillControlModelSelection(_rSelection); } sal_Int32 OReportWindow::impl_getRealPixelWidth() const @@ -411,7 +418,7 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const { nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); MapMode aMap( MAP_100TH_MM ); - const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap); + const Size aHeight = m_aViewsWindow->LogicToPixel(m_aViewsWindow->PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler->GetSizePixel().Height())),aMap); nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height())); } break; @@ -429,7 +436,7 @@ void OReportWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) { (void)_rEvent; Resize(); - m_aViewsWindow.Resize(); + m_aViewsWindow->Resize(); static sal_Int32 nIn = INVALIDATE_TRANSPARENT; Invalidate(nIn); } diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index d5cf903a4bac..d43068c02dca 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -46,20 +46,20 @@ void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& _aSize OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView) : OScrollWindowHelper_BASE( _pDesignView,WB_DIALOGCONTROL) ,OPropertyChangeListener(m_aMutex) - ,m_aHScroll( this, WB_HSCROLL|WB_REPEAT|WB_DRAG ) - ,m_aVScroll( this, WB_VSCROLL|WB_REPEAT|WB_DRAG ) - ,m_aCornerWin( this ) + ,m_aHScroll( new ScrollBar(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) ) + ,m_aVScroll( new ScrollBar(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) ) + ,m_aCornerWin( new ScrollBarBox(this) ) ,m_pParent(_pDesignView) - ,m_aReportWindow(this,m_pParent) + ,m_aReportWindow(new rptui::OReportWindow(this,m_pParent)) ,m_pReportDefintionMultiPlexer(NULL) { SetMapMode( MapMode( MAP_100TH_MM ) ); - impl_initScrollBar( m_aHScroll ); - impl_initScrollBar( m_aVScroll ); + impl_initScrollBar( *m_aHScroll.get() ); + impl_initScrollBar( *m_aVScroll.get() ); - m_aReportWindow.SetMapMode( MapMode( MAP_100TH_MM ) ); - m_aReportWindow.Show(); + m_aReportWindow->SetMapMode( MapMode( MAP_100TH_MM ) ); + m_aReportWindow->Show(); // normally we should be SCROLL_PANE SetAccessibleRole(css::accessibility::AccessibleRole::SCROLL_PANE); @@ -69,8 +69,19 @@ OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView) OScrollWindowHelper::~OScrollWindowHelper() { + dispose(); +} + +void OScrollWindowHelper::dispose() +{ if ( m_pReportDefintionMultiPlexer.is() ) m_pReportDefintionMultiPlexer->dispose(); + + m_aHScroll.disposeAndClear(); + m_aVScroll.disposeAndClear(); + m_aCornerWin.disposeAndClear(); + m_aReportWindow.disposeAndClear(); + OScrollWindowHelper_BASE::dispose(); } @@ -101,8 +112,8 @@ void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight) // now set the ranges without start marker Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100); long nWidth = long(_nWidth - (double)aStartWidth); - m_aHScroll.SetRangeMax( nWidth ); - m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() ); + m_aHScroll->SetRangeMax( nWidth ); + m_aVScroll->SetRangeMax( m_aTotalPixelSize.Height() ); Resize(); } @@ -114,7 +125,7 @@ Size OScrollWindowHelper::ResizeScrollBars() if ( aOutPixSz.Width() == 0 || aOutPixSz.Height() == 0 ) return aOutPixSz; - aOutPixSz.Height() -= m_aReportWindow.getRulerHeight(); + aOutPixSz.Height() -= m_aReportWindow->getRulerHeight(); // determine the size of the output-area and if we need scrollbars const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize(); bool bVVisible = false; // by default no vertical-ScrollBar @@ -143,31 +154,31 @@ Size OScrollWindowHelper::ResizeScrollBars() } while ( bChanged ); // until no visibility has changed - aOutPixSz.Height() += m_aReportWindow.getRulerHeight(); + aOutPixSz.Height() += m_aReportWindow->getRulerHeight(); // show or hide scrollbars - m_aVScroll.Show( bVVisible ); - m_aHScroll.Show( bHVisible ); + m_aVScroll->Show( bVVisible ); + m_aHScroll->Show( bHVisible ); // disable painting in the corner between the scrollbars if ( bVVisible && bHVisible ) { - m_aCornerWin.SetPosSizePixel(Point(aOutPixSz.Width(), aOutPixSz.Height()), Size(nScrSize, nScrSize) ); - m_aCornerWin.Show(); + m_aCornerWin->SetPosSizePixel(Point(aOutPixSz.Width(), aOutPixSz.Height()), Size(nScrSize, nScrSize) ); + m_aCornerWin->Show(); } else - m_aCornerWin.Hide(); + m_aCornerWin->Hide(); const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT ); // resize scrollbars and set their ranges { Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100); const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - (long)aStartWidth; - lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll); + lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ), Size( nNewWidth, nScrSize ), *m_aHScroll.get()); } { - const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow.getRulerHeight(); - lcl_setScrollBar(nNewHeight,Point( aOutPixSz.Width(), m_aReportWindow.getRulerHeight() ),Size( nScrSize,nNewHeight),m_aVScroll); + const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow->getRulerHeight(); + lcl_setScrollBar(nNewHeight,Point( aOutPixSz.Width(), m_aReportWindow->getRulerHeight() ), Size( nScrSize,nNewHeight), *m_aVScroll.get()); } return aOutPixSz; @@ -178,12 +189,12 @@ void OScrollWindowHelper::Resize() OScrollWindowHelper_BASE::Resize(); const Size aTotalOutputSize = ResizeScrollBars(); - m_aReportWindow.SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize); + m_aReportWindow->SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize); } IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, /*pScroll*/ ) { - m_aReportWindow.ScrollChildren( getThumbPos() ); + m_aReportWindow->ScrollChildren( getThumbPos() ); return 0; } @@ -191,127 +202,127 @@ void OScrollWindowHelper::addSection(const uno::Reference< report::XSection >& _ ,const OUString& _sColorEntry ,sal_uInt16 _nPosition) { - m_aReportWindow.addSection(_xSection,_sColorEntry,_nPosition); + m_aReportWindow->addSection(_xSection,_sColorEntry,_nPosition); } void OScrollWindowHelper::removeSection(sal_uInt16 _nPosition) { - m_aReportWindow.removeSection(_nPosition); + m_aReportWindow->removeSection(_nPosition); } void OScrollWindowHelper::toggleGrid(bool _bVisible) { - m_aReportWindow.toggleGrid(_bVisible); + m_aReportWindow->toggleGrid(_bVisible); } sal_uInt16 OScrollWindowHelper::getSectionCount() const { - return m_aReportWindow.getSectionCount(); + return m_aReportWindow->getSectionCount(); } void OScrollWindowHelper::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType ) { - m_aReportWindow.SetInsertObj(eObj,_sShapeType); + m_aReportWindow->SetInsertObj(eObj,_sShapeType); } OUString OScrollWindowHelper::GetInsertObjString() const { - return m_aReportWindow.GetInsertObjString(); + return m_aReportWindow->GetInsertObjString(); } void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode ) { - m_aReportWindow.SetMode(_eNewMode); + m_aReportWindow->SetMode(_eNewMode); } bool OScrollWindowHelper::HasSelection() const { - return m_aReportWindow.HasSelection(); + return m_aReportWindow->HasSelection(); } void OScrollWindowHelper::Delete() { - m_aReportWindow.Delete(); + m_aReportWindow->Delete(); } void OScrollWindowHelper::Copy() { - m_aReportWindow.Copy(); + m_aReportWindow->Copy(); } void OScrollWindowHelper::Paste() { - m_aReportWindow.Paste(); + m_aReportWindow->Paste(); } bool OScrollWindowHelper::IsPasteAllowed() const { - return m_aReportWindow.IsPasteAllowed(); + return m_aReportWindow->IsPasteAllowed(); } void OScrollWindowHelper::SelectAll(const sal_uInt16 _nObjectType) { - m_aReportWindow.SelectAll(_nObjectType); + m_aReportWindow->SelectAll(_nObjectType); } void OScrollWindowHelper::unmarkAllObjects(OSectionView* _pSectionView) { - m_aReportWindow.unmarkAllObjects(_pSectionView); + m_aReportWindow->unmarkAllObjects(_pSectionView); } sal_Int32 OScrollWindowHelper::getMaxMarkerWidth(bool _bWithEnd) const { - return m_aReportWindow.getMaxMarkerWidth(_bWithEnd); + return m_aReportWindow->getMaxMarkerWidth(_bWithEnd); } void OScrollWindowHelper::showRuler(bool _bShow) { - m_aReportWindow.showRuler(_bShow); + m_aReportWindow->showRuler(_bShow); } bool OScrollWindowHelper::handleKeyEvent(const KeyEvent& _rEvent) { - return m_aReportWindow.handleKeyEvent(_rEvent); + return m_aReportWindow->handleKeyEvent(_rEvent); } void OScrollWindowHelper::setMarked(OSectionView* _pSectionView, bool _bMark) { - m_aReportWindow.setMarked(_pSectionView,_bMark); + m_aReportWindow->setMarked(_pSectionView,_bMark); } void OScrollWindowHelper::setMarked(const uno::Reference< report::XSection>& _xSection, bool _bMark) { - m_aReportWindow.setMarked(_xSection,_bMark); + m_aReportWindow->setMarked(_xSection,_bMark); } void OScrollWindowHelper::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape, bool _bMark) { - m_aReportWindow.setMarked(_xShape,_bMark); + m_aReportWindow->setMarked(_xShape,_bMark); } ::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getMarkedSection(NearSectionAccess nsa) const { - return m_aReportWindow.getMarkedSection(nsa); + return m_aReportWindow->getMarkedSection(nsa); } ::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const { - return m_aReportWindow.getSectionWindow(_xSection); + return m_aReportWindow->getSectionWindow(_xSection); } void OScrollWindowHelper::markSection(const sal_uInt16 _nPos) { - m_aReportWindow.markSection(_nPos); + m_aReportWindow->markSection(_nPos); } void OScrollWindowHelper::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const { - m_aReportWindow.fillCollapsedSections(_rCollapsedPositions); + m_aReportWindow->fillCollapsedSections(_rCollapsedPositions); } void OScrollWindowHelper::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections) { - m_aReportWindow.collapseSections(_aCollpasedSections); + m_aReportWindow->collapseSections(_aCollpasedSections); } bool OScrollWindowHelper::Notify( NotifyEvent& rNEvt ) @@ -324,11 +335,11 @@ bool OScrollWindowHelper::Notify( NotifyEvent& rNEvt ) { ScrollBar* pHScrBar = NULL; ScrollBar* pVScrBar = NULL; - if ( m_aHScroll.IsVisible() ) - pHScrBar = &m_aHScroll; + if ( m_aHScroll->IsVisible() ) + pHScrBar = m_aHScroll.get(); - if ( m_aVScroll.IsVisible() ) - pVScrBar = &m_aVScroll; + if ( m_aVScroll->IsVisible() ) + pVScrBar = m_aVScroll.get(); if ( HandleScrollCommand( *pCommandEvent, pHScrBar, pVScrBar ) ) return true; @@ -338,7 +349,7 @@ bool OScrollWindowHelper::Notify( NotifyEvent& rNEvt ) void OScrollWindowHelper::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects) { - m_aReportWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects); + m_aReportWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects); } void OScrollWindowHelper::ImplInitSettings() @@ -363,39 +374,39 @@ void OScrollWindowHelper::DataChanged( const DataChangedEvent& rDCEvt ) void OScrollWindowHelper::_propertyChanged(const beans::PropertyChangeEvent& /*_rEvent*/) throw (uno::RuntimeException, std::exception) { - m_aReportWindow.notifySizeChanged(); + m_aReportWindow->notifySizeChanged(); } void OScrollWindowHelper::setGridSnap(bool bOn) { - m_aReportWindow.setGridSnap(bOn); + m_aReportWindow->setGridSnap(bOn); } void OScrollWindowHelper::setDragStripes(bool bOn) { - m_aReportWindow.setDragStripes(bOn); + m_aReportWindow->setDragStripes(bOn); } sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const { - return m_aReportWindow.getMarkedObjectCount(); + return m_aReportWindow->getMarkedObjectCount(); } void OScrollWindowHelper::zoom(const Fraction& _aZoom) { - m_aReportWindow.zoom(_aZoom); + m_aReportWindow->zoom(_aZoom); Resize(); Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT); } void OScrollWindowHelper::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const { - m_aReportWindow.fillControlModelSelection(_rSelection); + m_aReportWindow->fillControlModelSelection(_rSelection); } sal_uInt16 OScrollWindowHelper::getZoomFactor(SvxZoomType _eType) const { - return m_aReportWindow.getZoomFactor(_eType); + return m_aReportWindow->getZoomFactor(_eType); } } // rptui diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index b3c50f17b7e6..65827a1ac75a 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -48,35 +48,35 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep : Window( _pParent,WB_DIALOGCONTROL) ,OPropertyChangeListener(m_aMutex) ,m_pParent(_pParent) -,m_aStartMarker( this,_sColorEntry) -,m_aReportSection( this,_xSection) -,m_aSplitter(this) -,m_aEndMarker( this,_sColorEntry) +,m_aStartMarker( new rptui::OStartMarker(this,_sColorEntry)) +,m_aReportSection( new rptui::OReportSection(this,_xSection)) +,m_aSplitter(new Splitter(this)) +,m_aEndMarker( new rptui::OEndMarker(this,_sColorEntry)) { SetUniqueId(UID_RPT_SECTIONSWINDOW); const MapMode& rMapMode = _pParent->GetMapMode(); SetMapMode( rMapMode ); ImplInitSettings(); // TRY - m_aSplitter.SetMapMode( MapMode( MAP_100TH_MM ) ); - m_aSplitter.SetStartSplitHdl(LINK(this, OSectionWindow,StartSplitHdl)); - m_aSplitter.SetSplitHdl(LINK(this, OSectionWindow,SplitHdl)); - m_aSplitter.SetEndSplitHdl(LINK(this, OSectionWindow,EndSplitHdl)); - m_aSplitter.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() )); - m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,_xSection->getHeight())).Height()); + m_aSplitter->SetMapMode( MapMode( MAP_100TH_MM ) ); + m_aSplitter->SetStartSplitHdl(LINK(this, OSectionWindow,StartSplitHdl)); + m_aSplitter->SetSplitHdl(LINK(this, OSectionWindow,SplitHdl)); + m_aSplitter->SetEndSplitHdl(LINK(this, OSectionWindow,EndSplitHdl)); + m_aSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() )); + m_aSplitter->SetSplitPosPixel(m_aSplitter->LogicToPixel(Size(0,_xSection->getHeight())).Height()); - m_aStartMarker.setCollapsedHdl(LINK(this,OSectionWindow,Collapsed)); + m_aStartMarker->setCollapsedHdl(LINK(this,OSectionWindow,Collapsed)); - m_aStartMarker.zoom(rMapMode.GetScaleX()); - setZoomFactor(rMapMode.GetScaleX(),m_aReportSection); - setZoomFactor(rMapMode.GetScaleX(),m_aSplitter); - setZoomFactor(rMapMode.GetScaleX(),m_aEndMarker); + m_aStartMarker->zoom(rMapMode.GetScaleX()); + setZoomFactor(rMapMode.GetScaleX(), *m_aReportSection.get()); + setZoomFactor(rMapMode.GetScaleX(), *m_aSplitter.get()); + setZoomFactor(rMapMode.GetScaleX(), *m_aEndMarker.get()); - m_aSplitter.Show(); - m_aStartMarker.Show(); - m_aReportSection.Show(); - m_aEndMarker.Show(); + m_aSplitter->Show(); + m_aStartMarker->Show(); + m_aReportSection->Show(); + m_aEndMarker->Show(); Show(); m_pSectionMulti = new OPropertyChangeMultiplexer(this,_xSection.get()); @@ -100,6 +100,11 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep OSectionWindow::~OSectionWindow() { + dispose(); +} + +void OSectionWindow::dispose() +{ try { if ( m_pSectionMulti.is() ) @@ -110,6 +115,11 @@ OSectionWindow::~OSectionWindow() catch (uno::Exception&) { } + m_aStartMarker.disposeAndClear(); + m_aReportSection.disposeAndClear(); + m_aSplitter.disposeAndClear(); + m_aEndMarker.disposeAndClear(); + vcl::Window::dispose(); } void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) @@ -119,7 +129,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) const uno::Reference< report::XSection > xSection(_rEvent.Source,uno::UNO_QUERY); if ( xSection.is() ) { - const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection(); + const uno::Reference< report::XSection> xCurrentSection = m_aReportSection->getSection(); if ( _rEvent.PropertyName == PROPERTY_HEIGHT ) { m_pParent->getView()->SetUpdateMode(false); @@ -137,13 +147,13 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) || setReportSectionTitle(xReport,RID_STR_PAGE_HEADER,::std::mem_fun(&OReportHelper::getPageHeader),::std::mem_fun(&OReportHelper::getPageHeaderOn)) || setReportSectionTitle(xReport,RID_STR_PAGE_FOOTER,::std::mem_fun(&OReportHelper::getPageFooter),::std::mem_fun(&OReportHelper::getPageFooterOn)) ) { - m_aStartMarker.Invalidate(INVALIDATE_NOERASE); + m_aStartMarker->Invalidate(INVALIDATE_NOERASE); } else { OUString sTitle = ModuleRes(RID_STR_DETAIL); - m_aStartMarker.setTitle(sTitle); - m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); + m_aStartMarker->setTitle(sTitle); + m_aStartMarker->Invalidate(INVALIDATE_CHILDREN); } } } @@ -160,12 +170,12 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection, const ::std::mem_fun_t<bool,OReportHelper>& _pIsSectionOn) { OReportHelper aReportHelper(_xReport); - const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection.getSection(); + const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection->getSection(); if ( bRet ) { OUString sTitle = ModuleRes(_nResId); - m_aStartMarker.setTitle(sTitle); - m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); + m_aStartMarker->setTitle(sTitle); + m_aStartMarker->Invalidate(INVALIDATE_CHILDREN); } return bRet; } @@ -173,7 +183,7 @@ bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReport bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection, const ::std::mem_fun_t<bool,OGroupHelper>& _pIsSectionOn) { OGroupHelper aGroupHelper(_xGroup); - const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection.getSection() ; + const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection->getSection() ; if ( bRet ) { OUString sExpression = _xGroup->getExpression(); @@ -185,8 +195,8 @@ bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& OUString sTitle( ModuleRes(_nResId).toString() ); sTitle = sTitle.replaceFirst("#", sExpression); - m_aStartMarker.setTitle( sTitle ); - m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); + m_aStartMarker->setTitle( sTitle ); + m_aStartMarker->Invalidate(INVALIDATE_CHILDREN); } return bRet; } @@ -225,12 +235,12 @@ void OSectionWindow::Resize() const Point aThumbPos = m_pParent->getView()->getThumbPos(); aOutputSize.Width() -= aThumbPos.X(); - aOutputSize.Height() -= m_aSplitter.GetSizePixel().Height(); + aOutputSize.Height() -= m_aSplitter->GetSizePixel().Height(); - if ( m_aStartMarker.isCollapsed() ) + if ( m_aStartMarker->isCollapsed() ) { Point aPos(0,0); - m_aStartMarker.SetPosSizePixel(aPos,aOutputSize); + m_aStartMarker->SetPosSizePixel(aPos,aOutputSize); } else { @@ -240,49 +250,49 @@ void OSectionWindow::Resize() aStartWidth *= GetMapMode().GetScaleX(); // set start marker - m_aStartMarker.SetPosSizePixel(Point(0,0),Size(aStartWidth,aOutputSize.Height())); + m_aStartMarker->SetPosSizePixel(Point(0,0),Size(aStartWidth,aOutputSize.Height())); // set report section - const uno::Reference< report::XSection> xSection = m_aReportSection.getSection(); + const uno::Reference< report::XSection> xSection = m_aReportSection->getSection(); Size aSectionSize = LogicToPixel( Size( 0,xSection->getHeight() ) ); Point aReportPos(aStartWidth,0); aSectionSize.Width() = aOutputSize.Width() - (long)aStartWidth; if ( bShowEndMarker ) aSectionSize.Width() -= (long)aEndWidth; - m_aReportSection.SetPosSizePixel(aReportPos,aSectionSize); + m_aReportSection->SetPosSizePixel(aReportPos,aSectionSize); // set splitter aReportPos.Y() += aSectionSize.Height(); - m_aSplitter.SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter.GetSizePixel().Height())); + m_aSplitter->SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter->GetSizePixel().Height())); aSectionSize.Height() = (long)(1000 * (double)GetMapMode().GetScaleY()); - m_aSplitter.SetDragRectPixel( Rectangle(Point(aStartWidth,0),aSectionSize)); + m_aSplitter->SetDragRectPixel( Rectangle(Point(aStartWidth,0),aSectionSize)); // set end marker aReportPos.X() += aSectionSize.Width(); aReportPos.Y() = 0; - m_aEndMarker.Show(bShowEndMarker); - m_aEndMarker.SetPosSizePixel(aReportPos,Size(aEndWidth,aOutputSize.Height())); + m_aEndMarker->Show(bShowEndMarker); + m_aEndMarker->SetPosSizePixel(aReportPos,Size(aEndWidth,aOutputSize.Height())); } } void OSectionWindow::setCollapsed(bool _bCollapsed) { - if ( m_aStartMarker.isCollapsed() != _bCollapsed ) + if ( m_aStartMarker->isCollapsed() != _bCollapsed ) { - m_aStartMarker.setCollapsed(_bCollapsed); + m_aStartMarker->setCollapsed(_bCollapsed); } } void OSectionWindow::showProperties() { - m_pParent->getView()->showProperties( m_aReportSection.getSection().get() ); + m_pParent->getView()->showProperties( m_aReportSection->getSection().get() ); } void OSectionWindow::setMarked(bool _bMark) { - m_aStartMarker.setMarked(_bMark); - m_aEndMarker.setMarked(_bMark); + m_aStartMarker->setMarked(_bMark); + m_aEndMarker->setMarked(_bMark); } IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker ) @@ -290,9 +300,9 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker ) if ( _pMarker ) { bool bShow = !_pMarker->isCollapsed(); - m_aReportSection.Show(bShow); - m_aEndMarker.Show(bShow); - m_aSplitter.Show(bShow); + m_aReportSection->Show(bShow); + m_aEndMarker->Show(bShow); + m_aSplitter->Show(bShow); m_pParent->resize(*this); } @@ -302,11 +312,11 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker ) void OSectionWindow::zoom(const Fraction& _aZoom) { setZoomFactor(_aZoom,*this); - m_aStartMarker.zoom(_aZoom); + m_aStartMarker->zoom(_aZoom); - setZoomFactor(_aZoom,m_aReportSection); - setZoomFactor(_aZoom,m_aSplitter); - setZoomFactor(_aZoom,m_aEndMarker); + setZoomFactor(_aZoom, *m_aReportSection.get()); + setZoomFactor(_aZoom, *m_aSplitter.get()); + setZoomFactor(_aZoom, *m_aEndMarker.get()); Invalidate(); } @@ -332,8 +342,8 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel(); - const uno::Reference< report::XSection> xSection = m_aReportSection.getSection(); - nSplitPos = m_aSplitter.PixelToLogic(Size(0,nSplitPos)).Height(); + const uno::Reference< report::XSection> xSection = m_aReportSection->getSection(); + nSplitPos = m_aSplitter->PixelToLogic(Size(0,nSplitPos)).Height(); const sal_Int32 nCount = xSection->getCount(); for (sal_Int32 i = 0; i < nCount; ++i) @@ -349,7 +359,7 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) nSplitPos = 0; xSection->setHeight(nSplitPos); - m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,nSplitPos)).Height()); + m_aSplitter->SetSplitPosPixel(m_aSplitter->LogicToPixel(Size(0,nSplitPos)).Height()); return 0L; } @@ -371,21 +381,21 @@ void OSectionWindow::scrollChildren(long _nX) { const Point aDelta( _nX,0 ); - MapMode aMapMode( m_aReportSection.GetMapMode() ); + MapMode aMapMode( m_aReportSection->GetMapMode() ); const Point aOld = aMapMode.GetOrigin(); - lcl_setOrigin(m_aReportSection,aDelta.X(), 0); + lcl_setOrigin(*m_aReportSection.get(), aDelta.X(), 0); - aMapMode = m_aReportSection.GetMapMode(); + aMapMode = m_aReportSection->GetMapMode(); const Point aNew = aMapMode.GetOrigin(); const Point aDiff = aOld - aNew; { - lcl_scroll(m_aReportSection,aDiff); + lcl_scroll(*m_aReportSection.get(), aDiff); } - lcl_scroll(m_aEndMarker,m_aEndMarker.PixelToLogic(Point(_nX,0))); + lcl_scroll(*m_aEndMarker.get(), m_aEndMarker->PixelToLogic(Point(_nX,0))); - lcl_setOrigin(m_aSplitter,_nX, 0); - lcl_scroll(m_aSplitter,aDiff); + lcl_setOrigin(*m_aSplitter.get(),_nX, 0); + lcl_scroll(*m_aSplitter.get(),aDiff); } } // rptui diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index 37a1e7ce4608..23caea3a2cde 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -48,9 +48,9 @@ oslInterlockedCount OStartMarker::s_nImageRefCount = 0; OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry) : OColorListener(_pParent,_sColorEntry) -,m_aVRuler(this,WB_VERT) -,m_aText(this,WB_HYPHENATION) -,m_aImage(this,WB_LEFT|WB_TOP|WB_SCALE) +,m_aVRuler(new Ruler(this,WB_VERT)) +,m_aText(new FixedText(this,WB_HYPHENATION)) +,m_aImage(new FixedImage(this,WB_LEFT|WB_TOP|WB_SCALE)) ,m_pParent(_pParent) ,m_bShowRuler(true) { @@ -59,20 +59,20 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry osl_atomic_increment(&s_nImageRefCount); initDefaultNodeImages(); ImplInitSettings(); - m_aText.SetHelpId(HID_RPT_START_TITLE); - m_aText.SetPaintTransparent(true); - m_aImage.SetHelpId(HID_RPT_START_IMAGE); - m_aText.Show(); - m_aImage.Show(); - m_aVRuler.Show(); - m_aVRuler.Activate(); - m_aVRuler.SetPagePos(0); - m_aVRuler.SetBorders(); - m_aVRuler.SetIndents(); - m_aVRuler.SetMargin1(); - m_aVRuler.SetMargin2(); + m_aText->SetHelpId(HID_RPT_START_TITLE); + m_aText->SetPaintTransparent(true); + m_aImage->SetHelpId(HID_RPT_START_IMAGE); + m_aText->Show(); + m_aImage->Show(); + m_aVRuler->Show(); + m_aVRuler->Activate(); + m_aVRuler->SetPagePos(0); + m_aVRuler->SetBorders(); + m_aVRuler->SetIndents(); + m_aVRuler->SetMargin1(); + m_aVRuler->SetMargin2(); const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); - m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); + m_aVRuler->SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); EnableChildTransparentMode( true ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); SetPaintTransparent( true ); @@ -80,18 +80,27 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry OStartMarker::~OStartMarker() { + dispose(); +} + +void OStartMarker::dispose() +{ if ( osl_atomic_decrement(&s_nImageRefCount) == 0 ) { DELETEZ(s_pDefCollapsed); DELETEZ(s_pDefExpanded); } + m_aVRuler.disposeAndClear(); + m_aText.disposeAndClear(); + m_aImage.disposeAndClear(); + OColorListener::dispose(); } sal_Int32 OStartMarker::getMinHeight() const { Fraction aExtraWidth(long(2*REPORT_EXTRA_SPACE)); aExtraWidth *= GetMapMode().GetScaleX(); - return LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() + (long)aExtraWidth; + return LogicToPixel(Size(0,m_aText->GetTextHeight())).Height() + (long)aExtraWidth; } void OStartMarker::Paint( const Rectangle& rRect ) @@ -107,7 +116,7 @@ void OStartMarker::Paint( const Rectangle& rRect ) } else { - const long nVRulerWidth = m_aVRuler.GetSizePixel().Width(); + const long nVRulerWidth = m_aVRuler->GetSizePixel().Width(); nSize = aSize.Width() - nVRulerWidth; aSize.Width() += nCornerWidth; SetClipRegion(vcl::Region(PixelToLogic(Rectangle(Point(),Size(nSize,aSize.Height()))))); @@ -148,8 +157,8 @@ void OStartMarker::setColor() Color aTextColor = GetTextColor(); if ( aColor.GetLuminance() < 128 ) aTextColor = COL_WHITE; - m_aText.SetTextColor(aTextColor); - m_aText.SetLineColor(m_nColor); + m_aText->SetTextColor(aTextColor); + m_aText->SetLineColor(m_nColor); } void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) @@ -162,14 +171,14 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) const Size aOutputSize = GetOutputSizePixel(); if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() ) return; - Rectangle aRect(m_aImage.GetPosPixel(),m_aImage.GetSizePixel()); + Rectangle aRect(m_aImage->GetPosPixel(),m_aImage->GetSizePixel()); if ( rMEvt.GetClicks() == 2 || aRect.IsInside( aPos ) ) { m_bCollapsed = !m_bCollapsed; changeImage(); - m_aVRuler.Show(!m_bCollapsed && m_bShowRuler); + m_aVRuler->Show(!m_bCollapsed && m_bShowRuler); if ( m_aCollapsedLink.IsSet() ) m_aCollapsedLink.Call(this); } @@ -180,7 +189,7 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) void OStartMarker::changeImage() { Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; - m_aImage.SetImage(*pImage); + m_aImage->SetImage(*pImage); } void OStartMarker::initDefaultNodeImages() @@ -192,11 +201,11 @@ void OStartMarker::initDefaultNodeImages() } Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; - m_aImage.SetImage(*pImage); - m_aImage.SetMouseTransparent(true); - m_aImage.SetBackground(); - m_aText.SetBackground(); - m_aText.SetMouseTransparent(true); + m_aImage->SetImage(*pImage); + m_aImage->SetMouseTransparent(true); + m_aImage->SetBackground(); + m_aText->SetBackground(); + m_aText->SetMouseTransparent(true); } void OStartMarker::ImplInitSettings() @@ -212,11 +221,11 @@ void OStartMarker::Resize() const long nOutputWidth = aOutputSize.Width(); const long nOutputHeight = aOutputSize.Height(); - const long nVRulerWidth = m_aVRuler.GetSizePixel().Width(); + const long nVRulerWidth = m_aVRuler->GetSizePixel().Width(); const Point aRulerPos(nOutputWidth - nVRulerWidth,0); - m_aVRuler.SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight)); + m_aVRuler->SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight)); - Size aImageSize = m_aImage.GetImage().GetSizePixel(); + Size aImageSize = m_aImage->GetImage().GetSizePixel(); const MapMode& rMapMode = GetMapMode(); aImageSize.Width() = long(aImageSize.Width() * (double)rMapMode.GetScaleX()); aImageSize.Height() = long(aImageSize.Height() * (double)rMapMode.GetScaleY()); @@ -225,17 +234,17 @@ void OStartMarker::Resize() aExtraWidth *= rMapMode.GetScaleX(); Point aPos(aImageSize.Width() + (long)(aExtraWidth + aExtraWidth), aExtraWidth); - const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height()); - m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight)); + const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText->GetTextHeight())).Height()); + m_aText->SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight)); aPos.X() = aExtraWidth; - aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ; - m_aImage.SetPosSizePixel(aPos,aImageSize); + aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText->GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ; + m_aImage->SetPosSizePixel(aPos,aImageSize); } void OStartMarker::setTitle(const OUString& _sTitle) { - m_aText.SetText(_sTitle); + m_aText->SetText(_sTitle); } void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint) @@ -252,12 +261,12 @@ void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint) void OStartMarker::showRuler(bool _bShow) { m_bShowRuler = _bShow; - m_aVRuler.Show(!m_bCollapsed && m_bShowRuler); + m_aVRuler->Show(!m_bCollapsed && m_bShowRuler); } void OStartMarker::RequestHelp( const HelpEvent& rHEvt ) { - if( !m_aText.GetText().isEmpty()) + if( !m_aText->GetText().isEmpty()) { // Hilfe anzeigen Rectangle aItemRect(rHEvt.GetMousePosPixel(),Size(GetSizePixel().Width(),getMinHeight())); @@ -268,9 +277,9 @@ void OStartMarker::RequestHelp( const HelpEvent& rHEvt ) aItemRect.Right() = aPt.X(); aItemRect.Bottom() = aPt.Y(); if( rHEvt.GetMode() == HelpEventMode::BALLOON ) - Help::ShowBalloon( this, aItemRect.Center(), aItemRect, m_aText.GetText()); + Help::ShowBalloon( this, aItemRect.Center(), aItemRect, m_aText->GetText()); else - Help::ShowQuickHelp( this, aItemRect, m_aText.GetText() ); + Help::ShowQuickHelp( this, aItemRect, m_aText->GetText() ); } } @@ -284,8 +293,8 @@ void OStartMarker::setCollapsed(bool _bCollapsed) void OStartMarker::zoom(const Fraction& _aZoom) { setZoomFactor(_aZoom,*this); - m_aVRuler.SetZoom(_aZoom); - setZoomFactor(_aZoom,m_aText); + m_aVRuler->SetZoom(_aZoom); + setZoomFactor(_aZoom, *m_aText.get()); Resize(); Invalidate(); } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 30d690c799da..803be1cd0519 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -185,8 +185,14 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow) OViewsWindow::~OViewsWindow() { + dispose(); +} + +void OViewsWindow::dispose() +{ m_aColorConfig.RemoveListener(this); m_aSections.clear(); + vcl::Window::dispose(); } void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet) diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index 0e8f7b6492c1..a7d195c81849 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -185,6 +185,11 @@ PropBrw::PropBrw(const Reference< XComponentContext >& _xORB, vcl::Window* pPare PropBrw::~PropBrw() { + dispose(); +} + +void PropBrw::dispose() +{ if (m_xBrowserController.is()) implDetachController(); @@ -204,6 +209,7 @@ PropBrw::~PropBrw() {} ::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); + DockingWindow::dispose(); } void PropBrw::setCurrentPage(const OUString& _sLastActivePage) |