/Users/ericb/Desktop/SRC680_m247/starmath/source/action.cxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: action.cxx,v $
00006  *
00007  *  $Revision: 1.5 $
00008  *
00009  *  last change: $Author: vg $ $Date: 2007/05/25 12:11:28 $
00010  *
00011  *  The Contents of this file are made available subject to
00012  *  the terms of GNU Lesser General Public License Version 2.1.
00013  *
00014  *
00015  *    GNU Lesser General Public License Version 2.1
00016  *    =============================================
00017  *    Copyright 2005 by Sun Microsystems, Inc.
00018  *    901 San Antonio Road, Palo Alto, CA 94303, USA
00019  *
00020  *    This library is free software; you can redistribute it and/or
00021  *    modify it under the terms of the GNU Lesser General Public
00022  *    License version 2.1, as published by the Free Software Foundation.
00023  *
00024  *    This library is distributed in the hope that it will be useful,
00025  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00026  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00027  *    Lesser General Public License for more details.
00028  *
00029  *    You should have received a copy of the GNU Lesser General Public
00030  *    License along with this library; if not, write to the Free Software
00031  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00032  *    MA  02111-1307  USA
00033  *
00034  ************************************************************************/
00035 
00036 // MARKER(update_precomp.py): autogen include statement, do not remove
00037 #include "precompiled_starmath.hxx"
00038 
00039 
00040 #include "action.hxx"
00041 #include "smdll.hxx"
00042 #include "document.hxx"
00043 #include "starmath.hrc"
00044 
00045 
00046 SmFormatAction::SmFormatAction(SmDocShell *pDocSh,
00047                                                            const SmFormat& rOldFormat,
00048                                                            const SmFormat& rNewFormat) :
00049         pDoc( pDocSh ),
00050         aOldFormat( rOldFormat ),
00051         aNewFormat( rNewFormat )
00052 {
00053 }
00054 
00055 void SmFormatAction::Undo()
00056 {
00057         pDoc->SetFormat(aOldFormat);
00058 }
00059 
00060 void SmFormatAction::Redo()
00061 {
00062         pDoc->SetFormat(aNewFormat);
00063 }
00064 
00065 void SmFormatAction::Repeat(SfxRepeatTarget& rDocSh)
00066 {
00067     dynamic_cast< SmDocShell & >(rDocSh).SetFormat(aNewFormat);
00068 }
00069 
00070 UniString SmFormatAction::GetComment() const
00071 {
00072         return (SmResId(RID_UNDOFORMATNAME));
00073 }
00074 
00075 

Generated on Wed Feb 20 17:21:56 2008 for maths by  doxygen 1.5.1