diff options
author | Release Engineers <releng@openoffice.org> | 2009-05-06 10:59:57 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2009-05-06 10:59:57 +0000 |
commit | 4d3148e0b7ee607de9c86e9e9aa79e9cd423f1f1 (patch) | |
tree | 5c5025d215f13e88b0ab36d10e91b6c064bce7a9 /sfx2 | |
parent | 924c156e4a9333ac972a91d185380220860cc91b (diff) |
CWS-TOOLING: integrate CWS mba32issues01
2009-05-05 18:23:27 +0200 mba r271547 : apply diffs from m45->m47 for all files moved from dialog to cui
2009-05-05 18:22:02 +0200 mba r271545 : apply diffs from m45->m47 for all files moved from dialog to cui
2009-05-05 18:16:42 +0200 mba r271544 : apply diffs from m45->m47 for all files moved from dialog to cui
2009-04-29 19:35:58 +0200 mba r271392 : #i73672#: unify commands for inserting special characters
2009-04-29 18:01:27 +0200 mba r271391 : #i101337#: missing string resources
2009-04-29 18:01:10 +0200 mba r271390 : #i101337#: missing string resources
2009-04-29 15:42:47 +0200 mba r271380 : concurrency problem in multithreaded dmake due to missing dependency
2009-04-28 17:36:03 +0200 tbo r271336 : #i99432#
2009-04-28 13:57:52 +0200 mba r271322 : #i101302#: ctor might be called with pSet=0
2009-04-22 19:32:39 +0200 tbo r271138 : #i99432#
2009-04-09 14:46:03 +0200 mba r270709 : make sendreportw32.cxx compile with pch
2009-04-06 16:05:07 +0200 mba r270568 : #i99432#: some tweaks for build order
2009-04-06 15:38:52 +0200 mba r270558 : typo
2009-04-06 13:36:19 +0200 mba r270542 : #i99432#: split of localization also
2009-04-06 13:19:06 +0200 mba r270539 : #i99432#: split up srs files also
2009-04-03 17:57:59 +0200 mba r270513 : #i99432#: split dialog folder into two
2009-04-03 17:56:46 +0200 mba r270512 : #i99432#: split dialog folder into two
2009-04-01 22:15:00 +0200 mba r270364 : warnings on Linux
2009-04-01 22:10:44 +0200 mba r270363 : warnings on Linux
2009-04-01 21:43:54 +0200 mba r270362 : warning fixed
2009-04-01 21:41:27 +0200 mba r270361 : warning on Linux fixed
2009-04-01 21:35:44 +0200 mba r270360 : warning fixed
2009-04-01 20:19:59 +0200 mba r270358 : warning found on Linux fixed
2009-04-01 19:23:38 +0200 mba r270354 : warning due to missing eof
2009-04-01 18:56:25 +0200 mba r270352 : linking problem fixed that appeared only on mac
2009-04-01 18:41:30 +0200 mba r270350 : warnings discovered on Linux fixed
2009-04-01 18:34:28 +0200 mba r270349 : some fixes for warnings and include problems discoverd after resync and build on mac
2009-04-01 14:08:22 +0200 mba r270328 : CWS-TOOLING: rebase CWS mba32issues01 to trunk@270033 (milestone: DEV300:m45)
2009-03-04 18:13:35 +0100 mba r268858 : #i99432#: more dialogs moved to cui
2009-03-04 17:47:41 +0100 mba r268854 : #i99432#: more dialogs moved to cui
2009-03-04 17:32:39 +0100 mba r268851 : warning fixed
2009-03-04 12:59:26 +0100 mba r268814 : #i99432#: more dialogs moved to cui
2009-03-04 11:49:03 +0100 mba r268802 : #i99432#: CharmapDialog moved to cui
2009-03-04 10:46:00 +0100 mba r268795 : #i99432#: CharmapDialog moved to cui
2009-03-04 10:43:50 +0100 mba r268794 : #i99432#: CharmapDialog moved to cui
2009-03-04 10:00:29 +0100 mba r268792 : #i99432#: CharmapDialog moved to cui
2009-03-04 10:00:03 +0100 mba r268791 : #i99432#: CharmapDialog moved to cui
2009-03-04 09:59:43 +0100 mba r268790 : #i99432#: CharmapDialog moved to cui
2009-03-04 09:58:51 +0100 mba r268789 : #i99432#: CharmapDialog moved to cui
2009-03-04 09:58:16 +0100 mba r268788 : #i99432#: CharmapDialog moved to cui
2009-03-03 16:33:14 +0100 mba r268763 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:32:28 +0100 mba r268762 : #i99432#: some tabpages moved to cui
2009-03-03 16:32:09 +0100 mba r268761 : #i99432#: some tabpages moved to cui
2009-03-03 16:29:40 +0100 mba r268760 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:29:08 +0100 mba r268759 : #i99432#: MacroAssignment page moved to cui
2009-03-03 16:28:41 +0100 mba r268758 : #i99432#: MacroAssignment page moved to cui
2009-03-03 16:28:18 +0100 mba r268757 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:27:36 +0100 mba r268756 : #i99465#: replace FN_SYMBOL by SID_CHARMAP
2009-03-03 16:27:02 +0100 mba r268755 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:26:23 +0100 mba r268754 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:25:30 +0100 mba r268753 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:24:49 +0100 mba r268752 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:24:35 +0100 mba r268751 : #i99432#: MacroAssignment page moved to cui
2009-03-03 16:23:20 +0100 mba r268750 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:23:04 +0100 mba r268749 : #i99432#: MacroAssignment page moved to cui
2009-03-03 16:21:56 +0100 mba r268748 : #i99465#: new SfxAbstractDialog interface and creation methods
2009-03-03 16:18:39 +0100 mba r268747 : #i99432#: MacroAssignment page moved to cui
2009-03-03 16:13:14 +0100 mba r268745 : #i99465#: replace FN_SYMBOL by SID_CHARMAP
2009-03-03 16:02:54 +0100 mba r268738 : #i99432#: moved MacroAssignment TabPage from sfx2
2009-03-03 14:57:58 +0100 mba r268729 : #i99465#: transport return value via ItemSet
2009-03-03 00:08:10 +0100 mba r268701 : #i99432#: move acccfg to cuilib
2009-03-03 00:07:32 +0100 mba r268700 : #i99432#: move acccfg to cuilib
2009-03-03 00:02:01 +0100 mba r268699 : #i99432#: move acccfg to cuilib
2009-03-03 00:01:38 +0100 mba r268698 : #i99432#: move acccfg to cuilib
2009-03-03 00:01:11 +0100 mba r268697 : #i99432#: move acccfg to cuilib
2009-03-03 00:00:40 +0100 mba r268696 : #i99432#: move acccfg to cuilib
2009-03-03 00:00:06 +0100 mba r268695 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog
2009-03-02 23:59:22 +0100 mba r268694 : #i99432#: move acccfg to cuilib
2009-03-02 23:57:19 +0100 mba r268693 : #i99432#: move acccfg to svx
2009-03-02 23:56:14 +0100 mba r268692 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog
2009-03-02 23:49:37 +0100 mba r268691 : #i99785#: consolidate dialogs library
2009-03-02 17:26:40 +0100 mba r268683 : #i99785#: consolidate dialogs library
2009-03-02 17:24:28 +0100 mba r268682 : i99465#: consolidate slot for InsertSymbol command
2009-03-02 17:22:29 +0100 mba r268681 : #i99785#: consolidate dialogs library
2009-03-02 17:18:11 +0100 mba r268680 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 17:08:30 +0100 mba r268679 : #i99785#: consolidate dialogs library
2009-03-02 17:06:57 +0100 mba r268678 : #i99785#: consolidate dialogs library
2009-03-02 17:06:30 +0100 mba r268677 : #i99785#: consolidate dialogs library
2009-03-02 17:05:02 +0100 mba r268676 : #i99785#: consolidate dialogs library
2009-03-02 17:04:35 +0100 mba r268675 : #i99785#: consolidate dialogs library
2009-03-02 16:47:53 +0100 mba r268673 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:45:17 +0100 mba r268671 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:39:59 +0100 mba r268670 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:38:59 +0100 mba r268668 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:38:28 +0100 mba r268667 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:36:06 +0100 mba r268666 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:29:50 +0100 mba r268663 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:24:00 +0100 mba r268659 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:23:31 +0100 mba r268658 : i99432#: move accelconfig and macroassignment to cui
2009-03-02 16:22:41 +0100 mba r268657 : i99432#: move accelconfig and macroassignment to cui
2009-02-25 16:57:26 +0100 mba r268453 : obsolete
2009-02-17 10:50:51 +0100 mba r267846 : obsolete
2009-02-12 16:33:54 +0100 mba r267676 : #i96834#: warning fixed
2009-02-11 19:28:47 +0100 mba r267626 : #i91978#: unused code
2009-02-11 18:37:47 +0100 mba r267625 : metafile output, fixes for 3 layer office
2009-02-11 12:56:28 +0100 mba r267593 : selective trees; incomplete build lists; metafile output
Diffstat (limited to 'sfx2')
30 files changed, 219 insertions, 6404 deletions
diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx index 01b9a9a130f5..48d3d6517ae8 100644 --- a/sfx2/inc/sfx2/basedlgs.hxx +++ b/sfx2/inc/sfx2/basedlgs.hxx @@ -70,29 +70,38 @@ public: class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog { - sal_uInt32 nUniqId; - String aExtraData; - Timer aTimer; + sal_uInt32 nUniqId; + String aExtraData; + Timer aTimer; + const SfxItemSet* pInputSet; + SfxItemSet* pOutputSet; +private: SAL_DLLPRIVATE SfxModalDialog(SfxModalDialog &); // not defined SAL_DLLPRIVATE void operator =(SfxModalDialog &); // not defined -//#if 0 // _SOLAR__PRIVATE DECL_DLLPRIVATE_LINK( TimerHdl_Impl, Timer* ); -//#endif SAL_DLLPRIVATE void SetDialogData_Impl(); SAL_DLLPRIVATE void GetDialogData_Impl(); SAL_DLLPRIVATE void init(); protected: - SfxModalDialog(Window *pParent, const ResId &); - SfxModalDialog(Window* pParent, sal_uInt32 nUniqueId, - WinBits nWinStyle = WB_STDMODAL); - ~SfxModalDialog(); + SfxModalDialog(Window *pParent, const ResId& ); + SfxModalDialog(Window* pParent, sal_uInt32 nUniqueId, WinBits nWinStyle = WB_STDMODAL ); + + String& GetExtraData() { return aExtraData; } + sal_uInt32 GetUniqId() const { return nUniqId; } + SfxItemSet* GetItemSet() { return pOutputSet; } + void CreateOutputItemSet( SfxItemPool& rPool ); + void CreateOutputItemSet( const SfxItemSet& rInput ); + void SetInputSet( const SfxItemSet* pInSet ) { pInputSet = pInSet; } + SfxItemSet* GetOutputSetImpl() { return pOutputSet; } - String& GetExtraData() { return aExtraData; } - sal_uInt32 GetUniqId() const { return nUniqId; } +public: + ~SfxModalDialog(); + const SfxItemSet* GetOutputItemSet() const { return pOutputSet; } + const SfxItemSet* GetInputItemSet() const { return pInputSet; } }; // class SfxModelessDialog -------------------------------------------------- @@ -195,14 +204,12 @@ public: virtual ~SfxSingleTabDialog(); void SetPage( TabPage* pNewPage ); - void SetTabPage( SfxTabPage* pTabPage, - GetTabPageRanges pRangesFunc = 0 ); + void SetTabPage( SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0 ); SfxTabPage* GetTabPage() const { return pImpl->m_pSfxPage; } const USHORT* GetInputRanges( const SfxItemPool& rPool ); - void SetInputSet( const SfxItemSet* pInSet ) - { pOptions = pInSet; } - const SfxItemSet* GetOutputItemSet() const { return pOutSet; } +// void SetInputSet( const SfxItemSet* pInSet ) { pOptions = pInSet; } +// const SfxItemSet* GetOutputItemSet() const { return pOutSet; } OKButton* GetOKButton() const { return pOKBtn; } CancelButton* GetCancelButton() const { return pCancelBtn; } void SetInfoLink( const Link& rLink ); @@ -216,8 +223,8 @@ private: HelpButton* pHelpBtn; SingleTabDlgImpl* pImpl; - const SfxItemSet* pOptions; - SfxItemSet* pOutSet; +// const SfxItemSet* pOptions; +// SfxItemSet* pOutSet; DECL_DLLPRIVATE_LINK( OKHdl_Impl, Button * ); }; diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx index dfed56495dd1..7aa0884e91be 100644 --- a/sfx2/inc/sfx2/evntconf.hxx +++ b/sfx2/inc/sfx2/evntconf.hxx @@ -33,17 +33,9 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" - -//#if 0 // _SOLAR__PRIVATE - -#ifndef _FIXED_HXX //autogen +#include <tools/rtti.hxx> #include <vcl/fixed.hxx> -#endif -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif - -//#endif #define _SVSTDARR_USHORTS #include <svtools/svstdarr.hxx> // SvUShorts @@ -57,7 +49,6 @@ #include <svtools/macitem.hxx> class SfxMacroInfo; -class SfxMacroTabPage; class SfxMacroInfoArr_Impl; class SfxEventConfigItem_Impl; class SfxEventInfoArr_Impl; @@ -66,19 +57,56 @@ class SvxMacroTableDtor; #define SFX_NO_EVENT USHRT_MAX -//#if 0 // _SOLAR__PRIVATE -struct SfxEvent_Impl +struct SFX2_DLLPUBLIC SfxEventName { - String aEventName; - USHORT nEventId; + USHORT mnId; + String maEventName; + String maUIName; + + SfxEventName( USHORT nId, + const String& rEventName, + const String& rUIName ) + : mnId( nId ) + , maEventName( rEventName ) + , maUIName( rUIName ) {} +}; - SfxEvent_Impl(const String& rName, USHORT nId) : - aEventName(rName), - nEventId(nId) - {} +DECLARE_TABLE( _SfxEventNamesList, SfxEventName* ) + +class SFX2_DLLPUBLIC SfxEventNamesList : public _SfxEventNamesList +{ +public: + SfxEventNamesList( const USHORT nInitSz = 0, const USHORT nReSz = 1 ): _SfxEventNamesList( nInitSz, nReSz ) {} + SfxEventNamesList( const SfxEventNamesList &rCpy ) : _SfxEventNamesList() { *this = rCpy; } + ~SfxEventNamesList() { DelDtor(); } + SfxEventNamesList& operator=( const SfxEventNamesList &rCpy ); + void DelDtor(); }; -SV_DECL_PTRARR(SfxEventArr_Impl, SfxEvent_Impl*, 5, 5) +class SFX2_DLLPUBLIC SfxEventNamesItem : public SfxPoolItem +{ + SfxEventNamesList aEventsList; + +public: + TYPEINFO(); + + SfxEventNamesItem ( const USHORT nId ) : SfxPoolItem( nId ) {} + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; + virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + + const SfxEventNamesList& GetEvents() const { return aEventsList;} + void SetEvents( const SfxEventNamesList& rList ) { aEventsList = rList; } + void AddEvent( const String&, const String&, USHORT ); +}; // ----------------------------------------------------------------------- @@ -88,17 +116,10 @@ SV_DECL_PTRARR(SfxEventArr_Impl, SfxEvent_Impl*, 5, 5) #define PROP_MACRO_NAME "MacroName" #define STAR_BASIC "StarBasic" -// ----------------------------------------------------------------------- -//#else -//typedef SvPtrarr SfxEventArr_Impl; -//#endif - class SFX2_DLLPUBLIC SfxEventConfiguration { friend class SfxEventConfigItem_Impl; - SfxMacroInfoArr_Impl* pArr; - SfxEventArr_Impl* pEventArr; SvxMacroTableDtor* pAppTable; SvxMacroTableDtor* pDocTable; sal_Bool bIgnoreConfigure; @@ -107,35 +128,16 @@ public: SfxEventConfiguration(); ~SfxEventConfiguration(); - void RegisterEvent(USHORT nId, const String& rName); - String GetEventName(USHORT nId) const; - USHORT GetEventId(const String& rName) const; - USHORT GetEventCount() const - { return pEventArr->Count()-1; } - // const SvxMacro* GetMacroForEventId( USHORT nEventId, SfxObjectShell *pObjSh ); void ConfigureEvent(USHORT nId, const SvxMacro&, SfxObjectShell* pObjSh); void ConfigureEvent(USHORT nId, const String& rMacro, SfxObjectShell* pObjSh); - //const SfxMacroInfo* GetMacroInfo(USHORT nEventId, SfxObjectShell* pObjSh) const; - - // void AddEvents( SfxMacroTabPage* ) const; - //SvxMacroTableDtor* GetAppEventTable(); SvxMacroTableDtor* GetDocEventTable(SfxObjectShell*); - //void SetAppEventTable( const SvxMacroTableDtor& ); - //void SetDocEventTable( SfxObjectShell*, const SvxMacroTableDtor& ); static void RegisterEvent( USHORT nId, const String& rName, const String& rMacroName ); - //static BOOL Import( SvStream& rInStream, SvStream* pOutStream, SfxObjectShell* pDoc=NULL ); - //static BOOL Export( SvStream* pInStream, SvStream& rOutStream, SfxObjectShell* pDoc=NULL ); - -//#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE const SfxEvent_Impl* GetEvent_Impl(USHORT nPos) const - { return (*pEventArr)[nPos+1]; } - SAL_DLLPRIVATE BOOL Warn_Impl( SfxObjectShell *pDoc, const SvxMacro* pMacro ); SAL_DLLPRIVATE void PropagateEvent_Impl( SfxObjectShell *pDoc, USHORT nId, @@ -146,41 +148,6 @@ public: SAL_DLLPRIVATE static ULONG GetPos_Impl( USHORT nID, sal_Bool &rFound ); SAL_DLLPRIVATE static ULONG GetPos_Impl( const String& rName, sal_Bool &rFound ); -//#endif -}; -/* -//#if 0 // _SOLAR__PRIVATE -class SfxEventConfigItem_Impl : public SfxConfigItem -{ -friend class SfxEventConfiguration; - - SvxMacroTableDtor aMacroTable; - SfxEventConfiguration *pEvConfig; - SfxObjectShell *pObjShell; - BOOL bWarning; - BOOL bAlwaysWarning; - BOOL bInitialized; - - void ConstructMacroTable(); - int Load(SvStream&); - BOOL Store(SvStream&); - BOOL LoadXML(SvStream&); - BOOL StoreXML(SvStream&); - -public: - SfxEventConfigItem_Impl( USHORT, - SfxEventConfiguration*, - SfxObjectShell* pObjSh = NULL ); - ~SfxEventConfigItem_Impl(); - - void Init( SfxConfigManager* ); - virtual int Load(SotStorage&); - virtual BOOL Store(SotStorage&); - virtual String GetStreamName() const; - virtual void UseDefault(); - void ConfigureEvent( USHORT nPos, SvxMacro* ); }; -//#endif -*/ #endif diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index c150f0579ac2..c29d0797bf81 100644 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -246,9 +246,7 @@ #define STR_READONLY (RID_SFX_START+105) #define STR_SFX_FILTERNAME_ALL (RID_SFX_START+106) -#define STR_FILTERNAME_CFG (RID_SFX_START+107) #define STR_EDIT (RID_SFX_START+108) -#define STR_HUMAN_APPNAME (RID_SFX_START+109) #define STR_QUERY_SAVE_DOCUMENT (RID_SFX_START+110) #define STR_BYTES (RID_SFX_START+111) #define STR_KB (RID_SFX_START+112) diff --git a/sfx2/inc/sfx2/sfxdlg.hxx b/sfx2/inc/sfx2/sfxdlg.hxx index 54be8d26ba7e..47ee31c66575 100644 --- a/sfx2/inc/sfx2/sfxdlg.hxx +++ b/sfx2/inc/sfx2/sfxdlg.hxx @@ -68,22 +68,20 @@ namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } } -class SfxAbstractTabDialog : public VclAbstractDialog +class SfxAbstractDialog : public VclAbstractDialog { public: - virtual void SetCurPageId( USHORT nId ) = 0; virtual const SfxItemSet* GetOutputItemSet() const = 0; - virtual const USHORT* GetInputRanges( const SfxItemPool& ) = 0; - virtual void SetInputSet( const SfxItemSet* pInSet ) = 0; virtual void SetText( const XubString& rStr ) = 0; virtual String GetText() const = 0; }; -class AbstractSfxSingleTabDialog : public VclAbstractDialog //add for SvxMeasureDialog & SvxConnectionDialog +class SfxAbstractTabDialog : public SfxAbstractDialog { public: - virtual const SfxItemSet* GetOutputItemSet() const = 0; - + virtual void SetCurPageId( USHORT nId ) = 0; + virtual const USHORT* GetInputRanges( const SfxItemPool& ) = 0; + virtual void SetInputSet( const SfxItemSet* pInSet ) = 0; }; class SfxAbstractInsertObjectDialog : public VclAbstractDialog @@ -156,9 +154,6 @@ public: virtual VclAbstractDialog* CreateScriptErrorDialog( Window* pParent, com::sun::star::uno::Any aException ) = 0; - static SfxTabPage *CreateSfxAcceleratorConfigPage( - Window *pParent, const SfxItemSet& rSet ); - virtual VclAbstractDialog* CreateOptionsDialog( Window* pParent, const rtl::OUString& rExtensionId, const rtl::OUString& rApplicationContext ) = 0; }; diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index b41ea004f3e3..5efa13713133 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -570,8 +570,9 @@ #define SID_OPTIONS_PAGEURL (SID_SFX_START + 1713) #define SID_MORE_DICTIONARIES (SID_SFX_START + 1714) #define SID_ACTIVATE_STYLE_APPLY (SID_SFX_START + 1715) -#define SID_DEFAULTFILENAME (SID_SFX_START + 1716) -#define SID_SFX_free_START (SID_SFX_START + 1717) +#define SID_FONT_NAME (SID_SFX_START + 1716) +#define SID_DEFAULTFILENAME (SID_SFX_START + 1717) +#define SID_SFX_free_START (SID_SFX_START + 1718) #define SID_SFX_free_END (SID_SFX_START + 3999) #define SID_OPEN_NEW_VIEW (SID_SFX_START + 520) diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst index 53ed0df0aa7f..03ae35e5c3d7 100644 --- a/sfx2/prj/d.lst +++ b/sfx2/prj/d.lst @@ -24,7 +24,6 @@ mkdir: %_DEST%\inc%_EXT%\sfx2 ..\%COMMON_OUTDIR%\srs\sfxslots_srs.hid %COMMON_DEST%\res%_EXT%\sfxslots_srs.hid ..\util\sfx.xml %_DEST%\xml%_EXT%\sfx.xml ..\%__SRC%\misc\sfx2.csv %_DEST%\inc%_EXT%\sfx2.csv -..\%__SRC%\inc\macropg.hxx %_DEST%\inc%_EXT%\macropg.hxx ..\inc\sfx2\dllapi.h %_DEST%\inc%_EXT%\sfx2\dllapi.h ..\inc\sfx2\app.hxx %_DEST%\inc%_EXT%\sfx2\app.hxx @@ -58,7 +57,6 @@ mkdir: %_DEST%\inc%_EXT%\sfx2 ..\inc\sfx2\imgdef.hxx %_DEST%\inc%_EXT%\sfx2\imgdef.hxx ..\inc\sfx2\ipclient.hxx %_DEST%\inc%_EXT%\sfx2\ipclient.hxx ..\inc\sfx2\macrconf.hxx %_DEST%\inc%_EXT%\sfx2\macrconf.hxx -..\inc\sfx2\macropg.hxx %_DEST%\inc%_EXT%\sfx2\macropg.hxx ..\inc\sfx2\topfrm.hxx %_DEST%\inc%_EXT%\sfx2\topfrm.hxx ..\inc\sfx2\mgetempl.hxx %_DEST%\inc%_EXT%\sfx2\mgetempl.hxx ..\inc\mieclip.hxx %_DEST%\inc%_EXT%\sfx2\mieclip.hxx diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 85a205cd791b..748cbc29c707 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -220,7 +220,7 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) bDetermineFunction = true; String sLibName = String::CreateFromAscii( STRING( DLL_NAME ) ); - sLibName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "sfx" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "svx" ) ) ); + sLibName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "sfx" ) ), String( RTL_CONSTASCII_USTRINGPARAM( "cui" ) ) ); rtl::OUString aLibName( sLibName ); oslModule handleMod = osl_loadModuleRelative( diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src index 67ae95bbb4c6..ba9f4a3ffe11 100644 --- a/sfx2/source/appl/sfx.src +++ b/sfx2/source/appl/sfx.src @@ -81,11 +81,6 @@ String STR_SFX_FILTERNAME_ALL Text [ en-US ] = "All files (*.*)" ; }; -String STR_HUMAN_APPNAME -{ - TEXT = "%PRODUCTNAME" ; -}; - String STR_BYTES { Text [ en-US ] = "Bytes" ; diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index dc8dea0bf7a7..4686f77e4a4c 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -60,11 +60,8 @@ #include <sfx2/dispatch.hxx> #include "config.hrc" #include "sfxresid.hxx" -#include <sfx2/macropg.hxx> #include "eventsupplier.hxx" -//#include <sfx2/sfxsids.hrc> -//#include "sfxlocal.hrc" #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> @@ -90,43 +87,104 @@ static const USHORT nOldVersion = 4; static const USHORT nVersion = 5; TYPEINIT1(SfxEventHint, SfxHint); +TYPEINIT1(SfxEventNamesItem, SfxPoolItem); using namespace com::sun::star; -// class SfxMacroQueryDlg_Impl ------------------------------------------- -/* -class SfxMacroQueryDlg_Impl : public QueryBox +SfxEventNamesList& SfxEventNamesList::operator=( const SfxEventNamesList& rTbl ) { -public: - SfxMacroQueryDlg_Impl( const String& rMacro, BOOL bDefault ); -}; + DelDtor(); + SfxEventName* pTmp = ((SfxEventNamesList&)rTbl).First(); + while( pTmp ) + { + SfxEventName *pNew = new SfxEventName( *pTmp ); + Insert( rTbl.GetCurKey(), pNew ); + pTmp = ((SfxEventNamesList&)rTbl).Next(); + } + return *this; +} -// class SfxMacroQueryDlg_Impl ------------------------------------------- +void SfxEventNamesList::DelDtor() +{ + SfxEventName* pTmp = First(); + while( pTmp ) + { + delete pTmp; + pTmp = Next(); + } + Clear(); +} -SfxMacroQueryDlg_Impl::SfxMacroQueryDlg_Impl( const String& rMacName, BOOL bDefault ) : - QueryBox( NULL, SfxResId( QUERYBOX_MACROQUERY ) ) +int SfxEventNamesItem::operator==( const SfxPoolItem& rAttr ) const { - SetButtonText( GetButtonId(0), String( SfxResId(BTN_OK) ) ); - SetButtonText( GetButtonId(1), String( SfxResId(BTN_CANCEL) ) ); + DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - String aText = GetMessText(); - aText.SearchAndReplace( String::CreateFromAscii("$(MACRO)"), rMacName ); + const SfxEventNamesList& rOwn = aEventsList; + const SfxEventNamesList& rOther = ( (SfxEventNamesItem&) rAttr ).aEventsList; - if ( bDefault ) + // Anzahl unterschiedlich => auf jeden Fall ungleich + if ( rOwn.Count() != rOther.Count() ) + return FALSE; + + // einzeln verleichen; wegen Performance ist die Reihenfolge wichtig + for ( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo ) { - SetFocusButton(GetButtonId(0)); - aText.SearchAndReplace( String::CreateFromAscii("$(TEXT)"), String( SfxResId(FT_OK) ) ); + const SfxEventName *pOwn = rOwn.GetObject(nNo); + const SfxEventName *pOther = rOther.GetObject(nNo); + if ( rOwn.GetKey(pOwn) != rOther.GetKey(pOther) || + pOwn->maEventName != pOther->maEventName || + pOwn->maUIName != pOther->maUIName ) + return FALSE; } - else + + return TRUE; + +} + +SfxItemPresentation SfxEventNamesItem::GetPresentation( SfxItemPresentation, + SfxMapUnit, + SfxMapUnit, + XubString &rText, + const IntlWrapper* ) const +{ + rText.Erase(); + return SFX_ITEM_PRESENTATION_NONE; +} + +SfxPoolItem* SfxEventNamesItem::Clone( SfxItemPool *) const +{ + return new SfxEventNamesItem(*this); +} + +SfxPoolItem* SfxEventNamesItem::Create(SvStream &, USHORT) const +{ + DBG_ERROR("not streamable!"); + return new SfxEventNamesItem(Which()); +} + +SvStream& SfxEventNamesItem::Store(SvStream &rStream, USHORT ) const +{ + DBG_ERROR("not streamable!"); + return rStream; +} + +USHORT SfxEventNamesItem::GetVersion( USHORT ) const +{ + DBG_ERROR("not streamable!"); + return 0; +} + +void SfxEventNamesItem::AddEvent( const String& rName, const String& rUIName, USHORT nID ) +{ + SfxEventName* pName; + if ( 0 != (pName=aEventsList.Get(nID)) ) { - SetFocusButton(GetButtonId(1)); - aText.SearchAndReplace( String::CreateFromAscii("$(TEXT)"), String( SfxResId(FT_CANCEL) ) ); + DBG_WARNING("Event already added!"); } - - SetMessText( aText ); - FreeResource(); + else + aEventsList.Insert( nID, new SfxEventName( nID, rName, rUIName.Len() ? rUIName : rName ) ); } -*/ + // class SfxAsyncEvent_Impl ---------------------------------------------- class SfxAsyncEvent_Impl : public SfxListener @@ -196,26 +254,8 @@ IMPL_LINK(SfxAsyncEvent_Impl, TimerHdl, Timer*, pAsyncTimer) return 0L; } -// class SfxEventList_Impl ----------------------------------------------- - -struct EventNames_Impl -{ - USHORT mnId; - String maEventName; - String maUIName; - - EventNames_Impl( USHORT nId, - const String& rEventName, - const String& rUIName ) - : mnId( nId ) - , maEventName( rEventName ) - , maUIName( rUIName ) {} -}; - -DECLARE_LIST( SfxEventList_Impl, EventNames_Impl* ) - -SfxEventList_Impl *gp_Id_SortList = NULL; -SfxEventList_Impl *gp_Name_SortList = NULL; +SfxEventNamesList *gp_Id_SortList = NULL; +SfxEventNamesList *gp_Name_SortList = NULL; //========================================================================== @@ -224,96 +264,23 @@ SfxEventConfiguration::SfxEventConfiguration() , pDocTable( NULL ) { bIgnoreConfigure = sal_False; - - // Array zum Ermitteln der Bindungen - pEventArr = new SfxEventArr_Impl; - - // Einen default entry eingf"ugen - const SfxEvent_Impl *pEvent = new SfxEvent_Impl(String(), 0); - pEventArr->Insert(pEvent, 0); } -/* -SfxEventConfigItem_Impl* SfxEventConfiguration::GetAppEventConfig_Impl() -{ - if ( !pAppEventConfig ) - { - pAppEventConfig = new SfxEventConfigItem_Impl( SFX_ITEMTYPE_APPEVENTCONFIG, this ); - pAppEventConfig->Initialize(); - } - return pAppEventConfig; -} -*/ //========================================================================== SfxEventConfiguration::~SfxEventConfiguration() { - for (USHORT n=0; n<pEventArr->Count(); n++) - delete (*pEventArr)[n]; - delete pEventArr; delete pDocTable; if ( gp_Id_SortList ) { - EventNames_Impl* pData = gp_Id_SortList->First(); - while ( pData ) - { - delete pData; - pData = gp_Id_SortList->Next(); - } delete gp_Id_SortList; delete gp_Name_SortList; - gp_Id_SortList = NULL; gp_Name_SortList = NULL; } } -//========================================================================== - -void SfxEventConfiguration::RegisterEvent(USHORT nId, const String& rName) -{ - USHORT nCount = pEventArr->Count(); - const SfxEvent_Impl *pEvent = new SfxEvent_Impl(rName, nId); - pEventArr->Insert(pEvent, nCount); -} - -//========================================================================== - -String SfxEventConfiguration::GetEventName(USHORT nId) const -{ - DBG_ASSERT(pEventArr,"Keine Events angemeldet!"); - USHORT nCount = pEventArr->Count(); - for (USHORT n=1; n<nCount; n++) - { - if ((*pEventArr)[n]->nEventId == nId) - { - return (*pEventArr)[n]->aEventName; - } - } - - DBG_ERROR("Event nicht gefunden!"); - return (*pEventArr)[0]->aEventName; -} - -//========================================================================== - -USHORT SfxEventConfiguration::GetEventId(const String& rName) const -{ - DBG_ASSERT(pEventArr,"Keine Events angemeldet!"); - USHORT nCount = pEventArr->Count(); - for (USHORT n=1; n<nCount; n++) - { - if ((*pEventArr)[n]->aEventName == rName) - { - return (*pEventArr)[n]->nEventId; - } - } - - DBG_ERROR("Event nicht gefunden!"); - return SFX_NO_EVENT; -} - void SfxEventConfiguration::ConfigureEvent( USHORT nId, const SvxMacro& rMacro, SfxObjectShell *pDoc ) { if ( bIgnoreConfigure ) @@ -333,315 +300,6 @@ void SfxEventConfiguration::ConfigureEvent( USHORT nId, const SvxMacro& rMacro, } //========================================================================== -/* -const SvxMacro* SfxEventConfiguration::GetMacroForEventId -( - USHORT nId, - SfxObjectShell* pDoc -) -{ - pDocEventConfig = pDoc ? pDoc->GetEventConfig_Impl() : NULL; - const SvxMacro* pMacro=NULL; - if ( pDocEventConfig ) - pMacro = pDocEventConfig->aMacroTable.Seek( nId ); - if ( !pMacro ) - pMacro = GetAppEventConfig_Impl()->aMacroTable.Seek( nId ); - return pMacro; -} */ - -/* -const SfxMacroInfo* SfxEventConfiguration::GetMacroInfo -( - USHORT nId, - SfxObjectShell* pDoc -) const -{ - DBG_ASSERT(pEventArr,"Keine Events angemeldet!"); - - SfxEventConfigItem_Impl *pDocEventConfig = pDoc ? pDoc->GetEventConfig_Impl() : NULL; - const SvxMacro* pMacro=NULL; - if ( pDocEventConfig ) - pMacro = pDocEventConfig->aMacroTable.Seek( nId ); - if ( !pMacro ) - pMacro = const_cast< SfxEventConfiguration* >(this)->GetAppEventConfig_Impl()->aMacroTable.Seek( nId ); - - return SFX_APP()->GetMacroConfig()->GetMacroInfo_Impl( pMacro ); -} */ - -//========================================================================== -/* -SfxEventConfigItem_Impl::SfxEventConfigItem_Impl( USHORT nConfigId, - SfxEventConfiguration *pCfg, - SfxObjectShell *pObjSh) - : SfxConfigItem( nConfigId, pObjSh ? NULL : SFX_APP()->GetConfigManager_Impl() ) - , pEvConfig( pCfg ) - , pObjShell( pObjSh ) - , aMacroTable( 2, 2 ) - , bInitialized( FALSE ) - -{ - bInitialized = TRUE; -} - -//========================================================================== - -int SfxEventConfigItem_Impl::Load(SvStream& rStream) -{ - USHORT nFileVersion; - rStream >> nFileVersion; - if ( nFileVersion < nCompatVersion || nFileVersion > nVersion ) - return SfxConfigItem::WARNING_VERSION; - - SvxMacroTableDtor aLocalMacroTable; - if ( nFileVersion <= nOldVersion ) - { - if ( nFileVersion > nCompatVersion ) - { - USHORT nWarn; - rStream >> nWarn; - bWarning = ( nWarn & 0x01 ) != 0; - bAlwaysWarning = ( nWarn & 0x02 ) != 0; - } - else - bWarning = bAlwaysWarning = FALSE; - - USHORT nCount, nEventCount = pEvConfig->GetEventCount(); - rStream >> nCount; - - USHORT i; - for (i=0; i<nCount; i++) - { - USHORT nId; - SfxMacroInfo aInfo( pObjShell ); - rStream >> nId >> aInfo; - - for (USHORT n=0; n<nEventCount; n++) - { - USHORT nEventId = (*pEvConfig->pEventArr)[n+1]->nEventId; - if ( nEventId == nId ) - { - SvxMacro *pMacro = new SvxMacro( aInfo.GetQualifiedName(), aInfo.GetBasicName(), STARBASIC ); - aLocalMacroTable.Insert( nEventId, pMacro ); - break; - } - } - } - } - else - { - USHORT nWarn; - rStream >> nWarn; - bWarning = ( nWarn & 0x01 ) != 0; - bAlwaysWarning = ( nWarn & 0x02 ) != 0; - aLocalMacroTable.Read( rStream ); - } - - if ( pObjShell && pEvConfig ) - pEvConfig->PropagateEvents_Impl( pObjShell, aLocalMacroTable ); - - return SfxConfigItem::ERR_OK; -} - -BOOL SfxEventConfigItem_Impl::LoadXML( SvStream& rInStream ) -{ - ::framework::EventsConfig aCfg; - - // #110897# - // if ( ::framework::EventsConfiguration::LoadEventsConfig( rInStream, aCfg ) ) - if ( ::framework::EventsConfiguration::LoadEventsConfig( ::comphelper::getProcessServiceFactory(), rInStream, aCfg ) ) - { - long nCount = aCfg.aEventNames.getLength(); - for ( long i=0; i<nCount; i++ ) - { - SvxMacro* pMacro = SfxEvents_Impl::ConvertToMacro( aCfg.aEventsProperties[i], NULL, TRUE ); - USHORT nID = (USHORT) SfxEventConfiguration::GetEventId_Impl( aCfg.aEventNames[i] ); - if ( nID && pMacro ) - pEvConfig->PropagateEvent_Impl( pObjShell, nID, pMacro ); - else - DBG_ERROR("Suspicious event binding!"); - } - - return TRUE; - } - - return FALSE; -} - -//========================================================================== - -BOOL SfxEventConfigItem_Impl::Store(SvStream& rStream) -{ - USHORT nWarn=0; - if ( bWarning ) - nWarn |= 0x01; - if ( bAlwaysWarning ) - nWarn |= 0x02; - rStream << nVersion << nWarn; - aMacroTable.Write( rStream ); - return TRUE; -} - -BOOL SfxEventConfigItem_Impl::StoreXML( SvStream& rOutStream ) -{ - // get the event names - ResStringArray aEventNames( SfxResId( EVENT_NAMES_ARY ) ); - long nNamesCount = aEventNames.Count(); - - // create two sequences for names and properties - SEQUENCE < OUSTRING > aSequence( nNamesCount ); - SEQUENCE < ANY > aData( nNamesCount ); - - // fill in the names - OUSTRING* pNames = aSequence.getArray(); - long i; - for ( i=0; i<nNamesCount; i++ ) - pNames[i] = aEventNames.GetString( (USHORT) i); - - REFERENCE< XEVENTSSUPPLIER > xSupplier; - if ( pObjShell ) - { - xSupplier = REFERENCE< XEVENTSSUPPLIER >( pObjShell->GetModel(), UNO_QUERY ); - } - else - { - xSupplier = REFERENCE< XEVENTSSUPPLIER > - ( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster" )), UNO_QUERY ); - } - - // fill in the bindings - REFERENCE< XNAMEREPLACE > xEvents = xSupplier->getEvents(); - SvxMacroTableDtor& rTable = aMacroTable; - long nCount = (long) rTable.Count(); - for ( i=0; i<nCount; i++ ) - { - USHORT nID = (USHORT) rTable.GetObjectKey( i ); - OUSTRING aEventName = pEvConfig->GetEventName_Impl( nID ); - if ( aEventName.getLength() ) - { - // search name - long n; - for ( n=0; n<(long)nNamesCount; n++ ) - { - if ( aSequence[n] == aEventName ) - { - aData[n] = xEvents->getByName( aEventName ); - break; - } - } - - DBG_ASSERT( n<nNamesCount, "Unknown event!" ); - } - } - - ::framework::EventsConfig aCfg; - aCfg.aEventNames = aSequence; - aCfg.aEventsProperties = aData; - - // #110897# - // return ::framework::EventsConfiguration::StoreEventsConfig( rOutStream, aCfg ); - return ::framework::EventsConfiguration::StoreEventsConfig( ::comphelper::getProcessServiceFactory(), rOutStream, aCfg ); -} - -//========================================================================== - -String SfxEventConfigItem_Impl::GetStreamName() const -{ - return SfxConfigItem::GetStreamName( GetType() ); -} - -//========================================================================== - -void SfxEventConfigItem_Impl::UseDefault() -{ - bWarning = TRUE; - bAlwaysWarning = FALSE; - - aMacroTable.DelDtor(); - SetDefault( TRUE ); - pEvConfig->PropagateEvents_Impl( pObjShell, aMacroTable ); -} - -int SfxEventConfigItem_Impl::Load( SotStorage& rStorage ) -{ - SotStorageStreamRef xStream = rStorage.OpenSotStream( SfxEventConfigItem_Impl::GetStreamName(), STREAM_STD_READ ); - if ( xStream->GetError() ) - return SfxConfigItem::ERR_READ; - else - { - if ( bInitialized ) - { - aMacroTable.DelDtor(); - pEvConfig->PropagateEvents_Impl( pObjShell, aMacroTable ); - } - - if ( LoadXML( *xStream ) ) - return SfxConfigItem::ERR_OK; - else - return SfxConfigItem::ERR_READ; - } -} - -BOOL SfxEventConfigItem_Impl::Store( SotStorage& rStorage ) -{ - if ( pObjShell ) - // DocEventConfig is stored with the document - return TRUE; - - SotStorageStreamRef xStream = rStorage.OpenSotStream( SfxEventConfigItem_Impl::GetStreamName(), STREAM_STD_READWRITE|STREAM_TRUNC ); - if ( xStream->GetError() ) - return FALSE; - else - return StoreXML( *xStream ); -} - - -//========================================================================== - -SfxEventConfigItem_Impl::~SfxEventConfigItem_Impl() -{ -} - -//========================================================================== - -void SfxEventConfigItem_Impl::ConfigureEvent( USHORT nId, SvxMacro *pMacro ) -{ - if ( aMacroTable.Seek( nId ) ) - { - if ( pMacro ) - aMacroTable.Replace( nId, pMacro ); - else - aMacroTable.Remove( nId ); - } - else if ( pMacro ) - aMacroTable.Insert( nId, pMacro ); - SetDefault(FALSE); -} - - -void SfxEventConfiguration::AddEvents( SfxMacroTabPage* pPage ) const -{ - DBG_ASSERT(pEventArr,"Keine Events angemeldet!"); - USHORT nCount = pEventArr->Count(); - for (USHORT n=1; n<nCount; n++) - if ( (*pEventArr)[n]->aEventName.Len() ) - pPage->AddEvent( (*pEventArr)[n]->aEventName, (*pEventArr)[n]->nEventId ); -} - - -SvxMacroTableDtor* SfxEventConfiguration::GetAppEventTable() -{ - return &GetAppEventConfig_Impl()->aMacroTable; -} - * -void SfxEventConfiguration::SetAppEventTable( const SvxMacroTableDtor& rTable ) -{ - //GetAppEventConfig_Impl()->aMacroTable = rTable; - //pAppEventConfig->SetDefault(FALSE); - PropagateEvents_Impl( NULL, rTable ); -} - -*/ SvxMacroTableDtor* SfxEventConfiguration::GetDocEventTable( SfxObjectShell*pDoc ) { @@ -668,98 +326,6 @@ SvxMacroTableDtor* SfxEventConfiguration::GetDocEventTable( SfxObjectShell*pDoc return pDocTable; } -/* -void SfxEventConfiguration::SetDocEventTable( SfxObjectShell *pDoc, - const SvxMacroTableDtor& rTable ) -{ - if ( pDoc ) - { - pDoc->SetModified(TRUE); - PropagateEvents_Impl( pDoc, rTable ); - } - else - DBG_ERROR( "No Document!" ); -} - -//-------------------------------------------------------------------------- -void SfxEventConfiguration::PropagateEvents_Impl( SfxObjectShell *pDoc, - const SvxMacroTableDtor& rTable ) -{ - REFERENCE< XEVENTSSUPPLIER > xSupplier; - if ( pDoc ) - { - xSupplier = REFERENCE< XEVENTSSUPPLIER >( pDoc->GetModel(), UNO_QUERY ); - } - else - { - xSupplier = REFERENCE< XEVENTSSUPPLIER > - ( ::comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster" )), UNO_QUERY ); - } - - if ( xSupplier.is() ) - { - SvxMacro *pMacro; - ULONG nCount; - ULONG nID, i; - - REFERENCE< XNAMEREPLACE > xEvents = xSupplier->getEvents(); - - bIgnoreConfigure = sal_True; - - // Erase old values first, because we don't know anything about the - // changes here - - SEQUENCE < PROPERTYVALUE > aProperties; - SEQUENCE < OUSTRING > aEventNames = xEvents->getElementNames(); - OUSTRING* pNames = aEventNames.getArray(); - ANY aEmpty; - - aEmpty <<= aProperties; - nCount = aEventNames.getLength(); - - for ( i=0; i<nCount; i++ ) - { - try - { - xEvents->replaceByName( pNames[i], aEmpty ); - } - catch( ::com::sun::star::lang::IllegalArgumentException ) - { DBG_ERRORFILE( "PropagateEvents_Impl: caught IllegalArgumentException" ) } - catch( ::com::sun::star::container::NoSuchElementException ) - { DBG_ERRORFILE( "PropagateEvents_Impl: caught NoSuchElementException" ) } - } - - // now set the new values - - nCount = rTable.Count(); - - for ( i=0; i<nCount; i++ ) - { - pMacro = rTable.GetObject( i ); - nID = rTable.GetObjectKey( i ); - OUSTRING aEventName = GetEventName_Impl( nID ); - - if ( aEventName.getLength() ) - { - ANY aEventData = CreateEventData_Impl( pMacro ); - try - { - xEvents->replaceByName( aEventName, aEventData ); - } - catch( ::com::sun::star::lang::IllegalArgumentException ) - { DBG_ERRORFILE( "PropagateEvents_Impl: caught IllegalArgumentException" ) } - catch( ::com::sun::star::container::NoSuchElementException ) - { DBG_ERRORFILE( "PropagateEvents_Impl: caught NoSuchElementException" ) } - } - else - DBG_WARNING( "PropagateEvents_Impl: Got unkown event" ); - } - - bIgnoreConfigure = sal_False; - } -} -*/ //-------------------------------------------------------------------------- void SfxEventConfiguration::PropagateEvent_Impl( SfxObjectShell *pDoc, USHORT nId, @@ -904,7 +470,7 @@ ULONG SfxEventConfiguration::GetPos_Impl( USHORT nId, sal_Bool &rFound ) long nEnd = gp_Id_SortList->Count() - 1; long nMid = 0; - EventNames_Impl* pMid; + SfxEventName* pMid; rFound = sal_False; @@ -950,7 +516,7 @@ ULONG SfxEventConfiguration::GetPos_Impl( const String& rName, sal_Bool &rFound long nEnd = gp_Name_SortList->Count() - 1; long nMid = 0; - EventNames_Impl* pMid; + SfxEventName* pMid; rFound = sal_False; @@ -992,7 +558,7 @@ OUSTRING SfxEventConfiguration::GetEventName_Impl( ULONG nID ) if ( bFound ) { - EventNames_Impl *pData = gp_Id_SortList->GetObject( nPos ); + SfxEventName *pData = gp_Id_SortList->GetObject( nPos ); aRet = pData->maEventName; } } @@ -1012,7 +578,7 @@ ULONG SfxEventConfiguration::GetEventId_Impl( const OUSTRING& rEventName ) if ( bFound ) { - EventNames_Impl *pData = gp_Name_SortList->GetObject( nPos ); + SfxEventName *pData = gp_Name_SortList->GetObject( nPos ); nRet = pData->mnId; } } @@ -1027,8 +593,8 @@ void SfxEventConfiguration::RegisterEvent( USHORT nId, { if ( ! gp_Id_SortList ) { - gp_Id_SortList = new SfxEventList_Impl; - gp_Name_SortList = new SfxEventList_Impl; + gp_Id_SortList = new SfxEventNamesList; + gp_Name_SortList = new SfxEventNamesList; } sal_Bool bFound = sal_False; @@ -1040,65 +606,12 @@ void SfxEventConfiguration::RegisterEvent( USHORT nId, return; } - EventNames_Impl *pData; - - pData = new EventNames_Impl( nId, rMacroName, rUIName ); - gp_Id_SortList->Insert( pData, nPos ); - + gp_Id_SortList->Insert( nPos, new SfxEventName( nId, rMacroName, rUIName ) ); nPos = GetPos_Impl( rMacroName, bFound ); - DBG_ASSERT( !bFound, "RegisterEvent: Name in List, but ID not?" ); - - gp_Name_SortList->Insert( pData, nPos ); - - SFX_APP()->GetEventConfig()->RegisterEvent( nId, rUIName ); -} - -/* -BOOL SfxEventConfiguration::Import( SvStream& rInStream, SvStream* pOutStream, SfxObjectShell* pDoc ) -{ - if ( pDoc ) - { - // load events, they are automatically propagated to the document - DBG_ASSERT( !pOutStream, "DocEventConfig must not be converted!" ); - SfxEventConfigItem_Impl* pCfg = pDoc->GetEventConfig_Impl( TRUE ); - if ( pCfg ) - return ( pCfg->Load( rInStream ) == SfxConfigItem::ERR_OK ); - DBG_ERROR("Couldn't create EventConfiguration!"); - return FALSE; - } - else if ( pOutStream ) - { - SfxEventConfiguration aConfig; - if ( aConfig.GetAppEventConfig_Impl()->Load( rInStream ) == SfxConfigItem::ERR_OK ) - return aConfig.pAppEventConfig->StoreXML( *pOutStream ); - return FALSE; - } - DBG_ERROR( "No OutStream!" ); - return FALSE; -} + DBG_ASSERT( !bFound, "RegisterEvent: Name in List, but ID not?" ); -BOOL SfxEventConfiguration::Export( SvStream* pInStream, SvStream& rOutStream, SfxObjectShell* pDoc ) -{ - if ( pDoc ) - { - DBG_ASSERT( !pInStream, "DocEventConfig can't be converted!" ); - SfxEventConfigItem_Impl* pCfg = pDoc->GetEventConfig_Impl(); - if ( pCfg ) - return pCfg->Store( rOutStream ); - DBG_ERROR("Couldn't create EventConfiguration!"); - return FALSE; - } - else if ( pInStream ) - { - SfxEventConfiguration aConfig; - if ( aConfig.GetAppEventConfig_Impl()->LoadXML( *pInStream ) ) - return aConfig.pAppEventConfig->Store( rOutStream ); - return FALSE; - } + gp_Name_SortList->Insert( nPos, new SfxEventName( nId, rMacroName, rUIName ) ); - DBG_ERROR( "No InStream!" ); - return FALSE; + SFX_APP()->GetEventConfig(); } -*/ - diff --git a/sfx2/source/config/makefile.mk b/sfx2/source/config/makefile.mk index 256489d7a03f..cf2e07e0b5c1 100644 --- a/sfx2/source/config/makefile.mk +++ b/sfx2/source/config/makefile.mk @@ -42,10 +42,6 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -SRS1NAME=$(TARGET) -SRC1FILES = \ - config.src - SLOFILES = \ $(SLO)$/evntconf.obj diff --git a/sfx2/source/dialog/acccfg.cxx b/sfx2/source/dialog/acccfg.cxx deleted file mode 100644 index 0c6f531a7ed6..000000000000 --- a/sfx2/source/dialog/acccfg.cxx +++ /dev/null @@ -1,1348 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: acccfg.cxx,v $ - * $Revision: 1.40 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -//----------------------------------------------- -// include own files - -#include "acccfg.hxx" -#include "cfg.hxx" -#include "sfxresid.hxx" -#include <sfx2/msg.hxx> -#include <sfx2/macrconf.hxx> -#include <sfx2/app.hxx> -#include <sfx2/filedlghelper.hxx> - -#include "dialog.hrc" -#include "cfg.hrc" - -//----------------------------------------------- -// include interface declarations -#include <com/sun/star/frame/XFramesSupplier.hpp> -#include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/form/XReset.hpp> -#include <com/sun/star/frame/XModuleManager.hpp> -#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> - -#ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGERSUPLLIER_HPP_ -#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> -#endif -#include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/awt/KeyModifier.hpp> -#include <com/sun/star/embed/XTransactedObject.hpp> -#include <com/sun/star/embed/ElementModes.hpp> - -#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> - -//----------------------------------------------- -// include other projects -#include <unotools/processfactory.hxx> -#include <svtools/acceleratorexecute.hxx> -#include <comphelper/processfactory.hxx> -#include <svtools/svlbitm.hxx> -#include <vcl/svapp.hxx> -#include <vcl/help.hxx> -#include <rtl/ustrbuf.hxx> -#include <comphelper/sequenceashashmap.hxx> - -//----------------------------------------------- -// namespaces - -#ifdef css - #error "ambigous praeprozessor directive for css ..." -#else - namespace css = ::com::sun::star; -#endif - -//----------------------------------------------- -// definitions - -//----------------------------------------------- -static ::rtl::OUString SERVICE_STORAGEFACTORY = ::rtl::OUString::createFromAscii("com.sun.star.embed.StorageFactory" ); -static ::rtl::OUString SERVICE_UICONFIGMGR = ::rtl::OUString::createFromAscii("com.sun.star.ui.UIConfigurationManager" ); -static ::rtl::OUString SERVICE_DESKTOP = ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop" ); -static ::rtl::OUString SERVICE_MODULEMANAGER = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager" ); -static ::rtl::OUString SERVICE_GLOBALACCCFG = ::rtl::OUString::createFromAscii("com.sun.star.ui.GlobalAcceleratorConfiguration" ); -static ::rtl::OUString SERVICE_MODULEUICONFIGSUPPLIER = ::rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"); -static ::rtl::OUString SERVICE_UICMDDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription" ); - -static ::rtl::OUString MODULEPROP_SHORTNAME = ::rtl::OUString::createFromAscii("ooSetupFactoryShortName" ); -static ::rtl::OUString MODULEPROP_UINAME = ::rtl::OUString::createFromAscii("ooSetupFactoryUIName" ); -static ::rtl::OUString CMDPROP_UINAME = ::rtl::OUString::createFromAscii("Name" ); - -static ::rtl::OUString FOLDERNAME_UICONFIG = ::rtl::OUString::createFromAscii("Configurations2" ); - -static ::rtl::OUString MEDIATYPE_PROPNAME = ::rtl::OUString::createFromAscii("MediaType" ); -static ::rtl::OUString MEDIATYPE_UICONFIG = ::rtl::OUString::createFromAscii("application/vnd.sun.xml.ui.configuration" ); - -//----------------------------------------------- -static USHORT __FAR_DATA KEYCODE_ARRAY[] = -{ - KEY_F1 , - KEY_F2 , - KEY_F3 , - KEY_F4 , - KEY_F5 , - KEY_F6 , - KEY_F7 , - KEY_F8 , - KEY_F9 , - KEY_F10 , - KEY_F11 , - KEY_F12 , - - KEY_DOWN , - KEY_UP , - KEY_LEFT , - KEY_RIGHT , - KEY_HOME , - KEY_END , - KEY_PAGEUP , - KEY_PAGEDOWN , - KEY_RETURN , - KEY_ESCAPE , - KEY_BACKSPACE, - KEY_INSERT , - KEY_DELETE , - - KEY_OPEN , - KEY_CUT , - KEY_COPY , - KEY_PASTE , - KEY_UNDO , - KEY_REPEAT , - KEY_FIND , - KEY_PROPERTIES , - KEY_FRONT , - KEY_CONTEXTMENU , - KEY_MENU , - KEY_HELP , - - KEY_F1 | KEY_SHIFT, - KEY_F2 | KEY_SHIFT, - KEY_F3 | KEY_SHIFT, - KEY_F4 | KEY_SHIFT, - KEY_F5 | KEY_SHIFT, - KEY_F6 | KEY_SHIFT, - KEY_F7 | KEY_SHIFT, - KEY_F8 | KEY_SHIFT, - KEY_F9 | KEY_SHIFT, - KEY_F10 | KEY_SHIFT, - KEY_F11 | KEY_SHIFT, - KEY_F12 | KEY_SHIFT, - - KEY_DOWN | KEY_SHIFT, - KEY_UP | KEY_SHIFT, - KEY_LEFT | KEY_SHIFT, - KEY_RIGHT | KEY_SHIFT, - KEY_HOME | KEY_SHIFT, - KEY_END | KEY_SHIFT, - KEY_PAGEUP | KEY_SHIFT, - KEY_PAGEDOWN | KEY_SHIFT, - KEY_RETURN | KEY_SHIFT, - KEY_SPACE | KEY_SHIFT, - KEY_ESCAPE | KEY_SHIFT, - KEY_BACKSPACE | KEY_SHIFT, - KEY_INSERT | KEY_SHIFT, - KEY_DELETE | KEY_SHIFT, - - KEY_0 | KEY_MOD1 , - KEY_1 | KEY_MOD1 , - KEY_2 | KEY_MOD1 , - KEY_3 | KEY_MOD1 , - KEY_4 | KEY_MOD1 , - KEY_5 | KEY_MOD1 , - KEY_6 | KEY_MOD1 , - KEY_7 | KEY_MOD1 , - KEY_8 | KEY_MOD1 , - KEY_9 | KEY_MOD1 , - KEY_A | KEY_MOD1 , - KEY_B | KEY_MOD1 , - KEY_C | KEY_MOD1 , - KEY_D | KEY_MOD1 , - KEY_E | KEY_MOD1 , - KEY_F | KEY_MOD1 , - KEY_G | KEY_MOD1 , - KEY_H | KEY_MOD1 , - KEY_I | KEY_MOD1 , - KEY_J | KEY_MOD1 , - KEY_K | KEY_MOD1 , - KEY_L | KEY_MOD1 , - KEY_M | KEY_MOD1 , - KEY_N | KEY_MOD1 , - KEY_O | KEY_MOD1 , - KEY_P | KEY_MOD1 , - KEY_Q | KEY_MOD1 , - KEY_R | KEY_MOD1 , - KEY_S | KEY_MOD1 , - KEY_T | KEY_MOD1 , - KEY_U | KEY_MOD1 , - KEY_V | KEY_MOD1 , - KEY_W | KEY_MOD1 , - KEY_X | KEY_MOD1 , - KEY_Y | KEY_MOD1 , - KEY_Z | KEY_MOD1 , - - KEY_F1 | KEY_MOD1 , - KEY_F2 | KEY_MOD1 , - KEY_F3 | KEY_MOD1 , - KEY_F4 | KEY_MOD1 , - KEY_F5 | KEY_MOD1 , - KEY_F6 | KEY_MOD1 , - KEY_F7 | KEY_MOD1 , - KEY_F8 | KEY_MOD1 , - KEY_F9 | KEY_MOD1 , - KEY_F10 | KEY_MOD1 , - KEY_F11 | KEY_MOD1 , - KEY_F12 | KEY_MOD1 , - - KEY_DOWN | KEY_MOD1 , - KEY_UP | KEY_MOD1 , - KEY_LEFT | KEY_MOD1 , - KEY_RIGHT | KEY_MOD1 , - KEY_HOME | KEY_MOD1 , - KEY_END | KEY_MOD1 , - KEY_PAGEUP | KEY_MOD1 , - KEY_PAGEDOWN | KEY_MOD1 , - KEY_RETURN | KEY_MOD1 , - KEY_SPACE | KEY_MOD1 , - KEY_BACKSPACE | KEY_MOD1 , - KEY_INSERT | KEY_MOD1 , - KEY_DELETE | KEY_MOD1 , - - KEY_ADD | KEY_MOD1 , - KEY_SUBTRACT | KEY_MOD1 , - KEY_MULTIPLY | KEY_MOD1 , - KEY_DIVIDE | KEY_MOD1 , - - KEY_0 | KEY_SHIFT | KEY_MOD1, - KEY_1 | KEY_SHIFT | KEY_MOD1, - KEY_2 | KEY_SHIFT | KEY_MOD1, - KEY_3 | KEY_SHIFT | KEY_MOD1, - KEY_4 | KEY_SHIFT | KEY_MOD1, - KEY_5 | KEY_SHIFT | KEY_MOD1, - KEY_6 | KEY_SHIFT | KEY_MOD1, - KEY_7 | KEY_SHIFT | KEY_MOD1, - KEY_8 | KEY_SHIFT | KEY_MOD1, - KEY_9 | KEY_SHIFT | KEY_MOD1, - KEY_A | KEY_SHIFT | KEY_MOD1, - KEY_B | KEY_SHIFT | KEY_MOD1, - KEY_C | KEY_SHIFT | KEY_MOD1, - KEY_D | KEY_SHIFT | KEY_MOD1, - KEY_E | KEY_SHIFT | KEY_MOD1, - KEY_F | KEY_SHIFT | KEY_MOD1, - KEY_G | KEY_SHIFT | KEY_MOD1, - KEY_H | KEY_SHIFT | KEY_MOD1, - KEY_I | KEY_SHIFT | KEY_MOD1, - KEY_J | KEY_SHIFT | KEY_MOD1, - KEY_K | KEY_SHIFT | KEY_MOD1, - KEY_L | KEY_SHIFT | KEY_MOD1, - KEY_M | KEY_SHIFT | KEY_MOD1, - KEY_N | KEY_SHIFT | KEY_MOD1, - KEY_O | KEY_SHIFT | KEY_MOD1, - KEY_P | KEY_SHIFT | KEY_MOD1, - KEY_Q | KEY_SHIFT | KEY_MOD1, - KEY_R | KEY_SHIFT | KEY_MOD1, - KEY_S | KEY_SHIFT | KEY_MOD1, - KEY_T | KEY_SHIFT | KEY_MOD1, - KEY_U | KEY_SHIFT | KEY_MOD1, - KEY_V | KEY_SHIFT | KEY_MOD1, - KEY_W | KEY_SHIFT | KEY_MOD1, - KEY_X | KEY_SHIFT | KEY_MOD1, - KEY_Y | KEY_SHIFT | KEY_MOD1, - KEY_Z | KEY_SHIFT | KEY_MOD1, - - KEY_F1 | KEY_SHIFT | KEY_MOD1, - KEY_F2 | KEY_SHIFT | KEY_MOD1, - KEY_F3 | KEY_SHIFT | KEY_MOD1, - KEY_F4 | KEY_SHIFT | KEY_MOD1, - KEY_F5 | KEY_SHIFT | KEY_MOD1, - KEY_F6 | KEY_SHIFT | KEY_MOD1, - KEY_F7 | KEY_SHIFT | KEY_MOD1, - KEY_F8 | KEY_SHIFT | KEY_MOD1, - KEY_F9 | KEY_SHIFT | KEY_MOD1, - KEY_F10 | KEY_SHIFT | KEY_MOD1, - KEY_F11 | KEY_SHIFT | KEY_MOD1, - KEY_F12 | KEY_SHIFT | KEY_MOD1, - - KEY_DOWN | KEY_SHIFT | KEY_MOD1, - KEY_UP | KEY_SHIFT | KEY_MOD1, - KEY_LEFT | KEY_SHIFT | KEY_MOD1, - KEY_RIGHT | KEY_SHIFT | KEY_MOD1, - KEY_HOME | KEY_SHIFT | KEY_MOD1, - KEY_END | KEY_SHIFT | KEY_MOD1, - KEY_PAGEUP | KEY_SHIFT | KEY_MOD1, - KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD1, - - KEY_RETURN | KEY_SHIFT | KEY_MOD1, - KEY_SPACE | KEY_SHIFT | KEY_MOD1, - KEY_BACKSPACE | KEY_SHIFT | KEY_MOD1, - KEY_INSERT | KEY_SHIFT | KEY_MOD1, - KEY_DELETE | KEY_SHIFT | KEY_MOD1, -}; - -static USHORT KEYCODE_ARRAY_SIZE = (sizeof(KEYCODE_ARRAY) / sizeof(KEYCODE_ARRAY[0])); - -//----------------------------------------------- -// seems to be needed to layout the list box, which shows all -// assignable shortcuts -static long AccCfgTabs[] = -{ - 2, // Number of Tabs - 0, - 120 // Function -}; - -//----------------------------------------------- -class SfxAccCfgLBoxString_Impl : public SvLBoxString -{ - public: - SfxAccCfgLBoxString_Impl( SvLBoxEntry* pEntry, - USHORT nFlags, - const String& sText ); - - virtual ~SfxAccCfgLBoxString_Impl(); - - virtual void Paint(const Point& aPos , - SvLBox& rDevice, - USHORT nFlags , - SvLBoxEntry* pEntry ); -}; - -//----------------------------------------------- -SfxAccCfgLBoxString_Impl::SfxAccCfgLBoxString_Impl( SvLBoxEntry* pEntry, - USHORT nFlags, - const String& sText ) - : SvLBoxString(pEntry, nFlags, sText) -{ -} - -//----------------------------------------------- -SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl() -{ -} - -//----------------------------------------------- -void SfxAccCfgLBoxString_Impl::Paint(const Point& aPos , - SvLBox& rDevice, - USHORT /*nFlags*/, - SvLBoxEntry* pEntry ) -{ - /*/ ??? realy needed !!! - Font aOldFont(rDevice.GetFont()); - Font aNewFont(aOldFont ); - rDevice.SetFont( aFont ); - */ - - if (!pEntry) - return; - - TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); - if (!pUserData) - return; - - if (pUserData->m_bIsConfigurable) - rDevice.DrawText(aPos, GetText()); - else - rDevice.DrawCtrlText(aPos, GetText(), 0, STRING_LEN, TEXT_DRAW_DISABLE); - - //rDev.SetFont( aOldFont ); -} - -//----------------------------------------------- -void SfxAccCfgTabListBox_Impl::InitEntry( SvLBoxEntry* pEntry , - const XubString& sText , - const Image& aImage1, - const Image& aImage2, - SvLBoxButtonKind eButtonKind) -{ - SvTabListBox::InitEntry(pEntry, sText, aImage1, aImage2, eButtonKind); -} - -//----------------------------------------------- -/** select the entry, which match the current key input ... excepting - keys, which are used for the dialog itself. - */ -void SfxAccCfgTabListBox_Impl::KeyInput(const KeyEvent& aKey) -{ - KeyCode aCode1 = aKey.GetKeyCode(); - USHORT nCode1 = aCode1.GetCode(); - USHORT nMod1 = aCode1.GetModifier(); - - // is it related to our list box ? - if ( - (nCode1 != KEY_DOWN ) && - (nCode1 != KEY_UP ) && - (nCode1 != KEY_LEFT ) && - (nCode1 != KEY_RIGHT ) && - (nCode1 != KEY_PAGEUP ) && - (nCode1 != KEY_PAGEDOWN) - ) - { - SvLBoxEntry* pEntry = First(); - while (pEntry) - { - TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); - if (pUserData) - { - USHORT nCode2 = pUserData->m_aKey.GetCode(); - USHORT nMod2 = pUserData->m_aKey.GetModifier(); - if ( - (nCode1 == nCode2) && - (nMod1 == nMod2 ) - ) - { - Select (pEntry); - MakeVisible(pEntry); - return; - } - } - pEntry = Next(pEntry); - } - } - - // no - handle it as normal dialog input - SvTabListBox::KeyInput(aKey); -} - -//----------------------------------------------- -SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxItemSet& aSet ) - : SfxTabPage (pParent, SfxResId(TP_CONFIG_ACCEL), aSet) - , m_pMacroInfoItem () - , m_pFileDlg (NULL) - , aEntriesBox (this , this, SfxResId(BOX_ACC_ENTRIES )) - , aKeyboardGroup (this , SfxResId(GRP_ACC_KEYBOARD )) - , aOfficeButton (this , SfxResId(RB_OFFICE )) - , aModuleButton (this , SfxResId(RB_MODULE )) - , aChangeButton (this , SfxResId(BTN_ACC_CHANGE )) - , aRemoveButton (this , SfxResId(BTN_ACC_REMOVE )) - , aGroupText (this , SfxResId(TXT_ACC_GROUP )) - , aGroupLBox (this , SfxResId(BOX_ACC_GROUP), SFX_SLOT_ACCELCONFIG) - , aFunctionText (this , SfxResId(TXT_ACC_FUNCTION )) - , aFunctionBox (this , SfxResId(BOX_ACC_FUNCTION )) - , aKeyText (this , SfxResId(TXT_ACC_KEY )) - , aKeyBox (this , SfxResId(BOX_ACC_KEY )) - , aFunctionsGroup (this , SfxResId(GRP_ACC_FUNCTIONS )) - , aLoadButton (this , SfxResId(BTN_LOAD )) - , aSaveButton (this , SfxResId(BTN_SAVE )) - , aResetButton (this , SfxResId(BTN_RESET )) - , m_bStylesInfoInitialized(sal_False) - , m_xGlobal () - , m_xModule () - , m_xAct () -{ - FreeResource(); - - // install handler functions - aChangeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, ChangeHdl )); - aRemoveButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RemoveHdl )); - aEntriesBox.SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl )); - aGroupLBox.SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl )); - aFunctionBox.SetSelectHdl( LINK( this, SfxAcceleratorConfigPage, SelectHdl )); - aKeyBox.SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl )); - aLoadButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Load )); - aSaveButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Save )); - aResetButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Default )); - aOfficeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl )); - aModuleButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl )); - - // initialize Entriesbox - aEntriesBox.SetWindowBits(WB_HSCROLL|WB_CLIPCHILDREN); - aEntriesBox.SetSelectionMode(SINGLE_SELECTION); - aEntriesBox.SetTabs(&AccCfgTabs[0], MAP_APPFONT); - aEntriesBox.Resize(); // OS: Hack for right selection - aEntriesBox.SetSpaceBetweenEntries(0); - aEntriesBox.SetDragDropMode(0); - - // detect max keyname width - long nMaxWidth = 0; - for ( USHORT i = 0; i < KEYCODE_ARRAY_SIZE; ++i ) - { - long nTmp = GetTextWidth( KeyCode( KEYCODE_ARRAY[i] ).GetName() ); - if ( nTmp > nMaxWidth ) - nMaxWidth = nTmp; - } - // recalc second tab - long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MAP_APPFONT ).Width(); - nNewTab = nNewTab + 5; // additional space - aEntriesBox.SetTab( 1, nNewTab ); - - // initialize GroupBox - aGroupLBox.SetFunctionListBox(&aFunctionBox); - - // initialize KeyBox - aKeyBox.SetWindowBits(WB_CLIPCHILDREN|WB_HSCROLL|WB_SORT); -} - -//----------------------------------------------- -SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage() -{ - // free memory - remove all dynamic user data - SvLBoxEntry* pEntry = aEntriesBox.First(); - while (pEntry) - { - TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); - if (pUserData) - delete pUserData; - pEntry = aEntriesBox.Next(pEntry); - } - - pEntry = aKeyBox.First(); - while (pEntry) - { - TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); - if (pUserData) - delete pUserData; - pEntry = aKeyBox.Next(pEntry); - } - - aEntriesBox.Clear(); - aKeyBox.Clear(); - - delete m_pFileDlg; -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::InitAccCfg() -{ - // already initialized ? - if (m_xSMGR.is()) - return; // yes -> do nothing - - try - { - // no - initialize this instance - m_xSMGR = ::utl::getProcessServiceFactory(); - - m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION), css::uno::UNO_QUERY_THROW); - - // get the current active frame, which should be our "parent" - // for this session - m_xFrame = GetFrame(); - if ( !m_xFrame.is() ) - { - css::uno::Reference< css::frame::XFramesSupplier > xDesktop(m_xSMGR->createInstance(SERVICE_DESKTOP), css::uno::UNO_QUERY_THROW); - m_xFrame = xDesktop->getActiveFrame(); - } - - // identify module - css::uno::Reference< css::frame::XModuleManager > xModuleManager (m_xSMGR->createInstance(SERVICE_MODULEMANAGER), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::container::XNameAccess > xModuleManagerCont(xModuleManager , css::uno::UNO_QUERY_THROW); - m_sModuleLongName = xModuleManager->identify(m_xFrame); - ::comphelper::SequenceAsHashMap lModuleProps(xModuleManagerCont->getByName(m_sModuleLongName)); - m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_SHORTNAME, ::rtl::OUString()); - m_sModuleUIName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_UINAME , ::rtl::OUString()); - - // get global accelerator configuration - m_xGlobal = css::uno::Reference< css::ui::XAcceleratorConfiguration >(m_xSMGR->createInstance(SERVICE_GLOBALACCCFG), css::uno::UNO_QUERY_THROW); - - // get module accelerator configuration - css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier(m_xSMGR->createInstance(SERVICE_MODULEUICONFIGSUPPLIER), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::ui::XUIConfigurationManager > xUICfgManager = xModuleCfgSupplier->getUIConfigurationManager(m_sModuleLongName); - m_xModule = css::uno::Reference< css::ui::XAcceleratorConfiguration >(xUICfgManager->getShortCutManager(), css::uno::UNO_QUERY_THROW); - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - { m_xSMGR.clear(); } -} - -//----------------------------------------------- -/** Initialize text columns with own class to enable custom painting - This is needed as we have to paint disabled entries by ourself. No support for that in the - original SvTabListBox! - */ -void SfxAcceleratorConfigPage::CreateCustomItems( SvLBoxEntry* pEntry, - const String& sCol1 , - const String& sCol2 ) -{ - SfxAccCfgLBoxString_Impl* pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol1); - pEntry->ReplaceItem(pStringItem, 1); - - pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol2); - pEntry->ReplaceItem(pStringItem, 2); -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xAccMgr) -{ - if (!xAccMgr.is()) - return; - - if (!m_bStylesInfoInitialized) - { - css::uno::Reference< css::frame::XController > xController; - css::uno::Reference< css::frame::XModel > xModel; - if (m_xFrame.is()) - xController = m_xFrame->getController(); - if (xController.is()) - xModel = xController->getModel(); - - m_aStylesInfo.setModel(xModel); - aFunctionBox.SetStylesInfo(&m_aStylesInfo); - aGroupLBox.SetStylesInfo(&m_aStylesInfo); - m_bStylesInfoInitialized = sal_True; - } - - // Insert all editable accelerators into list box. It is possible - // that some accelerators are not mapped on the current system/keyboard - // but we don't want to lose these mappings. - USHORT c1 = KEYCODE_ARRAY_SIZE; - USHORT i1 = 0; - USHORT nListPos = 0; - for (i1=0; i1<c1; ++i1) - { - KeyCode aKey = KEYCODE_ARRAY[i1]; - String sKey = aKey.GetName(); - if (!sKey.Len()) - continue; - TAccInfo* pEntry = new TAccInfo(i1, nListPos, aKey); - SvLBoxEntry* pLBEntry = aEntriesBox.InsertEntryToColumn(sKey, 0L, LIST_APPEND, 0xFFFF); - pLBEntry->SetUserData(pEntry); - } - - // Assign all commands to its shortcuts - reading the accelerator config. - css::uno::Sequence< css::awt::KeyEvent > lKeys = xAccMgr->getAllKeyEvents(); - sal_Int32 c2 = lKeys.getLength(); - sal_Int32 i2 = 0; - USHORT nCol = aEntriesBox.TabCount()-1; - - for (i2=0; i2<c2; ++i2) - { - const css::awt::KeyEvent& aAWTKey = lKeys[i2]; - ::rtl::OUString sCommand = xAccMgr->getCommandByKeyEvent(aAWTKey); - String sLabel = GetLabel4Command(sCommand); - KeyCode aKeyCode = ::svt::AcceleratorExecute::st_AWTKey2VCLKey(aAWTKey); - USHORT nPos = MapKeyCodeToPos(aKeyCode); - - if (nPos == LISTBOX_ENTRY_NOTFOUND) - continue; - - aEntriesBox.SetEntryText(sLabel, nPos, nCol); - - SvLBoxEntry* pLBEntry = aEntriesBox.GetEntry(0, nPos); - TAccInfo* pEntry = (TAccInfo*)pLBEntry->GetUserData(); - - pEntry->m_bIsConfigurable = sal_True; - pEntry->m_sCommand = sCommand; - CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), sLabel); - } - - // Map the VCL hardcoded key codes and mark them as not changeable - ULONG c3 = Application::GetReservedKeyCodeCount(); - ULONG i3 = 0; - for (i3=0; i3<c3; ++i3) - { - const KeyCode* pKeyCode = Application::GetReservedKeyCode(i3); - USHORT nPos = MapKeyCodeToPos(*pKeyCode); - - if (nPos == LISTBOX_ENTRY_NOTFOUND) - continue; - - // Hardcoded function mapped so no ID possible and mark entry as not changeable - SvLBoxEntry* pLBEntry = aEntriesBox.GetEntry(0, nPos); - TAccInfo* pEntry = (TAccInfo*)pLBEntry->GetUserData(); - - pEntry->m_bIsConfigurable = sal_False; - CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), String()); - } -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::Apply(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xAccMgr) -{ - if (!xAccMgr.is()) - return; - - // Go through the list from the bottom to the top ... - // because logical accelerator must be preferred instead of - // physical ones! - SvLBoxEntry* pEntry = aEntriesBox.First(); - while (pEntry) - { - TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); - ::rtl::OUString sCommand ; - css::awt::KeyEvent aAWTKey ; - - if (pUserData) - { - sCommand = pUserData->m_sCommand; - aAWTKey = ::svt::AcceleratorExecute::st_VCLKey2AWTKey(pUserData->m_aKey); - } - - try - { - if (sCommand.getLength()) - xAccMgr->setKeyEvent(aAWTKey, sCommand); - else - xAccMgr->removeKeyEvent(aAWTKey); - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - {} - - pEntry = aEntriesBox.Next(pEntry); - } -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::ResetConfig() -{ - aEntriesBox.Clear(); -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, Load, Button*, EMPTYARG ) -{ - // ask for filename, where we should load the new config data from - StartFileDialog( WB_OPEN | WB_STDMODAL | WB_3DLOOK, - String( SfxResId( STR_LOADACCELCONFIG ) ) ); - return 0; -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, Save, Button*, EMPTYARG ) -{ - StartFileDialog( WB_SAVEAS | WB_STDMODAL | WB_3DLOOK, - String( SfxResId( STR_SAVEACCELCONFIG ) ) ); - return 0; -} - -//----------------------------------------------- -IMPL_LINK(SfxAcceleratorConfigPage, Default, PushButton*, EMPTYARG) -{ - css::uno::Reference< css::form::XReset > xReset(m_xAct, css::uno::UNO_QUERY); - if (xReset.is()) - xReset->reset(); - - aEntriesBox.SetUpdateMode(FALSE); - ResetConfig(); - Init(m_xAct); - aEntriesBox.SetUpdateMode(TRUE); - aEntriesBox.Invalidate(); - aEntriesBox.Select(aEntriesBox.GetEntry(0, 0)); - - return 0; -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, ChangeHdl, Button*, EMPTYARG ) -{ - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); - TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); - String sNewCommand = aFunctionBox.GetCurCommand(); - String sLabel = aFunctionBox.GetCurLabel(); - if (!sLabel.Len()) - sLabel = GetLabel4Command(sNewCommand); - - pEntry->m_sCommand = sNewCommand; - USHORT nCol = aEntriesBox.TabCount() - 1; - aEntriesBox.SetEntryText(sLabel, nPos, nCol); - - ((Link &) aFunctionBox.GetSelectHdl()).Call( &aFunctionBox ); - return 0; -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, RemoveHdl, Button *, EMPTYARG ) -{ - // get selected entry - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); - TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); - - // remove function name from selected entry - USHORT nCol = aEntriesBox.TabCount() - 1; - aEntriesBox.SetEntryText( String(), nPos, nCol ); - pEntry->m_sCommand = ::rtl::OUString(); - - ((Link &) aFunctionBox.GetSelectHdl()).Call( &aFunctionBox ); - return 0; -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox ) -{ - // disable help - Help::ShowBalloon( this, Point(), String() ); - if ( pListBox == &aEntriesBox ) - { - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() ); - TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); - ::rtl::OUString sPossibleNewCommand = aFunctionBox.GetCurCommand(); - - aRemoveButton.Enable( FALSE ); - aChangeButton.Enable( FALSE ); - - if (pEntry->m_bIsConfigurable) - { - if (pEntry->isConfigured()) - aRemoveButton.Enable( TRUE ); - aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand ); - } - } - else if ( pListBox == &aGroupLBox ) - { - aGroupLBox.GroupSelected(); - if ( !aFunctionBox.FirstSelected() ) - aChangeButton.Enable( FALSE ); - } - else if ( pListBox == &aFunctionBox ) - { - aRemoveButton.Enable( FALSE ); - aChangeButton.Enable( FALSE ); - - // #i36994 First selected can return zero! - SvLBoxEntry* pLBEntry = aEntriesBox.FirstSelected(); - if ( pLBEntry != 0 ) - { - USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( pLBEntry ); - TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); - ::rtl::OUString sPossibleNewCommand = aFunctionBox.GetCurCommand(); - - if (pEntry->m_bIsConfigurable) - { - if (pEntry->isConfigured()) - aRemoveButton.Enable( TRUE ); - aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand ); - } - - // update key box - aKeyBox.Clear(); - SvLBoxEntry* pIt = aEntriesBox.First(); - while ( pIt ) - { - TAccInfo* pUserData = (TAccInfo*)pIt->GetUserData(); - if ( pUserData && pUserData->m_sCommand == sPossibleNewCommand ) - { - TAccInfo* pU1 = new TAccInfo(-1, -1, pUserData->m_aKey); - SvLBoxEntry* pE1 = aKeyBox.InsertEntry( pUserData->m_aKey.GetName(), 0L, TRUE, LIST_APPEND ); - pE1->SetUserData(pU1); - pE1->EnableChildsOnDemand( FALSE ); - } - pIt = aEntriesBox.Next(pIt); - } - } - } - else - { - // goto selected "key" entry of the key box - SvLBoxEntry* pE2 = 0; - TAccInfo* pU2 = 0; - USHORT nP2 = LISTBOX_ENTRY_NOTFOUND; - SvLBoxEntry* pE3 = 0; - - pE2 = aKeyBox.FirstSelected(); - if (pE2) - pU2 = (TAccInfo*)pE2->GetUserData(); - if (pU2) - nP2 = MapKeyCodeToPos(pU2->m_aKey); - if (nP2 != LISTBOX_ENTRY_NOTFOUND) - pE3 = aEntriesBox.GetEntry( 0, nP2 ); - if (pE3) - { - aEntriesBox.Select( pE3 ); - aEntriesBox.MakeVisible( pE3 ); - } - } - - return 0; -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, RadioHdl, RadioButton *, EMPTYARG ) -{ - css::uno::Reference< css::ui::XAcceleratorConfiguration > xOld = m_xAct; - - if (aOfficeButton.IsChecked()) - m_xAct = m_xGlobal; - else if (aModuleButton.IsChecked()) - m_xAct = m_xModule; - - // nothing changed? => do nothing! - if ( m_xAct.is() && ( xOld == m_xAct ) ) - return 0; - - aEntriesBox.SetUpdateMode( FALSE ); - ResetConfig(); - Init(m_xAct); - aEntriesBox.SetUpdateMode( TRUE ); - aEntriesBox.Invalidate(); - - aGroupLBox.Init(m_xSMGR, m_xFrame, m_sModuleLongName); - - // pb: #133213# do not select NULL entries - SvLBoxEntry* pEntry = aEntriesBox.GetEntry( 0, 0 ); - if ( pEntry ) - aEntriesBox.Select( pEntry ); - pEntry = aGroupLBox.GetEntry( 0, 0 ); - if ( pEntry ) - aGroupLBox.Select( pEntry ); - - ((Link &) aFunctionBox.GetSelectHdl()).Call( &aFunctionBox ); - return 1L; -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, LoadHdl, sfx2::FileDialogHelper*, EMPTYARG ) -{ - DBG_ASSERT( m_pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" ); - - ::rtl::OUString sCfgName; - if ( ERRCODE_NONE == m_pFileDlg->GetError() ) - sCfgName = m_pFileDlg->GetPath(); - - if ( !sCfgName.getLength() ) - return 0; - - GetTabDialog()->EnterWait(); - - css::uno::Reference< css::frame::XModel > xDoc ; - css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ; - css::uno::Reference< css::embed::XStorage > xRootStorage; // we must hold the root storage alive, if xCfgMgr is used! - - try - { - // first check if URL points to a document already loaded - xDoc = SearchForAlreadyLoadedDoc(sCfgName); - if (xDoc.is()) - { - // Get ui config manager. There should always be one at the model. - css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xCfgSupplier(xDoc, css::uno::UNO_QUERY_THROW); - xCfgMgr = xCfgSupplier->getUIConfigurationManager(); - } - else - { - // URL doesn't point to a loaded document, try to access it as a single storage - // dont forget to release the storage afterwards! - css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory(m_xSMGR->createInstance(SERVICE_STORAGEFACTORY), css::uno::UNO_QUERY_THROW); - css::uno::Sequence< css::uno::Any > lArgs(2); - lArgs[0] <<= sCfgName; - lArgs[1] <<= css::embed::ElementModes::READ; - - xRootStorage = css::uno::Reference< css::embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::embed::XStorage > xUIConfig = xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, css::embed::ElementModes::READ); - if (xUIConfig.is()) - { - xCfgMgr = css::uno::Reference< css::ui::XUIConfigurationManager >(m_xSMGR->createInstance(SERVICE_UICONFIGMGR), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::ui::XUIConfigurationStorage > xCfgMgrStore(xCfgMgr, css::uno::UNO_QUERY_THROW); - xCfgMgrStore->setStorage(xUIConfig); - } - } - - if (xCfgMgr.is()) - { - // open the configuration and update our UI - css::uno::Reference< css::ui::XAcceleratorConfiguration > xTempAccMgr(xCfgMgr->getShortCutManager(), css::uno::UNO_QUERY_THROW); - - aEntriesBox.SetUpdateMode(FALSE); - ResetConfig(); - Init(xTempAccMgr); - aEntriesBox.SetUpdateMode(TRUE); - aEntriesBox.Invalidate(); - aEntriesBox.Select(aEntriesBox.GetEntry(0, 0)); - - } - - // dont forget to close the new opened storage! - // We are the owner of it. - if (xRootStorage.is()) - { - css::uno::Reference< css::lang::XComponent > xComponent; - xComponent = css::uno::Reference< css::lang::XComponent >(xCfgMgr, css::uno::UNO_QUERY); - if (xComponent.is()) - xComponent->dispose(); - xComponent = css::uno::Reference< css::lang::XComponent >(xRootStorage, css::uno::UNO_QUERY); - if (xComponent.is()) - xComponent->dispose(); - } - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - {} - - GetTabDialog()->LeaveWait(); - - return 0; -} - -//----------------------------------------------- -IMPL_LINK( SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, EMPTYARG ) -{ - DBG_ASSERT( m_pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" ); - - ::rtl::OUString sCfgName; - if ( ERRCODE_NONE == m_pFileDlg->GetError() ) - sCfgName = m_pFileDlg->GetPath(); - - if ( !sCfgName.getLength() ) - return 0; - - GetTabDialog()->EnterWait(); - - css::uno::Reference< css::frame::XModel > xDoc ; - css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ; - css::uno::Reference< css::embed::XStorage > xRootStorage; - - try - { - // first check if URL points to a document already loaded - xDoc = SearchForAlreadyLoadedDoc(sCfgName); - if (xDoc.is()) - { - // get config manager, force creation if there was none before - css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xCfgSupplier(xDoc, css::uno::UNO_QUERY_THROW); - xCfgMgr = xCfgSupplier->getUIConfigurationManager(); - } - else - { - // URL doesn't point to a loaded document, try to access it as a single storage - css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory(m_xSMGR->createInstance(SERVICE_STORAGEFACTORY), css::uno::UNO_QUERY_THROW); - css::uno::Sequence< css::uno::Any > lArgs(2); - lArgs[0] <<= sCfgName; - lArgs[1] <<= css::embed::ElementModes::WRITE; - - xRootStorage = css::uno::Reference< css::embed::XStorage >( - xStorageFactory->createInstanceWithArguments(lArgs), - css::uno::UNO_QUERY_THROW); - - css::uno::Reference< css::embed::XStorage > xUIConfig( - xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, css::embed::ElementModes::WRITE), - css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::beans::XPropertySet > xUIConfigProps( - xUIConfig, - css::uno::UNO_QUERY_THROW); - - // set the correct media type if the storage was new created - ::rtl::OUString sMediaType; - xUIConfigProps->getPropertyValue(MEDIATYPE_PROPNAME) >>= sMediaType; - if (!sMediaType.getLength()) - xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, css::uno::makeAny(MEDIATYPE_UICONFIG)); - - xCfgMgr = css::uno::Reference< css::ui::XUIConfigurationManager >(m_xSMGR->createInstance(SERVICE_UICONFIGMGR), css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::ui::XUIConfigurationStorage > xUICfgStore(xCfgMgr, css::uno::UNO_QUERY_THROW); - xUICfgStore->setStorage(xUIConfig); - } - - if (xCfgMgr.is()) - { - // get the target configuration access and update with all shortcuts - // which are set currently at the UI ! - // Dont copy the m_xAct content to it ... because m_xAct will be updated - // from the UI on pressing the button "OK" only. And inbetween it's not up to date ! - css::uno::Reference< css::ui::XAcceleratorConfiguration > xTargetAccMgr(xCfgMgr->getShortCutManager(), css::uno::UNO_QUERY_THROW); - Apply(xTargetAccMgr); - - // commit (order is important!) - css::uno::Reference< css::ui::XUIConfigurationPersistence > xCommit1(xTargetAccMgr, css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::ui::XUIConfigurationPersistence > xCommit2(xCfgMgr , css::uno::UNO_QUERY_THROW); - xCommit1->store(); - xCommit2->store(); - - if (xRootStorage.is()) - { - // Commit root storage - css::uno::Reference< css::embed::XTransactedObject > xCommit3(xRootStorage, css::uno::UNO_QUERY_THROW); - xCommit3->commit(); - } - } - - if (xRootStorage.is()) - { - css::uno::Reference< css::lang::XComponent > xComponent; - xComponent = css::uno::Reference< css::lang::XComponent >(xCfgMgr, css::uno::UNO_QUERY); - if (xComponent.is()) - xComponent->dispose(); - xComponent = css::uno::Reference< css::lang::XComponent >(xRootStorage, css::uno::UNO_QUERY); - if (xComponent.is()) - xComponent->dispose(); - } - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - {} - - GetTabDialog()->LeaveWait(); - - return 0; -} - -//----------------------------------------------- -String SfxAcceleratorConfigPage::GetFunctionName(KeyFuncType eType) const -{ - ::rtl::OUStringBuffer sName(256); - sName.appendAscii("\""); - switch(eType) - { - case KEYFUNC_NEW : - sName.append( String( SfxResId( STR_NEW ))); - break; - - case KEYFUNC_OPEN : - sName.append( String( SfxResId( STR_OPEN ))); - break; - - case KEYFUNC_SAVE : - sName.append( String( SfxResId( STR_SAVE ))); - break; - - case KEYFUNC_SAVEAS : - sName.append( String( SfxResId( STR_SAVEAS ))); - break; - - case KEYFUNC_PRINT : - sName.append( String( SfxResId( STR_PRINT ))); - break; - - case KEYFUNC_CLOSE : - sName.append( String( SfxResId( STR_CLOSE))); - break; - - case KEYFUNC_QUIT : - sName.append( String( SfxResId( STR_QUIT ))); - break; - - case KEYFUNC_CUT : - sName.append( String( SfxResId( STR_CUT ))); - break; - - case KEYFUNC_COPY : - sName.append( String( SfxResId( STR_COPY ))); - break; - - case KEYFUNC_PASTE : - sName.append( String( SfxResId( STR_PASTE ))); - break; - - case KEYFUNC_UNDO : - sName.append( String( SfxResId( STR_UNDO ))); - break; - - case KEYFUNC_REDO : - sName.append( String( SfxResId( STR_REDO ))); - break; - - case KEYFUNC_DELETE : - sName.append( String( SfxResId( STR_DELETE ))); - break; - - case KEYFUNC_REPEAT : - sName.append( String( SfxResId( STR_REPEAT ))); - break; - - case KEYFUNC_FIND : - sName.append( String( SfxResId( STR_FIND ))); - break; - - case KEYFUNC_FINDBACKWARD : - sName.append( String( SfxResId( STR_FINDBACKWARD ))); - break; - - case KEYFUNC_PROPERTIES : - sName.append( String( SfxResId( STR_PROPERTIES ))); - break; - - case KEYFUNC_FRONT : - sName.append( String( SfxResId( STR_FRONT ))); - break; - default: - break; - } - sName.appendAscii("\""); - return String(sName.makeStringAndClear()); -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTitle ) -{ - bool bSave = ( ( nBits & WB_SAVEAS ) == WB_SAVEAS ); - short nDialogType = bSave ? css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE - : css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE; - if ( m_pFileDlg ) - delete m_pFileDlg; - m_pFileDlg = new sfx2::FileDialogHelper( nDialogType, 0 ); - - m_pFileDlg->SetTitle( rTitle ); -// m_pFileDlg->SetDialogHelpId( bSave ? HID_CONFIG_SAVE : HID_CONFIG_LOAD ); - m_pFileDlg->AddFilter( String( SfxResId( STR_SFX_FILTERNAME_ALL ) ), - DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ) ); - m_pFileDlg->AddFilter( String( SfxResId( STR_FILTERNAME_CFG ) ), - DEFINE_CONST_UNICODE( "*.cfg" ) ); - - Link aDlgClosedLink = bSave ? LINK( this, SfxAcceleratorConfigPage, SaveHdl ) - : LINK( this, SfxAcceleratorConfigPage, LoadHdl ); - m_pFileDlg->StartExecuteModal( aDlgClosedLink ); -} - -//----------------------------------------------- -BOOL SfxAcceleratorConfigPage::FillItemSet( SfxItemSet& ) -{ - Apply(m_xAct); - try - { - m_xAct->store(); - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - { return FALSE; } - - return TRUE; -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::Reset( const SfxItemSet& ) -{ - // open accelerator configs - // Note: It initialize some other members too, which are needed here ... - // e.g. m_sModuleUIName! - InitAccCfg(); - - // change te description of the radio button, which switch to the module - // dependend accelerator configuration - String sButtonText = aModuleButton.GetText(); - sButtonText.SearchAndReplace(String::CreateFromAscii("$(MODULE)"), m_sModuleUIName); - aModuleButton.SetText(sButtonText); - - if (m_xModule.is()) - aModuleButton.Check(); - else - { - aModuleButton.Hide(); - aOfficeButton.Check(); - } - - RadioHdl(0); - - /* TODO ??? - if ( m_pMacroInfoItem ) - aGroupLBox.SelectMacro( m_pMacroInfoItem ); - */ -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::SelectMacro(const SfxMacroInfoItem *pItem) -{ - m_pMacroInfoItem = pItem; - aGroupLBox.SelectMacro( pItem ); -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::CopySource2Target(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xSourceAccMgr, - const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xTargetAccMgr) -{ - const css::uno::Sequence< css::awt::KeyEvent > lKeys = xSourceAccMgr->getAllKeyEvents(); - sal_Int32 c = lKeys.getLength(); - sal_Int32 i = 0; - for (i=0; i<c; ++i) - { - const css::awt::KeyEvent& rKey = lKeys[i]; - ::rtl::OUString sCommand = xSourceAccMgr->getCommandByKeyEvent(rKey); - xTargetAccMgr->setKeyEvent(rKey, sCommand); - } -} - -//----------------------------------------------- -KeyCode SfxAcceleratorConfigPage::MapPosToKeyCode(USHORT nPos) const -{ - TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); - KeyCode aCode(KEYCODE_ARRAY[pEntry->m_nKeyPos] & 0xFFF , - KEYCODE_ARRAY[pEntry->m_nKeyPos] & (KEY_SHIFT | KEY_MOD1)); - return aCode; -} - -//----------------------------------------------- -USHORT SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const -{ - USHORT nCode1 = aKey.GetCode()+aKey.GetModifier(); - SvLBoxEntry* pEntry = aEntriesBox.First(); - USHORT i = 0; - - while (pEntry) - { - TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData(); - if (pUserData) - { - USHORT nCode2 = pUserData->m_aKey.GetCode()+pUserData->m_aKey.GetModifier(); - if (nCode1 == nCode2) - return i; - } - pEntry = aEntriesBox.Next(pEntry); - ++i; - } - - return LISTBOX_ENTRY_NOTFOUND; -} - -//----------------------------------------------- -String SfxAcceleratorConfigPage::GetLabel4Command(const String& sCommand) -{ - try - { - // check global command configuration first - css::uno::Reference< css::container::XNameAccess > xModuleConf; - m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf; - if (xModuleConf.is()) - { - ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand)); - String sLabel = String(lProps.getUnpackedValueOrDefault(CMDPROP_UINAME, ::rtl::OUString())); - if (sLabel.Len()) - return sLabel; - } - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - {} - - // may be it's a style URL .. they must be handled special - SfxStyleInfo_Impl aStyle; - aStyle.sCommand = sCommand; - if (m_aStylesInfo.parseStyleCommand(aStyle)) - { - m_aStylesInfo.getLabel4Style(aStyle); - return aStyle.sLabel; - } - - return sCommand; -} - -//----------------------------------------------- -css::uno::Reference< css::frame::XModel > SfxAcceleratorConfigPage::SearchForAlreadyLoadedDoc(const String& /*sName*/) -{ - return css::uno::Reference< css::frame::XModel >(); -} - diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 4b155c9cfb11..6b92cb0137de 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -170,7 +170,7 @@ void SfxModalDialog::init() // ----------------------------------------------------------------------- -SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId) +SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId ) /* [Beschreibung] @@ -179,8 +179,10 @@ SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId) Die dort gespeicherte Position wird gesetzt. */ -: ModalDialog(pParent, rResId), - nUniqId(rResId.GetId()) +: ModalDialog(pParent, rResId), + nUniqId(rResId.GetId()), + pInputSet(0), + pOutputSet(0) { init(); } @@ -198,7 +200,9 @@ SfxModalDialog::SfxModalDialog(Window* pParent, */ ModalDialog(pParent, nWinStyle), - nUniqId(nUniqueId) + nUniqId(nUniqueId), + pInputSet(0), + pOutputSet(0) { init(); } @@ -220,6 +224,14 @@ SfxModalDialog::~SfxModalDialog() */ SetDialogData_Impl(); aTimer.Stop(); + delete pOutputSet; +} + +void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool ) +{ + DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" ); + if (!pOutputSet) + pOutputSet = new SfxAllItemSet( rPool ); } // ----------------------------------------------------------------------- @@ -234,6 +246,16 @@ IMPL_LINK( SfxModalDialog, TimerHdl_Impl, Timer*, EMPTYARG ) return 0L; } +void SfxModalDialog::CreateOutputItemSet( const SfxItemSet& rSet ) +{ + DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" ); + if (!pOutputSet) + { + pOutputSet = new SfxItemSet( rSet ); + pOutputSet->ClearItem(); + } +} + //------------------------------------------------------------------------- void SfxModelessDialog::StateChanged( StateChangedType nStateChange ) { @@ -721,31 +743,29 @@ IMPL_LINK( SfxSingleTabDialog, OKHdl_Impl, Button *, EMPTYARG ) */ { - if ( !pOptions ) + if ( !GetInputItemSet() ) { // TabPage without ItemSet EndDialog( RET_OK ); return 1; } - if ( !pOutSet ) + if ( !GetOutputItemSet() ) { - pOutSet = new SfxItemSet( *pOptions ); - pOutSet->ClearItem(); + CreateOutputItemSet( *GetInputItemSet() ); } sal_Bool bModified = sal_False; if ( pImpl->m_pSfxPage->HasExchangeSupport() ) { - int nRet = pImpl->m_pSfxPage->DeactivatePage( pOutSet ); - + int nRet = pImpl->m_pSfxPage->DeactivatePage( GetOutputSetImpl() ); if ( nRet != SfxTabPage::LEAVE_PAGE ) return 0; else - bModified = ( pOutSet->Count() > 0 ); + bModified = ( GetOutputItemSet()->Count() > 0 ); } else - bModified = pImpl->m_pSfxPage->FillItemSet( *pOutSet ); + bModified = pImpl->m_pSfxPage->FillItemSet( *GetOutputSetImpl() ); if ( bModified ) { @@ -781,12 +801,10 @@ SfxSingleTabDialog::SfxSingleTabDialog pOKBtn ( 0 ), pCancelBtn ( 0 ), pHelpBtn ( 0 ), - pImpl ( new SingleTabDlgImpl ), - pOptions ( &rSet ), - pOutSet ( 0 ) - + pImpl ( new SingleTabDlgImpl ) { DBG_WARNING( "please use the ctor with ViewFrame" ); + SetInputSet( &rSet ); } // ----------------------------------------------------------------------- @@ -810,12 +828,10 @@ SfxSingleTabDialog::SfxSingleTabDialog pOKBtn ( 0 ), pCancelBtn ( 0 ), pHelpBtn ( 0 ), - pImpl ( new SingleTabDlgImpl ), - pOptions ( pInSet ), - pOutSet ( 0 ) - + pImpl ( new SingleTabDlgImpl ) { DBG_WARNING( "bitte den Ctor mit ViewFrame verwenden" ); + SetInputSet( pInSet ); } // ----------------------------------------------------------------------- @@ -838,10 +854,7 @@ SfxSingleTabDialog::SfxSingleTabDialog pOKBtn ( NULL ), pCancelBtn ( NULL ), pHelpBtn ( NULL ), - pImpl ( new SingleTabDlgImpl ), - pOptions ( NULL ), - pOutSet ( NULL ) - + pImpl ( new SingleTabDlgImpl ) { pImpl->m_sInfoURL = rInfoURL; } @@ -858,7 +871,6 @@ SfxSingleTabDialog::~SfxSingleTabDialog() delete pImpl->m_pLine; delete pImpl->m_pInfoImage; delete pImpl; - delete pOutSet; } // ----------------------------------------------------------------------- @@ -973,7 +985,7 @@ void SfxSingleTabDialog::SetTabPage( SfxTabPage* pTabPage, if ( aUserItem >>= aTemp ) sUserData = String( aTemp ); pImpl->m_pSfxPage->SetUserData( sUserData ); - pImpl->m_pSfxPage->Reset( *pOptions ); + pImpl->m_pSfxPage->Reset( *GetInputItemSet() ); pImpl->m_pSfxPage->Show(); // Gr"ossen und Positionen anpassen @@ -1035,10 +1047,10 @@ extern "C" int BaseDlgsCmpUS_Impl( const void* p1, const void* p2 ) */ const sal_uInt16* SfxSingleTabDialog::GetInputRanges( const SfxItemPool& rPool ) { - if ( pOptions ) + if ( GetInputItemSet() ) { DBG_ERROR( "Set bereits vorhanden!" ); - return pOptions->GetRanges(); + return GetInputItemSet()->GetRanges(); } if ( pRanges ) diff --git a/sfx2/source/dialog/cfg.cxx b/sfx2/source/dialog/cfg.cxx deleted file mode 100644 index 170db6521d71..000000000000 --- a/sfx2/source/dialog/cfg.cxx +++ /dev/null @@ -1,1770 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: cfg.cxx,v $ - * $Revision: 1.65 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" -#include <vcl/help.hxx> -#include <basic/sbx.hxx> -#include <basic/basicmanagerrepository.hxx> -#include <basic/sbstar.hxx> -#include <basic/sbxmeth.hxx> -#include <basic/sbmod.hxx> -#include <basic/basmgr.hxx> -#include <vcl/wrkwin.hxx> -#include <tools/urlobj.hxx> -#include <tools/diagnose_ex.h> -#include <svtools/pathoptions.hxx> -#include <sot/storage.hxx> - -#ifndef GCC -#endif - -#include "cfg.hxx" - -#include "dialog.hrc" -#include "cfg.hrc" -#ifndef _SFX_HELPID_HRC -#include "helpid.hrc" -#endif - -#include <sfx2/app.hxx> -#include <sfx2/msg.hxx> -#include <sfx2/msgpool.hxx> -#include "sfxresid.hxx" -#include <sfx2/macrconf.hxx> -#include "minfitem.hxx" -#include "sfxresid.hxx" -#include <sfx2/objsh.hxx> -#include <sfx2/dispatch.hxx> -#include "sfxtypes.hxx" -#include "eventdlg.hxx" -#include "minfitem.hxx" -#include <sfx2/viewfrm.hxx> -#include "workwin.hxx" -#include <sfx2/filedlghelper.hxx> -#include <sfx2/request.hxx> - -#include <unotools/processfactory.hxx> -#include <comphelper/documentinfo.hxx> - -#ifndef _UNOTOOLS_CONFIGMGR_HXX_ -#include <unotools/configmgr.hxx> -#endif -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/frame/XDispatchInformationProvider.hpp> -#include <com/sun/star/uno/RuntimeException.hpp> -#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp> -#include <com/sun/star/script/provider/XScriptProvider.hpp> -#include <com/sun/star/script/browse/XBrowseNode.hpp> -#include <com/sun/star/script/browse/BrowseNodeTypes.hpp> - -#ifndef _COM_SUN_STAR_SCRIPT_BROWSE_BROWSENODEFACTORY_HPP_ -#include <com/sun/star/script/browse/XBrowseNodeFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_SCRIPT_BROWSE_BROWSENODEFACTORYVIEWTYPE_HPP_ -#include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp> -#endif -#include <com/sun/star/frame/XModuleManager.hpp> -#include <com/sun/star/frame/XDesktop.hpp> -#include <com/sun/star/container/XEnumerationAccess.hpp> -#include <com/sun/star/container/XEnumeration.hpp> -#include <com/sun/star/document/XDocumentInfoSupplier.hpp> -#include <com/sun/star/document/XScriptInvocationContext.hpp> -#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::script; -using namespace ::com::sun::star::frame; -using namespace ::com::sun::star::document; -namespace css = ::com::sun::star; - -#define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> -#include <svtools/imagemgr.hxx> -#include <tools/urlobj.hxx> -#include <rtl/ustrbuf.hxx> -#include <comphelper/sequenceashashmap.hxx> -#include <rtl/ustrbuf.hxx> - -static ::rtl::OUString SERVICE_UICATEGORYDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.ui.UICategoryDescription" ); -static ::rtl::OUString SERVICE_UICMDDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription"); - -SfxStylesInfo_Impl::SfxStylesInfo_Impl() -{} - -void SfxStylesInfo_Impl::setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel) -{ - m_xDoc = xModel; -} - -static ::rtl::OUString FAMILY_CHARACTERSTYLE = ::rtl::OUString::createFromAscii("CharacterStyles"); -static ::rtl::OUString FAMILY_PARAGRAPHSTYLE = ::rtl::OUString::createFromAscii("ParagraphStyles"); -static ::rtl::OUString FAMILY_FRAMESTYLE = ::rtl::OUString::createFromAscii("FrameStyles" ); -static ::rtl::OUString FAMILY_PAGESTYLE = ::rtl::OUString::createFromAscii("PageStyles" ); -static ::rtl::OUString FAMILY_NUMBERINGSTYLE = ::rtl::OUString::createFromAscii("NumberingStyles"); - -static ::rtl::OUString CMDURL_SPART = ::rtl::OUString::createFromAscii(".uno:StyleApply?Style:string="); -static ::rtl::OUString CMDURL_FPART2 = ::rtl::OUString::createFromAscii("&FamilyName:string="); - -static ::rtl::OUString CMDURL_STYLEPROT_ONLY = ::rtl::OUString::createFromAscii(".uno:StyleApply?"); -static ::rtl::OUString CMDURL_SPART_ONLY = ::rtl::OUString::createFromAscii("Style:string="); -static ::rtl::OUString CMDURL_FPART_ONLY = ::rtl::OUString::createFromAscii("FamilyName:string="); - -static ::rtl::OUString STYLEPROP_UINAME = ::rtl::OUString::createFromAscii("DisplayName"); - -::rtl::OUString SfxStylesInfo_Impl::generateCommand(const ::rtl::OUString& sFamily, const ::rtl::OUString& sStyle) -{ - ::rtl::OUStringBuffer sCommand(1024); - sCommand.append(CMDURL_SPART ); - sCommand.append(sStyle ); - sCommand.append(CMDURL_FPART2); - sCommand.append(sFamily ); - return sCommand.makeStringAndClear(); -} - -sal_Bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle) -{ - static sal_Int32 LEN_STYLEPROT = CMDURL_STYLEPROT_ONLY.getLength(); - static sal_Int32 LEN_SPART = CMDURL_SPART_ONLY.getLength(); - static sal_Int32 LEN_FPART = CMDURL_FPART_ONLY.getLength(); - - if (aStyle.sCommand.indexOf(CMDURL_STYLEPROT_ONLY, 0) != 0) - return sal_False; - - aStyle.sFamily = ::rtl::OUString(); - aStyle.sStyle = ::rtl::OUString(); - - sal_Int32 nCmdLen = aStyle.sCommand.getLength(); - ::rtl::OUString sCmdArgs = aStyle.sCommand.copy(LEN_STYLEPROT, nCmdLen-LEN_STYLEPROT); - sal_Int32 i = sCmdArgs.indexOf('&'); - if (i<0) - return sal_False; - - ::rtl::OUString sArg = sCmdArgs.copy(0, i); - if (sArg.indexOf(CMDURL_SPART_ONLY) == 0) - aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART); - else - if (sArg.indexOf(CMDURL_FPART_ONLY) == 0) - aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART); - - sArg = sCmdArgs.copy(i+1, sCmdArgs.getLength()-i-1); - if (sArg.indexOf(CMDURL_SPART_ONLY) == 0) - aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART); - else - if (sArg.indexOf(CMDURL_FPART_ONLY) == 0) - aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART); - - if (aStyle.sFamily.getLength() && aStyle.sStyle.getLength()) - return sal_True; - - return sal_False; -} - -void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle) -{ - try - { - css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY); - - css::uno::Reference< css::container::XNameAccess > xFamilies; - if (xModel.is()) - xFamilies = xModel->getStyleFamilies(); - - css::uno::Reference< css::container::XNameAccess > xStyleSet; - if (xFamilies.is()) - xFamilies->getByName(aStyle.sFamily) >>= xStyleSet; - - css::uno::Reference< css::beans::XPropertySet > xStyle; - if (xStyleSet.is()) - xStyleSet->getByName(aStyle.sStyle) >>= xStyle; - - aStyle.sLabel = ::rtl::OUString(); - if (xStyle.is()) - xStyle->getPropertyValue(STYLEPROP_UINAME) >>= aStyle.sLabel; - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - { aStyle.sLabel = ::rtl::OUString(); } - - if (!aStyle.sLabel.getLength()) - { - aStyle.sLabel = aStyle.sCommand; - /* - #if OSL_DEBUG_LEVEL > 1 - ::rtl::OUStringBuffer sMsg(256); - sMsg.appendAscii("There is no UIName for the style command \""); - sMsg.append (aStyle.sCommand ); - sMsg.appendAscii("\". The UI will be invalid then ..." ); - OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr()); - #endif - */ - } -} - -::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyleFamilies() -{ - // Its an optional interface! - css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY); - if (!xModel.is()) - return ::std::vector< SfxStyleInfo_Impl >(); - - css::uno::Reference< css::container::XNameAccess > xCont = xModel->getStyleFamilies(); - css::uno::Sequence< ::rtl::OUString > lFamilyNames = xCont->getElementNames(); - ::std::vector< SfxStyleInfo_Impl > lFamilies; - sal_Int32 c = lFamilyNames.getLength(); - sal_Int32 i = 0; - for(i=0; i<c; ++i) - { - SfxStyleInfo_Impl aFamilyInfo; - aFamilyInfo.sFamily = lFamilyNames[i]; - - try - { - css::uno::Reference< css::beans::XPropertySet > xFamilyInfo; - xCont->getByName(aFamilyInfo.sFamily) >>= xFamilyInfo; - if (!xFamilyInfo.is()) - { - // TODO_AS currently there is no support for an UIName property .. use internal family name instead - aFamilyInfo.sLabel = aFamilyInfo.sFamily; - } - else - xFamilyInfo->getPropertyValue(STYLEPROP_UINAME) >>= aFamilyInfo.sLabel; - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - { return ::std::vector< SfxStyleInfo_Impl >(); } - - lFamilies.push_back(aFamilyInfo); - } - - return lFamilies; -} - -::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const ::rtl::OUString& sFamily) -{ - static ::rtl::OUString PROP_UINAME = ::rtl::OUString::createFromAscii("DisplayName"); - - css::uno::Sequence< ::rtl::OUString > lStyleNames; - css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY_THROW); - css::uno::Reference< css::container::XNameAccess > xFamilies = xModel->getStyleFamilies(); - css::uno::Reference< css::container::XNameAccess > xStyleSet; - try - { - xFamilies->getByName(sFamily) >>= xStyleSet; - lStyleNames = xStyleSet->getElementNames(); - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - { return ::std::vector< SfxStyleInfo_Impl >(); } - - ::std::vector< SfxStyleInfo_Impl > lStyles; - sal_Int32 c = lStyleNames.getLength(); - sal_Int32 i = 0; - for (i=0; i<c; ++i) - { - SfxStyleInfo_Impl aStyleInfo; - aStyleInfo.sFamily = sFamily; - aStyleInfo.sStyle = lStyleNames[i]; - aStyleInfo.sCommand = SfxStylesInfo_Impl::generateCommand(aStyleInfo.sFamily, aStyleInfo.sStyle); - - try - { - css::uno::Reference< css::beans::XPropertySet > xStyle; - xStyleSet->getByName(aStyleInfo.sStyle) >>= xStyle; - if (!xStyle.is()) - continue; - xStyle->getPropertyValue(PROP_UINAME) >>= aStyleInfo.sLabel; - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - { continue; } - - lStyles.push_back(aStyleInfo); - } - return lStyles; -} -SV_IMPL_PTRARR(SfxGroupInfoArr_Impl, SfxGroupInfoPtr); -SfxConfigFunctionListBox_Impl::SfxConfigFunctionListBox_Impl( Window* pParent, const ResId& rResId) - : SvTreeListBox( pParent, rResId ) - , pCurEntry( 0 ) - , pStylesInfo( 0 ) -{ - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); - GetModel()->SetSortMode( SortAscending ); - - // Timer f"ur die BallonHelp - aTimer.SetTimeout( 200 ); - aTimer.SetTimeoutHdl( - LINK( this, SfxConfigFunctionListBox_Impl, TimerHdl ) ); -} - -SfxConfigFunctionListBox_Impl::~SfxConfigFunctionListBox_Impl() -{ - ClearAll(); -} - -void SfxConfigFunctionListBox_Impl::MouseMove( const MouseEvent& ) -{ - /* --> PB 2004-12-01 #i37000# - no own help text needed any longer - Point aMousePos = rMEvt.GetPosPixel(); - pCurEntry = GetCurEntry(); - - if ( pCurEntry && GetEntry( aMousePos ) == pCurEntry ) - aTimer.Start(); - else - { - Help::ShowBalloon( this, aMousePos, String() ); - aTimer.Stop(); - } - */ -} - - -IMPL_LINK( SfxConfigFunctionListBox_Impl, TimerHdl, Timer*, pTimer) -/* Beschreibung - Timer-Handler f"ur die Einblendung eines Hilfetextes. Wenn nach Ablauf des Timers - der Mauszeiger immer noch auf dem aktuell selektierten Eintrag steht, wird der - Helptext des Entries als Balloon-Help eingeblendet. -*/ -{ - (void)pTimer; // unused - /* --> PB 2004-12-01 #i37000# - no own help text needed any longer - aTimer.Stop(); - Point aMousePos = GetPointerPosPixel(); - SvLBoxEntry *pEntry = GetCurEntry(); - if ( pEntry && GetEntry( aMousePos ) == pEntry && pCurEntry == pEntry ) - { - String sHelpText = GetHelpText( pEntry ); - Help::ShowBalloon( this, OutputToScreenPixel( aMousePos ), sHelpText ); - } - */ - return 0L; -} - -void SfxConfigFunctionListBox_Impl::ClearAll() -/* Beschreibung - L"oscht alle Eintr"age in der FunctionListBox, alle UserDaten und alle evtl. - vorhandenen MacroInfos. -*/ -{ - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; i++ ) - { - SfxGroupInfo_Impl *pData = aArr[i]; - - if ( pData->nKind == SFX_CFGFUNCTION_MACRO || - pData->nKind == SFX_CFGFUNCTION_SCRIPT ) - { - SfxMacroInfo *pInfo = (SfxMacroInfo*) pData->pObject; - SFX_APP()->GetMacroConfig()->ReleaseSlotId( pInfo->GetSlotId() ); - delete pInfo; - } - - if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER - || pData->nKind == SFX_CFGGROUP_DOCBASICMGR - ) - { - XInterface* xi = static_cast<XInterface *>(pData->pObject); - if (xi != NULL) - { - xi->release(); - } - } - - delete pData; - } - - aArr.Remove( 0, nCount ); - Clear(); -} - -SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName ) -/* Beschreibung - Ermittelt den SvLBoxEntry zu einem "ubergebenen String. Das setzt voraus, da\s - die Namen eindeutig sind. -*/ -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - if ( GetEntryText( pEntry ) == rName ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId ) -/* Beschreibung - Ermittelt den SvLBoxEntry zu einer "ubergebenen Id. -*/ -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pData && pData->nOrd == nId ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -SfxMacroInfo* SfxConfigFunctionListBox_Impl::GetMacroInfo() -/* Beschreibung - Gibt die MacroInfo des selektierten Entry zur"uck ( sofern vorhanden ). -*/ -{ - SvLBoxEntry *pEntry = FirstSelected(); - if ( pEntry ) - { - SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pData && ( pData->nKind == SFX_CFGFUNCTION_MACRO || - pData->nKind == SFX_CFGFUNCTION_SCRIPT ) ) - return (SfxMacroInfo*) pData->pObject; - } - - return 0; -} - -String SfxConfigFunctionListBox_Impl::GetCurCommand() -{ - SvLBoxEntry *pEntry = FirstSelected(); - if (!pEntry) - return String(); - SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if (!pData) - return String(); - return pData->sCommand; -} - -String SfxConfigFunctionListBox_Impl::GetCurLabel() -{ - SvLBoxEntry *pEntry = FirstSelected(); - if (!pEntry) - return String(); - SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if (!pData) - return String(); - if (pData->sLabel.Len()) - return pData->sLabel; - return pData->sCommand; -} - -USHORT SfxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry ) -/* Beschreibung - Gibt die Ordnungsnummer ( SlotId oder Macro-Nummer ) des Eintrags zur"uck. -*/ -{ - SfxGroupInfo_Impl *pData = pEntry ? - (SfxGroupInfo_Impl*) pEntry->GetUserData() : 0; - if ( pData ) - return pData->nOrd; - return 0; -} - -/* -String SfxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry ) -{ - // Information zum selektierten Entry aus den Userdaten holen - SfxGroupInfo_Impl *pInfo = pEntry ? (SfxGroupInfo_Impl*) pEntry->GetUserData(): 0; - if ( pInfo ) - { - switch ( pInfo->nKind ) - { - case SFX_CFGGROUP_FUNCTION : - case SFX_CFGFUNCTION_SLOT : - { - // Eintrag ist eine Funktion, Hilfe aus der Office-Hilfe - USHORT nId = pInfo->nOrd; - String aText = Application::GetHelp()->GetHelpText( nId, this ); - - if ( !aText.Len() ) - aText = SFX_SLOTPOOL().GetSlotHelpText_Impl( nId ); - return aText; - } - - case SFX_CFGGROUP_SCRIPTCONTAINER : - case SFX_CFGFUNCTION_SCRIPT : - case SFX_CFGGROUP_BASICMGR : - case SFX_CFGGROUP_DOCBASICMGR : - case SFX_CFGGROUP_BASICLIB : - case SFX_CFGGROUP_BASICMOD : - case SFX_CFGFUNCTION_MACRO : - { - // Eintrag ist ein Macro, Hilfe aus der MacroInfo - SfxMacroInfo *pMacInfo = (SfxMacroInfo*) pInfo->pObject; - return pMacInfo->GetHelpText(); - } - - case SFX_CFGGROUP_STYLES : - return String(); - } - } - - return String(); -}*/ - -void SfxConfigFunctionListBox_Impl::FunctionSelected() -/* Beschreibung - Setzt die Balloonhelp zur"uck, da diese immer den Helptext des selektierten - Entry anzeigen soll. -*/ -{ - /* --> PB 2004-12-01 #i37000# - no own help text needed any longer - Help::ShowBalloon( this, Point(), String() ); - */ -} - -void SfxConfigFunctionListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles) -{ - pStylesInfo = pStyles; -} - -SfxConfigGroupListBox_Impl::SfxConfigGroupListBox_Impl( - Window* pParent, const ResId& rResId, ULONG nConfigMode ) - : SvTreeListBox( pParent, rResId ) - , nMode( nConfigMode ), bShowSF( FALSE ), bShowBasic( TRUE ), - m_hdImage(ResId(IMG_HARDDISK,*rResId.GetResMgr())), - m_hdImage_hc(ResId(IMG_HARDDISK_HC,*rResId.GetResMgr())), - m_libImage(ResId(IMG_LIB,*rResId.GetResMgr())), - m_libImage_hc(ResId(IMG_LIB_HC,*rResId.GetResMgr())), - m_macImage(ResId(IMG_MACRO,*rResId.GetResMgr())), - m_macImage_hc(ResId(IMG_MACRO_HC,*rResId.GetResMgr())), - m_docImage(ResId(IMG_DOC,*rResId.GetResMgr())), - m_docImage_hc(ResId(IMG_DOC_HC,*rResId.GetResMgr())), - m_sMyMacros(String(ResId(STR_MYMACROS,*rResId.GetResMgr()))), - m_sProdMacros(String(ResId(STR_PRODMACROS,*rResId.GetResMgr()))) -/* Beschreibung - Diese Listbox zeigt alle Funktionsgruppen und Basics an, die zur Konfiguration - zur Verf"ugung stehen. Basics werden noch in Bibliotheken und Module untergliedert. -*/ -{ - aScriptType = String(SfxResId(STR_BASICNAME)); - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); - SetNodeBitmaps( Image( ResId(BMP_COLLAPSED,*rResId.GetResMgr()) ), Image( ResId(BMP_EXPANDED,*rResId.GetResMgr()) ) , BMP_COLOR_NORMAL ); - SetNodeBitmaps( Image( ResId(BMP_COLLAPSED_HC,*rResId.GetResMgr()) ), Image( ResId(BMP_EXPANDED_HC,*rResId.GetResMgr()) ), BMP_COLOR_HIGHCONTRAST ); - - // Check configuration to see whether only Basic macros, - // only Scripting Framework scripts, or both should be listed - Any value; - sal_Bool tmp = false; - - value = ::utl::ConfigManager::GetConfigManager()->GetLocalProperty( - ::rtl::OUString::createFromAscii( - "Office.Scripting/ScriptDisplaySettings/ShowBasic" ) ); - - value >>= tmp; - - if (tmp == sal_True) { - bShowBasic = TRUE; - } - else { - bShowBasic = FALSE; - } - - value = ::utl::ConfigManager::GetConfigManager()->GetLocalProperty( - ::rtl::OUString::createFromAscii( - "Office.Scripting/ScriptDisplaySettings/ShowSF" ) ); - - value >>= tmp; - - if (tmp == sal_True) { - bShowSF = TRUE; - } - else { - bShowSF = FALSE; - } -} - - -SfxConfigGroupListBox_Impl::~SfxConfigGroupListBox_Impl() -{ - ClearAll(); -} - -void SfxConfigGroupListBox_Impl::ClearAll() -{ - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; i++ ) - { - SfxGroupInfo_Impl *pData = aArr[i]; - if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER - || pData->nKind == SFX_CFGGROUP_DOCBASICMGR - ) - { - XInterface* xi = static_cast<XInterface *>(pData->pObject); - if (xi != NULL) - { - xi->release(); - } - } - delete pData; - } - - aArr.Remove( 0, nCount ); - Clear(); -} - -void SfxConfigGroupListBox_Impl::SetScriptType( const String& rScriptType ) -{ - aScriptType = rScriptType; - ULONG nPos=0; - SvLBoxEntry *pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ ); - while ( pEntry ) - { - SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pInfo->nKind == SFX_CFGGROUP_BASICLIB && ( IsExpanded( pEntry ) || pInfo->bWasOpened ) ) - { - Collapse( pEntry ); - SvLBoxEntry *pChild = FirstChild( pEntry ); - while (pChild) - { - GetModel()->Remove( pChild ); - pChild = FirstChild( pEntry ); - } - - Expand( pEntry ); - } - - pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ ); - } -} - -void SfxConfigGroupListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles) -{ - pStylesInfo = pStyles; -} - -String SfxConfigGroupListBox_Impl::GetGroup() -/* Beschreibung - Gibt den Namen der selektierten Funktionsgruppe bzw. des selektierten - Basics zur"uck. -*/ -{ - SvLBoxEntry *pEntry = FirstSelected(); - while ( pEntry ) - { - SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pInfo->nKind == SFX_CFGGROUP_FUNCTION ) - return GetEntryText( pEntry ); - - if ( pInfo->nKind == SFX_CFGGROUP_BASICMGR ) - { - BasicManager *pMgr = (BasicManager*) pInfo->pObject; - return pMgr->GetName(); - } - - if ( pInfo->nKind == SFX_CFGGROUP_DOCBASICMGR ) - { - Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) ); - return ::comphelper::DocumentInfo::getDocumentTitle( xDoc ); - } - - pEntry = GetParent( pEntry ); - } - - return String(); -} - -//----------------------------------------------- -BasicManager* SfxConfigGroupListBox_Impl::GetBasicManager( const SvLBoxEntry& _rEntry ) -{ - BasicManager* pBasMgr = NULL; - - SfxGroupInfo_Impl* pInfo = (SfxGroupInfo_Impl*) _rEntry.GetUserData(); - switch ( pInfo->nKind ) - { - case SFX_CFGGROUP_BASICMGR : - pBasMgr = (BasicManager*) pInfo->pObject; - break; - case SFX_CFGGROUP_DOCBASICMGR : - { - Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) ); - pBasMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc ); - } - break; - } - return pBasMgr; -} - -//----------------------------------------------- -void SfxConfigGroupListBox_Impl::InitModule() -{ - try - { - css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider(m_xFrame, css::uno::UNO_QUERY_THROW); - css::uno::Sequence< sal_Int16 > lGroups = xProvider->getSupportedCommandGroups(); - sal_Int32 c1 = lGroups.getLength(); - sal_Int32 i1 = 0; - - for (i1=0; i1<c1; ++i1) - { - sal_Int16& rGroupID = lGroups[i1]; - ::rtl::OUString sGroupID = ::rtl::OUString::valueOf((sal_Int32)rGroupID); - ::rtl::OUString sGroupName ; - - try - { - m_xModuleCategoryInfo->getByName(sGroupID) >>= sGroupName; - if (!sGroupName.getLength()) - continue; - } - catch(const css::container::NoSuchElementException&) - { continue; } - - SvLBoxEntry* pEntry = InsertEntry(sGroupName, NULL); - SfxGroupInfo_Impl* pInfo = new SfxGroupInfo_Impl(SFX_CFGGROUP_FUNCTION, rGroupID); - pEntry->SetUserData(pInfo); - } - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - {} -} - -//----------------------------------------------- -void SfxConfigGroupListBox_Impl::InitBasic() -{ -} - -//----------------------------------------------- -void SfxConfigGroupListBox_Impl::InitStyles() -{ -} - -//----------------------------------------------- -namespace -{ - //........................................... - /** examines a component whether it supports XEmbeddedScripts, or provides access to such a - component by implementing XScriptInvocationContext. - @return - the model which supports the embedded scripts, or <NULL/> if it cannot find such a - model - */ - static Reference< XModel > lcl_getDocumentWithScripts_throw( const Reference< XInterface >& _rxComponent ) - { - Reference< XEmbeddedScripts > xScripts( _rxComponent, UNO_QUERY ); - if ( !xScripts.is() ) - { - Reference< XScriptInvocationContext > xContext( _rxComponent, UNO_QUERY ); - if ( xContext.is() ) - xScripts.set( xContext->getScriptContainer(), UNO_QUERY ); - } - - return Reference< XModel >( xScripts, UNO_QUERY ); - } - - //........................................... - static Reference< XModel > lcl_getScriptableDocument_nothrow( const Reference< XFrame >& _rxFrame ) - { - Reference< XModel > xDocument; - - // examine our associated frame - try - { - OSL_ENSURE( _rxFrame.is(), "lcl_getScriptableDocument_nothrow: you need to pass a frame to this dialog/tab page!" ); - if ( _rxFrame.is() ) - { - // first try the model in the frame - Reference< XController > xController( _rxFrame->getController(), UNO_SET_THROW ); - xDocument = lcl_getDocumentWithScripts_throw( xController->getModel() ); - - if ( !xDocument.is() ) - { - // if there is no suitable document in the frame, try the controller - xDocument = lcl_getDocumentWithScripts_throw( _rxFrame->getController() ); - } - } - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - - return xDocument; - } -} - -//----------------------------------------------- -void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , - const css::uno::Reference< css::frame::XFrame >& xFrame , - const ::rtl::OUString& sModuleLongName) -{ - SetUpdateMode(FALSE); - ClearAll(); // Remove all old entries from treelist box - - m_xFrame = xFrame; - if ( xSMGR.is()) - { - 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); - - InitModule(); - InitBasic(); - InitStyles(); - } - - /* - - // Verwendet wird der aktuelle Slotpool - if ( nMode ) - { - pSlotPool = pPool ? pPool : &SFX_SLOTPOOL(); - for ( USHORT i=1; i<pSlotPool->GetGroupCount(); i++ ) - { - // Gruppe anw"ahlen ( Gruppe 0 ist intern ) - String aName = pSlotPool->SeekGroup( i ); - const SfxSlot *pSfxSlot = pSlotPool->FirstSlot(); - if ( pSfxSlot ) - { - // Check if all entries are not useable. Don't - // insert a group without any useable function. - sal_Bool bActiveEntries = sal_False; - while ( pSfxSlot ) - { - USHORT nId = pSfxSlot->GetSlotId(); - if ( pSfxSlot->GetMode() & nMode ) - { - bActiveEntries = sal_True; - break; - } - - pSfxSlot = pSlotPool->NextSlot(); - } - - if ( bActiveEntries ) - { - // Wenn Gruppe nicht leer - SvLBoxEntry *pEntry = InsertEntry( aName, NULL ); - SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_FUNCTION, i ); - aArr.Insert( pInfo, aArr.Count() ); - pEntry->SetUserData( pInfo ); - } - } - } - } -*/ - SfxApplication *pSfxApp = SFX_APP(); - if ( bShowBasic ) - { - // Basics einsammeln - pSfxApp->EnterBasicCall(); - String aMacroName(' '); - aMacroName += String(SfxResId(STR_BASICMACROS)); - - // Zuerst AppBasic - BasicManager *pAppBasicMgr = pSfxApp->GetBasicManager(); - BOOL bInsert = TRUE; - /* - if ( pArr ) - { - bInsert = FALSE; - for ( USHORT n=0; n<pArr->Count(); n++ ) - { - if ( *(*pArr)[n] == pSfxApp->GetName() ) - { - bInsert = TRUE; - break; - } - } - } - */ - - if ( bInsert ) - { - pAppBasicMgr->SetName( pSfxApp->GetName() ); - if ( pAppBasicMgr->GetLibCount() ) - { - // Nur einf"ugen, wenn Bibliotheken vorhanden - String aAppBasTitle( SfxResId( STR_HUMAN_APPNAME ) ); - aAppBasTitle += aMacroName; - SvLBoxEntry *pEntry = InsertEntry( aAppBasTitle, 0 ); - SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMGR, 0, pAppBasicMgr ); - // aArr.Insert( pInfo, aArr.Count() ); - pEntry->SetUserData( pInfo ); - pEntry->EnableChildsOnDemand( TRUE ); - // Expand( pEntry ); - } - } - - Reference< XModel > xDoc( lcl_getScriptableDocument_nothrow( m_xFrame ) ); - if ( xDoc.is() ) - { - BasicManager* pBasicMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc ); - if ( pBasicMgr != pAppBasicMgr && pBasicMgr->GetLibCount() ) - { - String sDocTitle( ::comphelper::DocumentInfo::getDocumentTitle( xDoc ) ); - pBasicMgr->SetName( sDocTitle ); - - // Nur einf"ugen, wenn eigenes Basic mit Bibliotheken - SvLBoxEntry *pEntry = InsertEntry( sDocTitle.Append( aMacroName ), NULL ); - xDoc->acquire(); - SfxGroupInfo_Impl *pInfo = - new SfxGroupInfo_Impl( SFX_CFGGROUP_DOCBASICMGR, 0, xDoc.get() ); - pEntry->SetUserData( pInfo ); - pEntry->EnableChildsOnDemand( TRUE ); - } - } - - pSfxApp->LeaveBasicCall(); - } - - OSL_TRACE("** ** About to initialise SF Scripts"); - if ( bShowSF ) - { - OSL_TRACE("** ** bShowSF"); - // Add Scripting Framework entries - Reference< browse::XBrowseNode > rootNode; - Reference< XComponentContext > xCtx; - try - { - Reference < beans::XPropertySet > xProps( - ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); - xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW ); - Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName( - ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW ); - rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) ); - //rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROORGANIZER ) ); - } - catch( Exception& e ) - { - OSL_TRACE(" Caught some exception whilst retrieving browse nodes from factory... Exception: %s", - ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); - // TODO exception handling - } - - - if ( rootNode.is() ) - { - if ( nMode ) - { - //We call acquire on the XBrowseNode so that it does not - //get autodestructed and become invalid when accessed later. - rootNode->acquire(); - - SfxGroupInfo_Impl *pInfo = - new SfxGroupInfo_Impl( SFX_CFGGROUP_SCRIPTCONTAINER, 0, - static_cast<void *>(rootNode.get())); - - String aTitle( SfxResId( STR_DLG_MACROS ) ); - SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); - pNewEntry->SetUserData( pInfo ); - pNewEntry->EnableChildsOnDemand( TRUE ); - aArr.Insert( pInfo, aArr.Count() ); - } - else - { - //We are only showing scripts not slot APIs so skip - //Root node and show location nodes - try { - if ( rootNode->hasChildNodes() ) - { - Sequence< Reference< browse::XBrowseNode > > children = - rootNode->getChildNodes(); - BOOL bIsRootNode = FALSE; - - ::rtl::OUString user = ::rtl::OUString::createFromAscii("user"); - ::rtl::OUString share = ::rtl::OUString::createFromAscii("share"); - if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") )) - { - bIsRootNode = TRUE; - } - - //To mimic current starbasic behaviour we - //need to make sure that only the current document - //is displayed in the config tree. Tests below - //set the bDisplay flag to FALSE if the current - //node is a first level child of the Root and is NOT - //either the current document, user or share - ::rtl::OUString currentDocTitle; - Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) ); - if ( xDocument.is() ) - { - currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument ); - } - - for ( sal_Int32 n = 0; n < children.getLength(); n++ ) - { - Reference< browse::XBrowseNode >& theChild = children[n]; - BOOL bDisplay = TRUE; - ::rtl::OUString uiName = theChild->getName(); - if ( bIsRootNode ) - { - if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) || - theChild->getName().equals( currentDocTitle ) ) ) ) - { - bDisplay=FALSE; - } - else - { - if ( uiName.equals( user ) ) - { - uiName = m_sMyMacros; - } - else if ( uiName.equals( share ) ) - { - uiName = m_sProdMacros; - } - } - } - if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay ) - { - -// We call acquire on the XBrowseNode so that it does not -// get autodestructed and become invalid when accessed later. - theChild->acquire(); - - SfxGroupInfo_Impl* pInfo = - new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER, - 0, static_cast<void *>( theChild.get())); - - Image aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_NORMAL ); - SvLBoxEntry* pNewEntry = - InsertEntry( uiName, NULL); - SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); - SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); - aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_HIGHCONTRAST ); - SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); - SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); - - pNewEntry->SetUserData( pInfo ); - aArr.Insert( pInfo, aArr.Count() ); - - if ( children[n]->hasChildNodes() ) - { - Sequence< Reference< browse::XBrowseNode > > grandchildren = - children[n]->getChildNodes(); - - for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ ) - { - if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) - { - pNewEntry->EnableChildsOnDemand( TRUE ); - m = grandchildren.getLength(); - } - } - } - } - } - } - } - catch (RuntimeException&) { - // do nothing, the entry will not be displayed in the UI - } - } - } - } - - // add styles - if ( m_xSMGR.is() ) - { - String sStyle( SfxResId( STR_GROUP_STYLES ) ); - SvLBoxEntry *pEntry = InsertEntry( sStyle, 0 ); - SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, 0 ); // TODO last parameter should contain user data - aArr.Insert( pInfo, aArr.Count() ); - pEntry->SetUserData( pInfo ); - pEntry->EnableChildsOnDemand( TRUE ); - } - - MakeVisible( GetEntry( 0,0 ) ); - SetUpdateMode( TRUE ); -} -Image SfxConfigGroupListBox_Impl::GetImage( Reference< browse::XBrowseNode > node, Reference< XComponentContext > xCtx, bool bIsRootNode, bool bHighContrast ) -{ - Image aImage; - if ( bIsRootNode ) - { - ::rtl::OUString user = ::rtl::OUString::createFromAscii("user"); - ::rtl::OUString share = ::rtl::OUString::createFromAscii("share"); - if (node->getName().equals( user ) || node->getName().equals(share ) ) - { - if( bHighContrast == BMP_COLOR_NORMAL ) - aImage = m_hdImage; - else - aImage = m_hdImage_hc; - } - else - { - ::rtl::OUString factoryURL; - ::rtl::OUString nodeName = node->getName(); - Reference<XInterface> xDocumentModel = getDocumentModel(xCtx, nodeName ); - if ( xDocumentModel.is() ) - { - Reference< ::com::sun::star::frame::XModuleManager > - xModuleManager( - xCtx->getServiceManager() - ->createInstanceWithContext( - ::rtl::OUString::createFromAscii("" // xxx todo - "com.sun.star.frame.ModuleManager"), - xCtx ), - UNO_QUERY_THROW ); - Reference<container::XNameAccess> xModuleConfig( - xModuleManager, UNO_QUERY_THROW ); - // get the long name of the document: - ::rtl::OUString appModule( xModuleManager->identify( - xDocumentModel ) ); - Sequence<beans::PropertyValue> moduleDescr; - Any aAny = xModuleConfig->getByName(appModule); - if( sal_True != ( aAny >>= moduleDescr ) ) - { - throw RuntimeException(::rtl::OUString::createFromAscii("SFTreeListBox::Init: failed to get PropertyValue"), Reference< XInterface >()); - } - beans::PropertyValue const * pmoduleDescr = - moduleDescr.getConstArray(); - for ( sal_Int32 pos = moduleDescr.getLength(); pos--; ) - { - if (pmoduleDescr[ pos ].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( - "ooSetupFactoryEmptyDocumentURL") )) - { - pmoduleDescr[ pos ].Value >>= factoryURL; - OSL_TRACE("factory url for doc images is %s", - ::rtl::OUStringToOString( factoryURL , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); - break; - } - } - } - if( factoryURL.getLength() > 0 ) - { - if( bHighContrast == BMP_COLOR_NORMAL ) - aImage = SvFileInformationManager::GetFileImage( - INetURLObject(factoryURL), false, - BMP_COLOR_NORMAL ); - else - aImage = SvFileInformationManager::GetFileImage( - INetURLObject(factoryURL), false, - BMP_COLOR_HIGHCONTRAST ); - } - else - { - if( bHighContrast == BMP_COLOR_NORMAL ) - aImage = m_docImage; - else - aImage = m_docImage_hc; - } - } - } - else - { - if( node->getType() == browse::BrowseNodeTypes::SCRIPT ) - { - if( bHighContrast == BMP_COLOR_NORMAL ) - aImage = m_macImage; - else - aImage = m_macImage_hc; - } - else - { - if( bHighContrast == BMP_COLOR_NORMAL ) - aImage = m_libImage; - else - aImage = m_libImage_hc; - } - } - return aImage; -} - -Reference< XInterface > -SfxConfigGroupListBox_Impl::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName ) -{ - Reference< XInterface > xModel; - Reference< lang::XMultiComponentFactory > mcf = - xCtx->getServiceManager(); - Reference< frame::XDesktop > desktop ( - mcf->createInstanceWithContext( - ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx ), - UNO_QUERY ); - - Reference< container::XEnumerationAccess > componentsAccess = - desktop->getComponents(); - Reference< container::XEnumeration > components = - componentsAccess->createEnumeration(); - while (components->hasMoreElements()) - { - Reference< frame::XModel > model( - components->nextElement(), UNO_QUERY ); - if ( model.is() ) - { - ::rtl::OUString sTdocUrl = - ::comphelper::DocumentInfo::getDocumentTitle( model ); - if( sTdocUrl.equals( docName ) ) - { - xModel = model; - break; - } - } - } - return xModel; -} - -::rtl::OUString SfxConfigGroupListBox_Impl::parseLocationName( const ::rtl::OUString& location ) -{ - // strip out the last leaf of location name - // e.g. file://dir1/dir2/Blah.sxw - > Blah.sxw - ::rtl::OUString temp = location; - sal_Int32 lastSlashIndex = temp.lastIndexOf( ::rtl::OUString::createFromAscii( "/" ) ); - - if ( ( lastSlashIndex + 1 ) < temp.getLength() ) - { - temp = temp.copy( lastSlashIndex + 1 ); - } - // maybe we should throw here!!! - else - { - OSL_TRACE("Something wrong with name, perhaps we should throw an exception"); - } - return temp; -} - -//----------------------------------------------- -::rtl::OUString SfxConfigGroupListBox_Impl::MapCommand2UIName(const ::rtl::OUString& sCommand) -{ - ::rtl::OUString sUIName; - try - { - css::uno::Reference< css::container::XNameAccess > xModuleConf; - m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf; - if (xModuleConf.is()) - { - ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand)); - sUIName = lProps.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("Name"), ::rtl::OUString()); - } - } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(css::uno::Exception&) - { sUIName = ::rtl::OUString(); } - - // fallback for missing UINames !? - if (!sUIName.getLength()) - { - sUIName = sCommand; - /* - #if OSL_DEBUG_LEVEL > 1 - ::rtl::OUStringBuffer sMsg(256); - sMsg.appendAscii("There is no UIName for the internal command \""); - sMsg.append (sCommand ); - sMsg.appendAscii("\". The UI will be invalid then ..." ); - OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr()); - #endif - */ - } - - return sUIName; -} - -//----------------------------------------------- -void SfxConfigGroupListBox_Impl::GroupSelected() -/* Beschreibung - Eine Funktionsgruppe oder eine Basicmodul wurde selektiert. Alle Funktionen bzw. - Macros werden in der Functionlistbox anzeigt. -*/ -{ - SvLBoxEntry *pEntry = FirstSelected(); - SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - pFunctionListBox->SetUpdateMode(FALSE); - pFunctionListBox->ClearAll(); - if ( pInfo->nKind != SFX_CFGGROUP_FUNCTION && - pInfo->nKind != SFX_CFGGROUP_BASICMOD && - pInfo->nKind != SFX_CFGGROUP_SCRIPTCONTAINER && - pInfo->nKind != SFX_CFGGROUP_STYLES ) - { - pFunctionListBox->SetUpdateMode(TRUE); - return; - } - - switch ( pInfo->nKind ) - { - case SFX_CFGGROUP_FUNCTION : - { - USHORT nGroup = pInfo->nOrd; - css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider (m_xFrame, css::uno::UNO_QUERY_THROW); - css::uno::Sequence< css::frame::DispatchInformation > lCommands = xProvider->getConfigurableDispatchInformation(nGroup); - sal_Int32 c = lCommands.getLength(); - sal_Int32 i = 0; - - for (i=0; i<c; ++i) - { - const css::frame::DispatchInformation& rInfo = lCommands[i]; - ::rtl::OUString sUIName = MapCommand2UIName(rInfo.Command); - SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry(sUIName, NULL); - SfxGroupInfo_Impl* pGrpInfo = new SfxGroupInfo_Impl(SFX_CFGFUNCTION_SLOT, 0); - pGrpInfo->sCommand = rInfo.Command; - pGrpInfo->sLabel = sUIName; - pFuncEntry->SetUserData(pGrpInfo); - } - - break; - } - - case SFX_CFGGROUP_BASICMOD : - { - SvLBoxEntry *pLibEntry = GetParent( pEntry ); - SfxGroupInfo_Impl *pLibInfo = - (SfxGroupInfo_Impl*) pLibEntry->GetUserData(); - SvLBoxEntry *pBasEntry = GetParent( pLibEntry ); - SfxGroupInfo_Impl *pBasInfo = - (SfxGroupInfo_Impl*) pBasEntry->GetUserData(); - - StarBASIC *pLib = (StarBASIC*) pLibInfo->pObject; - Reference< XModel > xDoc; - if ( pBasInfo->nKind == SFX_CFGGROUP_DOCBASICMGR ) - xDoc = static_cast< XModel* >( pBasInfo->pObject ); - - SbModule *pMod = (SbModule*) pInfo->pObject; - for ( USHORT nMeth=0; nMeth < pMod->GetMethods()->Count(); nMeth++ ) - { - SbxMethod *pMeth = (SbxMethod*)pMod->GetMethods()->Get(nMeth); - SfxMacroInfoPtr pInf = new SfxMacroInfo( !xDoc.is(), - pLib->GetName(), - pMod->GetName(), - pMeth->GetName()); - if ( pMeth->GetInfo() ) - pInf->SetHelpText( pMeth->GetInfo()->GetComment() ); - USHORT nId = SFX_APP()->GetMacroConfig()->GetSlotId( pInf ); - if ( !nId ) - break; // Kein Slot mehr frei - - SvLBoxEntry* pFuncEntry = - pFunctionListBox->InsertEntry( pMeth->GetName(), NULL ); - SfxGroupInfo_Impl *pGrpInfo = - new SfxGroupInfo_Impl( SFX_CFGFUNCTION_MACRO, nId, pInf ); - pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() ); - pFuncEntry->SetUserData( pGrpInfo ); - } - - break; - } - - case SFX_CFGGROUP_SCRIPTCONTAINER: - { - if ( !GetChildCount( pEntry ) ) - { - Reference< browse::XBrowseNode > rootNode( - reinterpret_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ; - - try { - if ( rootNode->hasChildNodes() ) - { - Sequence< Reference< browse::XBrowseNode > > children = - rootNode->getChildNodes(); - - for ( sal_Int32 n = 0; n < children.getLength(); n++ ) - { - if (children[n]->getType() == browse::BrowseNodeTypes::SCRIPT) - { - ::rtl::OUString uri; - - Reference < beans::XPropertySet >xPropSet( children[n], UNO_QUERY ); - if (!xPropSet.is()) - { - continue; - } - - Any value = - xPropSet->getPropertyValue( String::CreateFromAscii( "URI" ) ); - value >>= uri; - - SfxMacroInfo* aInfo = new SfxMacroInfo( (String)uri ); - aInfo->SetHelpText( uri ); - SFX_APP()->GetMacroConfig()->GetSlotId( aInfo ); - - SfxGroupInfo_Impl* pGrpInfo = - new SfxGroupInfo_Impl(SFX_CFGFUNCTION_SCRIPT, - aInfo->GetSlotId(), aInfo); - - Image aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL ); - SvLBoxEntry* pNewEntry = - pFunctionListBox->InsertEntry( children[n]->getName(), NULL ); - pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); - pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); - aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_HIGHCONTRAST ); - pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); - pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); - - pGrpInfo->sCommand = uri; - pGrpInfo->sLabel = children[n]->getName(); - pNewEntry->SetUserData( pGrpInfo ); - - pFunctionListBox->aArr.Insert( - pGrpInfo, pFunctionListBox->aArr.Count() ); - - } - } - } - } - catch (RuntimeException&) { - // do nothing, the entry will not be displayed in the UI - } - } - break; - } - - case SFX_CFGGROUP_STYLES : - { - SfxStyleInfo_Impl* pFamily = (SfxStyleInfo_Impl*)(pInfo->pObject); - if (pFamily) - { - const ::std::vector< SfxStyleInfo_Impl > lStyles = pStylesInfo->getStyles(pFamily->sFamily); - ::std::vector< SfxStyleInfo_Impl >::const_iterator pIt; - for ( pIt = lStyles.begin(); - pIt != lStyles.end() ; - ++pIt ) - { - SfxStyleInfo_Impl* pStyle = new SfxStyleInfo_Impl(*pIt); - SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry( pStyle->sLabel, NULL ); - SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, pStyle ); - pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() ); - pGrpInfo->sCommand = pStyle->sCommand; - pGrpInfo->sLabel = pStyle->sLabel; - pFuncEntry->SetUserData( pGrpInfo ); - } - } - break; - } - - default: - return; - } - - if ( pFunctionListBox->GetEntryCount() ) - pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) ); - - pFunctionListBox->SetUpdateMode(TRUE); -} - -BOOL SfxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) -{ - BOOL bRet = SvTreeListBox::Expand( pParent ); - if ( bRet ) - { - // Wieviele Entries k"onnen angezeigt werden ? - ULONG nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); - - // Wieviele Kinder sollen angezeigt werden ? - ULONG nChildCount = GetVisibleChildCount( pParent ); - - // Passen alle Kinder und der parent gleichzeitig in die View ? - if ( nChildCount+1 > nEntries ) - { - // Wenn nicht, wenigstens parent ganz nach oben schieben - MakeVisible( pParent, TRUE ); - } - else - { - // An welcher relativen ViewPosition steht der aufzuklappende parent - SvLBoxEntry *pEntry = GetFirstEntryInView(); - ULONG nParentPos = 0; - while ( pEntry && pEntry != pParent ) - { - nParentPos++; - pEntry = GetNextEntryInView( pEntry ); - } - - // Ist unter dem parent noch genug Platz f"ur alle Kinder ? - if ( nParentPos + nChildCount + 1 > nEntries ) - ScrollOutputArea( (short)( nEntries - ( nParentPos + nChildCount + 1 ) ) ); - } - } - - return bRet; -} - -void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) -/* Beschreibung - Ein Basic oder eine Bibliothek werden ge"offnet -*/ -{ - SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); - pInfo->bWasOpened = TRUE; - switch ( pInfo->nKind ) - { - case SFX_CFGGROUP_BASICMGR : - case SFX_CFGGROUP_DOCBASICMGR : - { - if ( !GetChildCount( pEntry ) ) - { - // Erstmaliges "Offnen - BasicManager* pMgr( GetBasicManager( *pEntry ) ); - - SvLBoxEntry *pLibEntry = 0; - for ( USHORT nLib=0; nLib<pMgr->GetLibCount(); nLib++) - { - StarBASIC* pLib = pMgr->GetLib( nLib ); - pLibEntry = InsertEntry( pMgr->GetLibName( nLib ), pEntry ); - SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICLIB, nLib, pLib ); - aArr.Insert( pGrpInfo, aArr.Count() ); - pLibEntry->SetUserData( pGrpInfo ); - pLibEntry->EnableChildsOnDemand( TRUE ); - } - } - - break; - } - - case SFX_CFGGROUP_BASICLIB : - { - if ( !GetChildCount( pEntry ) ) - { - // Erstmaliges "Offnen - StarBASIC *pLib = (StarBASIC*) pInfo->pObject; - if ( !pLib ) - { - // Lib mu\s nachgeladen werden - SvLBoxEntry *pParent = GetParent( pEntry ); - BasicManager *pMgr( GetBasicManager( *pParent ) ); - - if ( pMgr->LoadLib( pInfo->nOrd ) ) - pInfo->pObject = pLib = pMgr->GetLib( pInfo->nOrd ); - else - break; - } - - SvLBoxEntry *pModEntry = 0; - for ( USHORT nMod=0; nMod<pLib->GetModules()->Count(); nMod++ ) - { - SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod ); - - BOOL bIsStarScript = FALSE; //pMod->ISA( SbJScriptModule ); - BOOL bWantsStarScript = aScriptType.EqualsAscii("StarScript"); - if ( bIsStarScript != bWantsStarScript ) - continue; - pModEntry = InsertEntry( pMod->GetName(), pEntry ); - SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMOD, 0, pMod ); - aArr.Insert( pGrpInfo, aArr.Count() ); - pModEntry->SetUserData( pGrpInfo ); - } - } - - break; - } - - case SFX_CFGGROUP_SCRIPTCONTAINER: - { - if ( !GetChildCount( pEntry ) ) - { - Reference< browse::XBrowseNode > rootNode( - reinterpret_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ; - - try { - if ( rootNode->hasChildNodes() ) - { - Sequence< Reference< browse::XBrowseNode > > children = - rootNode->getChildNodes(); - BOOL bIsRootNode = FALSE; - - ::rtl::OUString user = ::rtl::OUString::createFromAscii("user"); - ::rtl::OUString share = ::rtl::OUString::createFromAscii("share"); - if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") )) - { - bIsRootNode = TRUE; - } - - /* To mimic current starbasic behaviour we - need to make sure that only the current document - is displayed in the config tree. Tests below - set the bDisplay flag to FALSE if the current - node is a first level child of the Root and is NOT - either the current document, user or share */ - ::rtl::OUString currentDocTitle; - Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) ); - if ( xDocument.is() ) - { - currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument ); - } - - sal_Int32 nLen = children.getLength(); - for ( sal_Int32 n = 0; n < nLen; n++ ) - { - Reference< browse::XBrowseNode >& theChild = children[n]; - ::rtl::OUString aName( theChild->getName() ); - BOOL bDisplay = TRUE; - if ( bIsRootNode ) - { - if ( !( (aName.equals(user) || aName.equals(share) || aName.equals(currentDocTitle) ) ) ) - bDisplay=FALSE; - } - if ( children[n].is() && children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay ) - { - - /* - We call acquire on the XBrowseNode so that it does not - get autodestructed and become invalid when accessed later. - */ - theChild->acquire(); - - SfxGroupInfo_Impl* pGrpInfo = - new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER, - 0, static_cast<void *>( theChild.get())); - - Image aImage = GetImage( theChild, Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL ); - SvLBoxEntry* pNewEntry = - InsertEntry( theChild->getName(), pEntry ); - SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); - SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); - aImage = GetImage( theChild, Reference< XComponentContext >(), sal_False, BMP_COLOR_HIGHCONTRAST ); - SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); - SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); - - pNewEntry->SetUserData( pGrpInfo ); - aArr.Insert( pGrpInfo, aArr.Count() ); - - if ( children[n]->hasChildNodes() ) - { - Sequence< Reference< browse::XBrowseNode > > grandchildren = - children[n]->getChildNodes(); - - for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ ) - { - if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) - { - pNewEntry->EnableChildsOnDemand( TRUE ); - m = grandchildren.getLength(); - } - } - } - } - } - } - } - catch (RuntimeException&) { - // do nothing, the entry will not be displayed in the UI - } - } - break; - } - - case SFX_CFGGROUP_STYLES: - { - if ( !GetChildCount( pEntry ) ) - { - const ::std::vector< SfxStyleInfo_Impl > lStyleFamilies = pStylesInfo->getStyleFamilies(); - ::std::vector< SfxStyleInfo_Impl >::const_iterator pIt; - for ( pIt = lStyleFamilies.begin(); - pIt != lStyleFamilies.end() ; - ++pIt ) - { - SfxStyleInfo_Impl* pFamily = new SfxStyleInfo_Impl(*pIt); - SvLBoxEntry* pStyleEntry = InsertEntry( pFamily->sLabel, pEntry ); - SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, pFamily ); - aArr.Insert( pGrpInfo, aArr.Count() ); - pStyleEntry->SetUserData( pGrpInfo ); - pStyleEntry->EnableChildsOnDemand( FALSE ); - } - } - break; - } - - default: - DBG_ERROR( "Falscher Gruppentyp!" ); - break; - } -} - -void SfxConfigGroupListBox_Impl::SelectMacro( const SfxMacroInfoItem *pItem ) -{ - SelectMacro( pItem->GetBasicManager()->GetName(), - pItem->GetQualifiedName() ); -} - -void SfxConfigGroupListBox_Impl::SelectMacro( const String& rBasic, - const String& rMacro ) -{ - String aBasicName( rBasic ); - aBasicName += ' '; - aBasicName += String(SfxResId(STR_BASICMACROS)); - String aLib, aModule, aMethod; - USHORT nCount = rMacro.GetTokenCount('.'); - aMethod = rMacro.GetToken( nCount-1, '.' ); - if ( nCount > 2 ) - { - aLib = rMacro.GetToken( 0, '.' ); - aModule = rMacro.GetToken( nCount-2, '.' ); - } - - SvLBoxEntry *pEntry = FirstChild(0); - while ( pEntry ) - { - String aEntryBas = GetEntryText( pEntry ); - if ( aEntryBas == aBasicName ) - { - Expand( pEntry ); - SvLBoxEntry *pLib = FirstChild( pEntry ); - while ( pLib ) - { - String aEntryLib = GetEntryText( pLib ); - if ( aEntryLib == aLib ) - { - Expand( pLib ); - SvLBoxEntry *pMod = FirstChild( pLib ); - while ( pMod ) - { - String aEntryMod = GetEntryText( pMod ); - if ( aEntryMod == aModule ) - { - Expand( pMod ); - MakeVisible( pMod ); - Select( pMod ); - SvLBoxEntry *pMethod = pFunctionListBox->First(); - while ( pMethod ) - { - String aEntryMethod = GetEntryText( pMethod ); - if ( aEntryMethod == aMethod ) - { - pFunctionListBox->Select( pMethod ); - pFunctionListBox->MakeVisible( pMethod ); - return; - } - pMethod = pFunctionListBox->Next( pMethod ); - } - } - pMod = NextSibling( pMod ); - } - } - pLib = NextSibling( pLib ); - } - } - pEntry = NextSibling( pEntry ); - } -} diff --git a/sfx2/source/dialog/cfg.hrc b/sfx2/source/dialog/cfg.hrc deleted file mode 100644 index b89950ec64ad..000000000000 --- a/sfx2/source/dialog/cfg.hrc +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: cfg.hrc,v $ - * $Revision: 1.8 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <sfx2/sfxsids.hrc> - -#define BTN_MN_OK 1 -#define BTN_MN_CANCEL 2 -#define BTN_MN_NEWPOPUP 6 -#define BTN_MN_NEW 7 -#define BTN_MN_CHANGE 8 -#define BTN_MN_REMOVE 9 -#define BOX_MN_ENTRIES 10 -#define TXT_MN_FUNCTIONTEXT 13 -#define TXT_MN_FUNCTIONINFO 14 -#define TXT_MN_DESCRIPTIONTEXT 15 -#define TXT_MN_DESCRIPTIONINFO 16 -#define GRP_MN_MENU 17 -#define TXT_MN_GROUP 18 -#define BOX_MN_GROUP 19 -#define TXT_MN_FUNCTION 20 -#define BOX_MN_FUNCTION 21 -#define GRP_FUNCTIONS 22 -#define BTN_ACC_OK 1 -#define BTN_ACC_CANCEL 2 -#define BTN_ACC_CHANGE 3 -#define BTN_ACC_REMOVE 4 -#define BOX_ACC_ENTRIES 5 -#define TXT_ACC_DESCRIPTIONTEXT 6 -#define TXT_ACC_DESCRIPTIONINFO 7 -#define GRP_ACC_KEYBOARD 8 -#define TXT_ACC_GROUP 9 -#define BOX_ACC_GROUP 10 -#define TXT_ACC_FUNCTION 11 -#define BOX_ACC_FUNCTION 12 -#define TXT_ACC_KEY 13 -#define BOX_ACC_KEY 14 -#define GRP_ACC_FUNCTIONS 15 -#define TAB_CONTROL 12 -#define BOX_STATBAR_ENTRIES 5 -#define TXT_STATBAR_DESCRIPTIONTEXT 6 -#define TXT_STATBAR_DESCRIPTIONINFO 7 -#define GRP_STATBAR 8 -#define BTN_RESET 20 -#define BTN_LOAD 40 -#define BTN_SAVE 41 -#define BTN_MN_UP 42 -#define BTN_MN_DOWN 43 -#define RB_OFFICE 44 -#define RB_MODULE 45 - diff --git a/sfx2/source/dialog/cfg.src b/sfx2/source/dialog/cfg.src deleted file mode 100644 index 1eebc69a21ca..000000000000 --- a/sfx2/source/dialog/cfg.src +++ /dev/null @@ -1,403 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: cfg.src,v $ - * $Revision: 1.47 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include "dialog.hrc" -#include "cfg.hrc" - // pragma ---------------------------------------------------------------- - -#define MASKCOLOR MaskColor = \ - Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; }; - -#define PUSHBUTTON_TEXT_SAVE \ - Text [ en-US ] = "~Save..." ; \ - -#define PUSHBUTTON_TEXT_RESET \ - Text [ en-US ] = "R~eset" ; \ - -#define PUSHBUTTON_TEXT_LOAD \ - Text [ en-US ] = "~Load..." ; \ - -#define PUSHBUTTON_TEXT_REMOVE \ - Text [ en-US ] = "~Delete" ; \ - -#define PUSHBUTTON_TEXT_CHANGE \ - Text [ en-US ] = "~Modify" ; \ - -#define PUSHBUTTON_TEXT_NEW \ - Text [ en-US ] = "~New" ; \ - -#define FIXEDTEXT_TEXT_GROUP \ - Text [ en-US ] = "~Category" ; \ - -#define FIXEDTEXT_TEXT_FUNCTION \ - Text [ en-US ] = "Function" ; \ - -#define GROUPBOX_TEXT_FUNCTIONS \ - Text [ en-US ] = "Functions" ; \ - -String STR_MYMACROS -{ - Text [ en-US ] = "My Macros"; -}; -String STR_PRODMACROS -{ - Text [ en-US ] = "%PRODUCTNAME Macros"; -}; -Image IMG_HARDDISK -{ - ImageBitmap = Bitmap { File = "harddisk_16.bmp" ; }; - MASKCOLOR -}; -Image IMG_HARDDISK_HC -{ - ImageBitmap = Bitmap { File = "harddisk_16_h.bmp" ; }; - MASKCOLOR -}; -Image IMG_LIB -{ - ImageBitmap = Bitmap { File = "im30820.png"; }; - MASKCOLOR -}; -Image IMG_LIB_HC -{ - ImageBitmap = Bitmap { File = "imh30820.png"; }; - MASKCOLOR -}; -Image IMG_MACRO -{ - ImageBitmap = Bitmap { File = "im30821.png"; }; - MASKCOLOR -}; -Image IMG_MACRO_HC -{ - ImageBitmap = Bitmap { File = "imh30821.png"; }; - MASKCOLOR -}; -Image IMG_DOC -{ - ImageBitmap = Bitmap { File = "im30826.png"; }; - MASKCOLOR -}; -Image IMG_DOC_HC -{ - ImageBitmap = Bitmap { File = "imh30826.png"; }; - MASKCOLOR -}; - - // TP_CONFIG_ACCEL ------------------------------------------------------- -TabPage TP_CONFIG_ACCEL -{ - HelpId = HID_CONFIG_ACCEL ; - Hide = TRUE ; - Size = MAP_APPFONT ( 273 , 258 ) ; - RadioButton RB_OFFICE - { - Pos = MAP_APPFONT ( 192 , 6 ) ; - Size = MAP_APPFONT ( 75 , 10 ) ; - Text = "%PRODUCTNAME" ; - }; - RadioButton RB_MODULE - { - Pos = MAP_APPFONT ( 192 , 19 ) ; - Size = MAP_APPFONT ( 75 , 10 ) ; - Text = "$(MODULE)" ; - }; - PushButton BTN_ACC_CHANGE - { - Pos = MAP_APPFONT ( 192 , 35 ) ; - Size = MAP_APPFONT ( 75 , 14 ) ; - TabStop = TRUE ; - PUSHBUTTON_TEXT_CHANGE - }; - PushButton BTN_ACC_REMOVE - { - Pos = MAP_APPFONT ( 192 , 52 ) ; - Size = MAP_APPFONT ( 75 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - PUSHBUTTON_TEXT_REMOVE - }; - FixedLine GRP_ACC_KEYBOARD - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 180 , 8 ) ; - Group = TRUE ; - Text [ en-US ] = "Shortcut keys"; - }; - Control BOX_ACC_ENTRIES - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 174 , 120 ) ; - TabStop = TRUE ; - Group = TRUE ; - HelpId = HID_ACCELCONFIG_LISTBOX ; - }; - FixedLine GRP_ACC_FUNCTIONS - { - Pos = MAP_APPFONT ( 6 , 140 ) ; - Size = MAP_APPFONT ( 258 , 8 ) ; - Group = TRUE ; - GROUPBOX_TEXT_FUNCTIONS - }; - FixedText TXT_ACC_GROUP - { - Pos = MAP_APPFONT ( 12 , 151 ) ; - Size = MAP_APPFONT ( 78 , 8 ) ; - Group = TRUE ; - Left = TRUE ; - FIXEDTEXT_TEXT_GROUP - }; - Control BOX_ACC_GROUP - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 161 ) ; - Size = MAP_APPFONT ( 78 , 91 ) ; - TabStop = TRUE ; - HelpId = HID_CONFIGGROUP_ACC_LISTBOX ; - }; - FixedText TXT_ACC_FUNCTION - { - Pos = MAP_APPFONT ( 93 , 151 ) ; - Size = MAP_APPFONT ( 88 , 8 ) ; - Left = TRUE ; - FIXEDTEXT_TEXT_FUNCTION - }; - Control BOX_ACC_FUNCTION - { - Border = TRUE ; - Pos = MAP_APPFONT ( 93 , 161 ) ; - Size = MAP_APPFONT ( 88 , 91 ) ; - TabStop = TRUE ; - HelpId = HID_CONFIGFUNCTION_ACC_LISTBOX ; - }; - FixedText TXT_ACC_KEY - { - Pos = MAP_APPFONT ( 184 , 151 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "~Keys" ; - Left = TRUE ; - }; - Control BOX_ACC_KEY - { - Border = TRUE ; - Pos = MAP_APPFONT ( 184 , 161 ) ; - Size = MAP_APPFONT ( 80 , 91 ) ; - TabStop = TRUE ; - }; - PushButton BTN_LOAD - { - Pos = MAP_APPFONT ( 192 , 86 ) ; - Size = MAP_APPFONT ( 75 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - PUSHBUTTON_TEXT_LOAD - }; - PushButton BTN_SAVE - { - Pos = MAP_APPFONT ( 192 , 103 ) ; - Size = MAP_APPFONT ( 75 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - PUSHBUTTON_TEXT_SAVE - }; - PushButton BTN_RESET - { - Pos = MAP_APPFONT ( 192 , 120 ) ; - Size = MAP_APPFONT ( 75 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - PUSHBUTTON_TEXT_RESET - }; -}; - // Strings --------------------------------------------------------------- -String STR_NEW -{ - Text [ en-US ] = "New" ; -}; -String STR_OPEN -{ - Text [ en-US ] = "Open" ; -}; -String STR_SAVE -{ - Text [ en-US ] = "Save" ; -}; -String STR_SAVEAS -{ - Text [ en-US ] = "Save As" ; -}; -String STR_PRINT -{ - Text [ en-US ] = "Print" ; -}; -String STR_QUIT -{ - Text [ en-US ] = "Exit" ; -}; -String STR_CUT -{ - Text [ en-US ] = "Cut" ; -}; -String STR_COPY -{ - Text [ en-US ] = "Copy" ; -}; -String STR_PASTE -{ - Text [ en-US ] = "Paste" ; -}; -String STR_DELETE -{ - Text [ en-US ] = "Delete" ; -}; -String STR_FIND -{ - Text [ en-US ] = "Search" ; -}; -String STR_FINDBACKWARD -{ - Text [ en-US ] = "Search backward" ; -}; -String STR_PROPERTIES -{ - Text [ en-US ] = "Properties" ; -}; -String STR_FRONT -{ - Text [ en-US ] = "To front" ; -}; - // MessageBoxes ---------------------------------------------------------- -QueryBox QBX_MNUCFG_UNDEFINED_FUNCTIONS -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_NO ; - Message [ en-US ] = "There are still undefined functions (???).\n\nDo you want to accept the configuration anyway?" ; -}; -QueryBox QBX_MNUCFG_POPUP_FUNCTIONS -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_NO ; - Message [ en-US ] = "There are still entries with functions that can only be assigned to pop-ups.\n\nContinue anyway?" ; -}; -InfoBox IBX_MNUCFG_ALREADY_INCLUDED -{ - Message [ en-US ] = "Function is already included in this popup." ; -}; -String STR_LOADMENUCONFIG -{ - Text [ en-US ] = "Load Menu Configuration" ; -}; -String STR_SAVEMENUCONFIG -{ - Text [ en-US ] = "Save Menu Configuration" ; -}; -String STR_LOADACCELCONFIG -{ - Text [ en-US ] = "Load Keyboard Configuration" ; -}; -String STR_SAVEACCELCONFIG -{ - Text [ en-US ] = "Save Keyboard Configuration" ; -}; -String STR_LOADSTATBARCONFIG -{ - Text [ en-US ] = "Load Status Bar Configuration" ; -}; -String STR_SAVESTATBARCONFIG -{ - Text [ en-US ] = "Save Status Bar Configuration" ; -}; -String STR_MENU -{ - Text [ en-US ] = "Menu" ; -}; -String STR_TOOLBAR_SEPARATOR -{ - Text [ en-US ] = "Separator"; -}; - -String STR_TOOLBAR_SPACE -{ - Text [ en-US ] = "Invisible separator"; -}; - - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc index 1bfed39a9f25..72cc8c659bc4 100644 --- a/sfx2/source/dialog/dialog.hrc +++ b/sfx2/source/dialog/dialog.hrc @@ -61,52 +61,12 @@ #define STR_DELETE_STYLE ( RC_DIALOG_BEGIN + 18) #define STR_DELETE_STYLE_USED ( RC_DIALOG_BEGIN + 20) -#define BMP_COLLAPSED ( RC_DIALOG_BEGIN + 18) -#define BMP_EXPANDED ( RC_DIALOG_BEGIN + 19) -#define TP_CONFIG_ACCEL ( RC_DIALOG_BEGIN + 20) -//#define TP_CONFIG_MENU ( RC_DIALOG_BEGIN + 21) -//#define TP_CONFIG_STATBAR ( RC_DIALOG_BEGIN + 22) -//#define TP_CONFIG_OBJECTBAR ( RC_DIALOG_BEGIN + 31) -//#define TP_CONFIG_EVENT ( RC_DIALOG_BEGIN + 32) -//#define DLG_CONFIG ( RC_DIALOG_BEGIN + 23) - -#define IBX_MNUCFG_ALREADY_INCLUDED ( RC_DIALOG_BEGIN + 24) -#define QBX_MNUCFG_UNDEFINED_FUNCTIONS ( RC_DIALOG_BEGIN + 25) -#define QBX_MNUCFG_POPUP_FUNCTIONS ( RC_DIALOG_BEGIN + 26) - -#define STR_NEW ( RC_DIALOG_BEGIN + 27) -#define STR_OPEN ( RC_DIALOG_BEGIN + 28) -#define STR_SAVE ( RC_DIALOG_BEGIN + 29) -#define STR_SAVEAS ( RC_DIALOG_BEGIN + 30) -#define STR_PRINT ( RC_DIALOG_BEGIN + 32) -#define STR_QUIT ( RC_DIALOG_BEGIN + 33) -#define STR_CUT ( RC_DIALOG_BEGIN + 34) -#define STR_COPY ( RC_DIALOG_BEGIN + 35) -#define STR_PASTE ( RC_DIALOG_BEGIN + 36) -#define STR_DELETE ( RC_DIALOG_BEGIN + 39) -#define STR_FIND ( RC_DIALOG_BEGIN + 41) -#define STR_FINDBACKWARD ( RC_DIALOG_BEGIN + 42) -#define STR_PROPERTIES ( RC_DIALOG_BEGIN + 43) -#define STR_FRONT ( RC_DIALOG_BEGIN + 44) -#define STR_BASICMACROS ( RC_DIALOG_BEGIN + 45) -#define STR_MENU ( RC_DIALOG_BEGIN + 46) -#define STR_DLG_MACROS ( RC_DIALOG_BEGIN + 47) - #define LOGO_IMAGELIST ( RC_DIALOG_BEGIN + 45) #define MN_CONTEXT_TEMPLDLG ( RC_DIALOG_BEGIN + 46) #define MSG_LAYOUT_NOT_LOADING ( RC_DIALOG_BEGIN + 49) #define ACC_LAYOUT_NOT_LOADING ( RC_DIALOG_BEGIN + 50) -#define STR_LOADMENUCONFIG ( RC_DIALOG_BEGIN + 53) -#define STR_SAVEMENUCONFIG ( RC_DIALOG_BEGIN + 54) - -#define STR_LOADACCELCONFIG ( RC_DIALOG_BEGIN + 55) -#define STR_SAVEACCELCONFIG ( RC_DIALOG_BEGIN + 56) - -#define STR_LOADSTATBARCONFIG ( RC_DIALOG_BEGIN + 57) -#define STR_SAVESTATBARCONFIG ( RC_DIALOG_BEGIN + 58) - #define MSG_ERR_CANT_EDIT_OLD_FORMAT ( RC_DIALOG_BEGIN + 60 ) #define MSG_ERR_CANT_EDIT_OPEN_DOCS ( RC_DIALOG_BEGIN + 61 ) @@ -121,8 +81,6 @@ #define STR_INTERNET ( RC_DIALOG_BEGIN + 65 ) #define RID_AUTOHIDE ( RC_DIALOG_BEGIN + 66 ) -#define RID_SFX_TP_MACROASSIGN ( RC_DIALOG_BEGIN + 67 ) - #define DLG_ONLINE_REGISTER ( RC_DIALOG_BEGIN + 68 ) #define DLG_VERSIONS ( RC_DIALOG_BEGIN + 69 ) #define DLG_COMMENTS ( RC_DIALOG_BEGIN + 70 ) @@ -140,14 +98,6 @@ #define RID_ERRBOX_MAIL_CONFIG ( RC_DIALOG_BEGIN + 92 ) -#define STR_TOOLBAR_SEPARATOR ( RC_DIALOG_BEGIN + 93 ) -#define STR_TOOLBAR_SPACE ( RC_DIALOG_BEGIN + 94 ) - -#define STR_BASICNAME ( RC_DIALOG_BEGIN + 96 ) - -#define BMP_COLLAPSED_HC ( RC_DIALOG_BEGIN + 97 ) -#define BMP_EXPANDED_HC ( RC_DIALOG_BEGIN + 98 ) - #define IMG_LST_STYLE_DESIGNER_HC ( RC_DIALOG_BEGIN + 99 ) // 100-106 in tbxcust.hrc @@ -156,17 +106,6 @@ #define RID_DLG_SEARCH ( RC_DIALOG_BEGIN + 109 ) -#define IMG_HARDDISK ( RC_DIALOG_BEGIN + 110 ) -#define IMG_HARDDISK_HC ( RC_DIALOG_BEGIN + 111 ) -#define STR_PRODMACROS ( RC_DIALOG_BEGIN + 112 ) -#define STR_MYMACROS ( RC_DIALOG_BEGIN + 113 ) -#define IMG_LIB ( RC_DIALOG_BEGIN + 114 ) -#define IMG_LIB_HC ( RC_DIALOG_BEGIN + 115 ) -#define IMG_MACRO ( RC_DIALOG_BEGIN + 116 ) -#define IMG_MACRO_HC ( RC_DIALOG_BEGIN + 117 ) -#define IMG_DOC ( RC_DIALOG_BEGIN + 118 ) -#define IMG_DOC_HC ( RC_DIALOG_BEGIN + 119 ) -#define STR_GROUP_STYLES ( RC_DIALOG_BEGIN + 110 ) #define STR_PDF_EXPORT_SEND ( RC_DIALOG_BEGIN + 120 ) #define STR_RECHECK_DOCUMENT ( RC_DIALOG_BEGIN + 121 ) #define IMG_INFO ( RC_DIALOG_BEGIN + 122 ) diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src index 7a212b28bdd3..c50b17436ca6 100644 --- a/sfx2/source/dialog/dialog.src +++ b/sfx2/source/dialog/dialog.src @@ -148,36 +148,6 @@ String STR_DELETE_STYLE_USED { Text [ en-US ] = "You are deleting an applied Style!\n" ; }; -Image BMP_COLLAPSED -{ - ImageBitmap = Bitmap - { - File = "plus.bmp" ; - }; - // MaskColor = Color { Predefine = COL_GREEN ; }; -}; -Image BMP_EXPANDED -{ - ImageBitmap = Bitmap - { - File = "minus.bmp" ; - }; - // MaskColor = Color { Predefine = COL_GREEN ; }; -}; -Image BMP_EXPANDED_HC -{ - ImageBitmap = Bitmap - { - File = "minus_h.bmp" ; - }; -}; -Image BMP_COLLAPSED_HC -{ - ImageBitmap = Bitmap - { - File = "plus_h.bmp" ; - }; -}; Menu MN_CONTEXT_TEMPLDLG { ItemList = @@ -202,14 +172,6 @@ Menu MN_CONTEXT_TEMPLDLG }; }; }; -String STR_BASICMACROS -{ - Text [ en-US ] = "BASIC Macros" ; -}; -String STR_DLG_MACROS -{ - Text [ en-US ] = "%PRODUCTNAME Macros" ; -}; InfoBox MSG_LAYOUT_NOT_LOADING { @@ -292,10 +254,6 @@ String SID_NAVIGATOR { Text [ en-US ] = "Navigator"; }; -String STR_BASICNAME -{ - Text = "%PRODUCTNAME Basic" ; -}; ErrorBox MSG_ERROR_WRONG_CONFIRM { @@ -304,11 +262,6 @@ ErrorBox MSG_ERROR_WRONG_CONFIRM Message [ en-US ] = "Faulty password confirmation"; }; -String STR_GROUP_STYLES -{ - Text [ en-US ] = "Styles" ; -}; - String STR_PDF_EXPORT_SEND { Text [ en-US ] = "Send" ; diff --git a/sfx2/source/dialog/macropg.cxx b/sfx2/source/dialog/macropg.cxx deleted file mode 100644 index 68b979a25440..000000000000 --- a/sfx2/source/dialog/macropg.cxx +++ /dev/null @@ -1,772 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: macropg.cxx,v $ - * $Revision: 1.21 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" -#include <basic/basmgr.hxx> -#ifndef GCC -#endif - -#define ITEMID_MACRO 0 -#include <sfx2/macropg.hxx> -#undef ITEMID_MACRO - -#define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> -#ifndef _SV_MEDIT_HXX -#include <svtools/svmedit.hxx> -#endif - -#include "cfg.hxx" -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include "macropg.hrc" -#include "sfxresid.hxx" -#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 ), - pDeletePB( NULL ), - pStrEvent( NULL ), - pAssignedMacro( NULL ), - pScriptTypeLB( NULL ), - pEventLB( NULL ), - pGroupLB( NULL ), - pFT_MacroLBLabel( NULL ), - pMacroLB( NULL ), - pMacroFT( NULL ), - pMacroStr( NULL ), - fnGetRange( NULL ), - fnGetMacroOfRange( NULL ), - bReadOnly( FALSE ) -{ -} - -_SfxMacroTabPage_Impl::~_SfxMacroTabPage_Impl() -{ - delete pAssignPB; - delete pDeletePB; - delete pStrEvent; - delete pAssignedMacro; - delete pScriptTypeLB; - delete pEventLB; - delete pGroupLB; - delete pMacroLB; - delete pFT_MacroLBLabel; - delete pMacroFT; - delete pMacroStr; -} - - -SvStringsDtor* _ImpGetRangeHdl( _SfxMacroTabPage*, const String& rLanguage ); -SvStringsDtor* _ImpGetMacrosOfRangeHdl( _SfxMacroTabPage*, const String& rLanguage, const String& rRange ); - -static USHORT __FAR_DATA aPageRg[] = { - SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, - 0 -}; - -// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert -static long nTabs[] = - { - 2, // Number of Tabs - 0, 90 - }; - -#define TAB_WIDTH_MIN 10 - -// IDs for items in HeaderBar of EventLB -#define ITEMID_EVENT 1 -#define ITMEID_ASSMACRO 2 - - -#define LB_EVENTS_ITEMPOS 1 -#define LB_MACROS_ITEMPOS 2 - - -IMPL_LINK( _HeaderTabListBox, HeaderEndDrag_Impl, HeaderBar*, pBar ) -{ - (void)pBar; // unused - DBG_ASSERT( pBar == &maHeaderBar, "*_HeaderTabListBox::HeaderEndDrag_Impl: something is wrong here..." ); - - if( !maHeaderBar.GetCurItemId() ) - return 0; - - if( !maHeaderBar.IsItemMode() ) - { - Size aSz; - USHORT nTabsCount = maHeaderBar.GetItemCount(); - long nTmpSz = 0; - long nWidth = maHeaderBar.GetItemSize( ITEMID_EVENT ); - long nBarWidth = maHeaderBar.GetSizePixel().Width(); - - if( nWidth < TAB_WIDTH_MIN ) - maHeaderBar.SetItemSize( ITEMID_EVENT, TAB_WIDTH_MIN ); - else if( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN ) - maHeaderBar.SetItemSize( ITEMID_EVENT, nBarWidth - TAB_WIDTH_MIN ); - - { - for( USHORT i = 1 ; i < nTabsCount ; ++i ) - { - long nItemWidth = maHeaderBar.GetItemSize( i ); - aSz.Width() = nItemWidth + nTmpSz; - nTmpSz += nItemWidth; - maListBox.SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width(), MAP_APPFONT ); - } - } - } - return 1; -} - -long _HeaderTabListBox::Notify( NotifyEvent& rNEvt ) -{ - long nRet = Control::Notify( rNEvt ); - - if( rNEvt.GetWindow() != &maListBox && rNEvt.GetType() == EVENT_GETFOCUS ) - maListBox.GrabFocus(); - - return nRet; -} - -_HeaderTabListBox::_HeaderTabListBox( Window* pParent, const ResId& rId ) : - Control( pParent, rId ), - - maListBox( this, WB_HSCROLL | WB_CLIPCHILDREN ), - maHeaderBar( this, WB_BOTTOMBORDER ) -{ - maListBox.SetHelpId( HID_MACRO_HEADERTABLISTBOX ); -} - -_HeaderTabListBox::~_HeaderTabListBox() -{ -} - -void _HeaderTabListBox::ConnectElements( void ) -{ - // calc pos and size of header bar - Point aPnt( 0, 0 ); - Size aSize( maHeaderBar.CalcWindowSizePixel() ); - Size aCtrlSize( GetOutputSizePixel() ); - aSize.Width() = aCtrlSize.Width(); - maHeaderBar.SetPosSizePixel( aPnt, aSize ); - - // calc pos and size of ListBox - aPnt.Y() += aSize.Height(); - aSize.Height() = aCtrlSize.Height() - aSize.Height(); - maListBox.SetPosSizePixel( aPnt, aSize ); - - // set handler - maHeaderBar.SetEndDragHdl( LINK( this, _HeaderTabListBox, HeaderEndDrag_Impl ) ); - - maListBox.InitHeaderBar( &maHeaderBar ); -} - -void _HeaderTabListBox::Show( BOOL bVisible, USHORT nFlags ) -{ - maListBox.Show( bVisible, nFlags ); - maHeaderBar.Show( bVisible, nFlags ); -} - -void _HeaderTabListBox::Enable( bool bEnable, bool bChild ) -{ - maListBox.Enable( bEnable, bChild ); - maHeaderBar.Enable( bEnable, bChild ); -} - - -String ConvertToUIName_Impl( SvxMacro *pMacro, const String& /*rLanguage*/ ) -{ - String aName( pMacro->GetMacName() ); - String aEntry; - if ( ! pMacro->GetLanguage().EqualsAscii("JavaScript") ) - { - USHORT nCount = aName.GetTokenCount('.'); - aEntry = aName.GetToken( nCount-1, '.' ); - if ( nCount > 2 ) - { - aEntry += '('; - aEntry += aName.GetToken( 0, '.' ); - aEntry += '.'; - aEntry += aName.GetToken( nCount-2, '.' ); - aEntry += ')'; - } - return aEntry; - } - else - return aName; -} - -void _SfxMacroTabPage::EnableButtons( const String& rLangName ) -{ - // Solange die Eventbox leer ist, nichts tun - const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected(); - if ( pE ) - { - // Gebundenes Macro holen - const SvxMacro* pM = aTbl.Get( (USHORT)(ULONG) pE->GetUserData() ); - mpImpl->pDeletePB->Enable( 0 != pM && !mpImpl->bReadOnly ); - - // Bei gleichem ScriptType Zuweisung nur, wenn Macro sich - // ge"andert hat; bei verschiedenem ScriptType, wenn Script nicht leer - String sEventMacro; - sEventMacro = ((SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS ))->GetText(); - if ( rLangName.EqualsAscii("JavaScript") ) - { - DBG_ERROR( "_SfxMacroTabPage::EnableButtons(): this is not an up to date usage!" ); - } - else - { - SfxMacroInfo* pInfo = mpImpl->pMacroLB->GetMacroInfo(); - String sSelMacro; - if ( pInfo ) - sSelMacro = pInfo->GetMacroName(); - if( pM && rLangName != pM->GetLanguage() ) - mpImpl->pAssignPB->Enable( pInfo != 0 && !mpImpl->bReadOnly ); - else - mpImpl->pAssignPB->Enable( pInfo && !mpImpl->bReadOnly && !sSelMacro.EqualsIgnoreCaseAscii( sEventMacro ) ); - } - } -} - -_SfxMacroTabPage::_SfxMacroTabPage( Window* pParent, const ResId& rResId, const SfxItemSet& rAttrSet ) - : SfxTabPage( pParent, rResId, rAttrSet ) - -{ - mpImpl = new _SfxMacroTabPage_Impl; - mpImpl->fnGetRange = &_ImpGetRangeHdl; - mpImpl->fnGetMacroOfRange = &_ImpGetMacrosOfRangeHdl; -} - -_SfxMacroTabPage::~_SfxMacroTabPage() -{ - DELETEZ( mpImpl ); -} - -void _SfxMacroTabPage::AddEvent( const String & rEventName, USHORT nEventId ) -{ - String sTmp( rEventName ); - sTmp += '\t'; - - // falls die Tabelle schon gueltig ist - SvxMacro* pM = aTbl.Get( nEventId ); - if( pM ) - { - String sNew( ConvertToUIName_Impl( pM, mpImpl->pScriptTypeLB->GetSelectEntry() ) ); - sTmp += sNew; - } - - SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().InsertEntry( sTmp ); - pE->SetUserData( reinterpret_cast< void* >( sal::static_int_cast< sal_IntPtr >( nEventId )) ); -} - -void _SfxMacroTabPage::ScriptChanged( const String& aLangName ) -{ - // neue Bereiche und deren Funktionen besorgen - { - mpImpl->pGroupLB->SetScriptType( aLangName ); - mpImpl->pGroupLB->Show(); - mpImpl->pMacroLB->Show(); - mpImpl->pMacroFT->SetText( *mpImpl->pMacroStr ); - } - - EnableButtons( aLangName ); -} - -void _SfxMacroTabPage::SetGetRangeLink( FNGetRangeHdl pFn ) -{ - mpImpl->fnGetRange = pFn; -} - -FNGetRangeHdl _SfxMacroTabPage::GetGetRangeLink() const -{ - return mpImpl->fnGetRange; -} - -void _SfxMacroTabPage::SetGetMacrosOfRangeLink( FNGetMacrosOfRangeHdl pFn ) -{ - mpImpl->fnGetMacroOfRange = pFn; -} - -FNGetMacrosOfRangeHdl _SfxMacroTabPage::GetGetMacrosOfRangeLink() const -{ - return mpImpl->fnGetMacroOfRange; -} - -BOOL _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet ) -{ - SvxMacroItem aItem( GetWhich( aPageRg[0] ) ); - ((SvxMacroTableDtor&)aItem.GetMacroTable()) = aTbl; - - const SfxPoolItem* pItem; - if( SFX_ITEM_SET != GetItemSet().GetItemState( aItem.Which(), TRUE, &pItem ) - || aItem != *(SvxMacroItem*)pItem ) - { - rSet.Put( aItem ); - return TRUE; - } - return FALSE; -} - -void _SfxMacroTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( aPageRg[0] ), TRUE, &pItem )) - aTbl = ((SvxMacroItem*)pItem)->GetMacroTable(); - - FillEvents(); - - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.GetEntry( 0 ); - if( pE ) - rListBox.SetCurEntry( pE ); -} - -void _SfxMacroTabPage::SetReadOnly( BOOL bSet ) -{ - mpImpl->bReadOnly = bSet; -} - -BOOL _SfxMacroTabPage::IsReadOnly() const -{ - return mpImpl->bReadOnly; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.FirstSelected(); - ULONG nPos; - if( !pE || LISTBOX_ENTRY_NOTFOUND == - ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) - { - DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" ); - return 0; - } - - USHORT nEventId = (USHORT)(ULONG)pE->GetUserData(); - String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry(); - - const SvxMacro* pM = pThis->aTbl.Get( nEventId ); - if( pM ) - { - if( aLanguage != pM->GetLanguage() ) - { - pImpl->pScriptTypeLB->SelectEntry( pM->GetLanguage() ); - pThis->ScriptChanged( pM->GetLanguage() ); - } - else - { - DBG_ASSERT( !aLanguage.EqualsAscii("JavaScript"), "_SfxMacroTabPage, SelectEvent_Impl(): outdated use!" ); - } - } - - pThis->EnableButtons( aLanguage ); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox*, EMPTYARG ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - String sSel( pImpl->pGroupLB->GetGroup() ); - String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry(); - if( !aLanguage.EqualsAscii( "JavaScript" ) ) - { - pImpl->pGroupLB->GroupSelected(); - SfxMacroInfo* pMacro = pImpl->pMacroLB->GetMacroInfo(); - String aLabelText; - if( pMacro ) - { - aLabelText = pImpl->maStaticMacroLBLabel; - aLabelText += pMacro->GetModuleName(); - } - else - { - // Wenn dort ein Macro drin ist, wurde es selektiert und der - // AssignButton schon in SelectMacro richtig enabled - pImpl->pAssignPB->Enable( FALSE ); - } - - pImpl->pFT_MacroLBLabel->SetText( aLabelText ); - } - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox*, EMPTYARG ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - pImpl->pMacroLB->FunctionSelected(); - pThis->EnableButtons( pImpl->pScriptTypeLB->GetSelectEntry() ); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit*, EMPTYARG ) -{ - pThis->EnableButtons( DEFINE_CONST_UNICODE("JavaScript") ); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.FirstSelected(); - ULONG nPos; - if( !pE || LISTBOX_ENTRY_NOTFOUND == - ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) - { - DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" ); - return 0; - } - - const BOOL bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled(); - - // aus der Tabelle entfernen - USHORT nEvent = (USHORT)(ULONG)pE->GetUserData(); - SvxMacro *pRemoveMacro = pThis->aTbl.Remove( nEvent ); - delete pRemoveMacro; - - String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry(); - String sNew; - if( bAssEnabled ) - { - String sGroup; - String sMacro; - String aEntryText( sNew ); - DBG_ASSERT( !aLanguage.EqualsAscii("JavaScript"), "_SfxMacroTabPage, AssignDeleteHdl_Impl(): outdated use!" ); - - SfxMacroInfo* pMacro = pImpl->pMacroLB->GetMacroInfo(); - sMacro = pMacro->GetQualifiedName(); - sGroup = pImpl->pGroupLB->GetGroup(); - sNew = pMacro->GetMacroName(); - - if( sMacro.CompareToAscii( "vnd.sun.star.script:", 20 ) == COMPARE_EQUAL ) - { - OSL_TRACE("ASSIGN_DELETE: Its a script"); - pThis->aTbl.Insert( - nEvent, new SvxMacro( sMacro, String::CreateFromAscii("Script") ) ); - } - else - { - OSL_TRACE("ASSIGN_DELETE: Its a basic macro"); - String sBasicName(SfxResId(STR_BASICNAME)); - if ( aLanguage == sBasicName ) - pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, sGroup, STARBASIC ) ); - else - pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, aLanguage ) ); - } - } - - pImpl->pEventLB->SetUpdateMode( FALSE ); - pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS ); - rListBox.GetModel()->InvalidateEntry( pE ); - rListBox.Select( pE ); - rListBox.MakeVisible( pE ); - rListBox.SetUpdateMode( TRUE ); - - pThis->EnableButtons( aLanguage ); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton*, EMPTYARG ) -{ - pThis->ScriptChanged( pThis->mpImpl->pScriptTypeLB->GetSelectEntry() ); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer*, EMPTYARG ) -{ - // FillMacroList() can take a long time -> show wait cursor and disable input - SfxTabDialog* pTabDlg = pThis->GetTabDialog(); - // perhaps the tabpage is part of a SingleTabDialog then pTabDlg == NULL - if ( pTabDlg ) - { - pTabDlg->EnterWait(); - pTabDlg->EnableInput( FALSE ); - } - pThis->FillMacroList(); - if ( pTabDlg ) - { - pTabDlg->EnableInput( TRUE ); - pTabDlg->LeaveWait(); - } - return 0; -} - -void _SfxMacroTabPage::InitAndSetHandler() -{ - // Handler installieren - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - HeaderBar& rHeaderBar = mpImpl->pEventLB->GetHeaderBar(); - Link aLnk(STATIC_LINK(this, _SfxMacroTabPage, AssignDeleteHdl_Impl )); - mpImpl->pMacroLB->SetDoubleClickHdl( aLnk ); - mpImpl->pDeletePB->SetClickHdl( aLnk ); - mpImpl->pAssignPB->SetClickHdl( aLnk ); - rListBox.SetDoubleClickHdl( aLnk ); - - rListBox.SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectEvent_Impl )); - mpImpl->pGroupLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectGroup_Impl )); - mpImpl->pMacroLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectMacro_Impl )); - - mpImpl->pScriptTypeLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, ChangeScriptHdl_Impl )); - - rListBox.SetSelectionMode( SINGLE_SELECTION ); - rListBox.SetTabs( &nTabs[0], MAP_APPFONT ); - Size aSize( nTabs[ 2 ], 0 ); - rHeaderBar.InsertItem( ITEMID_EVENT, *mpImpl->pStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); - aSize.Width() = 1764; // don't know what, so 42^2 is best to use... - rHeaderBar.InsertItem( ITMEID_ASSMACRO, *mpImpl->pAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); - rListBox.SetSpaceBetweenEntries( 0 ); - - mpImpl->pEventLB->Show(); - mpImpl->pEventLB->ConnectElements(); - - mpImpl->pEventLB->Enable( TRUE ); - mpImpl->pGroupLB->Enable( TRUE ); - mpImpl->pMacroLB->Enable( TRUE ); - - mpImpl->pScriptTypeLB->SetDropDownLineCount( 3 ); - String sBasicName(SfxResId(STR_BASICNAME)); - mpImpl->pScriptTypeLB->InsertEntry( sBasicName ); - mpImpl->pScriptTypeLB->SelectEntry( sBasicName ); - - mpImpl->pGroupLB->SetFunctionListBox( mpImpl->pMacroLB ); - - mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) ); - mpImpl->maFillGroupTimer.SetTimeout( 0 ); - mpImpl->maFillGroupTimer.Start(); -} - -void _SfxMacroTabPage::FillMacroList() -{ - String aLanguage = mpImpl->pScriptTypeLB->GetSelectEntry(); - if( ! aLanguage.EqualsAscii("JavaScript") ) - { - // 2 Listboxen - SvStringsDtor* pArr = (*mpImpl->fnGetRange)( this, String(SfxResId(STR_BASICNAME)) ); - if( pArr ) - { - mpImpl->pGroupLB->Init( - ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >(), - GetFrame(), - ::rtl::OUString() ); - - delete pArr; - } - } -} - -void _SfxMacroTabPage::FillEvents() -{ - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - - String aLanguage = mpImpl->pScriptTypeLB->GetSelectEntry(); - ULONG nEntryCnt = rListBox.GetEntryCount(); - - // Events aus der Tabelle holen und die EventListBox entsprechen fuellen - for( ULONG n = 0 ; n < nEntryCnt ; ++n ) - { - SvLBoxEntry* pE = rListBox.GetEntry( n ); - if( pE ) - { - SvLBoxString* pLItem = ( SvLBoxString* ) pE->GetItem( LB_MACROS_ITEMPOS ); - DBG_ASSERT( pLItem && SV_ITEM_ID_LBOXSTRING == pLItem->IsA(), "_SfxMacroTabPage::FillEvents(): no LBoxString" ); - - String sOld( pLItem->GetText() ); - String sNew; - USHORT nEventId = ( USHORT ) ( ULONG ) pE->GetUserData(); - if( aTbl.IsKeyValid( nEventId ) ) - sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ), aLanguage ); - - if( sOld != sNew ) - { - pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS ); - rListBox.GetModel()->InvalidateEntry( pE ); - } - } - } -} - -void _SfxMacroTabPage::SelectEvent( const String & /*rEventName*/, USHORT nEventId ) -{ - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - ULONG nEntryCnt = rListBox.GetEntryCount(); - - for( ULONG n = 0 ; n < nEntryCnt ; ++n ) - { - SvLBoxEntry* pE = rListBox.GetEntry( n ); - if( pE && ( USHORT ) ( ULONG ) pE->GetUserData() == nEventId ) - { - rListBox.SetCurEntry( pE ); - rListBox.MakeVisible( pE ); - break; - } - } -} - - -SvStringsDtor* __EXPORT _ImpGetRangeHdl( _SfxMacroTabPage* /*pTbPg*/, const String& rLanguage ) -{ - SvStringsDtor* pNew = new SvStringsDtor; - SfxApplication* pSfxApp = SFX_APP(); - - if ( !rLanguage.EqualsAscii("JavaScript") ) - { - pSfxApp->EnterBasicCall(); - - // AppBasic einf"ugen - String* pNewEntry = new String( pSfxApp->GetName() ); - pNew->Insert( pNewEntry, pNew->Count() ); - - // Aktuelles Dokument - SfxObjectShell* pDoc = SfxObjectShell::Current(); - if ( pDoc ) - { - String aTitle = pDoc->GetTitle(); - - // Hack f"ur Aufruf aus der Basic-IDE : das Basic ermitteln, das - // gerade bearbeitet wird - - String aAppName(DEFINE_CONST_UNICODE("BASIC - ")); - USHORT nLen = aAppName.Len(); - if ( aTitle.CompareIgnoreCaseToAscii( aAppName, nLen ) == COMPARE_EQUAL ) - { - // Basic-Namensprefix entfernen - aTitle.Erase( 0, nLen ); - USHORT nIndex=0, nCount=aTitle.GetTokenCount('.'); - if ( nCount > 1 ) - { - // Namen der Library entfernen - aTitle.GetToken( nCount-2, '.', nIndex ); - aTitle.Erase( nIndex-1 ); - } - - // Wenn das App-Basic gerade in der Basic-IDE bearbeitet wird, kein - // Dokument verwenden - pDoc = SfxObjectShell::GetFirst(); - while( pDoc ) - { - if ( aTitle == pDoc->GetTitle() ) - break; - pDoc = SfxObjectShell::GetNext( *pDoc ); - } - } - - if ( pDoc && pDoc->GetBasicManager() != SFX_APP()->GetBasicManager() && - pDoc->GetBasicManager()->GetLibCount() ) - { - pNewEntry = new String( aTitle ); - pNew->Insert( pNewEntry, pNew->Count() ); - } - } - - pSfxApp->LeaveBasicCall(); - } - - return pNew; -} - -// besorgen der Funktionen eines Bereiches -SvStringsDtor* __EXPORT _ImpGetMacrosOfRangeHdl( - _SfxMacroTabPage* /*pTbPg*/, - const String& /*rLanguage*/, - const String& /*rRange*/ ) -{ - SvStringsDtor* pNew = new SvStringsDtor; - return pNew; -} - - -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 ) ); - mpImpl->pAssignedMacro = new String( SfxResId( STR_ASSMACRO ) ); - mpImpl->pEventLB = new _HeaderTabListBox( this, SfxResId( LB_EVENT ) ); - mpImpl->pAssignPB = new PushButton( this, SfxResId( PB_ASSIGN ) ); - mpImpl->pDeletePB = new PushButton( this, SfxResId( PB_DELETE ) ); - mpImpl->pScriptTypeLB = new ListBox(this, SfxResId( LB_SCRIPTTYPE ) ); - mpImpl->pScriptTypeLB->Hide(); - mpImpl->pMacroFT = new FixedText( this, SfxResId( FT_MACRO ) ); - mpImpl->pGroupLB = new SfxConfigGroupListBox_Impl( this, SfxResId( LB_GROUP ) ); - mpImpl->pFT_MacroLBLabel = new FixedText( this, SfxResId( FT_LABEL4LB_MACROS ) ); - mpImpl->maStaticMacroLBLabel= mpImpl->pFT_MacroLBLabel->GetText(); - mpImpl->pMacroLB = new SfxConfigFunctionListBox_Impl( this, SfxResId( LB_MACROS ) ); - mpImpl->pMacroStr = new String( SfxResId( STR_MACROS ) ); - - FreeResource(); - - SetFrame( rxDocumentFrame ); - - InitAndSetHandler(); - - ScriptChanged( String( SfxResId( STR_BASICNAME ) ) ); -} - -SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) -{ - return new SfxMacroTabPage( pParent, SfxResId( RID_SFX_TP_MACROASSIGN), NULL, rAttrSet ); -} - - -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 ) -{ - SfxTabPage* pPage = SfxMacroTabPage::Create( this, rSet ); - pPage->SetFrame( rxDocumentFrame ); - SetTabPage( pPage ); -} - -SfxMacroAssignDlg::~SfxMacroAssignDlg() -{ -} - - diff --git a/sfx2/source/dialog/macropg.hrc b/sfx2/source/dialog/macropg.hrc deleted file mode 100644 index f3e1a0de40a8..000000000000 --- a/sfx2/source/dialog/macropg.hrc +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: macropg.hrc,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _MACROPG_HRC -#define _MACROPG_HRC - -#ifndef _SVT_CONTROLDIMS_HRC_ -#include <svtools/controldims.hrc> -#endif - -#define LB_EVENT 2 -#define PB_ASSIGN 3 -#define PB_DELETE 4 -#define FT_MACRO 5 -#define LB_GROUP 6 -#define LB_MACROS 7 -#define LB_SCRIPTTYPE 8 -#define FT_LABEL4LB_MACROS 9 -#define STR_JAVASCRIPT 10 -#define STR_MACROS 11 -#define ED_JAVASCRIPT 12 -#define STR_EVENT 13 -#define STR_ASSMACRO 14 - - -// COL0<---------------WIDTH_1_2--------------->COL3<->COL4<----WIDTH4---->COL5 -// <--WIDTH1-->COL1<-SPACE1->COL2<--WIDTH2-> - -#define WIDTH_TP 260 // of whole tabpage -#define COL5 (WIDTH_TP-RSC_SP_DLG_INNERBORDER_RIGHT) -#define COL4 (COL5-RSC_CD_PUSHBUTTON_WIDTH) -#define COL3 (COL4-RSC_SP_CTRL_X) -#define COL0 (RSC_SP_TBPG_INNERBORDER_LEFT) -#define WIDTH1_2 (COL3-COL0) // width of upper listbox -#define SPACE1 4 // space between lower listboxes -#define WIDTH1 ((WIDTH1_2-SPACE1)/2) // width of lower left listbox -#define WIDTH2 (WIDTH1_2-WIDTH1-SPACE1) // width of lower right listbox -#define COL1 (COL0+WIDTH1) -#define COL2 (COL1+SPACE1) - -#define HEIGHT_TP 185 // of whole tabpage -#define HEIGHT0 62 // of upper listbox -#define ROW0 6 // more than RSC_SP_FLGR_INNERBORDER_TOP cause of bad design -#define ROW1 (ROW0+RSC_CD_PUSHBUTTON_HEIGHT) // Assign button -#define ROW2 (ROW1+RSC_SP_CTRL_GROUP_Y) -#define ROW3 (ROW2+RSC_CD_PUSHBUTTON_HEIGHT) // Remove button -#define ROW4 (ROW3+RSC_SP_CTRL_GROUP_Y) -#define ROW5 (ROW4+RSC_CD_DROPDOWN_HEIGHT) // script type listbox (hidden) -#define ROW6 (ROW0+HEIGHT0) -#define ROW7 (ROW6+RSC_SP_CTRL_Y) -#define HEIGHT_EXTRA7 (RSC_CD_FIXEDTEXT_HEIGHT) // additional height for FT_LABEL4LB_MACROS -#define ROW7A (ROW7+HEIGHT_EXTRA7) -#define ROW8 (ROW7+RSC_CD_FIXEDTEXT_HEIGHT+HEIGHT_EXTRA7)// label for lower listboxes (2 lines!) -#define ROW9 (HEIGHT_TP-RSC_SP_TBPG_INNERBORDER_BOTTOM) -#define HEIGHT8 (ROW9-ROW8) // of lower listboxes - -#endif - diff --git a/sfx2/source/dialog/macropg.src b/sfx2/source/dialog/macropg.src deleted file mode 100644 index 31a4ba0f7023..000000000000 --- a/sfx2/source/dialog/macropg.src +++ /dev/null @@ -1,144 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: macropg.src,v $ - * $Revision: 1.39 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "macropg.hrc" -#include "dialog.hrc" -#include "helpid.hrc" -TabPage RID_SFX_TP_MACROASSIGN -{ - // HelpID = HID_MACROASSIGN ; - Hide = TRUE ; - SVLook = TRUE ; - DialogControl = TRUE ; - Size = MAP_APPFONT ( WIDTH_TP , HEIGHT_TP ) ; - Text [ en-US ] = "Assign Macro" ; - String STR_EVENT - { - Text [ en-US ] = "Event" ; - }; - String STR_ASSMACRO - { - Text [ en-US ] = "Assigned macro"; - }; - Control LB_EVENT - { - Border = TRUE ; - Pos = MAP_APPFONT ( COL0 , ROW0 ) ; - Size = MAP_APPFONT ( WIDTH1_2 , HEIGHT0 ) ; - TabStop = TRUE ; - DialogControl = TRUE ; - ClipChildren = TRUE ; - Disable = TRUE ; - Group = TRUE ; - HelpID = HID_MACRO_LB_EVENT ; - }; - FixedText FT_MACRO - { - Pos = MAP_APPFONT ( COL0 , ROW7A ) ; - Size = MAP_APPFONT ( WIDTH1 , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Group = TRUE ; - }; - Control LB_GROUP - { - Border = TRUE ; - Pos = MAP_APPFONT ( COL0 , ROW8 ) ; - Size = MAP_APPFONT ( WIDTH1 , HEIGHT8 ) ; - TabStop = TRUE ; - Group = TRUE ; - HelpId = HID_MACRO_GROUP ; - }; - FixedText FT_LABEL4LB_MACROS - { - Pos = MAP_APPFONT ( COL2 , ROW7 ) ; - Size = MAP_APPFONT ( WIDTH1 , RSC_CD_FIXEDTEXT_HEIGHT + HEIGHT_EXTRA7 ) ; - WordBreak = TRUE; - Text [ en-US ] = "~Existing macros in:\n" ; - }; - Control LB_MACROS - { - Border = TRUE ; - Pos = MAP_APPFONT ( COL2 , ROW8 ) ; - Size = MAP_APPFONT ( WIDTH2 , HEIGHT8 ) ; - TabStop = TRUE ; - HelpId = HID_MACRO_MACROS ; - }; - PushButton PB_ASSIGN - { - Pos = MAP_APPFONT ( COL4 , ROW0 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - // ### ACHTUNG: Neuer Text in Resource? Z~uweisen : Zuweisen - Disable = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "~Assign" ; - }; - PushButton PB_DELETE - { - Pos = MAP_APPFONT ( COL4 , ROW2 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - Disable = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "~Remove" ; - }; - ListBox LB_SCRIPTTYPE - { - Pos = MAP_APPFONT ( COL4 , ROW4 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , 60 ) ; - // en-US was missing - Text [ en-US ] = "~Scripting Language" ; - TabStop = TRUE ; - Disable = FALSE ; - DropDown = TRUE ; - }; - String STR_MACROS - { - Text [ en-US ] = "Macros" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - diff --git a/sfx2/source/dialog/makefile.mk b/sfx2/source/dialog/makefile.mk index 58c74680cdd2..230bbe432aea 100644 --- a/sfx2/source/dialog/makefile.mk +++ b/sfx2/source/dialog/makefile.mk @@ -41,8 +41,6 @@ TARGET=dialog # --- Files -------------------------------------------------------------- EXCEPTIONSFILES=\ - $(SLO)$/acccfg.obj \ - $(SLO)$/cfg.obj \ $(SLO)$/filedlghelper.obj \ $(SLO)$/filtergrouping.obj \ $(SLO)$/itemconnect.obj \ @@ -60,7 +58,6 @@ SLOFILES =\ $(SLO)$/basedlgs.obj \ $(SLO)$/dinfedt.obj \ $(SLO)$/intro.obj \ - $(SLO)$/macropg.obj \ $(SLO)$/mgetempl.obj \ $(SLO)$/navigat.obj \ $(SLO)$/newstyle.obj \ @@ -81,12 +78,10 @@ SRS1NAME=$(TARGET) SRC1FILES =\ recfloat.src \ alienwarn.src \ - cfg.src \ dialog.src \ dinfdlg.src \ dinfedt.src \ filedlghelper.src \ - macropg.src \ mailwindow.src \ mgetempl.src \ newstyle.src \ diff --git a/sfx2/source/dialog/sfxdlg.cxx b/sfx2/source/dialog/sfxdlg.cxx index dc54627647ff..0e5f91ccea34 100644 --- a/sfx2/source/dialog/sfxdlg.cxx +++ b/sfx2/source/dialog/sfxdlg.cxx @@ -36,15 +36,8 @@ #include <osl/module.hxx> #include <tools/string.hxx> -#include "cfg.hxx" SfxAbstractDialogFactory* SfxAbstractDialogFactory::Create() { return (SfxAbstractDialogFactory*) VclAbstractDialogFactory::Create(); } - -SfxTabPage* SfxAbstractDialogFactory::CreateSfxAcceleratorConfigPage( - Window *pParent, const SfxItemSet& rSet ) -{ - return new SfxAcceleratorConfigPage( pParent, rSet ); -} diff --git a/sfx2/source/inc/acccfg.hxx b/sfx2/source/inc/acccfg.hxx deleted file mode 100644 index 3c793a423a1d..000000000000 --- a/sfx2/source/inc/acccfg.hxx +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: acccfg.hxx,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _ACCCFG_HXX -#define _ACCCFG_HXX - -// #include ***************************************************************** - -#include <vcl/fixed.hxx> -#ifndef _SV_BUTTON_HXX //autogen -#include <vcl/button.hxx> -#endif -#include <vcl/dialog.hxx> -#include <vcl/lstbox.hxx> -#include <sfx2/minarray.hxx> - -// forward ****************************************************************** - -class SfxAcceleratorManager; - -// class SfxAcceleratorConfigListBox ************************************************* - -class SfxAcceleratorConfigListBox : public ListBox -{ - void KeyInput( const KeyEvent &rKEvt ); - -public: - - SfxAcceleratorConfigListBox( Window *pParent, ResId &rResId ) : - ListBox( pParent, rResId ) {} - - void ReplaceEntry( USHORT nPos, const String &rStr ); - void ExpandEntry ( USHORT nPos, const String &rStr ); -}; - -// class USHORTArr ********************************************************** - -#if !defined(_MNUCFG_HXX) && !defined(_TBXCFG_HXX) -DECL_2BYTEARRAY(USHORTArr, USHORT, 10, 10) -#endif - -// class SfxAcceleratorConfigDialog ************************************************** - -class SfxAcceleratorConfigDialog : public ModalDialog -{ - OKButton aOKButton; - CancelButton aCancelButton; - PushButton aChangeButton; - PushButton aRemoveButton; - SfxAcceleratorConfigListBox aEntriesBox; - FixedText aDescriptionTextText; - FixedText aDescriptionInfoText; - FixedLine aKeyboardGroup; - FixedText aGroupText; - ListBox aGroupLBox; - FixedText aFunctionText; - ListBox aFunctionBox; - FixedText aKeyText; - ListBox aKeyBox; - FixedLine aFunctionsGroup; - - SfxAcceleratorManager *pMgr; - - USHORTArr aAccelArr; - USHORTArr aFunctionArr; - USHORTArr aKeyArr; - - void OKHdl ( Button * ); - void ChangeHdl( Button * ); - void RemoveHdl( Button * ); - void SelectHdl( ListBox *pListBox ); - - KeyCode PosToKeyCode ( USHORT nPos ) const; - USHORT KeyCodeToPos ( const KeyCode &rCode ) const; - String GetFunctionName( KeyFuncType eType ) const; - -public: - - SfxAcceleratorConfigDialog( Window *pParent ); -}; - -#endif - diff --git a/sfx2/source/inc/cfg.hxx b/sfx2/source/inc/cfg.hxx deleted file mode 100644 index 7030ba05aacc..000000000000 --- a/sfx2/source/inc/cfg.hxx +++ /dev/null @@ -1,620 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: cfg.hxx,v $ - * $Revision: 1.41 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SFXCFG_HXX -#define _SFXCFG_HXX - -#include <vector> -#include <algorithm> -#include <vcl/lstbox.hxx> -#include <vcl/fixed.hxx> -#include <vcl/group.hxx> -#include <svtools/svtabbx.hxx> -#include <svtools/svtreebx.hxx> - -// -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/container/XIndexContainer.hpp> -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/frame/XModuleManager.hpp> -#include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/ui/XAcceleratorConfiguration.hpp> -#include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/frame/XStorable.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> -#include <com/sun/star/lang/XSingleComponentFactory.hpp> -#include <com/sun/star/script/browse/XBrowseNode.hpp> -#include <com/sun/star/container/XNameAccess.hpp> - -#define _SVSTDARR_USHORTS -#define _SVSTDARR_STRINGSDTOR -#include <svtools/svstdarr.hxx> // SvUShorts -#include <sfx2/minarray.hxx> -#include <sfx2/tabdlg.hxx> - -class SfxMacroInfoArr_Impl; -class SfxMacroInfoItem; -class SfxMacroInfo; -class BasicManager; - -#define SFX_CFGGROUP_FUNCTION 1 -#define SFX_CFGGROUP_BASICMGR 2 -#define SFX_CFGGROUP_DOCBASICMGR 3 -#define SFX_CFGGROUP_BASICLIB 4 -#define SFX_CFGGROUP_BASICMOD 5 -#define SFX_CFGFUNCTION_MACRO 6 -#define SFX_CFGFUNCTION_SLOT 7 -#define SFX_CFGGROUP_SCRIPTCONTAINER 8 -#define SFX_CFGFUNCTION_SCRIPT 9 -#define SFX_CFGGROUP_STYLES 10 - -#define css ::com::sun::star - -struct SfxStyleInfo_Impl -{ - public: - - ::rtl::OUString sFamily; - ::rtl::OUString sStyle; - ::rtl::OUString sCommand; - ::rtl::OUString sLabel; - - SfxStyleInfo_Impl() - {} - - SfxStyleInfo_Impl(const SfxStyleInfo_Impl& rCopy) - { - sFamily = rCopy.sFamily; - sStyle = rCopy.sStyle; - sCommand = rCopy.sCommand; - sLabel = rCopy.sLabel; - } -}; - -struct SfxStylesInfo_Impl -{ - private: - - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDoc; - - public: - - SfxStylesInfo_Impl(); - void setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel); - - sal_Bool parseStyleCommand(SfxStyleInfo_Impl& aStyle); - void getLabel4Style(SfxStyleInfo_Impl& aStyle); - - ::std::vector< SfxStyleInfo_Impl > getStyleFamilies(); - ::std::vector< SfxStyleInfo_Impl > getStyles(const ::rtl::OUString& sFamily); - - static ::rtl::OUString generateCommand(const ::rtl::OUString& sFamily, const ::rtl::OUString& sStyle); -}; - -struct SfxGroupInfo_Impl -{ - USHORT nKind; - USHORT nOrd; - void* pObject; - BOOL bWasOpened; - String sCommand; - String sLabel; - - SfxGroupInfo_Impl( USHORT n, USHORT nr, void* pObj = 0 ) : - nKind( n ), nOrd( nr ), pObject( pObj ), bWasOpened(FALSE) {} -}; - -typedef SfxGroupInfo_Impl* SfxGroupInfoPtr; -SV_DECL_PTRARR_DEL(SfxGroupInfoArr_Impl, SfxGroupInfoPtr, 5, 5) - -class SfxConfigFunctionListBox_Impl : public SvTreeListBox -{ - friend class SfxConfigGroupListBox_Impl; - Timer aTimer; - SvLBoxEntry* pCurEntry; - SfxGroupInfoArr_Impl aArr; - SfxStylesInfo_Impl* pStylesInfo; - - DECL_LINK( TimerHdl, Timer* ); - virtual void MouseMove( const MouseEvent& rMEvt ); - -public: - SfxConfigFunctionListBox_Impl( Window*, const ResId& ); - ~SfxConfigFunctionListBox_Impl(); - - void ClearAll(); - SvLBoxEntry* GetEntry_Impl( USHORT nId ); - SvLBoxEntry* GetEntry_Impl( const String& ); - USHORT GetId( SvLBoxEntry *pEntry ); - using Window::GetHelpText; - String GetHelpText( SvLBoxEntry *pEntry ); - USHORT GetCurId() { return GetId( FirstSelected() ); } - String GetCurCommand(); - String GetCurLabel(); - SfxMacroInfo* GetMacroInfo(); - void FunctionSelected(); - void SetStylesInfo(SfxStylesInfo_Impl* pStyles); -}; - -class SfxSlotPool; -class SfxConfigGroupListBox_Impl : public SvTreeListBox -{ - SfxSlotPool* pSlotPool; - SfxConfigFunctionListBox_Impl* pFunctionListBox; - SfxGroupInfoArr_Impl aArr; - ULONG nMode; - String aScriptType; - BOOL bShowSF; // show Scripting Framework scripts - BOOL bShowBasic; // show Basic scripts - - Image m_hdImage; - Image m_hdImage_hc; - Image m_libImage; - Image m_libImage_hc; - Image m_macImage; - Image m_macImage_hc; - Image m_docImage; - Image m_docImage_hc; - - ::rtl::OUString m_sMyMacros; - ::rtl::OUString m_sProdMacros; - - ::rtl::OUString m_sModuleLongName; - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; - css::uno::Reference< css::frame::XFrame > m_xFrame; - css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo; - css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo; - css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription; - - Image GetImage( ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > node, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xCtx, bool bIsRootNode, bool bHighContrast ); - - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDocumentModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xCtx, ::rtl::OUString& docName ); - ::rtl::OUString parseLocationName( const ::rtl::OUString& location ); - - void InitModule(); - void InitBasic(); - void InitStyles(); - - ::rtl::OUString MapCommand2UIName(const ::rtl::OUString& sCommand); - - SfxStylesInfo_Impl* pStylesInfo; - -protected: - virtual void RequestingChilds( SvLBoxEntry *pEntry); - using SvListView::Expand; - virtual BOOL Expand( SvLBoxEntry* pParent ); - -public: - SfxConfigGroupListBox_Impl ( Window* pParent, - const ResId&, - ULONG nConfigMode = 0 ); - ~SfxConfigGroupListBox_Impl(); - void ClearAll(); - - void Init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , - const css::uno::Reference< css::frame::XFrame >& xFrame , - const ::rtl::OUString& sModuleLongName); - void SetFunctionListBox( SfxConfigFunctionListBox_Impl *pBox ) - { pFunctionListBox = pBox; } - void Open( SvLBoxEntry*, BOOL ); - void GroupSelected(); - void SelectMacro( const SfxMacroInfoItem* ); - void SelectMacro( const String&, const String& ); - String GetGroup(); - BasicManager* GetBasicManager( const SvLBoxEntry& _rEntry ); - void SetScriptType( const String& rScriptType ); - void SetStylesInfo(SfxStylesInfo_Impl* pStyles); -}; -/* -class SfxMenuConfigEntry -{ -private: - USHORT nId; - BOOL bPopUp; - String aHelpText; - String aStr; - String aCommand; - String aHelpURL; - BOOL bConfigure; - BOOL bStrEdited; - -public: - SfxMenuConfigEntry( USHORT nInitId, const String& rInitStr, - const String& rHelpText, BOOL bPopup = FALSE ); - SfxMenuConfigEntry() : nId( 0 ), bPopUp( FALSE ), bConfigure( TRUE ), bStrEdited( FALSE ) {} - ~SfxMenuConfigEntry(); - - USHORT GetId() const { return nId; } - void SetId( USHORT nNew ); - void SetCommand( const String& rCmd ) { aCommand = rCmd; } - const String& GetName() const { return aStr; } - void SetName( const String& rStr ) { aStr = rStr; bStrEdited = TRUE; } - const String& GetHelpText() const { return aHelpText; } - void SetHelpText( const String& rStr ) { aHelpText = rStr; } - const String& GetHelpURL() const { return aHelpURL; } - void SetHelpURL( const String& rStr ) { aHelpURL = rStr; } - void SetPopup( BOOL bOn = TRUE ) { bPopUp = bOn; } - void SetConfigurable( BOOL bOn = TRUE ) { bConfigure = bOn; } - BOOL IsBinding() const { return nId != 0 && !bPopUp; } - BOOL IsSeparator() const { return nId == 0; } - BOOL IsPopup() const { return bPopUp; } - BOOL IsConfigurable() const { return bConfigure; } - BOOL HasChangedName() const { return bStrEdited; } - const String& GetCommand() const { return aCommand; } -}; - -// class SfxMenuConfigEntryArr ************************************************* - -SV_DECL_PTRARR_DEL(SfxMenuConfigEntryArr, SfxMenuConfigEntry *, 16, 16) - -class SfxMenuConfigPage; -class SfxMenuCfgTabListBox_Impl : public SvTabListBox -{ - com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xComponentContext; - com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > m_aSeparatorSeq; - SfxMenuConfigPage* pPage; - SfxMenuConfigEntryArr aMenuArr; - Timer aTimer; - SfxMenuConfigEntry* pCurEntry; - rtl::OUString m_aDescriptorCommandURL; - rtl::OUString m_aDescriptorType; - rtl::OUString m_aDescriptorLabel; - rtl::OUString m_aDescriptorHelpURL; - rtl::OUString m_aDescriptorContainer; - - DECL_LINK( TimerHdl, Timer* ); - - com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& GetSeparator(); - com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > ConvertSfxMenuConfigEntry( SfxMenuConfigEntry* pEntry ); - -public : - SfxMenuCfgTabListBox_Impl( Window *pParent, const ResId& rResId ); - ~SfxMenuCfgTabListBox_Impl(); - - virtual long PreNotify( NotifyEvent& ); - virtual void ModelIsRemoving( SvListEntry* pEntry ); - void EntryInserted( SvListEntry* pEntry ); - virtual void ModelHasCleared(); - virtual void EditingRequest( SvLBoxEntry* pEntry, - SvLBoxItem* pItem, const Point& rMousePos ); - virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ); - virtual void MouseMove( const MouseEvent& rMEvt ); - virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); - virtual BOOL NotifyMoving(SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, ULONG& ); - void Apply( com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& rNewMenuBar, com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >& rFactory, SvLBoxEntry *pParent = NULL ); -}; - -// class SfxMenuConfigPage ----------------------------------------------- - -class SfxMenuConfigPage : public SfxTabPage -{ -private: - SfxMenuCfgTabListBox_Impl aEntriesBox; - const SfxMacroInfoItem* m_pMacroInfoItem; - FixedLine aMenuGroup; - PushButton aNewButton; - PushButton aNewPopupButton; - PushButton aChangeButton; - PushButton aRemoveButton; - ImageButton aUpButton; - ImageButton aDownButton; - FixedText aGroupText; - SfxConfigGroupListBox_Impl aGroupLBox; - FixedText aFunctionText; - SfxConfigFunctionListBox_Impl aFunctionBox; - FixedLine aFunctionsGroup; - PushButton aLoadButton; - PushButton aSaveButton; - PushButton aResetButton; - - ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr; - ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr; - ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; - ::com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame; - ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > m_xMenuBarSettings; - ::com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_xCommandToLabelMap; - String m_aMenuResourceURL; - sal_Bool m_bDocConfig; - sal_Bool m_bDocReadOnly; - -// SfxMenuManager* pMgr; - - BOOL m_bModified; - BOOL m_bDefault; - - DECL_LINK( MoveHdl, Button * ); - DECL_LINK( NewHdl, Button * ); - DECL_LINK( NewPopupHdl, Button * ); - DECL_LINK( ChangeHdl, Button * ); - DECL_LINK( RemoveHdl, Button * ); - DECL_LINK( SelectHdl, Control* ); - - void CheckEntry( Control* ); - USHORT GetCurId(); - String MakeEntry( const SfxMenuConfigEntry &rEntry ) const; - String Trim( const String &rStr ) const; - - sal_Bool GetMenuItemData( const ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& rItemContainer, - sal_Int32 nIndex, - rtl::OUString& rCommandURL, - rtl::OUString& rHelpURL, - rtl::OUString& rLabel, - sal_uInt16& rType, - ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& xPopupMenu ); - - void FillEntriesBox( const ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& xMenuBarSettings, SfxMenuCfgTabListBox_Impl& aEntriesBox, SvLBoxEntry *pParentEntry ); - void Init(); - void ResetConfig(); - - BOOL TryMove_Impl( Button*, SvLBoxEntry** pEntry=NULL, ULONG* pPos=NULL ); - - DECL_LINK( Default, PushButton * ); - DECL_LINK( Save, Button * ); - DECL_LINK( Load, Button * ); - -public: - SfxMenuConfigPage( Window *pParent, const SfxItemSet& rItemSet ); - virtual ~SfxMenuConfigPage(); - - virtual BOOL FillItemSet( SfxItemSet& ); - virtual void Reset( const SfxItemSet& ); - void Apply( BOOL ); - void SetModified( BOOL bSet ) { m_bModified = bSet; } - void SetDefault( BOOL bSet ) { m_bDefault = bSet; } - - void SelectMacro(const SfxMacroInfoItem*); - - ::com::sun::star::uno::Reference < com::sun::star::container::XNameAccess > - GetCommandToLabelMap() { return m_xCommandToLabelMap; } -}; - - -class SfxAcceleratorManager; -*/ -// class SfxAcceleratorConfigListBox ************************************************* - -class SfxAcceleratorConfigPage; -class SfxAccCfgTabListBox_Impl : public SvTabListBox -{ - SfxAcceleratorConfigPage* m_pAccelConfigPage; - - void KeyInput( const KeyEvent &rKEvt ); - -protected: - virtual void InitEntry( SvLBoxEntry*, const XubString&, const Image&, const Image&, SvLBoxButtonKind eButtonKind ); - -public: - SfxAccCfgTabListBox_Impl( - SfxAcceleratorConfigPage* pAccelConfigPage, - Window *pParent, - const ResId &rResId ) : - SvTabListBox( pParent, rResId ), - m_pAccelConfigPage( pAccelConfigPage ) - {} - - void ReplaceEntry( USHORT nPos, const String &rStr ); -}; - -// class SfxAcceleratorConfigPage ---------------------------------------- - -struct TAccInfo -{ - public: - - TAccInfo( sal_Int32 nKeyPos , - sal_Int32 nListPos, - const KeyCode& aKey ) - : m_nKeyPos (nKeyPos ) - , m_nListPos (nListPos ) - , m_bIsConfigurable(sal_True ) - , m_sCommand ( ) - , m_aKey (aKey ) - // its important to set TRUE as default - - // because only fix entries will be disabled later ... - {} - - sal_Bool isConfigured() const - { - return (m_nKeyPos>-1 && m_nListPos>-1 && m_sCommand.getLength()); - } - - sal_Int32 m_nKeyPos; - sal_Int32 m_nListPos; - sal_Bool m_bIsConfigurable; - ::rtl::OUString m_sCommand; - KeyCode m_aKey; -}; - -namespace sfx2 -{ - class FileDialogHelper; -} - -class SfxAcceleratorConfigPage : public SfxTabPage -{ - friend class SfxAccCfgTabListBox_Impl; -private: - const SfxMacroInfoItem* m_pMacroInfoItem; - sfx2::FileDialogHelper* m_pFileDlg; - - SfxAccCfgTabListBox_Impl aEntriesBox; - FixedLine aKeyboardGroup; - RadioButton aOfficeButton; - RadioButton aModuleButton; - PushButton aChangeButton; - PushButton aRemoveButton; - FixedText aGroupText; - SfxConfigGroupListBox_Impl aGroupLBox; - FixedText aFunctionText; - SfxConfigFunctionListBox_Impl aFunctionBox; - FixedText aKeyText; - SvTreeListBox aKeyBox; - FixedLine aFunctionsGroup; - PushButton aLoadButton; - PushButton aSaveButton; - PushButton aResetButton; - SfxStylesInfo_Impl m_aStylesInfo; - sal_Bool m_bStylesInfoInitialized; - - css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; - css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobal; - css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModule; - css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xAct; - css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription; - css::uno::Reference< css::frame::XFrame > m_xFrame; - - ::rtl::OUString m_sModuleLongName; - ::rtl::OUString m_sModuleShortName; - ::rtl::OUString m_sModuleUIName; - - DECL_LINK( ChangeHdl, Button * ); - DECL_LINK( RemoveHdl, Button * ); - DECL_LINK( SelectHdl, Control * ); - DECL_LINK( Save, Button * ); - DECL_LINK( Load, Button * ); - DECL_LINK( Default, PushButton * ); - DECL_LINK( RadioHdl, RadioButton* ); - - DECL_LINK( LoadHdl, sfx2::FileDialogHelper* ); - DECL_LINK( SaveHdl, sfx2::FileDialogHelper* ); - - String GetLabel4Command(const String& sCommand); - void InitAccCfg(); - KeyCode MapPosToKeyCode( USHORT nPos ) const; - USHORT MapKeyCodeToPos( const KeyCode &rCode ) const; - String GetFunctionName( KeyFuncType eType ) const; - css::uno::Reference< css::frame::XModel > SearchForAlreadyLoadedDoc(const String& sName); - void StartFileDialog( WinBits nBits, const String& rTitle ); - - void Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr); - void ResetConfig(); - - void CreateCustomItems( SvLBoxEntry* pEntry, const String& aCol1, const String& aCol2 ); - -public: - SfxAcceleratorConfigPage( Window *pParent, const SfxItemSet& rItemSet ); - virtual ~SfxAcceleratorConfigPage(); - - virtual BOOL FillItemSet( SfxItemSet& ); - virtual void Reset( const SfxItemSet& ); - - void SelectMacro(const SfxMacroInfoItem*); - void Apply(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& pAccMgr); - void CopySource2Target(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xSourceAccMgr, - const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xTargetAccMgr); -}; -/* -class SfxConfigDialog : public SfxTabDialog -{ - const SfxMacroInfoItem* pMacroInfo; - SfxViewFrame* pViewFrame; - USHORT nObjectBar; - -public: - SfxConfigDialog( Window*, const SfxItemSet*, SfxViewFrame* pFrame ); - ~SfxConfigDialog(); - - void ActivateToolBoxConfig( USHORT nId ); - void ActivateMacroConfig( const SfxMacroInfoItem* ); - void ActivateTabPage( USHORT ); - - virtual void PageCreated( USHORT nId, SfxTabPage &rPage ); - virtual short Ok(); - - static String FileDialog_Impl( Window *pParent, WinBits nBits, const String& rTitle ); - static SfxConfigManager* MakeCfgMgr_Impl( const String& rName, BOOL bWriting, BOOL& bCreated ); -}; - -class SfxStatusBarManager; -class SfxStbInfoArr_Impl; - -class SfxStatusBarConfigListBox : public SvTreeListBox -{ -friend class SfxStatusBarConfigPage; - SvLBoxButtonData* pButton; - BOOL bModified; - BOOL bDefault; - SvLBoxEntry* pCurEntry; - Timer aTimer; - - DECL_LINK( TimerHdl, Timer* ); - -public: - - SfxStatusBarConfigListBox( Window* pParent, - const ResId& ); - ~SfxStatusBarConfigListBox(); - - virtual BOOL NotifyAcceptDrop( SvLBoxEntry* pEntry ); - virtual BOOL NotifyMoving(SvLBoxEntry*, - SvLBoxEntry*,SvLBoxEntry*&,ULONG&); - virtual void CheckButtonHdl(); - virtual void MouseMove( const MouseEvent& rMEvt ); - virtual void KeyInput( const KeyEvent& rKeyEvent ); -}; - -// class SfxStatusBarConfigPage ------------------------------------------ - -class SfxStatusBarConfigPage : public SfxTabPage -{ -private: - SfxStatusBarConfigListBox aEntriesBox; - FixedLine aStatusBarGroup; - PushButton aLoadButton; - PushButton aSaveButton; - PushButton aResetButton; - - SvUShorts aListOfIds; - SfxStatusBarManager* pMgr; - SfxStbInfoArr_Impl* pArr; - BOOL bMgrCreated; - - DECL_LINK( SelectHdl, SvTreeListBox * ); - DECL_LINK( Save, Button * ); - DECL_LINK( Load, Button * ); - DECL_LINK( Default, PushButton * ); - - void Init(); - void ResetConfig(); - -public: - SfxStatusBarConfigPage( Window *pParent, const SfxItemSet& rItemSet ); - virtual ~SfxStatusBarConfigPage(); - - virtual BOOL FillItemSet( SfxItemSet& ); - virtual void Reset( const SfxItemSet& ); - void Apply( SfxStatusBarManager*, BOOL ); -}; -*/ - -#undef css -#undef css - -#endif - diff --git a/sfx2/source/inc/eventdlg.hxx b/sfx2/source/inc/eventdlg.hxx deleted file mode 100644 index 1e06cb388c17..000000000000 --- a/sfx2/source/inc/eventdlg.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: eventdlg.hxx,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _EVENTDLG_HXX -#define _EVENTDLG_HXX - -#include <vcl/menubtn.hxx> - -#include <sfx2/evntconf.hxx> -#include <sfx2/macropg.hxx> - -class Menu; -class SfxMacroInfoItem; -class SvxMacroItem; - -class SfxEventConfigPage : public _SfxMacroTabPage -{ - RadioButton aStarOfficeRB; - RadioButton aDocumentRB; - - SvxMacroItem* pAppItem; - SvxMacroItem* pDocItem; - BOOL bAppConfig; - - DECL_LINK( SelectHdl_Impl, RadioButton* ); - -public: - SfxEventConfigPage( Window *pParent, const SfxItemSet& rSet ); - ~SfxEventConfigPage(); - - void Init(); - void SelectMacro( const SfxMacroInfoItem* ); - void SelectMacro( const SvxMacro* ); - void Apply(); - - virtual BOOL FillItemSet( SfxItemSet& ); - virtual void Reset( const SfxItemSet& ); -}; - - -#endif - diff --git a/sfx2/source/inc/headertablistbox.hxx b/sfx2/source/inc/headertablistbox.hxx deleted file mode 100644 index e0b7da4c96e9..000000000000 --- a/sfx2/source/inc/headertablistbox.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: headertablistbox.hxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _HEADERTABLISTBOX_HXX -#define _HEADERTABLISTBOX_HXX - -#include <svtools/headbar.hxx> -#include <svtools/svtabbx.hxx> - - -class _HeaderTabListBox : public Control -{ -private: - SvHeaderTabListBox maListBox; - HeaderBar maHeaderBar; -protected: - DECL_LINK( HeaderEndDrag_Impl, HeaderBar* ); - virtual long Notify( NotifyEvent& rNEvt ); -public: - _HeaderTabListBox( Window* pParent, const ResId& rId ); - virtual ~_HeaderTabListBox(); - - inline SvHeaderTabListBox& GetListBox( void ); - inline HeaderBar& GetHeaderBar( void ); - - void ConnectElements( void ); - // should be called after all manipulations on elements are done - // calcs real sizes depending on sizes of this - void Show( BOOL bVisible = TRUE, USHORT nFlags = 0 ); // same meaning as Windows::Show() - void Enable( bool bEnable = true, bool bChild = true ); // same meaning as Windows::Enable() -}; - -inline SvHeaderTabListBox& _HeaderTabListBox::GetListBox( void ) -{ - return maListBox; -} - -inline HeaderBar& _HeaderTabListBox::GetHeaderBar( void ) -{ - return maHeaderBar; -} - - -#endif diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index 5f66e119f3a6..1b2cc2220a28 100644 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -49,9 +49,6 @@ #define HID_DOCINFODESC (HID_SFX_START + 8) #define HID_DOCINFODOC (HID_SFX_START + 9) #define HID_DOCINFOUSER (HID_SFX_START + 10) -#define HID_CONFIG_MENU (HID_SFX_START + 11) -#define HID_CONFIG_ACCEL (HID_SFX_START + 12) -#define HID_CONFIG_STATBAR (HID_SFX_START + 13) #define HID_BOOKMARKPROPS (HID_SFX_START + 14) #define HID_BOOKGROUPPROPS (HID_SFX_START + 15) #define HID_BOOKFILEPROPS (HID_SFX_START + 16) @@ -98,7 +95,6 @@ #define HID_TEMPLATE_FMT (HID_SFX_START + 61) #define HID_TEMPLATE_FILTER (HID_SFX_START + 62) #define HID_FTPSERVER_PAGE (HID_SFX_START + 63) -#define HID_MACRO_LB_EVENT (HID_SFX_START + 64) #define HID_DLG_SFX_EXP_SEARCH (HID_SFX_START + 65) #define HID_TP_SFX_EXP_SEARCH_CRITERIA (HID_SFX_START + 66) #define HID_TP_SFX_EXP_SEARCH_PLACE (HID_SFX_START + 67) @@ -106,12 +102,6 @@ #define HID_TEMPLDLG_NEWBYEXAMPLE (HID_SFX_START + 69) #define HID_TEMPLDLG_UPDATEBYEXAMPLE (HID_SFX_START + 70) #define HID_TEMPLDLG_WATERCAN (HID_SFX_START + 71) -#define HID_CONFIGFUNCTION_LISTBOX (HID_SFX_START + 72) -#define HID_CONFIGGROUP_LISTBOX (HID_SFX_START + 73) -#define HID_STATUSBARCONFIG_LISTBOX (HID_SFX_START + 74) -#define HID_ACCELCONFIG_LISTBOX (HID_SFX_START + 75) -#define HID_MENUCONFIG_LISTBOX (HID_SFX_START + 76) -#define HID_TOOLBOXCONFIG_LISTBOX (HID_SFX_START + 77) #define HID_DESKTOP (HID_SFX_START + 78) #define HID_EXPLORERTOOLSTOOLBOX (HID_SFX_START + 79) #define HID_EXPLOREROBJECTTOOLBOX (HID_SFX_START + 80) @@ -121,8 +111,6 @@ #define HID_ENVTOOLBOX (HID_SFX_START + 84) #define HID_FRAMESETEDIT_TOOLBOX (HID_SFX_START + 85) #define HID_NAVIGATOR_WINDOW (HID_SFX_START + 86) -#define HID_MACRO_GROUP (HID_SFX_START + 87) -#define HID_MACRO_MACROS (HID_SFX_START + 88) #define HID_TABDLG_RESET_BTN (HID_SFX_START + 89) #define HID_TABDLG_STANDARD_BTN (HID_SFX_START + 90) #define HID_HELPAGENT_TIP_BOX (HID_SFX_START + 91) @@ -271,8 +259,6 @@ #define HID_FILEDLG_NEW_FAVORITE (HID_SFX_START + 235) #define HID_FILEDLG_EDIT_FAVORITES_LISTBOX (HID_SFX_START + 236) #define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR (HID_SFX_START + 237) -#define HID_CONFIGFUNCTION_ACC_LISTBOX (HID_SFX_START + 238) -#define HID_CONFIGGROUP_ACC_LISTBOX (HID_SFX_START + 239) #define HID_CNT_CB_FORCE_BODY_EXPORT (HID_SFX_START + 240) #define HID_CNT_PAGE_REPSTATE_CONTROL (HID_SFX_START + 241) #define HID_TASKSTATUSBAR (HID_SFX_START + 242) @@ -347,8 +333,6 @@ #define HID_CONFIG_SAVE (HID_SFX_START + 310) #define HID_SEARCHDIALOG (HID_SFX_START + 311) -#define HID_MACRO_HEADERTABLISTBOX (HID_SFX_START + 312) -#define HID_MACROCHECKDIALOG (HID_SFX_START + 313) #define HID_XMLSEC_WARNING_BROKENSIGNATURE (HID_SFX_START + 314) #define HID_XMLSEC_QUERY_LOSINGSIGNATURE (HID_SFX_START + 315) diff --git a/sfx2/source/inc/macropg_impl.hxx b/sfx2/source/inc/macropg_impl.hxx deleted file mode 100644 index c50dde950339..000000000000 --- a/sfx2/source/inc/macropg_impl.hxx +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: macropg_impl.hxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _MACROPG_IMPL_HXX -#define _MACROPG_IMPL_HXX - -class _SfxMacroTabPage_Impl -{ -public: - _SfxMacroTabPage_Impl( void ); - ~_SfxMacroTabPage_Impl(); - - String maStaticMacroLBLabel; - PushButton* pAssignPB; - PushButton* pDeletePB; - String* pStrEvent; - String* pAssignedMacro; - ListBox* pScriptTypeLB; - _HeaderTabListBox* pEventLB; - SfxConfigGroupListBox_Impl* pGroupLB; - FixedText* pFT_MacroLBLabel; - SfxConfigFunctionListBox_Impl* pMacroLB; - - FixedText* pMacroFT; - String* pMacroStr; - FNGetRangeHdl fnGetRange; - FNGetMacrosOfRangeHdl fnGetMacroOfRange; - - BOOL bReadOnly; - Timer maFillGroupTimer; -}; - -#endif - diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src index 3c21c3b2898b..92f029929ffb 100644 --- a/sfx2/util/hidother.src +++ b/sfx2/util/hidother.src @@ -197,6 +197,4 @@ hidspecial HID_CLOSE_WARNING { HelpID = HID_CLOSE_WARNING; }; hidspecial HID_DID_SAVE_PACKED_XML { HelpID = HID_DID_SAVE_PACKED_XML; }; hidspecial HID_HELP_ONHELP { HelpID = HID_HELP_ONHELP; }; hidspecial HID_HELP_TEXT_SELECTION_MODE { HelpID = HID_HELP_TEXT_SELECTION_MODE; }; -hidspecial HID_MACROCHECKDIALOG { HelpID = HID_MACROCHECKDIALOG; }; -hidspecial HID_MACRO_HEADERTABLISTBOX { HelpID = HID_MACRO_HEADERTABLISTBOX; }; hidspecial HID_DLG_CHECKFORONLINEUPDATE { HelpID = HID_DLG_CHECKFORONLINEUPDATE; }; diff --git a/sfx2/util/makefile.mk b/sfx2/util/makefile.mk index 8b1b18c4707b..cfed0a838ffa 100644 --- a/sfx2/util/makefile.mk +++ b/sfx2/util/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -72,6 +72,7 @@ HELPIDFILES=\ .IF "$(GUI)"!="UNX" LIB2TARGET= $(LB)$/$(TARGET).lib LIB2FILES= $(LB)$/isfx.lib +LIB2DEPN=$(SHL1TARGETN) .ENDIF SHL1TARGET= sfx$(DLLPOSTFIX) @@ -132,7 +133,6 @@ SFXSRSLIST=\ $(SRS)$/sfx.srs \ $(SRS)$/doc.srs \ $(SRS)$/view.srs \ - $(SRS)$/config.srs \ $(SRS)$/menu.srs \ $(SRS)$/dialog.srs \ $(SRS)$/bastyp.srs |