diff options
-rw-r--r-- | starmath/sdi/smslots.sdi | 28 | ||||
-rw-r--r-- | starmath/source/document.cxx | 129 | ||||
-rw-r--r-- | starmath/source/smdll.cxx | 20 | ||||
-rw-r--r-- | starmath/source/typemap.cxx | 7 |
4 files changed, 149 insertions, 35 deletions
diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index f081822db6f3..605c9e6cd8a4 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -5,8 +5,8 @@ #* #* Beschreibung Starmath IDL-File #* -#* Letzte Aenderung $Author: tl $ $Date: 2001-05-02 16:58:48 $ -#* $Revision: 1.2 $ +#* Letzte Aenderung $Author: jp $ $Date: 2001-10-12 15:57:24 $ +#* $Revision: 1.3 $ #* #* $Logfile: T:/starmath/sdi/smslots.sdv $ #* @@ -16,7 +16,7 @@ Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/starmath/sdi/smslots.sdi,v 1.2 2001-05-02 16:58:48 tl Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/starmath/sdi/smslots.sdi,v 1.3 2001-10-12 15:57:24 jp Exp $ *************************************************************************/ @@ -153,6 +153,25 @@ interface FormulaDocument : OfficeDocument ExecMethod = Execute ; StateMethod = GetState ; ] + + SID_UNDO //idlpp ole : no , status : no + [ + ExecMethod = Execute ; + StateMethod = GetState ; + ] + SID_REDO //idlpp ole : no , status : no + [ + ExecMethod = Execute ; + StateMethod = GetState ; + ] + SID_GETUNDOSTRINGS //idlpp ole : no , status : no + [ + StateMethod = GetState ; + ] + SID_GETREDOSTRINGS //idlpp ole : no , status : no + [ + StateMethod = GetState ; + ] } shell SmDocShell : SfxObjectShell @@ -318,6 +337,9 @@ shell SmViewShell : SfxViewShell Source Code Control System - History $Log: not supported by cvs2svn $ + Revision 1.2 2001/05/02 16:58:48 tl + Math configuration and Symbol/SymbolSet/SymbolSetManager + Revision 1.1.1.1 2000/09/18 16:57:26 hr initial import diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index cd764334eb51..7f1a70c3181a 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -2,9 +2,9 @@ * * $RCSfile: document.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.42 $ * - * last change: $Author: tl $ $Date: 2001-10-08 11:47:58 $ + * last change: $Author: jp $ $Date: 2001-10-12 15:54:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -135,6 +135,9 @@ #ifndef _SFXREQUEST_HXX //autogen #include <sfx2/request.hxx> #endif +#ifndef _SFXVIEWFRM_HXX +#include <sfx2/viewfrm.hxx> +#endif #ifndef _SFXECODE_HXX //autogen #include <svtools/sfxecode.hxx> #endif @@ -165,6 +168,9 @@ #ifndef _SVX_FHGTITEM_HXX #include <svx/fhgtitem.hxx> #endif +#ifndef _SFXSLSTITM_HXX +#include <svtools/slstitm.hxx> +#endif #ifndef STARMATH_HRC #include <starmath.hrc> @@ -1422,6 +1428,38 @@ void SmDocShell::Execute(SfxRequest& rReq) } } break; + + case SID_UNDO: + case SID_REDO: + { + SfxUndoManager* pUndoMgr = GetUndoManager(); + if( pUndoMgr ) + { + USHORT nId = rReq.GetSlot(), nCnt = 1; + const SfxItemSet* pArgs = rReq.GetArgs(); + const SfxPoolItem* pItem; + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, FALSE, &pItem )) + nCnt = ((SfxUInt16Item*)pItem)->GetValue(); + + BOOL (SfxUndoManager:: *fnDo)( USHORT ); + + sal_uInt16 nCount; + if( SID_UNDO == rReq.GetSlot() ) + { + nCount = pUndoMgr->GetUndoActionCount(); + fnDo = &SfxUndoManager::Undo; + } + else + { + nCount = pUndoMgr->GetRedoActionCount(); + fnDo = &SfxUndoManager::Redo; + } + + for( ; nCnt && nCount; --nCnt, --nCount ) + (pUndoMgr->*fnDo)( 0 ); + } + } + break; } } @@ -1434,26 +1472,24 @@ void SmDocShell::GetState(SfxItemSet &rSet) { switch (nWh) { - case SID_TEXTMODE: - { - rSet.Put(SfxBoolItem(SID_TEXTMODE, GetFormat().IsTextmode())); - break; - } + case SID_TEXTMODE: + rSet.Put(SfxBoolItem(SID_TEXTMODE, GetFormat().IsTextmode())); + break; - case SID_DOCTEMPLATE : - rSet.DisableItem (SID_DOCTEMPLATE); - break; + case SID_DOCTEMPLATE : + rSet.DisableItem (SID_DOCTEMPLATE); + break; - case SID_AUTO_REDRAW : + case SID_AUTO_REDRAW : { SmModule *pp = SM_MOD1(); BOOL bRedraw = pp->GetConfig()->IsAutoRedraw(); rSet.Put (SfxBoolItem(SID_AUTO_REDRAW, bRedraw)); - break; } + break; - case SID_TOOLBOX: + case SID_TOOLBOX: { BOOL bState = FALSE; SmViewShell *pView = SmGetActiveView(); @@ -1466,25 +1502,72 @@ void SmDocShell::GetState(SfxItemSet &rSet) bState = TRUE; } rSet.Put(SfxBoolItem(SID_TOOLBOX, bState)); - break; } + break; - case SID_MODIFYSTATUS: + case SID_MODIFYSTATUS: { - char cMod = ' '; + sal_Unicode cMod = ' '; if (IsModified()) cMod = '*'; rSet.Put(SfxStringItem(SID_MODIFYSTATUS, String(cMod))); - break; } + break; - case SID_TEXT: - rSet.Put(SfxStringItem(SID_TEXT, GetText())); - break; + case SID_TEXT: + rSet.Put(SfxStringItem(SID_TEXT, GetText())); + break; + + case SID_GRAPHIC: + rSet.Put(SfxInt16Item(SID_GRAPHIC, nModifyCount)); + break; + + case SID_UNDO: + case SID_REDO: + { + SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this ); + if( pFrm ) + pFrm->GetSlotState( nWh, NULL, &rSet ); + else + rSet.DisableItem( nWh ); + } + break; + + case SID_GETUNDOSTRINGS: + case SID_GETREDOSTRINGS: + { + SfxUndoManager* pUndoMgr = GetUndoManager(); + if( pUndoMgr ) + { + UniString (SfxUndoManager:: *fnGetComment)( USHORT ) const; - case SID_GRAPHIC: - rSet.Put(SfxInt16Item(SID_GRAPHIC, nModifyCount)); - break; + sal_uInt16 nCount; + if( SID_GETUNDOSTRINGS == nWh ) + { + nCount = pUndoMgr->GetUndoActionCount(); + fnGetComment = &SfxUndoManager::GetUndoActionComment; + } + else + { + nCount = pUndoMgr->GetRedoActionCount(); + fnGetComment = &SfxUndoManager::GetRedoActionComment; + } + if( nCount ) + { + String sList; + for( sal_uInt16 n = 0; n < nCount; ++n ) + ( sList += (pUndoMgr->*fnGetComment)( n ) ) + += '\n'; + + SfxStringListItem aItem( nWh ); + aItem.SetString( sList ); + rSet.Put( aItem ); + } + } + else + rSet.DisableItem( nWh ); + } + break; } } } diff --git a/starmath/source/smdll.cxx b/starmath/source/smdll.cxx index 567dc9ad2aa1..2788115c0386 100644 --- a/starmath/source/smdll.cxx +++ b/starmath/source/smdll.cxx @@ -2,9 +2,9 @@ * * $RCSfile: smdll.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: tl $ $Date: 2001-05-30 07:52:27 $ + * last change: $Author: jp $ $Date: 2001-10-12 15:54:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,21 +76,25 @@ #ifndef _SFX_OBJFAC_HXX #include <sfx2/docfac.hxx> #endif +#ifndef _SVX_LBOXCTRL_HXX_ +#include <svx/lboxctrl.hxx> +#endif #ifndef _SMDLL_HXX -#include "smdll.hxx" +#include <smdll.hxx> #endif #ifndef DOCUMENT_HXX -#include "document.hxx" +#include <document.hxx> #endif #ifndef TOOLBOX_HXX -#include "toolbox.hxx" +#include <toolbox.hxx> #endif #ifndef VIEW_HXX -#include "view.hxx" +#include <view.hxx> #endif + #ifndef _STARMATH_HRC -#include "starmath.hrc" +#include <starmath.hrc> #endif BOOL SmDLL::bInitialized = FALSE; @@ -144,6 +148,8 @@ void SmDLL::Init() SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pp ); SvxModifyControl::RegisterControl( SID_TEXTSTATUS, pp ); + SvxUndoRedoControl::RegisterControl( SID_UNDO, pp ); + SvxUndoRedoControl::RegisterControl( SID_REDO, pp ); SmToolBoxWrapper::RegisterChildWindow(TRUE); SmCmdBoxWrapper::RegisterChildWindow(TRUE); diff --git a/starmath/source/typemap.cxx b/starmath/source/typemap.cxx index acfcd447816d..1f9907b3048a 100644 --- a/starmath/source/typemap.cxx +++ b/starmath/source/typemap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: typemap.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:27 $ + * last change: $Author: jp $ $Date: 2001-10-12 15:54:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -182,6 +182,9 @@ #ifndef _SVX_ZOOMITEM_HXX //autogen #include <svx/zoomitem.hxx> #endif +#ifndef _SFXSLSTITM_HXX +#include <svtools/slstitm.hxx> +#endif #define SFX_TYPEMAP #include "smslots.hxx" |