Tag: cws_src680_rpt23fix02
User: oj      
Date: 2007-07-27 12:22:01+0000
Modified:
   dba/reportdesign/source/core/api/ReportDefinition.cxx
   dba/reportdesign/source/core/misc/conditionupdater.cxx
   dba/reportdesign/source/core/sdr/RptObjectListener.cxx
   dba/reportdesign/source/core/sdr/UndoActions.cxx
   dba/reportdesign/source/core/sdr/formatnormalizer.cxx
   dba/reportdesign/source/filter/xml/xmlHelper.cxx
   dba/reportdesign/source/filter/xml/xmlImage.cxx
   dba/reportdesign/source/filter/xml/xmlfilter.cxx
   dba/reportdesign/source/ui/dlg/CondFormat.cxx
   dba/reportdesign/source/ui/dlg/Navigator.cxx
   dba/reportdesign/source/ui/inc/propbrw.hxx
   dba/reportdesign/source/ui/misc/Undo.cxx
   dba/reportdesign/source/ui/misc/toolboxcontroller.cxx
   dba/reportdesign/source/ui/report/ReportController.cxx
   dba/reportdesign/source/ui/report/propbrw.cxx

Log:
 #i77907# remove entries from context when propbrw is destroyed

File Changes:

Directory: /dba/reportdesign/source/core/api/
=============================================

File [changed]: ReportDefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/api/ReportDefinition.cxx?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +2 -19
--------------------
--- ReportDefinition.cxx        2007-07-24 12:48:02+0000        1.2.4.1
+++ ReportDefinition.cxx        2007-07-27 12:21:57+0000        1.2.4.2
@@ -637,7 +637,6 @@
        uno::Reference< report::XSection>                               
m_xDetail;
        uno::Reference< embed::XStorage >                               
m_xStorage;
        uno::Reference< frame::XController >                    
m_xCurrentController;
-       uno::Reference< document::XEventListener >              
m_xDocEventBroadcaster;
     uno::Reference< container::XIndexAccess >               m_xViewData;
     uno::Reference< container::XNameAccess >                m_xStyles;
     uno::Reference< report::XFunctions >                    m_xFunctions;
@@ -785,13 +784,11 @@
         SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin();
            rAdmin.NewStandardLayer();
            rAdmin.NewLayer( UniString::CreateFromAscii( 
RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ) );
-               
m_pImpl->m_xDocEventBroadcaster.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")),m_aProps->m_xContext),
-                       uno::UNO_QUERY);
         m_pImpl->m_xFunctions = new OFunctions(this,m_aProps->m_xContext);
        }
        catch(uno::Exception)
        {
-               OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!");
+               OSL_ENSURE(0,"Error!");
        }
 }
 // 
-----------------------------------------------------------------------------
@@ -815,8 +812,6 @@
            m_pImpl->m_aDocEventListeners.disposeAndClear( aDisposeEvent );
                m_pImpl->m_aStorageChangeListeners.disposeAndClear( 
aDisposeEvent );
 
-               m_pImpl->m_xDocEventBroadcaster.clear();
-
                ::comphelper::disposeComponent(m_pImpl->m_xGroups);
                ::comphelper::disposeComponent(m_pImpl->m_xReportHeader);
                ::comphelper::disposeComponent(m_pImpl->m_xReportFooter);
@@ -836,6 +831,7 @@
         m_pImpl->m_xStyles.clear();
         m_pImpl->m_xUIConfigurationManager.clear();
         m_pImpl->m_pReportModel.reset();
+        m_pImpl->m_aArgs.realloc(0);
        }
 }
 // 
-----------------------------------------------------------------------------
@@ -1886,20 +1882,7 @@
                ::osl::ResettableMutexGuard aGuard(m_aMutex);
                
::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
                document::EventObject aEvt(*this, _sEventName);         
-        /// TODO: this code has to be deleted after as cws will be integrated
-        uno::Reference< document::XEventListener > xDocEventBroadcaster;
-        try
-       {
-                       
xDocEventBroadcaster.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")),m_aProps->m_xContext),
-               uno::UNO_QUERY);
-       }
-           catch(uno::Exception)
-       {
-               OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!");
-           }
         aGuard.clear();
