Kaydet (Commit) 074ef56b authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Meeks

vcl: VclPtr conversion in reportdesign

Change-Id: Iadbd90bfe2cdf6afff3d745ac488036c3d031963
üst a3cc3ce5
...@@ -151,11 +151,11 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ...@@ -151,11 +151,11 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
,::comphelper::OPropertyChangeListener(m_aMutex) ,::comphelper::OPropertyChangeListener(m_aMutex)
,::comphelper::OContainerListener(m_aMutex) ,::comphelper::OContainerListener(m_aMutex)
,m_xRowSet(_xRowSet) ,m_xRowSet(_xRowSet)
,m_aActions(this,ModuleRes(RID_TB_SORTING)) ,m_aActions(new ToolBox(this,ModuleRes(RID_TB_SORTING)))
,m_pListBox(new OAddFieldWindowListBox( this )) ,m_pListBox(new OAddFieldWindowListBox( this ))
,m_aFixedLine(this, ModuleRes(ADDFIELD_FL_HELP_SEPARATOR) ) ,m_aFixedLine(new FixedLine(this, ModuleRes(ADDFIELD_FL_HELP_SEPARATOR) ))
,m_aHelpText(this, ModuleRes(ADDFIELD_HELP_FIELD) ) ,m_aHelpText(new FixedText(this, ModuleRes(ADDFIELD_HELP_FIELD) ))
,m_aInsertButton(this, WB_TABSTOP|WB_CENTER) ,m_aInsertButton(new PushButton(this, WB_TABSTOP|WB_CENTER))
,m_nCommandType(0) ,m_nCommandType(0)
,m_bEscapeProcessing(false) ,m_bEscapeProcessing(false)
,m_pChangeListener(NULL) ,m_pChangeListener(NULL)
...@@ -165,13 +165,13 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ...@@ -165,13 +165,13 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
m_aActions.SetStyle(m_aActions.GetStyle()|WB_LINESPACING); m_aActions->SetStyle(m_aActions->GetStyle()|WB_LINESPACING);
m_aActions.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); m_aActions->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
m_aActions.SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction)); m_aActions->SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
setToolBox(&m_aActions); setToolBox(m_aActions.get());
m_aActions.CheckItem(SID_FM_SORTUP); m_aActions->CheckItem(SID_FM_SORTUP);
m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, false); m_aActions->EnableItem(SID_ADD_CONTROL_PAIR, false);
m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) ); m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
m_pListBox->SetSelectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) ); m_pListBox->SetSelectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) );
...@@ -179,12 +179,12 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ...@@ -179,12 +179,12 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) ); m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
m_pListBox->Show(); m_pListBox->Show();
const OUString sTitle(ModuleRes(RID_STR_INSERT)); const OUString sTitle(ModuleRes(RID_STR_INSERT));
m_aInsertButton.SetText(sTitle); m_aInsertButton->SetText(sTitle);
m_aInsertButton.SetClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) ); m_aInsertButton->SetClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
m_aInsertButton.Show(); m_aInsertButton->Show();
m_aFixedLine.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() ); m_aFixedLine->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
m_aHelpText.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() ); m_aHelpText->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
...@@ -208,6 +208,11 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ...@@ -208,6 +208,11 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
OAddFieldWindow::~OAddFieldWindow() OAddFieldWindow::~OAddFieldWindow()
{
dispose();
}
void OAddFieldWindow::dispose()
{ {
if ( m_pListBox.get() ) if ( m_pListBox.get() )
{ {
...@@ -222,6 +227,12 @@ OAddFieldWindow::~OAddFieldWindow() ...@@ -222,6 +227,12 @@ OAddFieldWindow::~OAddFieldWindow()
m_pChangeListener->dispose(); m_pChangeListener->dispose();
if ( m_pContainerListener.is() ) if ( m_pContainerListener.is() )
m_pContainerListener->dispose(); m_pContainerListener->dispose();
m_aActions.disposeAndClear();
m_aFixedLine.disposeAndClear();
m_aHelpText.disposeAndClear();
m_aInsertButton.disposeAndClear();
FloatingWindow::dispose();
} }
...@@ -307,10 +318,10 @@ void OAddFieldWindow::Update() ...@@ -307,10 +318,10 @@ void OAddFieldWindow::Update()
{ {
// ListBox loeschen // ListBox loeschen
m_pListBox->Clear(); m_pListBox->Clear();
const sal_uInt16 nItemCount = m_aActions.GetItemCount(); const sal_uInt16 nItemCount = m_aActions->GetItemCount();
for (sal_uInt16 j = 0; j< nItemCount; ++j) for (sal_uInt16 j = 0; j< nItemCount; ++j)
{ {
m_aActions.EnableItem(m_aActions.GetItemId(j),false); m_aActions->EnableItem(m_aActions->GetItemId(j),false);
} }
OUString aTitle(ModuleRes(RID_STR_FIELDSELECTION)); OUString aTitle(ModuleRes(RID_STR_FIELDSELECTION));
...@@ -356,7 +367,7 @@ void OAddFieldWindow::Update() ...@@ -356,7 +367,7 @@ void OAddFieldWindow::Update()
{ {
for (sal_uInt16 i = 0; i < nItemCount; ++i) for (sal_uInt16 i = 0; i < nItemCount; ++i)
{ {
m_aActions.EnableItem(m_aActions.GetItemId(i)); m_aActions->EnableItem(m_aActions->GetItemId(i));
} }
} }
OnSelectHdl(NULL); OnSelectHdl(NULL);
...@@ -380,15 +391,15 @@ void OAddFieldWindow::Resize() ...@@ -380,15 +391,15 @@ void OAddFieldWindow::Resize()
const Size aFixedTextSize(LogicToPixel( Size( FIXEDTEXT_WIDTH, FIXEDTEXT_HEIGHT ), MAP_APPFONT )); const Size aFixedTextSize(LogicToPixel( Size( FIXEDTEXT_WIDTH, FIXEDTEXT_HEIGHT ), MAP_APPFONT ));
// ToolBar // ToolBar
Size aToolbarSize( m_aActions.GetSizePixel() ); Size aToolbarSize( m_aActions->GetSizePixel() );
Point aToolbarPos( aRelated.Width(), aRelated.Height()); Point aToolbarPos( aRelated.Width(), aRelated.Height());
m_aActions.SetPosPixel(Point(aToolbarPos.X(), aToolbarPos.Y())); m_aActions->SetPosPixel(Point(aToolbarPos.X(), aToolbarPos.Y()));
Size aLBSize( aWindowSize ); Size aLBSize( aWindowSize );
aLBSize.Width() -= ( 2 * aRelated.Width() ); aLBSize.Width() -= ( 2 * aRelated.Width() );
// help text // help text
const Size aHelpTextSize = m_aHelpText.CalcMinimumSize(aLBSize.Width()); const Size aHelpTextSize = m_aHelpText->CalcMinimumSize(aLBSize.Width());
// ListBox // ListBox
Point aLBPos( aRelated.Width(), aRelated.Height() + aToolbarSize.Height() + aRelated.Height() ); Point aLBPos( aRelated.Width(), aRelated.Height() + aToolbarSize.Height() + aRelated.Height() );
...@@ -402,11 +413,11 @@ void OAddFieldWindow::Resize() ...@@ -402,11 +413,11 @@ void OAddFieldWindow::Resize()
// FixedLine // FixedLine
Size aFLSize( aLBSize.Width(),aFixedTextSize.Height() ); Size aFLSize( aLBSize.Width(),aFixedTextSize.Height() );
Point aFLPos( aRelated.Width(), aLBPos.Y() + aLBSize.Height() + aRelated.Height()); Point aFLPos( aRelated.Width(), aLBPos.Y() + aLBSize.Height() + aRelated.Height());
m_aFixedLine.SetPosSizePixel( aFLPos, aFLSize ); m_aFixedLine->SetPosSizePixel( aFLPos, aFLSize );
// Help text // Help text
Point aFTPos( aRelated.Width(), aFLPos.Y() + aFLSize.Height() + aRelated.Height() ); Point aFTPos( aRelated.Width(), aFLPos.Y() + aFLSize.Height() + aRelated.Height() );
m_aHelpText.SetPosSizePixel( aFTPos, aHelpTextSize ); m_aHelpText->SetPosSizePixel( aFTPos, aHelpTextSize );
} }
uno::Reference< sdbc::XConnection> OAddFieldWindow::getConnection() const uno::Reference< sdbc::XConnection> OAddFieldWindow::getConnection() const
...@@ -477,7 +488,7 @@ void OAddFieldWindow::_elementReplaced( const container::ContainerEvent& /*_rEve ...@@ -477,7 +488,7 @@ void OAddFieldWindow::_elementReplaced( const container::ContainerEvent& /*_rEve
IMPL_LINK( OAddFieldWindow, OnSelectHdl, void* ,/*_pAddFieldDlg*/) IMPL_LINK( OAddFieldWindow, OnSelectHdl, void* ,/*_pAddFieldDlg*/)
{ {
m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, ( m_pListBox.get() && m_pListBox->GetSelectionCount() > 0 )); m_aActions->EnableItem(SID_ADD_CONTROL_PAIR, ( m_pListBox.get() && m_pListBox->GetSelectionCount() > 0 ));
return 0L; return 0L;
} }
...@@ -495,7 +506,7 @@ void OAddFieldWindow::setImageList(sal_Int16 _eBitmapSet) ...@@ -495,7 +506,7 @@ void OAddFieldWindow::setImageList(sal_Int16 _eBitmapSet)
sal_Int16 nN = IMG_ADDFIELD_DLG_SC; sal_Int16 nN = IMG_ADDFIELD_DLG_SC;
if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE ) if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE )
nN = IMG_ADDFIELD_DLG_LC; nN = IMG_ADDFIELD_DLG_LC;
m_aActions.SetImageList(ImageList(ModuleRes(nN))); m_aActions->SetImageList(ImageList(ModuleRes(nN)));
} }
void OAddFieldWindow::resizeControls(const Size& _rDiff) void OAddFieldWindow::resizeControls(const Size& _rDiff)
...@@ -509,27 +520,27 @@ void OAddFieldWindow::resizeControls(const Size& _rDiff) ...@@ -509,27 +520,27 @@ void OAddFieldWindow::resizeControls(const Size& _rDiff)
IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ ) IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ )
{ {
const sal_uInt16 nCurItem = m_aActions.GetCurItemId(); const sal_uInt16 nCurItem = m_aActions->GetCurItemId();
if ( SID_ADD_CONTROL_PAIR == nCurItem ) if ( SID_ADD_CONTROL_PAIR == nCurItem )
OnDoubleClickHdl(NULL); OnDoubleClickHdl(NULL);
else else
{ {
if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions.IsItemChecked(nCurItem) ) if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions->IsItemChecked(nCurItem) )
{ {
const sal_uInt16 nItemCount = m_aActions.GetItemCount(); const sal_uInt16 nItemCount = m_aActions->GetItemCount();
for (sal_uInt16 j = 0; j< nItemCount; ++j) for (sal_uInt16 j = 0; j< nItemCount; ++j)
{ {
const sal_uInt16 nItemId = m_aActions.GetItemId(j); const sal_uInt16 nItemId = m_aActions->GetItemId(j);
if ( nCurItem != nItemId ) if ( nCurItem != nItemId )
m_aActions.CheckItem(nItemId,false); m_aActions->CheckItem(nItemId,false);
} }
SvSortMode eSortMode = SortNone; SvSortMode eSortMode = SortNone;
if ( SID_FM_REMOVE_FILTER_SORT != nCurItem ) if ( SID_FM_REMOVE_FILTER_SORT != nCurItem )
{ {
m_aActions.CheckItem(nCurItem,!m_aActions.IsItemChecked(nCurItem)); m_aActions->CheckItem(nCurItem,!m_aActions->IsItemChecked(nCurItem));
if ( m_aActions.IsItemChecked(SID_FM_SORTUP) ) if ( m_aActions->IsItemChecked(SID_FM_SORTUP) )
eSortMode = SortAscending; eSortMode = SortAscending;
else if ( m_aActions.IsItemChecked(SID_FM_SORTDOWN) ) else if ( m_aActions->IsItemChecked(SID_FM_SORTDOWN) )
eSortMode = SortDescending; eSortMode = SortDescending;
} }
......
...@@ -97,11 +97,13 @@ IMPL_LINK( ConditionField, OnFormula, Button*, _pClickedButton ) ...@@ -97,11 +97,13 @@ IMPL_LINK( ConditionField, OnFormula, Button*, _pClickedButton )
class OColorPopup : public FloatingWindow class OColorPopup : public FloatingWindow
{ {
DECL_LINK( SelectHdl, void * ); DECL_LINK( SelectHdl, void * );
Condition* m_pCondition; Condition* m_pCondition;
sal_uInt16 m_nSlotId; sal_uInt16 m_nSlotId;
public: public:
OColorPopup(vcl::Window* _pParent,Condition* _pCondition); OColorPopup(vcl::Window* _pParent,Condition* _pCondition);
ValueSet m_aColorSet; virtual ~OColorPopup();
virtual void dispose() SAL_OVERRIDE;
VclPtr<ValueSet> m_aColorSet;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
...@@ -114,9 +116,9 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition) ...@@ -114,9 +116,9 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition)
:FloatingWindow(_pParent, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK|WB_DIALOGCONTROL )) :FloatingWindow(_pParent, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK|WB_DIALOGCONTROL ))
,m_pCondition(_pCondition) ,m_pCondition(_pCondition)
,m_nSlotId(0) ,m_nSlotId(0)
,m_aColorSet( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) ) ,m_aColorSet( new ValueSet(this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT)) )
{ {
m_aColorSet.SetHelpId( HID_RPT_POPUP_COLOR_CTRL ); m_aColorSet->SetHelpId( HID_RPT_POPUP_COLOR_CTRL );
SetHelpId( HID_RPT_POPUP_COLOR ); SetHelpId( HID_RPT_POPUP_COLOR );
const Size aSize12( 13, 13 ); const Size aSize12( 13, 13 );
short i = 0; short i = 0;
...@@ -127,34 +129,45 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition) ...@@ -127,34 +129,45 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition)
if ( nCount > PALETTE_SIZE ) if ( nCount > PALETTE_SIZE )
// Show scrollbar if more than PALLETTE_SIZE colors are available // Show scrollbar if more than PALLETTE_SIZE colors are available
m_aColorSet.SetStyle( m_aColorSet.GetStyle() | WB_VSCROLL ); m_aColorSet->SetStyle( m_aColorSet->GetStyle() | WB_VSCROLL );
for ( i = 0; i < nCount; i++ ) for ( i = 0; i < nCount; i++ )
{ {
XColorEntry* pEntry = pColorList->GetColor(i); XColorEntry* pEntry = pColorList->GetColor(i);
m_aColorSet.InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() ); m_aColorSet->InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() );
} }
while ( i < PALETTE_SIZE ) while ( i < PALETTE_SIZE )
{ {
// fill empty elements if less then PALLETTE_SIZE colors are available // fill empty elements if less then PALLETTE_SIZE colors are available
m_aColorSet.InsertItem( i+1, aColWhite, aStrWhite ); m_aColorSet->InsertItem( i+1, aColWhite, aStrWhite );
i++; i++;
} }
m_aColorSet.SetSelectHdl( LINK( this, OColorPopup, SelectHdl ) ); m_aColorSet->SetSelectHdl( LINK( this, OColorPopup, SelectHdl ) );
m_aColorSet.SetColCount( PALETTE_X ); m_aColorSet->SetColCount( PALETTE_X );
m_aColorSet.SetLineCount( PALETTE_Y ); m_aColorSet->SetLineCount( PALETTE_Y );
Size aSize = m_aColorSet.CalcWindowSizePixel( aSize12 ); Size aSize = m_aColorSet->CalcWindowSizePixel( aSize12 );
aSize.Width() += 4; aSize.Width() += 4;
aSize.Height() += 4; aSize.Height() += 4;
SetOutputSizePixel( aSize ); SetOutputSizePixel( aSize );
m_aColorSet.Show(); m_aColorSet->Show();
}
OColorPopup::~OColorPopup()
{
dispose();
}
void OColorPopup::dispose()
{
m_aColorSet.disposeAndClear();
FloatingWindow::dispose();
} }
void OColorPopup::KeyInput( const KeyEvent& rKEvt ) void OColorPopup::KeyInput( const KeyEvent& rKEvt )
{ {
m_aColorSet.KeyInput(rKEvt); m_aColorSet->KeyInput(rKEvt);
} }
void OColorPopup::Resize() void OColorPopup::Resize()
...@@ -162,12 +175,12 @@ void OColorPopup::Resize() ...@@ -162,12 +175,12 @@ void OColorPopup::Resize()
Size aSize = GetOutputSizePixel(); Size aSize = GetOutputSizePixel();
aSize.Width() -= 4; aSize.Width() -= 4;
aSize.Height() -= 4; aSize.Height() -= 4;
m_aColorSet.SetPosSizePixel( Point(2,2), aSize ); m_aColorSet->SetPosSizePixel( Point(2,2), aSize );
} }
void OColorPopup::StartSelection() void OColorPopup::StartSelection()
{ {
m_aColorSet.StartSelection(); m_aColorSet->StartSelection();
} }
void OColorPopup::SetSlotId(sal_uInt16 _nSlotId) void OColorPopup::SetSlotId(sal_uInt16 _nSlotId)
...@@ -175,20 +188,20 @@ void OColorPopup::SetSlotId(sal_uInt16 _nSlotId) ...@@ -175,20 +188,20 @@ void OColorPopup::SetSlotId(sal_uInt16 _nSlotId)
m_nSlotId = _nSlotId; m_nSlotId = _nSlotId;
if ( SID_ATTR_CHAR_COLOR_BACKGROUND == _nSlotId || SID_BACKGROUND_COLOR == _nSlotId ) if ( SID_ATTR_CHAR_COLOR_BACKGROUND == _nSlotId || SID_BACKGROUND_COLOR == _nSlotId )
{ {
m_aColorSet.SetStyle( m_aColorSet.GetStyle() | WB_NONEFIELD ); m_aColorSet->SetStyle( m_aColorSet->GetStyle() | WB_NONEFIELD );
m_aColorSet.SetText( OUString(ModuleRes( STR_TRANSPARENT )) ); m_aColorSet->SetText( OUString(ModuleRes( STR_TRANSPARENT )) );
} }
} }
IMPL_LINK_NOARG(OColorPopup, SelectHdl) IMPL_LINK_NOARG(OColorPopup, SelectHdl)
{ {
sal_uInt16 nItemId = m_aColorSet.GetSelectItemId(); sal_uInt16 nItemId = m_aColorSet->GetSelectItemId();
Color aColor( nItemId == 0 ? Color( COL_TRANSPARENT ) : m_aColorSet.GetItemColor( nItemId ) ); Color aColor( nItemId == 0 ? Color( COL_TRANSPARENT ) : m_aColorSet->GetItemColor( nItemId ) );
/* #i33380# Moved the following line above the Dispatch() calls. /* #i33380# Moved the following line above the Dispatch() calls.
This instance may be deleted in the meantime (i.e. when a dialog is opened This instance may be deleted in the meantime (i.e. when a dialog is opened
while in Dispatch()), accessing members will crash in this case. */ while in Dispatch()), accessing members will crash in this case. */
m_aColorSet.SetNoSelection(); m_aColorSet->SetNoSelection();
if ( IsInPopupMode() ) if ( IsInPopupMode() )
EndPopupMode(); EndPopupMode();
...@@ -293,6 +306,11 @@ sal_uInt16 Condition::mapToolbarItemToSlotId(sal_uInt16 nItemId) const ...@@ -293,6 +306,11 @@ sal_uInt16 Condition::mapToolbarItemToSlotId(sal_uInt16 nItemId) const
} }
Condition::~Condition() Condition::~Condition()
{
dispose();
}
void Condition::dispose()
{ {
m_bInDestruction = true; m_bInDestruction = true;
...@@ -301,6 +319,7 @@ Condition::~Condition() ...@@ -301,6 +319,7 @@ Condition::~Condition()
delete m_pCondLHS; delete m_pCondLHS;
delete m_pCondRHS; delete m_pCondRHS;
delete m_pBtnUpdaterBackgroundColor; delete m_pBtnUpdaterBackgroundColor;
VclHBox::dispose();
} }
IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ ) IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ )
......
...@@ -107,6 +107,7 @@ namespace rptui ...@@ -107,6 +107,7 @@ namespace rptui
public: public:
Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction, ::rptui::OReportController& _rController ); Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction, ::rptui::OReportController& _rController );
virtual ~Condition(); virtual ~Condition();
virtual void dispose() SAL_OVERRIDE;
/** will be called when the id of the image list needs to change. /** will be called when the id of the image list needs to change.
@param _eBitmapSet @param _eBitmapSet
......
...@@ -86,6 +86,11 @@ void FormulaDialog::fill() ...@@ -86,6 +86,11 @@ void FormulaDialog::fill()
} }
FormulaDialog::~FormulaDialog() FormulaDialog::~FormulaDialog()
{
dispose();
}
void FormulaDialog::dispose()
{ {
if ( m_pAddField ) if ( m_pAddField )
{ {
...@@ -97,6 +102,7 @@ FormulaDialog::~FormulaDialog() ...@@ -97,6 +102,7 @@ FormulaDialog::~FormulaDialog()
} }
StoreFormEditData( m_pFormulaData ); StoreFormEditData( m_pFormulaData );
formula::FormulaModalDialog::dispose();
} }
......
...@@ -97,6 +97,7 @@ class OFieldExpressionControl : public TContainerListenerBase ...@@ -97,6 +97,7 @@ class OFieldExpressionControl : public TContainerListenerBase
public: public:
OFieldExpressionControl(OGroupsSortingDialog* _pParentDialog, vcl::Window *_pParent); OFieldExpressionControl(OGroupsSortingDialog* _pParentDialog, vcl::Window *_pParent);
virtual ~OFieldExpressionControl(); virtual ~OFieldExpressionControl();
virtual void dispose() SAL_OVERRIDE;
// XEventListener // XEventListener
virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
...@@ -181,6 +182,12 @@ OFieldExpressionControl::OFieldExpressionControl(OGroupsSortingDialog* _pParentD ...@@ -181,6 +182,12 @@ OFieldExpressionControl::OFieldExpressionControl(OGroupsSortingDialog* _pParentD
OFieldExpressionControl::~OFieldExpressionControl() OFieldExpressionControl::~OFieldExpressionControl()
{
dispose();
}
void OFieldExpressionControl::dispose()
{ {
WeakImplHelper1::acquire(); WeakImplHelper1::acquire();
uno::Reference< report::XGroups > xGroups = m_pParent->getGroups(); uno::Reference< report::XGroups > xGroups = m_pParent->getGroups();
...@@ -193,6 +200,7 @@ OFieldExpressionControl::~OFieldExpressionControl() ...@@ -193,6 +200,7 @@ OFieldExpressionControl::~OFieldExpressionControl()
Application::RemoveUserEvent( m_nDeleteEvent ); Application::RemoveUserEvent( m_nDeleteEvent );
delete m_pComboCell; delete m_pComboCell;
OFieldExpressionControl_Base::dispose();
} }
uno::Sequence<uno::Any> OFieldExpressionControl::fillSelectedGroups() uno::Sequence<uno::Any> OFieldExpressionControl::fillSelectedGroups()
...@@ -969,12 +977,18 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl ...@@ -969,12 +977,18 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
} }
OGroupsSortingDialog::~OGroupsSortingDialog() OGroupsSortingDialog::~OGroupsSortingDialog()
{
dispose();
}
void OGroupsSortingDialog::dispose()
{ {
delete m_pFieldExpression; delete m_pFieldExpression;
m_xColumns.clear(); m_xColumns.clear();
m_pReportListener->dispose(); m_pReportListener->dispose();
if ( m_pCurrentGroupListener.is() ) if ( m_pCurrentGroupListener.is() )
m_pCurrentGroupListener->dispose(); m_pCurrentGroupListener->dispose();
FloatingWindow::dispose();
} }
void OGroupsSortingDialog::UpdateData( ) void OGroupsSortingDialog::UpdateData( )
......
...@@ -182,6 +182,7 @@ protected: ...@@ -182,6 +182,7 @@ protected:
public: public:
NavigatorTree(vcl::Window* pParent,OReportController& _rController ); NavigatorTree(vcl::Window* pParent,OReportController& _rController );
virtual ~NavigatorTree(); virtual ~NavigatorTree();
virtual void dispose() SAL_OVERRIDE;
DECL_LINK(OnEntrySelDesel, NavigatorTree*); DECL_LINK(OnEntrySelDesel, NavigatorTree*);
DECL_LINK( OnDropActionTimer, void* ); DECL_LINK( OnDropActionTimer, void* );
...@@ -254,6 +255,11 @@ NavigatorTree::NavigatorTree( vcl::Window* pParent,OReportController& _rControll ...@@ -254,6 +255,11 @@ NavigatorTree::NavigatorTree( vcl::Window* pParent,OReportController& _rControll
} }
NavigatorTree::~NavigatorTree() NavigatorTree::~NavigatorTree()
{
dispose();
}
void NavigatorTree::dispose()
{ {
SvTreeListEntry* pCurrent = First(); SvTreeListEntry* pCurrent = First();
while ( pCurrent ) while ( pCurrent )
...@@ -263,6 +269,7 @@ NavigatorTree::~NavigatorTree() ...@@ -263,6 +269,7 @@ NavigatorTree::~NavigatorTree()
} }
m_pReportListener->dispose(); m_pReportListener->dispose();
m_pSelectionListener->dispose(); m_pSelectionListener->dispose();
SvTreeListBox::dispose();
} }
void NavigatorTree::Command( const CommandEvent& rEvt ) void NavigatorTree::Command( const CommandEvent& rEvt )
......
...@@ -54,18 +54,18 @@ class OAddFieldWindow :public FloatingWindow ...@@ -54,18 +54,18 @@ class OAddFieldWindow :public FloatingWindow
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xRowSet; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xRowSet;
ToolBox m_aActions; VclPtr<ToolBox> m_aActions;
::std::unique_ptr<OAddFieldWindowListBox> m_pListBox; ::std::unique_ptr<OAddFieldWindowListBox> m_pListBox;
FixedLine m_aFixedLine; VclPtr<FixedLine> m_aFixedLine;
FixedText m_aHelpText; VclPtr<FixedText> m_aHelpText;
PushButton m_aInsertButton; VclPtr<PushButton> m_aInsertButton;
Link m_aCreateLink; Link m_aCreateLink;
OUString m_aCommandName; OUString m_aCommandName;
OUString m_sFilter; OUString m_sFilter;
sal_Int32 m_nCommandType; sal_Int32 m_nCommandType;
bool m_bEscapeProcessing; bool m_bEscapeProcessing;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pChangeListener; ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pChangeListener;
::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener; ::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
...@@ -80,6 +80,7 @@ public: ...@@ -80,6 +80,7 @@ public:
, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xRowSet); , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xRowSet);
virtual ~OAddFieldWindow(); virtual ~OAddFieldWindow();
virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& _rNEvt ) SAL_OVERRIDE; virtual bool PreNotify( NotifyEvent& _rNEvt ) SAL_OVERRIDE;
......
...@@ -59,12 +59,12 @@ namespace rptui ...@@ -59,12 +59,12 @@ namespace rptui
class ODesignView : public dbaui::ODataView, public SfxBroadcaster, public IMarkedSection class ODesignView : public dbaui::ODataView, public SfxBroadcaster, public IMarkedSection
{ {
private: private:
SplitWindow m_aSplitWin; VclPtr<SplitWindow> m_aSplitWin;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xReportComponent; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xReportComponent;
OReportController& m_rReportController; OReportController& m_rReportController;
OScrollWindowHelper m_aScrollWindow; VclPtr<OScrollWindowHelper> m_aScrollWindow;
vcl::Window* m_pTaskPane; vcl::Window* m_pTaskPane;
PropBrw* m_pPropWin; PropBrw* m_pPropWin;
OAddFieldWindow* m_pAddField; OAddFieldWindow* m_pAddField;
OSectionView* m_pCurrentView; OSectionView* m_pCurrentView;
...@@ -72,8 +72,8 @@ namespace rptui ...@@ -72,8 +72,8 @@ namespace rptui
Idle m_aMarkIdle; Idle m_aMarkIdle;
Point m_aScrollOffset; Point m_aScrollOffset;
DlgEdMode m_eMode; DlgEdMode m_eMode;
sal_uInt16 m_nCurrentPosition; sal_uInt16 m_nCurrentPosition;
sal_uInt16 m_eActObj; sal_uInt16 m_eActObj;
bool m_bFirstDraw; bool m_bFirstDraw;
Size m_aGridSizeCoarse; Size m_aGridSizeCoarse;
Size m_aGridSizeFine; Size m_aGridSizeFine;
...@@ -100,6 +100,7 @@ namespace rptui ...@@ -100,6 +100,7 @@ namespace rptui
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&,
OReportController& _rController); OReportController& _rController);
virtual ~ODesignView(); virtual ~ODesignView();
virtual void dispose() SAL_OVERRIDE;
// Window overrides // Window overrides
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
......
...@@ -68,6 +68,7 @@ public: ...@@ -68,6 +68,7 @@ public:
, svl::SharedStringPool& rStrPool ); , svl::SharedStringPool& rStrPool );
virtual ~FormulaDialog(); virtual ~FormulaDialog();
virtual void dispose() SAL_OVERRIDE;
// IFormulaEditorHelper // IFormulaEditorHelper
virtual void notifyChange() SAL_OVERRIDE; virtual void notifyChange() SAL_OVERRIDE;
......
...@@ -145,6 +145,7 @@ public: ...@@ -145,6 +145,7 @@ public:
,bool _bReadOnly ,bool _bReadOnly
,::rptui::OReportController* _pController); ,::rptui::OReportController* _pController);
virtual ~OGroupsSortingDialog(); virtual ~OGroupsSortingDialog();
virtual void dispose() SAL_OVERRIDE;
/** sets the newe columns at the groups dialog. /** sets the newe columns at the groups dialog.
@param _xColumns the new columns @param _xColumns the new columns
......
...@@ -81,6 +81,7 @@ namespace rptui ...@@ -81,6 +81,7 @@ namespace rptui
public: public:
OReportSection(OSectionWindow* _pParent,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); OReportSection(OSectionWindow* _pParent,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
virtual ~OReportSection(); virtual ~OReportSection();
virtual void dispose() SAL_OVERRIDE;
// window overrides // window overrides
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
......
...@@ -45,10 +45,10 @@ namespace rptui ...@@ -45,10 +45,10 @@ namespace rptui
, public ::cppu::BaseMutex , public ::cppu::BaseMutex
, public ::comphelper::OPropertyChangeListener , public ::comphelper::OPropertyChangeListener
{ {
Ruler m_aHRuler; VclPtr<Ruler> m_aHRuler;
ODesignView* m_pView; ODesignView* m_pView;
OScrollWindowHelper* m_pParent; OScrollWindowHelper* m_pParent;
OViewsWindow m_aViewsWindow; VclPtr<OViewsWindow> m_aViewsWindow;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener; ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
::std::unique_ptr<DlgEdFactory> ::std::unique_ptr<DlgEdFactory>
m_pObjFac; m_pObjFac;
...@@ -67,6 +67,7 @@ namespace rptui ...@@ -67,6 +67,7 @@ namespace rptui
public: public:
OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView); OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView);
virtual ~OReportWindow(); virtual ~OReportWindow();
virtual void dispose() SAL_OVERRIDE;
// Window overrides // Window overrides
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
...@@ -136,7 +137,7 @@ namespace rptui ...@@ -136,7 +137,7 @@ namespace rptui
*/ */
void showRuler(bool _bShow); void showRuler(bool _bShow);
inline sal_Int32 getRulerHeight() const { return m_aHRuler.GetSizePixel().Height(); } inline sal_Int32 getRulerHeight() const { return m_aHRuler->GetSizePixel().Height(); }
/** returns the total width of the first section /** returns the total width of the first section
*/ */
......
...@@ -48,14 +48,14 @@ namespace rptui ...@@ -48,14 +48,14 @@ namespace rptui
, public IMarkedSection , public IMarkedSection
{ {
private: private:
ScrollBar m_aHScroll; VclPtr<ScrollBar> m_aHScroll;
ScrollBar m_aVScroll; VclPtr<ScrollBar> m_aVScroll;
ScrollBarBox m_aCornerWin; // window in the bottom right corner VclPtr<ScrollBarBox> m_aCornerWin; // window in the bottom right corner
Size m_aTotalPixelSize; Size m_aTotalPixelSize;
ODesignView* m_pParent; ODesignView* m_pParent;
OReportWindow m_aReportWindow; VclPtr<OReportWindow> m_aReportWindow;
::rtl::Reference<comphelper::OPropertyChangeMultiplexer > ::rtl::Reference<comphelper::OPropertyChangeMultiplexer >
m_pReportDefintionMultiPlexer; // listener for property changes m_pReportDefintionMultiPlexer; // listener for property changes
DECL_LINK( ScrollHdl, ScrollBar*); DECL_LINK( ScrollHdl, ScrollBar*);
Size ResizeScrollBars(); Size ResizeScrollBars();
...@@ -74,17 +74,18 @@ namespace rptui ...@@ -74,17 +74,18 @@ namespace rptui
public: public:
OScrollWindowHelper( ODesignView* _pReportDesignView); OScrollWindowHelper( ODesignView* _pReportDesignView);
virtual ~OScrollWindowHelper(); virtual ~OScrollWindowHelper();
virtual void dispose() SAL_OVERRIDE;
/** late ctor /** late ctor
*/ */
void initialize(); void initialize();
inline Point getThumbPos() const { return Point(m_aHScroll.GetThumbPos(),m_aVScroll.GetThumbPos())/*m_aScrollOffset*/; } inline Point getThumbPos() const { return Point(m_aHScroll->GetThumbPos(),m_aVScroll->GetThumbPos())/*m_aScrollOffset*/; }
inline const OReportWindow& getReportWindow() const { return m_aReportWindow; } inline const OReportWindow& getReportWindow() const { return *m_aReportWindow.get(); }
void setTotalSize(sal_Int32 _nWidth, sal_Int32 _nHeight); void setTotalSize(sal_Int32 _nWidth, sal_Int32 _nHeight);
inline Size getTotalSize() const { return m_aTotalPixelSize; } inline Size getTotalSize() const { return m_aTotalPixelSize; }
inline ScrollBar& GetHScroll() { return m_aHScroll; } inline ScrollBar& GetHScroll() { return *m_aHScroll.get(); }
inline ScrollBar& GetVScroll() { return m_aVScroll; } inline ScrollBar& GetVScroll() { return *m_aVScroll.get(); }
// forwards // forwards
void SetMode( DlgEdMode _eMode ); void SetMode( DlgEdMode _eMode );
......
...@@ -47,11 +47,11 @@ namespace rptui ...@@ -47,11 +47,11 @@ namespace rptui
, public ::cppu::BaseMutex , public ::cppu::BaseMutex
, public ::comphelper::OPropertyChangeListener , public ::comphelper::OPropertyChangeListener
{ {
OViewsWindow* m_pParent; OViewsWindow* m_pParent;
OStartMarker m_aStartMarker; VclPtr<OStartMarker> m_aStartMarker;
OReportSection m_aReportSection; VclPtr<OReportSection> m_aReportSection;
Splitter m_aSplitter; VclPtr<Splitter> m_aSplitter;
OEndMarker m_aEndMarker; VclPtr<OEndMarker> m_aEndMarker;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pSectionMulti; ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pSectionMulti;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pGroupMulti; ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pGroupMulti;
...@@ -98,10 +98,11 @@ namespace rptui ...@@ -98,10 +98,11 @@ namespace rptui
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
,const OUString& _sColorEntry); ,const OUString& _sColorEntry);
virtual ~OSectionWindow(); virtual ~OSectionWindow();
virtual void dispose() SAL_OVERRIDE;
inline OStartMarker& getStartMarker() { return m_aStartMarker; } inline OStartMarker& getStartMarker() { return *m_aStartMarker.get(); }
inline OReportSection& getReportSection() { return m_aReportSection; } inline OReportSection& getReportSection() { return *m_aReportSection.get(); }
inline OEndMarker& getEndMarker() { return m_aEndMarker; } inline OEndMarker& getEndMarker() { return *m_aEndMarker.get(); }
inline OViewsWindow* getViewsWindow() { return m_pParent; } inline OViewsWindow* getViewsWindow() { return m_pParent; }
void setCollapsed(bool _bCollapsed); void setCollapsed(bool _bCollapsed);
......
...@@ -31,9 +31,9 @@ namespace rptui ...@@ -31,9 +31,9 @@ namespace rptui
class OStartMarker : public OColorListener class OStartMarker : public OColorListener
{ {
Ruler m_aVRuler; VclPtr<Ruler> m_aVRuler;
FixedText m_aText; VclPtr<FixedText> m_aText;
FixedImage m_aImage; VclPtr<FixedImage> m_aImage;
OSectionWindow* m_pParent; OSectionWindow* m_pParent;
static Image* s_pDefCollapsed; static Image* s_pDefCollapsed;
static Image* s_pDefExpanded; static Image* s_pDefExpanded;
...@@ -50,6 +50,7 @@ namespace rptui ...@@ -50,6 +50,7 @@ namespace rptui
public: public:
OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry); OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry);
virtual ~OStartMarker(); virtual ~OStartMarker();
virtual void dispose() SAL_OVERRIDE;
// SfxListener // SfxListener
virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint) SAL_OVERRIDE; virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint) SAL_OVERRIDE;
......
...@@ -153,6 +153,7 @@ namespace rptui ...@@ -153,6 +153,7 @@ namespace rptui
OViewsWindow( OViewsWindow(
OReportWindow* _pReportWindow); OReportWindow* _pReportWindow);
virtual ~OViewsWindow(); virtual ~OViewsWindow();
virtual void dispose() SAL_OVERRIDE;
// Window overrides // Window overrides
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
......
...@@ -90,6 +90,7 @@ public: ...@@ -90,6 +90,7 @@ public:
,Window* pParent ,Window* pParent
,ODesignView* _pDesignView); ,ODesignView* _pDesignView);
virtual ~PropBrw(); virtual ~PropBrw();
virtual void dispose() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE;
......
...@@ -110,6 +110,11 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re ...@@ -110,6 +110,11 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re
} }
OReportSection::~OReportSection() OReportSection::~OReportSection()
{
dispose();
}
void OReportSection::dispose()
{ {
m_pPage = NULL; m_pPage = NULL;
if ( m_pMulti.is() ) if ( m_pMulti.is() )
...@@ -125,6 +130,7 @@ OReportSection::~OReportSection() ...@@ -125,6 +130,7 @@ OReportSection::~OReportSection()
m_pView->EndListening( *m_pModel ); m_pView->EndListening( *m_pModel );
m_pView = NULL; m_pView = NULL;
} }
vcl::Window::dispose();
} }
void OReportSection::Paint( const Rectangle& rRect ) void OReportSection::Paint( const Rectangle& rRect )
......
...@@ -48,9 +48,9 @@ oslInterlockedCount OStartMarker::s_nImageRefCount = 0; ...@@ -48,9 +48,9 @@ oslInterlockedCount OStartMarker::s_nImageRefCount = 0;
OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry) OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry)
: OColorListener(_pParent,_sColorEntry) : OColorListener(_pParent,_sColorEntry)
,m_aVRuler(this,WB_VERT) ,m_aVRuler(new Ruler(this,WB_VERT))
,m_aText(this,WB_HYPHENATION) ,m_aText(new FixedText(this,WB_HYPHENATION))
,m_aImage(this,WB_LEFT|WB_TOP|WB_SCALE) ,m_aImage(new FixedImage(this,WB_LEFT|WB_TOP|WB_SCALE))
,m_pParent(_pParent) ,m_pParent(_pParent)
,m_bShowRuler(true) ,m_bShowRuler(true)
{ {
...@@ -59,39 +59,48 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry ...@@ -59,39 +59,48 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry
osl_atomic_increment(&s_nImageRefCount); osl_atomic_increment(&s_nImageRefCount);
initDefaultNodeImages(); initDefaultNodeImages();
ImplInitSettings(); ImplInitSettings();
m_aText.SetHelpId(HID_RPT_START_TITLE); m_aText->SetHelpId(HID_RPT_START_TITLE);
m_aText.SetPaintTransparent(true); m_aText->SetPaintTransparent(true);
m_aImage.SetHelpId(HID_RPT_START_IMAGE); m_aImage->SetHelpId(HID_RPT_START_IMAGE);
m_aText.Show(); m_aText->Show();
m_aImage.Show(); m_aImage->Show();
m_aVRuler.Show(); m_aVRuler->Show();
m_aVRuler.Activate(); m_aVRuler->Activate();
m_aVRuler.SetPagePos(0); m_aVRuler->SetPagePos(0);
m_aVRuler.SetBorders(); m_aVRuler->SetBorders();
m_aVRuler.SetIndents(); m_aVRuler->SetIndents();
m_aVRuler.SetMargin1(); m_aVRuler->SetMargin1();
m_aVRuler.SetMargin2(); m_aVRuler->SetMargin2();
const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); 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 ); EnableChildTransparentMode( true );
SetParentClipMode( PARENTCLIPMODE_NOCLIP ); SetParentClipMode( PARENTCLIPMODE_NOCLIP );
SetPaintTransparent( true ); SetPaintTransparent( true );
} }
OStartMarker::~OStartMarker() OStartMarker::~OStartMarker()
{
dispose();
}
void OStartMarker::dispose()
{ {
if ( osl_atomic_decrement(&s_nImageRefCount) == 0 ) if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
{ {
DELETEZ(s_pDefCollapsed); DELETEZ(s_pDefCollapsed);
DELETEZ(s_pDefExpanded); DELETEZ(s_pDefExpanded);
} }
m_aVRuler.disposeAndClear();
m_aText.disposeAndClear();
m_aImage.disposeAndClear();
OColorListener::dispose();
} }
sal_Int32 OStartMarker::getMinHeight() const sal_Int32 OStartMarker::getMinHeight() const
{ {
Fraction aExtraWidth(long(2*REPORT_EXTRA_SPACE)); Fraction aExtraWidth(long(2*REPORT_EXTRA_SPACE));
aExtraWidth *= GetMapMode().GetScaleX(); 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 ) void OStartMarker::Paint( const Rectangle& rRect )
...@@ -107,7 +116,7 @@ void OStartMarker::Paint( const Rectangle& rRect ) ...@@ -107,7 +116,7 @@ void OStartMarker::Paint( const Rectangle& rRect )
} }
else else
{ {
const long nVRulerWidth = m_aVRuler.GetSizePixel().Width(); const long nVRulerWidth = m_aVRuler->GetSizePixel().Width();
nSize = aSize.Width() - nVRulerWidth; nSize = aSize.Width() - nVRulerWidth;
aSize.Width() += nCornerWidth; aSize.Width() += nCornerWidth;
SetClipRegion(vcl::Region(PixelToLogic(Rectangle(Point(),Size(nSize,aSize.Height()))))); SetClipRegion(vcl::Region(PixelToLogic(Rectangle(Point(),Size(nSize,aSize.Height())))));
...@@ -148,8 +157,8 @@ void OStartMarker::setColor() ...@@ -148,8 +157,8 @@ void OStartMarker::setColor()
Color aTextColor = GetTextColor(); Color aTextColor = GetTextColor();
if ( aColor.GetLuminance() < 128 ) if ( aColor.GetLuminance() < 128 )
aTextColor = COL_WHITE; aTextColor = COL_WHITE;
m_aText.SetTextColor(aTextColor); m_aText->SetTextColor(aTextColor);
m_aText.SetLineColor(m_nColor); m_aText->SetLineColor(m_nColor);
} }
void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
...@@ -162,14 +171,14 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) ...@@ -162,14 +171,14 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
const Size aOutputSize = GetOutputSizePixel(); const Size aOutputSize = GetOutputSizePixel();
if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() ) if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() )
return; return;
Rectangle aRect(m_aImage.GetPosPixel(),m_aImage.GetSizePixel()); Rectangle aRect(m_aImage->GetPosPixel(),m_aImage->GetSizePixel());
if ( rMEvt.GetClicks() == 2 || aRect.IsInside( aPos ) ) if ( rMEvt.GetClicks() == 2 || aRect.IsInside( aPos ) )
{ {
m_bCollapsed = !m_bCollapsed; m_bCollapsed = !m_bCollapsed;
changeImage(); changeImage();
m_aVRuler.Show(!m_bCollapsed && m_bShowRuler); m_aVRuler->Show(!m_bCollapsed && m_bShowRuler);
if ( m_aCollapsedLink.IsSet() ) if ( m_aCollapsedLink.IsSet() )
m_aCollapsedLink.Call(this); m_aCollapsedLink.Call(this);
} }
...@@ -180,7 +189,7 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) ...@@ -180,7 +189,7 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
void OStartMarker::changeImage() void OStartMarker::changeImage()
{ {
Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
m_aImage.SetImage(*pImage); m_aImage->SetImage(*pImage);
} }
void OStartMarker::initDefaultNodeImages() void OStartMarker::initDefaultNodeImages()
...@@ -192,11 +201,11 @@ void OStartMarker::initDefaultNodeImages() ...@@ -192,11 +201,11 @@ void OStartMarker::initDefaultNodeImages()
} }
Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
m_aImage.SetImage(*pImage); m_aImage->SetImage(*pImage);
m_aImage.SetMouseTransparent(true); m_aImage->SetMouseTransparent(true);
m_aImage.SetBackground(); m_aImage->SetBackground();
m_aText.SetBackground(); m_aText->SetBackground();
m_aText.SetMouseTransparent(true); m_aText->SetMouseTransparent(true);
} }
void OStartMarker::ImplInitSettings() void OStartMarker::ImplInitSettings()
...@@ -212,11 +221,11 @@ void OStartMarker::Resize() ...@@ -212,11 +221,11 @@ void OStartMarker::Resize()
const long nOutputWidth = aOutputSize.Width(); const long nOutputWidth = aOutputSize.Width();
const long nOutputHeight = aOutputSize.Height(); 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); 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(); const MapMode& rMapMode = GetMapMode();
aImageSize.Width() = long(aImageSize.Width() * (double)rMapMode.GetScaleX()); aImageSize.Width() = long(aImageSize.Width() * (double)rMapMode.GetScaleX());
aImageSize.Height() = long(aImageSize.Height() * (double)rMapMode.GetScaleY()); aImageSize.Height() = long(aImageSize.Height() * (double)rMapMode.GetScaleY());
...@@ -225,17 +234,17 @@ void OStartMarker::Resize() ...@@ -225,17 +234,17 @@ void OStartMarker::Resize()
aExtraWidth *= rMapMode.GetScaleX(); aExtraWidth *= rMapMode.GetScaleX();
Point aPos(aImageSize.Width() + (long)(aExtraWidth + aExtraWidth), aExtraWidth); 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()); 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)); m_aText->SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
aPos.X() = aExtraWidth; aPos.X() = aExtraWidth;
aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ; aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText->GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ;
m_aImage.SetPosSizePixel(aPos,aImageSize); m_aImage->SetPosSizePixel(aPos,aImageSize);
} }
void OStartMarker::setTitle(const OUString& _sTitle) void OStartMarker::setTitle(const OUString& _sTitle)
{ {
m_aText.SetText(_sTitle); m_aText->SetText(_sTitle);
} }
void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint) void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
...@@ -252,12 +261,12 @@ 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) void OStartMarker::showRuler(bool _bShow)
{ {
m_bShowRuler = _bShow; m_bShowRuler = _bShow;
m_aVRuler.Show(!m_bCollapsed && m_bShowRuler); m_aVRuler->Show(!m_bCollapsed && m_bShowRuler);
} }
void OStartMarker::RequestHelp( const HelpEvent& rHEvt ) void OStartMarker::RequestHelp( const HelpEvent& rHEvt )
{ {
if( !m_aText.GetText().isEmpty()) if( !m_aText->GetText().isEmpty())
{ {
// Hilfe anzeigen // Hilfe anzeigen
Rectangle aItemRect(rHEvt.GetMousePosPixel(),Size(GetSizePixel().Width(),getMinHeight())); Rectangle aItemRect(rHEvt.GetMousePosPixel(),Size(GetSizePixel().Width(),getMinHeight()));
...@@ -268,9 +277,9 @@ void OStartMarker::RequestHelp( const HelpEvent& rHEvt ) ...@@ -268,9 +277,9 @@ void OStartMarker::RequestHelp( const HelpEvent& rHEvt )
aItemRect.Right() = aPt.X(); aItemRect.Right() = aPt.X();
aItemRect.Bottom() = aPt.Y(); aItemRect.Bottom() = aPt.Y();
if( rHEvt.GetMode() == HelpEventMode::BALLOON ) if( rHEvt.GetMode() == HelpEventMode::BALLOON )
Help::ShowBalloon( this, aItemRect.Center(), aItemRect, m_aText.GetText()); Help::ShowBalloon( this, aItemRect.Center(), aItemRect, m_aText->GetText());
else else
Help::ShowQuickHelp( this, aItemRect, m_aText.GetText() ); Help::ShowQuickHelp( this, aItemRect, m_aText->GetText() );
} }
} }
...@@ -284,8 +293,8 @@ void OStartMarker::setCollapsed(bool _bCollapsed) ...@@ -284,8 +293,8 @@ void OStartMarker::setCollapsed(bool _bCollapsed)
void OStartMarker::zoom(const Fraction& _aZoom) void OStartMarker::zoom(const Fraction& _aZoom)
{ {
setZoomFactor(_aZoom,*this); setZoomFactor(_aZoom,*this);
m_aVRuler.SetZoom(_aZoom); m_aVRuler->SetZoom(_aZoom);
setZoomFactor(_aZoom,m_aText); setZoomFactor(_aZoom, *m_aText.get());
Resize(); Resize();
Invalidate(); Invalidate();
} }
......
...@@ -184,9 +184,15 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow) ...@@ -184,9 +184,15 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow)
} }
OViewsWindow::~OViewsWindow() OViewsWindow::~OViewsWindow()
{
dispose();
}
void OViewsWindow::dispose()
{ {
m_aColorConfig.RemoveListener(this); m_aColorConfig.RemoveListener(this);
m_aSections.clear(); m_aSections.clear();
vcl::Window::dispose();
} }
void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet) void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet)
......
...@@ -184,6 +184,11 @@ PropBrw::PropBrw(const Reference< XComponentContext >& _xORB, vcl::Window* pPare ...@@ -184,6 +184,11 @@ PropBrw::PropBrw(const Reference< XComponentContext >& _xORB, vcl::Window* pPare
PropBrw::~PropBrw() PropBrw::~PropBrw()
{
dispose();
}
void PropBrw::dispose()
{ {
if (m_xBrowserController.is()) if (m_xBrowserController.is())
implDetachController(); implDetachController();
...@@ -204,6 +209,7 @@ PropBrw::~PropBrw() ...@@ -204,6 +209,7 @@ PropBrw::~PropBrw()
{} {}
::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); ::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
DockingWindow::dispose();
} }
void PropBrw::setCurrentPage(const OUString& _sLastActivePage) void PropBrw::setCurrentPage(const OUString& _sLastActivePage)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment