summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-06 17:42:26 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-06 17:42:26 +0000
commitc13153dfd0fcc200b3f0e2e4b1839a5e49f8969a (patch)
tree5ec9f6791efb3bb8a9e4ea12dff6c01c075a7201 /extensions
parente811f031cfb312112d9d46d82254840046836f3e (diff)
INTEGRATION: CWS odbmacros2 (1.10.8); FILE MERGED
2008/02/04 13:09:22 fs 1.10.8.2: RESYNC: (1.10-1.11); FILE MERGED 2007/12/12 14:36:04 fs 1.10.8.1: #i49133# when invoking the macro assignment dialog, pass it the frame of our context document
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/propctrlr/eventhandler.cxx40
1 files changed, 35 insertions, 5 deletions
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index 09cfef39f5ba..1c8df94741cd 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: eventhandler.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: ihi $ $Date: 2008-01-14 14:57:12 $
+ * last change: $Author: kz $ $Date: 2008-03-06 18:42:26 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -67,6 +67,7 @@
/** === end UNO includes === **/
#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/types.hxx>
#include <cppuhelper/implbase1.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
@@ -78,6 +79,7 @@
#include <tools/diagnose_ex.h>
#include <map>
+#include <algorithm>
//------------------------------------------------------------------------
extern "C" void SAL_CALL createRegistryInfo_EventHandler()
@@ -135,6 +137,10 @@ namespace pcr
using ::com::sun::star::inspection::XObjectInspectorUI;
using ::com::sun::star::util::XModifiable;
using ::com::sun::star::beans::PropertyChangeEvent;
+ using ::com::sun::star::frame::XFrame;
+ using ::com::sun::star::frame::XModel;
+ using ::com::sun::star::frame::XController;
+ using ::com::sun::star::uno::UNO_SET_THROW;
/** === end UNO using === **/
namespace PropertyControlType = ::com::sun::star::inspection::PropertyControlType;
namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
@@ -876,12 +882,17 @@ namespace pcr
// the dialog
SvxAbstractDialogFactory* pFactory = SvxAbstractDialogFactory::Create();
- SfxItemSet aItems( SFX_APP()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM );
- aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, m_bIsDialogElement ) );
if ( !pFactory )
return InteractiveSelectionResult_Cancelled;
+
::std::auto_ptr< VclAbstractDialog > pDialog( pFactory->CreateSvxMacroAssignDlg(
- PropertyHandlerHelper::getDialogParentWindow( m_aContext ), aItems, pEventHolder.get(), nInitialSelection ) );
+ PropertyHandlerHelper::getDialogParentWindow( m_aContext ),
+ impl_getContextFrame_nothrow(),
+ m_bIsDialogElement,
+ pEventHolder.get(),
+ nInitialSelection
+ ) );
+
if ( !pDialog.get() )
return InteractiveSelectionResult_Cancelled;
@@ -937,6 +948,25 @@ namespace pcr
return sal_True;
}
+ //------------------------------------------------------------------------
+ Reference< XFrame > EventHandler::impl_getContextFrame_nothrow() const
+ {
+ Reference< XFrame > xContextFrame;
+
+ try
+ {
+ Reference< XModel > xContextDocument( m_aContext.getContextValueByAsciiName( "ContextDocument" ), UNO_QUERY_THROW );
+ Reference< XController > xController( xContextDocument->getCurrentController(), UNO_SET_THROW );
+ xContextFrame.set( xController->getFrame(), UNO_SET_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return xContextFrame;
+ }
+
//--------------------------------------------------------------------
sal_Int32 EventHandler::impl_getComponentIndexInParent_throw() const
{