-        if ( xDocEventBroadcaster.is() )
-            xDocEventBroadcaster->notifyEvent(aEvt);
                
m_pImpl->m_aDocEventListeners.notifyEach(&document::XEventListener::notifyEvent,aEvt);
        }
        catch(uno::Exception&)

Directory: /dba/reportdesign/source/core/misc/
==============================================

File [changed]: conditionupdater.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/misc/conditionupdater.cxx?r1=1.1.4.2&r2=1.1.4.3
Delta lines:  +7 -3
-------------------
--- conditionupdater.cxx        2007-07-24 12:48:03+0000        1.1.4.2
+++ conditionupdater.cxx        2007-07-27 12:21:57+0000        1.1.4.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: conditionupdater.cxx,v $
  *
- *  $Revision: 1.1.4.2 $
+ *  $Revision: 1.1.4.3 $
  *
- *  last change: $Author: oj $ $Date: 2007/07/24 12:48:03 $
+ *  last change: $Author: oj $ $Date: 2007/07/27 12:21:57 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -43,6 +43,7 @@
 /** === end UNO includes === **/
 
 #include <tools/diagnose_ex.h>
+#include <tools/debug.hxx>
 
 //........................................................................
 namespace rptui
@@ -62,14 +63,17 @@
        //====================================================================
        //= ConditionUpdater
        //====================================================================
+    DBG_NAME(rpt_ConditionUpdater)    
        //--------------------------------------------------------------------
     ConditionUpdater::ConditionUpdater()
     {
+        DBG_CTOR(rpt_ConditionUpdater,NULL);        
     }
 
        //--------------------------------------------------------------------
     ConditionUpdater::~ConditionUpdater()
     {
+        DBG_DTOR(rpt_ConditionUpdater,NULL);        
     }
 
        //--------------------------------------------------------------------

Directory: /dba/reportdesign/source/core/sdr/
=============================================

File [changed]: RptObjectListener.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/sdr/RptObjectListener.cxx?r1=1.2&r2=1.2.4.1
Delta lines:  +6 -4
-------------------
--- RptObjectListener.cxx       2007-07-09 11:56:16+0000        1.2
+++ RptObjectListener.cxx       2007-07-27 12:21:57+0000        1.2.4.1
@@ -51,16 +51,18 @@
 //============================================================================
 
 //----------------------------------------------------------------------------
-
+DBG_NAME(rpt_OObjectListener)
 OObjectListener::OObjectListener(OObjectBase* _pObject)
                  :m_pObject(_pObject)
 {
+    DBG_CTOR(rpt_OObjectListener,NULL);    
 }
 
 //----------------------------------------------------------------------------
 
 OObjectListener::~OObjectListener()
 {
+    DBG_DTOR(rpt_OObjectListener,NULL);    
 }
 
 // XEventListener

File [changed]: UndoActions.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/sdr/UndoActions.cxx?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +3 -0
-------------------
--- UndoActions.cxx     2007-07-24 12:48:04+0000        1.2.4.1
+++ UndoActions.cxx     2007-07-27 12:21:57+0000        1.2.4.2
@@ -101,16 +101,19 @@
 DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, 
PropertySetInfoCache);
 
//------------------------------------------------------------------------------
 TYPEINIT1( OCommentUndoAction,          SdrUndoAction );
+DBG_NAME(rpt_OCommentUndoAction)
 //----------------------------------------------------------------------------
 OCommentUndoAction::OCommentUndoAction(SdrModel& _rMod,USHORT nCommentID) 
        :SdrUndoAction(_rMod)
 { 
+    DBG_CTOR(rpt_OCommentUndoAction,NULL);    
     m_pController = static_cast< OReportModel& >( _rMod ).getController();
        if ( nCommentID )
         m_strComment = String(ModuleRes(nCommentID)); 
 }
 OCommentUndoAction::~OCommentUndoAction()
 {
+    DBG_DTOR(rpt_OCommentUndoAction,NULL);    
 }
 //----------------------------------------------------------------------------
 void OCommentUndoAction::Undo()

