[Libreoffice-commits] core.git: Branch 'feature/vclref' - dbaccess/source include/dbaccess
Michael Meeks
michael.meeks at collabora.com
Fri Feb 27 02:06:06 PST 2015
dbaccess/source/core/dataaccess/databasedocument.cxx | 1 +
dbaccess/source/ui/app/AppDetailPageHelper.cxx | 4 ++--
dbaccess/source/ui/app/AppDetailPageHelper.hxx | 4 ++--
dbaccess/source/ui/browser/dataview.cxx | 13 ++++++-------
include/dbaccess/dataview.hxx | 4 ++--
5 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit fe64e57f2d37d77811a3648ccf11b76eaa7e5f0e
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Fri Feb 27 10:09:37 2015 +0000
dbaccess: nail the last double-dispose issue breaking the test.
Change-Id: I861c970db9c36c973bcb2fa94a3e8e12f8de4f13
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 4e8099d..7203779 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1505,6 +1505,7 @@ void SAL_CALL ODatabaseDocument::close( sal_Bool _bDeliverOwnership ) throw (Clo
// SYNCHRONIZED ->
{
DocumentGuard aGuard(*this, DocumentGuard::DefaultMethod);
+ assert (!m_bClosing);
m_bClosing = true;
}
// <- SYNCHRONIZED
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 5461767..1516bb4 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -193,7 +193,6 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo
,m_aBorder(new Window(this,WB_BORDER | WB_READONLY))
,m_aPreview(new OPreviewWindow(m_aBorder.get()))
,m_aDocumentInfo(new ::svtools::ODocumentInfoPreview(m_aBorder.get(), WB_LEFT | WB_VSCROLL | WB_READONLY) )
- ,m_pTablePreview(NULL)
,m_ePreviewMode(_ePreviewMode)
{
@@ -212,7 +211,7 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo
m_aPreview->SetHelpId(HID_APP_VIEW_PREVIEW_1);
- m_pTablePreview = new OTablePreviewWindow(m_aBorder.get(), WB_READONLY | WB_DIALOGCONTROL );
+ m_pTablePreview.set( new OTablePreviewWindow(m_aBorder.get(), WB_READONLY | WB_DIALOGCONTROL ) );
m_pTablePreview->SetHelpId(HID_APP_VIEW_PREVIEW_2);
m_aDocumentInfo->SetHelpId(HID_APP_VIEW_PREVIEW_3);
@@ -259,6 +258,7 @@ void OAppDetailPageHelper::dispose()
m_aTBPreview.disposeAndClear();
m_aPreview.disposeAndClear();
m_aDocumentInfo.disposeAndClear();
+ m_pTablePreview.disposeAndClear();
m_aBorder.disposeAndClear();
m_aMenu.reset();
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index ef9899f..9e8d5e9 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -84,8 +84,8 @@ namespace dbaui
VclPtr<Window> m_aBorder;
VclPtr<OPreviewWindow> m_aPreview;
VclPtr<::svtools::ODocumentInfoPreview>
- m_aDocumentInfo;
- vcl::Window* m_pTablePreview;
+ m_aDocumentInfo;
+ VclPtr<vcl::Window> m_pTablePreview;
::std::unique_ptr<PopupMenu> m_aMenu;
PreviewMode m_ePreviewMode;
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >
diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx
index 3f15879..e023e5b 100644
--- a/dbaccess/source/ui/browser/dataview.cxx
+++ b/dbaccess/source/ui/browser/dataview.cxx
@@ -65,10 +65,9 @@ namespace dbaui
WinBits nStyle)
:Window(pParent,nStyle)
,m_xContext(_rxContext)
- ,m_rController( _rController )
+ ,m_xController( &_rController )
,m_aSeparator( new FixedLine(this) )
{
- m_rController.acquire();
m_pAccel.reset(::svt::AcceleratorExecute::createAcceleratorHelper());
m_aSeparator->Show();
}
@@ -84,7 +83,7 @@ namespace dbaui
void ODataView::dispose()
{
- m_rController.release();
+ m_xController.clear();
m_aSeparator.disposeAndClear();
m_pAccel.reset();
vcl::Window::dispose();
@@ -141,7 +140,7 @@ namespace dbaui
case MouseNotifyEvent::KEYUP:
case MouseNotifyEvent::MOUSEBUTTONDOWN:
case MouseNotifyEvent::MOUSEBUTTONUP:
- bHandled = m_rController.interceptUserInput( _rNEvt );
+ bHandled = m_xController->interceptUserInput( _rNEvt );
break;
default:
break;
@@ -155,7 +154,7 @@ namespace dbaui
if ( nType == StateChangedType::CONTROLBACKGROUND )
{
// Check if we need to get new images for normal/high contrast mode
- m_rController.notifyHiContrastChanged();
+ m_xController->notifyHiContrastChanged();
}
if ( nType == StateChangedType::INITSHOW )
@@ -164,7 +163,7 @@ namespace dbaui
// model's arguments.
try
{
- Reference< XController > xController( m_rController.getXController(), UNO_SET_THROW );
+ Reference< XController > xController( m_xController->getXController(), UNO_SET_THROW );
Reference< XModel > xModel( xController->getModel(), UNO_QUERY );
if ( xModel.is() )
{
@@ -190,7 +189,7 @@ namespace dbaui
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
// Check if we need to get new images for normal/high contrast mode
- m_rController.notifyHiContrastChanged();
+ m_xController->notifyHiContrastChanged();
}
}
void ODataView::attachFrame(const Reference< XFrame >& _xFrame)
diff --git a/include/dbaccess/dataview.hxx b/include/dbaccess/dataview.hxx
index e0652b9..104e80b 100644
--- a/include/dbaccess/dataview.hxx
+++ b/include/dbaccess/dataview.hxx
@@ -37,7 +37,7 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; // the service factory to work with
protected:
- IController& m_rController; // the controller in where we resides in
+ rtl::Reference<IController> m_xController; // the controller in where we resides in
VclPtr<FixedLine> m_aSeparator;
::std::unique_ptr< ::svt::AcceleratorExecute> m_pAccel;
@@ -58,7 +58,7 @@ namespace dbaui
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
- inline IController& getCommandController() const { return m_rController; }
+ inline IController& getCommandController() const { return *m_xController.get(); }
/** will be called when the controls need to be resized.
*/
More information about the Libreoffice-commits
mailing list