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

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: config.cxx,v $
00006  *
00007  *  $Revision: 1.11 $
00008  *
00009  *  last change: $Author: obo $ $Date: 2006/09/17 07:51:42 $
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 #ifndef _SFXITEMSET_HXX //autogen
00041 #include <svtools/itemset.hxx>
00042 #endif
00043 #ifndef _SFXHINT_HXX //autogen
00044 #include <svtools/hint.hxx>
00045 #endif
00046 #ifndef _SFXSMPLHINT_HXX //autogen
00047 #include <svtools/smplhint.hxx>
00048 #endif
00049 #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
00050 #include <svtools/pathoptions.hxx>
00051 #endif
00052 #ifndef _SFXSIDS_HRC //autogen
00053 #include <sfx2/sfxsids.hrc>
00054 #endif
00055 #ifndef _SFXENUMITEM_HXX //autogen
00056 #include <svtools/eitem.hxx>
00057 #endif
00058 #ifndef _SFXITEMPOOL_HXX //autogen
00059 #include <svtools/itempool.hxx>
00060 #endif
00061 #ifndef _SFXSTRITEM_HXX //autogen
00062 #include <svtools/stritem.hxx>
00063 #endif
00064 #ifndef _SFXINTITEM_HXX //autogen
00065 #include <svtools/intitem.hxx>
00066 #endif
00067 #ifndef _STREAM_HXX
00068 #include <tools/stream.hxx>
00069 #endif
00070 
00071 
00072 #ifndef CONFIG_HXX
00073 #include "config.hxx"
00074 #endif
00075 #ifndef FORMAT_HXX
00076 #include "format.hxx"
00077 #endif
00078 #ifndef _SMMOD_HXX
00079 #include "smmod.hxx"
00080 #endif
00081 #ifndef _STARMATH_HRC
00082 #include "starmath.hrc"
00083 #endif
00084 
00086 
00087 SmConfig::SmConfig()
00088 {
00089 }
00090 
00091 
00092 SmConfig::~SmConfig()
00093 {
00094 }
00095 
00096 
00097 void SmConfig::ItemSetToConfig(const SfxItemSet &rSet)
00098 {
00099         const SfxPoolItem *pItem         = NULL;
00100 
00101         UINT16 nU16;
00102         BOOL bVal;
00103         if (rSet.GetItemState(SID_PRINTSIZE, TRUE, &pItem) == SFX_ITEM_SET)
00104         {       nU16 = ((const SfxUInt16Item *) pItem)->GetValue();
00105         SetPrintSize( (SmPrintSize) nU16 );
00106         }
00107     if (rSet.GetItemState(SID_PRINTZOOM, TRUE, &pItem) == SFX_ITEM_SET)
00108         {       nU16 = ((const SfxUInt16Item *) pItem)->GetValue();
00109         SetPrintZoomFactor( nU16 );
00110         }
00111         if (rSet.GetItemState(SID_PRINTTITLE, TRUE, &pItem) == SFX_ITEM_SET)
00112         {       bVal = ((const SfxBoolItem *) pItem)->GetValue();
00113         SetPrintTitle( bVal );
00114         }
00115         if (rSet.GetItemState(SID_PRINTTEXT, TRUE, &pItem) == SFX_ITEM_SET)
00116         {       bVal = ((const SfxBoolItem *) pItem)->GetValue();
00117         SetPrintFormulaText( bVal );
00118         }
00119         if (rSet.GetItemState(SID_PRINTFRAME, TRUE, &pItem) == SFX_ITEM_SET)
00120         {       bVal = ((const SfxBoolItem *) pItem)->GetValue();
00121         SetPrintFrame( bVal );
00122         }
00123         if (rSet.GetItemState(SID_AUTOREDRAW, TRUE, &pItem) == SFX_ITEM_SET)
00124         {       bVal = ((const SfxBoolItem *) pItem)->GetValue();
00125         SetAutoRedraw( bVal );
00126         }
00127         if (rSet.GetItemState(SID_NO_RIGHT_SPACES, TRUE, &pItem) == SFX_ITEM_SET)
00128         {       bVal = ((const SfxBoolItem *) pItem)->GetValue();
00129         if (IsIgnoreSpacesRight() != bVal)
00130         {
00131             SetIgnoreSpacesRight( bVal );
00132 
00133             // (angezeigte) Formeln muessen entsprechen neu formatiert werden.
00134                         // Das erreichen wir mit:
00135                         Broadcast(SfxSimpleHint(HINT_FORMATCHANGED));
00136                 }
00137         }
00138 
00139         SaveOther();
00140 }
00141 
00142 
00143 void SmConfig::ConfigToItemSet(SfxItemSet &rSet) const
00144 {
00145         const SfxItemPool *pPool = rSet.GetPool();
00146 
00147         rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTSIZE),
00148                            (UINT16) GetPrintSize()));
00149         rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTZOOM),
00150                            (UINT16) GetPrintZoomFactor()));
00151 
00152     rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTITLE), IsPrintTitle()));
00153     rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTEXT),  IsPrintFormulaText()));
00154     rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTFRAME), IsPrintFrame()));
00155     rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTOREDRAW), IsAutoRedraw()));
00156     rSet.Put(SfxBoolItem(pPool->GetWhich(SID_NO_RIGHT_SPACES), IsIgnoreSpacesRight()));
00157 }
00158 
00159 
00161 
00162 

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