File [changed]: formatnormalizer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/sdr/formatnormalizer.cxx?r1=1.2&r2=1.2.4.1
Delta lines:  +6 -3
-------------------
--- formatnormalizer.cxx        2007-07-09 11:56:16+0000        1.2
+++ formatnormalizer.cxx        2007-07-27 12:21:57+0000        1.2.4.1
@@ -79,17 +79,20 @@
        //====================================================================
        //= FormatNormalizer
        //====================================================================
+    DBG_NAME(rpt_FormatNormalizer)    
        //--------------------------------------------------------------------
     FormatNormalizer::FormatNormalizer( const OReportModel& _rModel )
         :m_rModel( _rModel )
         ,m_xReportDefinition( )
         ,m_bFieldListDirty( true )
     {
+        DBG_CTOR(rpt_FormatNormalizer,NULL);        
     }
 
        //--------------------------------------------------------------------
     FormatNormalizer::~FormatNormalizer()
     {
+        DBG_DTOR(rpt_FormatNormalizer,NULL);        
     }
 
        //--------------------------------------------------------------------

Directory: /dba/reportdesign/source/filter/xml/
===============================================

File [changed]: xmlHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlHelper.cxx?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +3 -1
-------------------
--- xmlHelper.cxx       2007-07-24 12:48:04+0000        1.2.4.1
+++ xmlHelper.cxx       2007-07-27 12:21:58+0000        1.2.4.2
@@ -124,13 +124,15 @@
        using namespace ::com::sun::star::sdb;
        using namespace ::com::sun::star::form;
     using namespace ::com::sun::star::beans;
-
+DBG_NAME(rpt_OPropertyHandlerFactory)
 OPropertyHandlerFactory::OPropertyHandlerFactory()
 {
+    DBG_CTOR(rpt_OPropertyHandlerFactory,NULL);    
 }
 // 
-----------------------------------------------------------------------------
 OPropertyHandlerFactory::~OPropertyHandlerFactory()
 {
+    DBG_DTOR(rpt_OPropertyHandlerFactory,NULL);    
 }
 // 
-----------------------------------------------------------------------------
 const XMLPropertyHandler* 
OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 _nType) const

