00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "precompiled_starmath.hxx"
00038
00039
00040 #ifndef _SOT_FACTORY_HXX //autogen
00041 #include <sot/factory.hxx>
00042 #endif
00043 #ifndef _SVX_SVXIDS_HRC //autogen
00044 #include <svx/svxids.hrc>
00045 #endif
00046 #ifndef _SVX_MODCTRL_HXX //autogen
00047 #include <svx/modctrl.hxx>
00048 #endif
00049 #ifndef _SVX_ZOOMCTRL_HXX //autogen
00050 #include <svx/zoomctrl.hxx>
00051 #endif
00052 #ifndef _SFX_OBJFAC_HXX
00053 #include <sfx2/docfac.hxx>
00054 #endif
00055 #ifndef _SVX_LBOXCTRL_HXX_
00056 #include <svx/lboxctrl.hxx>
00057 #endif
00058 #ifndef _SFXDOCFILE_HXX //autogen
00059 #include <sfx2/docfile.hxx>
00060 #endif
00061 #ifndef _SFX_DOCFILT_HACK_HXX //autogen
00062 #include <sfx2/docfilt.hxx>
00063 #endif
00064 #ifndef _SFXAPP_HXX //autogen
00065 #include <sfx2/app.hxx>
00066 #endif
00067
00068 #ifndef _SMDLL_HXX
00069 #include <smdll.hxx>
00070 #endif
00071 #ifndef DOCUMENT_HXX
00072 #include <document.hxx>
00073 #endif
00074 #ifndef TOOLBOX_HXX
00075 #include <toolbox.hxx>
00076 #endif
00077 #ifndef VIEW_HXX
00078 #include <view.hxx>
00079 #endif
00080
00081 #ifndef _STARMATH_HRC
00082 #include <starmath.hrc>
00083 #endif
00084
00085 #include <svx/xmlsecctrl.hxx>
00086
00087
00088
00089 BOOL SmDLL::bInitialized = FALSE;
00090
00091
00092
00093
00094
00095
00096 void SmDLL::Init()
00097 {
00098 if ( bInitialized )
00099 return;
00100
00101 bInitialized = TRUE;
00102
00103 SfxObjectFactory& rFactory = SmDocShell::Factory();
00104
00105 SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
00106 *ppShlPtr = new SmModule( &rFactory );
00107
00108 SfxModule *p = SM_MOD1();
00109 SmModule *pp = (SmModule *) p;
00110
00111 rFactory.SetDocumentServiceName( String::CreateFromAscii("com.sun.star.formula.FormulaProperties") );
00112
00113 SmModule::RegisterInterface(pp);
00114 SmDocShell::RegisterInterface(pp);
00115 SmViewShell::RegisterInterface(pp);
00116
00117 SmViewShell::RegisterFactory(1);
00118
00119 SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pp );
00120 SvxModifyControl::RegisterControl( SID_TEXTSTATUS, pp );
00121 SvxUndoRedoControl::RegisterControl( SID_UNDO, pp );
00122 SvxUndoRedoControl::RegisterControl( SID_REDO, pp );
00123 XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pp );
00124
00125 SmToolBoxWrapper::RegisterChildWindow(TRUE);
00126 SmCmdBoxWrapper::RegisterChildWindow(TRUE);
00127 }
00128
00129
00130
00131
00132
00133
00134 void SmDLL::Exit()
00135 {
00136
00137 SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
00138 delete (*ppShlPtr);
00139 (*ppShlPtr) = NULL;
00140
00141 *GetAppData(SHL_SM) = 0;
00142 }