summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-09-30 12:22:37 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-09-30 12:22:37 +0000
commit95c5041f7568854cd5e92a2b39d439a41661a70c (patch)
tree7cfedb7e45cae1f823820d61afc587accf6f71ad /sfx2
parent2932b392f78873c9393433773bdf64896cee14bb (diff)
CWS-TOOLING: integrate CWS docmacroassignments_DEV300
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/macropg.hxx22
-rw-r--r--sfx2/source/dialog/cfg.cxx20
-rw-r--r--sfx2/source/dialog/macropg.cxx29
3 files changed, 50 insertions, 21 deletions
diff --git a/sfx2/inc/sfx2/macropg.hxx b/sfx2/inc/sfx2/macropg.hxx
index 323b6ed23a..9bb03415bd 100644
--- a/sfx2/inc/sfx2/macropg.hxx
+++ b/sfx2/inc/sfx2/macropg.hxx
@@ -36,14 +36,15 @@
#include <sfx2/basedlgs.hxx>
#include <sfx2/tabdlg.hxx>
#include <svtools/macitem.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
+#include <com/sun/star/frame/XFrame.hpp>
+
class _SfxMacroTabPage;
class SvStringsDtor;
class SvTabListBox;
class Edit;
class String;
+class SfxObjectShell;
typedef SvStringsDtor* (*FNGetRangeHdl)( _SfxMacroTabPage*, const String& rLanguage );
typedef SvStringsDtor* (*FNGetMacrosOfRangeHdl)( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
@@ -124,8 +125,12 @@ inline void _SfxMacroTabPage::ClearMacroTbl()
class SFX2_DLLPUBLIC SfxMacroTabPage : public _SfxMacroTabPage
{
public:
- SfxMacroTabPage( Window* pParent, const ResId& rId,
- const SfxItemSet& rSet );
+ SfxMacroTabPage(
+ Window* pParent,
+ const ResId& rId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
+ const SfxItemSet& rSet
+ );
// --------- Erben aus der Basis -------------
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
@@ -134,7 +139,14 @@ public:
class SFX2_DLLPUBLIC SfxMacroAssignDlg : public SfxSingleTabDialog
{
public:
- SfxMacroAssignDlg( Window* pParent, SfxItemSet& rSet );
+ SfxMacroAssignDlg(
+ Window* pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
+ SfxItemSet& rSet );
+ SfxMacroAssignDlg(
+ Window* pParent,
+ const SfxObjectShell* _pShell,
+ SfxItemSet& rSet );
virtual ~SfxMacroAssignDlg();
};
diff --git a/sfx2/source/dialog/cfg.cxx b/sfx2/source/dialog/cfg.cxx
index 8250918760..925b49a702 100644
--- a/sfx2/source/dialog/cfg.cxx
+++ b/sfx2/source/dialog/cfg.cxx
@@ -830,19 +830,19 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul
SetUpdateMode(FALSE);
ClearAll(); // Remove all old entries from treelist box
+ m_xFrame = xFrame;
if ( xSMGR.is())
{
- m_xSMGR = xSMGR;
- m_xFrame = xFrame;
- m_sModuleLongName = sModuleLongName;
+ m_xSMGR = xSMGR;
+ m_sModuleLongName = sModuleLongName;
- m_xGlobalCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICATEGORYDESCRIPTION), css::uno::UNO_QUERY_THROW);
- m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName) , css::uno::UNO_QUERY_THROW);
- m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION) , css::uno::UNO_QUERY_THROW);
+ m_xGlobalCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICATEGORYDESCRIPTION), css::uno::UNO_QUERY_THROW);
+ m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName) , css::uno::UNO_QUERY_THROW);
+ m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION) , css::uno::UNO_QUERY_THROW);
- InitModule();
- InitBasic();
- InitStyles();
+ InitModule();
+ InitBasic();
+ InitStyles();
}
/*
@@ -1031,7 +1031,7 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul
::rtl::OUString uiName = theChild->getName();
if ( bIsRootNode )
{
- if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) ||
+ if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) ||
theChild->getName().equals( currentDocTitle ) ) ) )
{
bDisplay=FALSE;
diff --git a/sfx2/source/dialog/macropg.cxx b/sfx2/source/dialog/macropg.cxx
index 915f5e51d3..bf5c569c50 100644
--- a/sfx2/source/dialog/macropg.cxx
+++ b/sfx2/source/dialog/macropg.cxx
@@ -52,10 +52,13 @@
#include "dialog.hrc"
#include <sfx2/macrconf.hxx>
#include <sfx2/sfxdefs.hxx>
+#include <sfx2/viewfrm.hxx>
#include "helpid.hrc"
#include "headertablistbox.hxx"
#include "macropg_impl.hxx"
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::frame::XFrame;
_SfxMacroTabPage_Impl::_SfxMacroTabPage_Impl( void ) :
pAssignPB( NULL ),
@@ -582,8 +585,7 @@ void _SfxMacroTabPage::FillMacroList()
mpImpl->pGroupLB->Init(
::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory >(),
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XFrame >(),
+ GetFrame(),
::rtl::OUString() );
delete pArr;
@@ -712,7 +714,7 @@ SvStringsDtor* __EXPORT _ImpGetMacrosOfRangeHdl(
}
-SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const SfxItemSet& rSet )
+SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet )
: _SfxMacroTabPage( pParent, rResId, rSet )
{
mpImpl->pStrEvent = new String( SfxResId( STR_EVENT ) );
@@ -731,6 +733,8 @@ SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Sf
FreeResource();
+ SetFrame( rxDocumentFrame );
+
InitAndSetHandler();
ScriptChanged( String( SfxResId( STR_BASICNAME ) ) );
@@ -738,14 +742,27 @@ SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Sf
SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
{
- return new SfxMacroTabPage( pParent, SfxResId( RID_SFX_TP_MACROASSIGN), rAttrSet );
+ return new SfxMacroTabPage( pParent, SfxResId( RID_SFX_TP_MACROASSIGN), NULL, rAttrSet );
}
-SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, SfxItemSet& rSet )
+SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, const SfxObjectShell* _pShell, SfxItemSet& rSet )
+ : SfxSingleTabDialog( pParent, rSet, 0 )
+{
+ SfxMacroTabPage* pPage = dynamic_cast< SfxMacroTabPage* >( SfxMacroTabPage::Create( this, rSet ) );
+ if ( _pShell && _pShell->GetFrame() && _pShell->GetFrame()->GetFrame() )
+ pPage->SetFrame( _pShell->GetFrame()->GetFrame()->GetFrameInterface() );
+ else
+ OSL_ENSURE( false, "SfxMacroAssignDlg::SfxMacroAssignDlg: no shell -> no frame -> no document macros!" );
+ SetTabPage( pPage );
+}
+
+SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, const Reference< XFrame >& rxDocumentFrame, SfxItemSet& rSet )
: SfxSingleTabDialog( pParent, rSet, 0 )
{
- SetTabPage( SfxMacroTabPage::Create( this, rSet ) );
+ SfxTabPage* pPage = SfxMacroTabPage::Create( this, rSet );
+ pPage->SetFrame( rxDocumentFrame );
+ SetTabPage( pPage );
}
SfxMacroAssignDlg::~SfxMacroAssignDlg()