File [changed]: xmlImage.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlImage.cxx?r1=1.2&r2=1.2.4.1
Delta lines:  +4 -4
-------------------
--- xmlImage.cxx        2007-07-09 11:56:18+0000        1.2
+++ xmlImage.cxx        2007-07-27 12:21:58+0000        1.2.4.1
@@ -111,7 +111,7 @@
                 case XML_TOK_DATA_FORMULA: 
                     {
                         sal_Int32 nLen = sValue.getLength();
-                        if ( nLen )
+                        if ( nLen > 4 )
                         {
                             sValue = sValue.copy(5,nLen-6);
                                                
_xComponent->setDataField(sValue);

File [changed]: xmlfilter.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlfilter.cxx?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +9 -5
-------------------
--- xmlfilter.cxx       2007-07-24 12:48:04+0000        1.2.4.1
+++ xmlfilter.cxx       2007-07-27 12:21:58+0000        1.2.4.2
@@ -178,7 +178,7 @@
 };
 
 TYPEINIT1( RptMLMasterStylesContext_Impl, XMLTextMasterStylesContext );
-
+DBG_NAME(rpt_RptMLMasterStylesContext_Impl)
 RptMLMasterStylesContext_Impl::RptMLMasterStylesContext_Impl(
                ORptFilter& rImport, sal_uInt16 nPrfx,
         const ::rtl::OUString& rLName ,
@@ -186,10 +186,12 @@
        XMLTextMasterStylesContext( rImport, nPrfx, rLName, xAttrList )
     ,m_rImport(rImport)
 {
+    DBG_CTOR(rpt_RptMLMasterStylesContext_Impl,NULL);    
 }
 
 RptMLMasterStylesContext_Impl::~RptMLMasterStylesContext_Impl()
 {
+    DBG_DTOR(rpt_RptMLMasterStylesContext_Impl,NULL);    
 }
 
 void RptMLMasterStylesContext_Impl::EndElement()
@@ -416,10 +418,11 @@
 // -------------
 // - ORptFilter -
 // -------------
-
+DBG_NAME(rpt_ORptFilter)
 ORptFilter::ORptFilter( const uno::Reference< XMultiServiceFactory >& 
_rxMSF,sal_uInt16 nImportFlags ) 
        :SvXMLImport(_rxMSF,nImportFlags)
 {
+    DBG_CTOR(rpt_ORptFilter,NULL);    
        GetMM100UnitConverter().setCoreMeasureUnit(MAP_100TH_MM);
        GetMM100UnitConverter().setXMLMeasureUnit(MAP_CM);
     GetNamespaceMap().Add( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( 
sXML_np__rpt) ),
@@ -441,6 +444,7 @@
 
 ORptFilter::~ORptFilter() throw()
 {
+    DBG_DTOR(rpt_ORptFilter,NULL);    
 }
 
//------------------------------------------------------------------------------
 uno::Reference< XInterface > ORptFilter::create(uno::Reference< 
XComponentContext > const & xContext)

Directory: /dba/reportdesign/source/ui/dlg/
===========================================

File [changed]: CondFormat.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/CondFormat.cxx?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +3 -0
-------------------
--- CondFormat.cxx      2007-07-25 14:07:01+0000        1.2.4.1
+++ CondFormat.cxx      2007-07-27 12:21:58+0000        1.2.4.2
@@ -110,6 +110,7 @@
     //========================================================================
     // class ConditionalFormattingDialog
     //========================================================================
+    DBG_NAME(rpt_ConditionalFormattingDialog)    
     ConditionalFormattingDialog::ConditionalFormattingDialog(
             Window* _pParent, const Reference< XReportControlModel >& 
_rxFormatConditions, ::rptui::OReportController& _rController )
         :ModalDialog( _pParent, ModuleRes(RID_CONDFORMAT) )
@@ -123,6 +124,7 @@
         ,m_xFormatConditions( _rxFormatConditions )  
         ,m_bDeletingCondition( false )
     {
+        DBG_CTOR(rpt_ConditionalFormattingDialog,NULL);        
         OSL_ENSURE( m_xFormatConditions.is(), 
"ConditionalFormattingDialog::ConditionalFormattingDialog: ReportControlModel 
is NULL -> Prepare for GPF!" );
 
         m_xCopy.set( m_xFormatConditions->createClone(), UNO_QUERY_THROW );
@@ -138,6 +140,7 @@
     ConditionalFormattingDialog::~ConditionalFormattingDialog()
     {
         m_aConditions.clear();
+        DBG_DTOR(rpt_ConditionalFormattingDialog,NULL);        
     }
 
     // 
-----------------------------------------------------------------------------

File [changed]: Navigator.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/Navigator.cxx?r1=1.2&r2=1.2.4.1
Delta lines:  +9 -4
-------------------
--- Navigator.cxx       2007-07-09 11:56:29+0000        1.2
+++ Navigator.cxx       2007-07-27 12:21:58+0000        1.2.4.1
@@ -265,7 +265,7 @@
 private:
     using SvTreeListBox::ExecuteDrop;
 };
-
+DBG_NAME(rpt_NavigatorTree)
 // 
-----------------------------------------------------------------------------
 NavigatorTree::NavigatorTree( Window* pParent,OReportController* _pController )
         :SvTreeListBox( pParent, 
WB_HASBUTTONS|WB_HASLINES|WB_BORDER|WB_HSCROLL|WB_HASBUTTONSATROOT )
@@ -278,6 +278,7 @@
         ,m_pDragedEntry(NULL)
         ,m_nTimerCounter( DROP_ACTION_TIMER_INITIAL_TICKS )
 {
+    DBG_CTOR(rpt_NavigatorTree,NULL);    
     m_pReportListener = new 
OPropertyChangeMultiplexer(this,m_pController->getReportDefinition().get());
     m_pReportListener->addProperty(PROPERTY_PAGEHEADERON);
     m_pReportListener->addProperty(PROPERTY_PAGEFOOTERON);
@@ -322,6 +323,7 @@
     }
     m_pReportListener->dispose();
     m_pSelectionListener->dispose();
+    DBG_DTOR(rpt_NavigatorTree,NULL);    
 }
 
//------------------------------------------------------------------------------
 void NavigatorTree::Command( const CommandEvent& rEvt )
@@ -822,6 +824,7 @@
             GetModel()->Remove(_pEntry);
     }
 }
+DBG_NAME(rpt_NavigatorTree_UserData)
 // 
-----------------------------------------------------------------------------
 NavigatorTree::UserData::UserData(NavigatorTree* _pTree,const 
uno::Reference<uno::XInterface>& _xContent) 
     : OPropertyChangeListener(m_aMutex)
@@ -829,6 +832,7 @@
     , m_xContent(_xContent)
     , m_pTree(_pTree)
 {
+    DBG_CTOR(rpt_NavigatorTree_UserData,NULL);    
     uno::Reference<beans::XPropertySet> xProp(m_xContent,uno::UNO_QUERY);
     if ( xProp.is() )
     {
@@ -855,6 +859,7 @@
 // 
-----------------------------------------------------------------------------
 NavigatorTree::UserData::~UserData()
 {
+    DBG_DTOR(rpt_NavigatorTree_UserData,NULL);    
     if ( m_pContainerListener.is() )
         m_pContainerListener->dispose();
     if ( m_pListener.is() )

Directory: /dba/reportdesign/source/ui/inc/
===========================================

File [changed]: propbrw.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/propbrw.hxx?r1=1.2&r2=1.2.4.1
Delta lines:  +6 -4
-------------------
--- propbrw.hxx 2007-07-09 11:56:31+0000        1.2
+++ propbrw.hxx 2007-07-27 12:21:58+0000        1.2.4.1
@@ -54,7 +54,7 @@
 #ifndef _COM_SUN_STAR_INSPECTION_XOBJECTINSPECTOR_HPP_
 #include <com/sun/star/inspection/XObjectInspector.hpp>
 #endif
-
+#include <com/sun/star/uno/XComponentContext.hpp>
 #ifndef _SFXBRDCST_HXX //autogen
 #include <svtools/brdcst.hxx>
 #endif
@@ -87,6 +87,8 @@
 {
 private:
     OModuleClient          m_aModuleClient;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext 
> 
+                        m_xInspectorContext;
        ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory >
                                            m_xORB;
        ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >

Directory: /dba/reportdesign/source/ui/misc/
============================================

File [changed]: Undo.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/misc/Undo.cxx?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +3 -0
-------------------
--- Undo.cxx    2007-07-24 12:48:06+0000        1.2.4.1
+++ Undo.cxx    2007-07-27 12:21:58+0000        1.2.4.2
@@ -136,6 +136,7 @@
 }
 //----------------------------------------------------------------------------
 TYPEINIT1( OSectionUndo,         OCommentUndoAction );
+DBG_NAME(rpt_OSectionUndo)
 //----------------------------------------------------------------------------
 OSectionUndo::OSectionUndo(OReportModel& _rMod
                            ,sal_uInt16 _nSlot
@@ -146,6 +147,7 @@
 ,m_nSlot(_nSlot)
 ,m_bInserted(false)
 {
+    DBG_CTOR(rpt_OSectionUndo,NULL);    
 }
 // 
-----------------------------------------------------------------------------
 OSectionUndo::~OSectionUndo()
@@ -175,6 +177,7 @@
             }
         }
     }
+    DBG_DTOR(rpt_OSectionUndo,NULL);    
 }
 // 
-----------------------------------------------------------------------------
 void OSectionUndo::collectControls(const uno::Reference< report::XSection >& 
_xSection)

File [changed]: toolboxcontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/misc/toolboxcontroller.cxx?r1=1.2&r2=1.2.4.1
Delta lines:  +6 -3
-------------------
--- toolboxcontroller.cxx       2007-07-09 11:56:32+0000        1.2
+++ toolboxcontroller.cxx       2007-07-27 12:21:58+0000        1.2.4.1
@@ -158,11 +158,13 @@
        return *(new OToolboxController(Reference< XMultiServiceFactory 
>(xContext->getServiceManager(),UNO_QUERY)));
 }
 // 
