Kaydet (Commit) cb715a83 authored tarafından jp's avatar jp

Task #93129#: use also the new Undo-/Red controler

üst dc065cd4
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#* #*
#* Beschreibung Starmath IDL-File #* Beschreibung Starmath IDL-File
#* #*
#* Letzte Aenderung $Author: tl $ $Date: 2001-05-02 16:58:48 $ #* Letzte Aenderung $Author: jp $ $Date: 2001-10-12 15:57:24 $
#* $Revision: 1.2 $ #* $Revision: 1.3 $
#* #*
#* $Logfile: T:/starmath/sdi/smslots.sdv $ #* $Logfile: T:/starmath/sdi/smslots.sdv $
#* #*
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
Source Code Control System - Header 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 ...@@ -153,6 +153,25 @@ interface FormulaDocument : OfficeDocument
ExecMethod = Execute ; ExecMethod = Execute ;
StateMethod = GetState ; 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 shell SmDocShell : SfxObjectShell
...@@ -318,6 +337,9 @@ shell SmViewShell : SfxViewShell ...@@ -318,6 +337,9 @@ shell SmViewShell : SfxViewShell
Source Code Control System - History Source Code Control System - History
$Log: not supported by cvs2svn $ $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 Revision 1.1.1.1 2000/09/18 16:57:26 hr
initial import initial import
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: document.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -135,6 +135,9 @@ ...@@ -135,6 +135,9 @@
#ifndef _SFXREQUEST_HXX //autogen #ifndef _SFXREQUEST_HXX //autogen
#include <sfx2/request.hxx> #include <sfx2/request.hxx>
#endif #endif
#ifndef _SFXVIEWFRM_HXX
#include <sfx2/viewfrm.hxx>
#endif
#ifndef _SFXECODE_HXX //autogen #ifndef _SFXECODE_HXX //autogen
#include <svtools/sfxecode.hxx> #include <svtools/sfxecode.hxx>
#endif #endif
...@@ -165,6 +168,9 @@ ...@@ -165,6 +168,9 @@
#ifndef _SVX_FHGTITEM_HXX #ifndef _SVX_FHGTITEM_HXX
#include <svx/fhgtitem.hxx> #include <svx/fhgtitem.hxx>
#endif #endif
#ifndef _SFXSLSTITM_HXX
#include <svtools/slstitm.hxx>
#endif
#ifndef STARMATH_HRC #ifndef STARMATH_HRC
#include <starmath.hrc> #include <starmath.hrc>
...@@ -1422,6 +1428,38 @@ void SmDocShell::Execute(SfxRequest& rReq) ...@@ -1422,6 +1428,38 @@ void SmDocShell::Execute(SfxRequest& rReq)
} }
} }
break; 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) ...@@ -1434,26 +1472,24 @@ void SmDocShell::GetState(SfxItemSet &rSet)
{ {
switch (nWh) switch (nWh)
{ {
case SID_TEXTMODE: case SID_TEXTMODE:
{ rSet.Put(SfxBoolItem(SID_TEXTMODE, GetFormat().IsTextmode()));
rSet.Put(SfxBoolItem(SID_TEXTMODE, GetFormat().IsTextmode())); break;
break;
}
case SID_DOCTEMPLATE : case SID_DOCTEMPLATE :
rSet.DisableItem (SID_DOCTEMPLATE); rSet.DisableItem (SID_DOCTEMPLATE);
break; break;
case SID_AUTO_REDRAW : case SID_AUTO_REDRAW :
{ {
SmModule *pp = SM_MOD1(); SmModule *pp = SM_MOD1();
BOOL bRedraw = pp->GetConfig()->IsAutoRedraw(); BOOL bRedraw = pp->GetConfig()->IsAutoRedraw();
rSet.Put (SfxBoolItem(SID_AUTO_REDRAW, bRedraw)); rSet.Put (SfxBoolItem(SID_AUTO_REDRAW, bRedraw));
break;
} }
break;
case SID_TOOLBOX: case SID_TOOLBOX:
{ {
BOOL bState = FALSE; BOOL bState = FALSE;
SmViewShell *pView = SmGetActiveView(); SmViewShell *pView = SmGetActiveView();
...@@ -1466,25 +1502,72 @@ void SmDocShell::GetState(SfxItemSet &rSet) ...@@ -1466,25 +1502,72 @@ void SmDocShell::GetState(SfxItemSet &rSet)
bState = TRUE; bState = TRUE;
} }
rSet.Put(SfxBoolItem(SID_TOOLBOX, bState)); rSet.Put(SfxBoolItem(SID_TOOLBOX, bState));
break;
} }
break;
case SID_MODIFYSTATUS: case SID_MODIFYSTATUS:
{ {
char cMod = ' '; sal_Unicode cMod = ' ';
if (IsModified()) if (IsModified())
cMod = '*'; cMod = '*';
rSet.Put(SfxStringItem(SID_MODIFYSTATUS, String(cMod))); rSet.Put(SfxStringItem(SID_MODIFYSTATUS, String(cMod)));
break;
} }
break;
case SID_TEXT: case SID_TEXT:
rSet.Put(SfxStringItem(SID_TEXT, GetText())); rSet.Put(SfxStringItem(SID_TEXT, GetText()));
break; 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: sal_uInt16 nCount;
rSet.Put(SfxInt16Item(SID_GRAPHIC, nModifyCount)); if( SID_GETUNDOSTRINGS == nWh )
break; {
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;
} }
} }
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: smdll.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -76,21 +76,25 @@ ...@@ -76,21 +76,25 @@
#ifndef _SFX_OBJFAC_HXX #ifndef _SFX_OBJFAC_HXX
#include <sfx2/docfac.hxx> #include <sfx2/docfac.hxx>
#endif #endif
#ifndef _SVX_LBOXCTRL_HXX_
#include <svx/lboxctrl.hxx>
#endif
#ifndef _SMDLL_HXX #ifndef _SMDLL_HXX
#include "smdll.hxx" #include <smdll.hxx>
#endif #endif
#ifndef DOCUMENT_HXX #ifndef DOCUMENT_HXX
#include "document.hxx" #include <document.hxx>
#endif #endif
#ifndef TOOLBOX_HXX #ifndef TOOLBOX_HXX
#include "toolbox.hxx" #include <toolbox.hxx>
#endif #endif
#ifndef VIEW_HXX #ifndef VIEW_HXX
#include "view.hxx" #include <view.hxx>
#endif #endif
#ifndef _STARMATH_HRC #ifndef _STARMATH_HRC
#include "starmath.hrc" #include <starmath.hrc>
#endif #endif
BOOL SmDLL::bInitialized = FALSE; BOOL SmDLL::bInitialized = FALSE;
...@@ -144,6 +148,8 @@ void SmDLL::Init() ...@@ -144,6 +148,8 @@ void SmDLL::Init()
SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pp ); SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pp );
SvxModifyControl::RegisterControl( SID_TEXTSTATUS, pp ); SvxModifyControl::RegisterControl( SID_TEXTSTATUS, pp );
SvxUndoRedoControl::RegisterControl( SID_UNDO, pp );
SvxUndoRedoControl::RegisterControl( SID_REDO, pp );
SmToolBoxWrapper::RegisterChildWindow(TRUE); SmToolBoxWrapper::RegisterChildWindow(TRUE);
SmCmdBoxWrapper::RegisterChildWindow(TRUE); SmCmdBoxWrapper::RegisterChildWindow(TRUE);
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: typemap.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -182,6 +182,9 @@ ...@@ -182,6 +182,9 @@
#ifndef _SVX_ZOOMITEM_HXX //autogen #ifndef _SVX_ZOOMITEM_HXX //autogen
#include <svx/zoomitem.hxx> #include <svx/zoomitem.hxx>
#endif #endif
#ifndef _SFXSLSTITM_HXX
#include <svtools/slstitm.hxx>
#endif
#define SFX_TYPEMAP #define SFX_TYPEMAP
#include "smslots.hxx" #include "smslots.hxx"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment