00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
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
00134
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