-----------------------------------------------------------------------------
+DBG_NAME(rpt_OToolboxController)
 OToolboxController::OToolboxController(const Reference< XMultiServiceFactory 
>& _rxORB)
        : m_pToolbarController(NULL)
        ,m_nToolBoxId(1)
        ,m_nSlotId(0)
 {
+    DBG_CTOR(rpt_OToolboxController,NULL);    
        osl_incrementInterlockedCount(&m_refCount);
        m_xServiceManager = _rxORB;
        osl_decrementInterlockedCount(&m_refCount);
@@ -171,6 +173,7 @@
 // 
-----------------------------------------------------------------------------
 OToolboxController::~OToolboxController()
 {
+    DBG_DTOR(rpt_OToolboxController,NULL);    
 }
 // 
-----------------------------------------------------------------------------
 // XInterface

Directory: /dba/reportdesign/source/ui/report/
==============================================

File [changed]: ReportController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportController.cxx?r1=1.2.4.3&r2=1.2.4.4
Delta lines:  +1 -0
-------------------
--- ReportController.cxx        2007-07-25 14:07:02+0000        1.2.4.3
+++ ReportController.cxx        2007-07-27 12:21:59+0000        1.2.4.4
@@ -440,6 +440,7 @@
     {
         ::comphelper::disposeComponent( m_xRowSet );
         ::comphelper::disposeComponent( m_xRowSetMediator );
+        ::comphelper::disposeComponent( m_xFormatter );
     }
     catch(uno::Exception&)
     {

File [changed]: propbrw.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/propbrw.cxx?r1=1.2&r2=1.2.4.1
Delta lines:  +36 -21
---------------------
--- propbrw.cxx 2007-07-09 11:56:33+0000        1.2
+++ propbrw.cxx 2007-07-27 12:21:59+0000        1.2.4.1
@@ -37,7 +37,6 @@
 #ifndef _REPORT_PROPBRW_HXX
 #include "propbrw.hxx"
 #endif
-
 #ifndef _REPORT_RPTUIOBJ_HXX
 #include "RptObject.hxx"
 #endif
@@ -178,7 +177,6 @@
     }
 }
 //-----------------------------------------------------------------------
-
 //============================================================================
 // PropBrw
 //============================================================================
@@ -217,38 +215,35 @@
 
        if (m_xMeAsFrame.is())
        {
+        Reference< XComponentContext > xOwnContext;
                try
                {
-                       Sequence< Any > aArgs(1);
-                       aArgs[0] <<= PropertyValue(
-                
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")),
-                               0,
-                               makeAny(VCLUnoHelper::GetInterface ( this )),
-                               PropertyState_DIRECT_VALUE
-                       );
             // our own component context
             Reference< XPropertySet > xFactoryProperties( m_xORB, 
UNO_QUERY_THROW );
-            Reference< XComponentContext > xOwnContext(
+            xOwnContext.set(
                 xFactoryProperties->getPropertyValue( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
                 UNO_QUERY_THROW );
 
+            /*uno::Reference< XComponent> xModel = new 
OContextHelper(m_xORB,uno::Reference< 
XComponent>(m_pDesignView->getController()->getModel(),uno::UNO_QUERY) );
+            uno::Reference< XComponent> xDialogParentWindow = new 
OContextHelper(m_xORB,uno::Reference< XComponent>(VCLUnoHelper::GetInterface ( 
this ),uno::UNO_QUERY) );
+            uno::Reference< XComponent> xConnection = new 
OContextHelper(m_xORB,uno::Reference< 
XComponent>(m_pDesignView->getController()->getConnection(),uno::UNO_QUERY) );*/
             // a ComponentContext for the
             ::cppu::ContextEntry_Init aHandlerContextInfo[] =
             {
-                ::cppu::ContextEntry_Init( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) ), makeAny( 
m_pDesignView->getController()->getModel() ) ),
-                ::cppu::ContextEntry_Init( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ), makeAny( 
VCLUnoHelper::GetInterface ( this ) ) ),
+                ::cppu::ContextEntry_Init( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) ), makeAny( 
m_pDesignView->getController()->getModel() )),
+                ::cppu::ContextEntry_Init( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ), makeAny( 
VCLUnoHelper::GetInterface ( this ) )),
                 ::cppu::ContextEntry_Init( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ), makeAny( 
m_pDesignView->getController()->getConnection() ) ),
             };
