Kaydet (Commit) dac64284 authored tarafından Frank Schoenheit [fs]'s avatar Frank Schoenheit [fs]

undoapi: made SfxUndoManager an implementation of the new, abstract ::svl::IUndoManager interface.

Change the SfxShell's UndoManager attribute to be an IUndoManager. Did all the resulting changes
up the source tree.
This way, we'll hopefully be able to provide an IUndoManager implementation in Writer, which
is not based on the SfxUndoManager, but on Writer's own Undo implementation.
üst ed4ed591
......@@ -210,7 +210,7 @@ public:
void Repaint();
virtual SfxUndoManager *GetUndoManager ();
virtual ::svl::IUndoManager *GetUndoManager ();
virtual SfxItemPool& GetPool() const;
......
......@@ -997,7 +997,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
SmFormat aNewFormat( aOldFormat );
aNewFormat.SetTextmode(!aOldFormat.IsTextmode());
SfxUndoManager *pTmpUndoMgr = GetUndoManager();
::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
......@@ -1040,7 +1040,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
SmFormat aNewFormat( aOldFormat );
pFontTypeDialog->WriteTo(aNewFormat);
SfxUndoManager *pTmpUndoMgr = GetUndoManager();
::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
......@@ -1064,7 +1064,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pFontSizeDialog->WriteTo(aNewFormat);
SfxUndoManager *pTmpUndoMgr = GetUndoManager();
::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
......@@ -1088,7 +1088,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pDistanceDialog->WriteTo(aNewFormat);
SfxUndoManager *pTmpUndoMgr = GetUndoManager();
::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
......@@ -1117,7 +1117,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pAlignDialog->WriteTo( aFmt );
pp->GetConfig()->SetStandardFormat( aFmt );
SfxUndoManager *pTmpUndoMgr = GetUndoManager();
::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
......@@ -1140,7 +1140,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
case SID_UNDO:
case SID_REDO:
{
SfxUndoManager* pTmpUndoMgr = GetUndoManager();
::svl::IUndoManager* pTmpUndoMgr = GetUndoManager();
if( pTmpUndoMgr )
{
USHORT nId = rReq.GetSlot(), nCnt = 1;
......@@ -1149,18 +1149,18 @@ void SmDocShell::Execute(SfxRequest& rReq)
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, FALSE, &pItem ))
nCnt = ((SfxUInt16Item*)pItem)->GetValue();
BOOL (SfxUndoManager:: *fnDo)();
BOOL (::svl::IUndoManager:: *fnDo)();
sal_uInt16 nCount;
if( SID_UNDO == rReq.GetSlot() )
{
nCount = pTmpUndoMgr->GetUndoActionCount();
fnDo = &SfxUndoManager::Undo;
fnDo = &::svl::IUndoManager::Undo;
}
else
{
nCount = pTmpUndoMgr->GetRedoActionCount();
fnDo = &SfxUndoManager::Redo;
fnDo = &::svl::IUndoManager::Redo;
}
for( ; nCnt && nCount; --nCnt, --nCount )
......@@ -1247,21 +1247,21 @@ void SmDocShell::GetState(SfxItemSet &rSet)
case SID_GETUNDOSTRINGS:
case SID_GETREDOSTRINGS:
{
SfxUndoManager* pTmpUndoMgr = GetUndoManager();
::svl::IUndoManager* pTmpUndoMgr = GetUndoManager();
if( pTmpUndoMgr )
{
UniString(SfxUndoManager:: *fnGetComment)( USHORT ) const;
UniString(::svl::IUndoManager:: *fnGetComment)( USHORT ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWh )
{
nCount = pTmpUndoMgr->GetUndoActionCount();
fnGetComment = &SfxUndoManager::GetUndoActionComment;
fnGetComment = &::svl::IUndoManager::GetUndoActionComment;
}
else
{
nCount = pTmpUndoMgr->GetRedoActionCount();
fnGetComment = &SfxUndoManager::GetRedoActionComment;
fnGetComment = &::svl::IUndoManager::GetRedoActionComment;
}
if( nCount )
{
......@@ -1284,7 +1284,7 @@ void SmDocShell::GetState(SfxItemSet &rSet)
}
SfxUndoManager *SmDocShell::GetUndoManager()
::svl::IUndoManager *SmDocShell::GetUndoManager()
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::GetUndoManager" );
......
......@@ -65,7 +65,7 @@ public:
virtual bool DoesUndo() const = 0;
/** Zusammenfassen von Kontinuierlichen Insert/Delete/Overwrite von
Charaktern. Default ist ::com::sun::star::sdbcx::Group-Undo.
Charaktern. Default ist Group-Undo.
*/
virtual void DoGroupUndo(bool bUn) = 0;
......
......@@ -71,7 +71,8 @@ public:
void StateSearch(SfxItemSet &);
virtual SfxUndoManager* GetUndoManager();
virtual ::svl::IUndoManager*
GetUndoManager();
};
#endif
......@@ -57,7 +57,8 @@ public:
SwDrawTextShell(SwView &rView);
virtual ~SwDrawTextShell();
virtual SfxUndoManager* GetUndoManager();
virtual ::svl::IUndoManager*
GetUndoManager();
void StateDisableItems(SfxItemSet &);
......
......@@ -161,7 +161,7 @@ SwAnnotationShell::~SwAnnotationShell()
{
}
SfxUndoManager* SwAnnotationShell::GetUndoManager()
::svl::IUndoManager* SwAnnotationShell::GetUndoManager()
{
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
if ( !pPostItMgr ||
......@@ -1368,7 +1368,7 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
{
const SfxItemSet* pArgs = rReq.GetArgs();
SfxUndoManager* pUndoManager = GetUndoManager();
::svl::IUndoManager* pUndoManager = GetUndoManager();
SwWrtShell &rSh = rView.GetWrtShell();
long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin()
......@@ -1445,7 +1445,7 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
SfxWhichIter aIter(rSet);
USHORT nWhich = aIter.FirstWhich();
SfxUndoManager* pUndoManager = GetUndoManager();
::svl::IUndoManager* pUndoManager = GetUndoManager();
SfxViewFrame *pSfxViewFrame = rView.GetViewFrame();
SwWrtShell &rSh = rView.GetWrtShell();
......@@ -1480,18 +1480,18 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
{
if( pUndoManager )
{
UniString (SfxUndoManager:: *fnGetComment)( USHORT ) const;
UniString (::svl::IUndoManager:: *fnGetComment)( USHORT ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWhich )
{
nCount = pUndoManager->GetUndoActionCount();
fnGetComment = &SfxUndoManager::GetUndoActionComment;
fnGetComment = &::svl::IUndoManager::GetUndoActionComment;
}
else
{
nCount = pUndoManager->GetRedoActionCount();
fnGetComment = &SfxUndoManager::GetRedoActionComment;
fnGetComment = &::svl::IUndoManager::GetRedoActionComment;
}
String sList;
......
......@@ -623,7 +623,7 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq)
1 < (nCnt = ((SfxUInt16Item*)pItem)->GetValue()) )
{
// then we make by ourself.
SfxUndoManager* pUndoManager = GetUndoManager();
::svl::IUndoManager* pUndoManager = GetUndoManager();
if( pUndoManager )
{
if( SID_UNDO == nId )
......@@ -668,21 +668,21 @@ void SwDrawTextShell::StateUndo(SfxItemSet &rSet)
case SID_GETUNDOSTRINGS:
case SID_GETREDOSTRINGS:
{
SfxUndoManager* pUndoManager = GetUndoManager();
::svl::IUndoManager* pUndoManager = GetUndoManager();
if( pUndoManager )
{
UniString (SfxUndoManager:: *fnGetComment)( USHORT ) const;
UniString (::svl::IUndoManager:: *fnGetComment)( USHORT ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWhich )
{
nCount = pUndoManager->GetUndoActionCount();
fnGetComment = &SfxUndoManager::GetUndoActionComment;
fnGetComment = &::svl::IUndoManager::GetUndoActionComment;
}
else
{
nCount = pUndoManager->GetRedoActionCount();
fnGetComment = &SfxUndoManager::GetRedoActionComment;
fnGetComment = &::svl::IUndoManager::GetRedoActionComment;
}
if( nCount )
{
......@@ -899,7 +899,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
/*-- 22.10.2003 14:26:32---------------------------------------------------
-----------------------------------------------------------------------*/
SfxUndoManager* SwDrawTextShell::GetUndoManager()
::svl::IUndoManager* SwDrawTextShell::GetUndoManager()
{
SwWrtShell &rSh = GetShell();
pSdrView = rSh.GetDrawView();
......
......@@ -554,7 +554,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
case SID_UNDO:
case SID_REDO:
{
SfxUndoManager& rMgr = pTextView->GetTextEngine()->GetUndoManager();
::svl::IUndoManager& rMgr = pTextView->GetTextEngine()->GetUndoManager();
USHORT nCount = 0;
if(nWhich == SID_UNDO)
{
......
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