-            Reference< XComponentContext > xInspectorContext(
+            m_xInspectorContext.set(
                 ::cppu::createComponentContext( aHandlerContextInfo, sizeof( 
aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ),
                 xOwnContext ) );
                        // create a property browser controller
             bool bEnableHelpSection = lcl_shouldEnableHelpSection( m_xORB );
             Reference< inspection::XObjectInspectorModel> xInspectorModel( 
bEnableHelpSection
-                ?   
report::inspection::DefaultComponentInspectorModel::createWithHelpSection( 
xInspectorContext, 3, 8 )
-                :   
report::inspection::DefaultComponentInspectorModel::createDefault( 
xInspectorContext ) );
+                ?   
report::inspection::DefaultComponentInspectorModel::createWithHelpSection( 
m_xInspectorContext, 3, 8 )
+                :   
report::inspection::DefaultComponentInspectorModel::createDefault( 
m_xInspectorContext ) );
             
-            m_xBrowserController = 
inspection::ObjectInspector::createWithModel(xInspectorContext, 
xInspectorModel);
+            m_xBrowserController = 
inspection::ObjectInspector::createWithModel(m_xInspectorContext, 
xInspectorModel);
             if ( !m_xBrowserController.is() )
             {
                 const ::rtl::OUString sServiceName( 
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.inspection.ObjectInspector" ) );
@@ -263,9 +258,10 @@
                 {
                     uno::Reference< inspection::XObjectInspector > xInspector( 
m_xBrowserController, uno::UNO_QUERY_THROW );
                     uno::Reference< inspection::XObjectInspectorUI > 
xInspectorUI( xInspector->getInspectorUI() );
-                    uno::Reference< uno::XInterface > xDefaultHelpProvider( 
inspection::DefaultHelpProvider::create( xInspectorContext, xInspectorUI ) );
+                    uno::Reference< uno::XInterface > xDefaultHelpProvider( 
inspection::DefaultHelpProvider::create( m_xInspectorContext, xInspectorUI ) );
                 }
             }
+            xFactoryProperties->setPropertyValue( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ,makeAny(xOwnContext));
                }
                catch (Exception&)
                {
@@ -274,6 +270,9 @@
                        {
                                
::comphelper::disposeComponent(m_xBrowserController);
                                
::comphelper::disposeComponent(m_xBrowserComponentWindow);
+                Reference< XPropertySet > xFactoryProperties( m_xORB, 
UNO_QUERY_THROW );
+                if ( xOwnContext.is() )
+                    xFactoryProperties->setPropertyValue( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ,makeAny(xOwnContext));
                        }
                        catch(Exception&) { }
                        m_xBrowserController.clear();
@@ -299,6 +298,21 @@
        if (m_xBrowserController.is())
                implDetachController();
 
+    try
+    {
+        uno::Reference<container::XNameContainer> 
xName(m_xInspectorContext,uno::UNO_QUERY);
+        if ( xName.is() )
+        {
+            const ::rtl::OUString pProps[] = { ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) )
+                                            ,  ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) )
+                                            , ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) )};
+            for (size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i)
+                xName->removeByName(pProps[i]);
+        }
+    }
+    catch(Exception&)
+    {}
+
     
::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
 
        DBG_DTOR( rpt_PropBrw,NULL);
@@ -317,8 +331,9 @@
     if ( m_xBrowserController.is() )
         m_xBrowserController->attachFrame( NULL );
 
-    m_xBrowserController.clear();
     m_xMeAsFrame.clear();
+    m_xBrowserController.clear();
+    m_xBrowserComponentWindow.clear();
 }
 //-----------------------------------------------------------------------
 ::rtl::OUString PropBrw::getCurrentPage() const




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to