xref: /aoo41x/main/starmath/source/cfgitem.cxx (revision d107581f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_starmath.hxx"
26 
27 
28 #include <vcl/svapp.hxx>
29 
30 #include "cfgitem.hxx"
31 
32 #include "starmath.hrc"
33 #include "smdll.hxx"
34 #include "format.hxx"
35 
36 using namespace rtl;
37 using namespace com::sun::star;
38 using namespace com::sun::star::uno;
39 using namespace com::sun::star::beans;
40 
41 
42 static const char* aRootName = "Office.Math";
43 
44 #define SYMBOL_LIST         "SymbolList"
45 #define FONT_FORMAT_LIST    "FontFormatList"
46 
47 /////////////////////////////////////////////////////////////////
48 
49 
lcl_GetFontPropertyNames()50 static Sequence< OUString > lcl_GetFontPropertyNames()
51 {
52 	static const char * aPropNames[] =
53 	{
54         "Name",
55         "CharSet",
56         "Family",
57         "Pitch",
58         "Weight",
59         "Italic",
60 		0
61 	};
62 
63 	const char** ppPropName = aPropNames;
64 
65     Sequence< OUString > aNames( 6 );
66 	OUString *pNames = aNames.getArray();
67 	for( sal_Int32 i = 0; *ppPropName;  ++i, ++ppPropName )
68 	{
69 		pNames[i] = A2OU( *ppPropName );
70 	}
71 	//aNames.realloc( i );
72 	return aNames;
73 }
74 
75 /////////////////////////////////////////////////////////////////
76 
77 
lcl_GetSymbolPropertyNames()78 static Sequence< OUString > lcl_GetSymbolPropertyNames()
79 {
80 	static const char * aPropNames[] =
81 	{
82         "Char",
83         "Set",
84         "Predefined",
85         "FontFormatId",
86 		0
87 	};
88 
89 	const char** ppPropName = aPropNames;
90 
91     Sequence< OUString > aNames( 4 );
92 	OUString *pNames = aNames.getArray();
93 	for( sal_Int32 i = 0; *ppPropName;  ++i, ++ppPropName )
94 	{
95 		pNames[i] = A2OU( *ppPropName );
96 	}
97 	//aNames.realloc( i );
98 	return aNames;
99 }
100 
101 /////////////////////////////////////////////////////////////////
102 
103 static const char * aMathPropNames[] =
104 {
105     "Print/Title",
106     "Print/FormulaText",
107     "Print/Frame",
108     "Print/Size",
109     "Print/ZoomFactor",
110     "LoadSave/IsSaveOnlyUsedSymbols",
111     //"Misc/NoSymbolsWarning",  @deprecated
112     "Misc/IgnoreSpacesRight",
113     "View/ToolboxVisible",
114     "View/AutoRedraw",
115     "View/FormulaCursor"
116 };
117 
118 
119 //! Beware of order according to *_BEGIN *_END defines in format.hxx !
120 //! see respective load/save routines here
121 static const char * aFormatPropNames[] =
122 {
123     "StandardFormat/Textmode",
124     "StandardFormat/GreekCharStyle",
125     "StandardFormat/ScaleNormalBracket",
126     "StandardFormat/HorizontalAlignment",
127     "StandardFormat/BaseSize",
128     "StandardFormat/TextSize",
129     "StandardFormat/IndexSize",
130     "StandardFormat/FunctionSize",
131     "StandardFormat/OperatorSize",
132     "StandardFormat/LimitsSize",
133     "StandardFormat/Distance/Horizontal",
134     "StandardFormat/Distance/Vertical",
135     "StandardFormat/Distance/Root",
136     "StandardFormat/Distance/SuperScript",
137     "StandardFormat/Distance/SubScript",
138     "StandardFormat/Distance/Numerator",
139     "StandardFormat/Distance/Denominator",
140     "StandardFormat/Distance/Fraction",
141     "StandardFormat/Distance/StrokeWidth",
142     "StandardFormat/Distance/UpperLimit",
143     "StandardFormat/Distance/LowerLimit",
144     "StandardFormat/Distance/BracketSize",
145     "StandardFormat/Distance/BracketSpace",
146     "StandardFormat/Distance/MatrixRow",
147     "StandardFormat/Distance/MatrixColumn",
148     "StandardFormat/Distance/OrnamentSize",
149     "StandardFormat/Distance/OrnamentSpace",
150     "StandardFormat/Distance/OperatorSize",
151     "StandardFormat/Distance/OperatorSpace",
152     "StandardFormat/Distance/LeftSpace",
153     "StandardFormat/Distance/RightSpace",
154     "StandardFormat/Distance/TopSpace",
155     "StandardFormat/Distance/BottomSpace",
156     "StandardFormat/Distance/NormalBracketSize",
157     "StandardFormat/VariableFont",
158     "StandardFormat/FunctionFont",
159     "StandardFormat/NumberFont",
160     "StandardFormat/TextFont",
161     "StandardFormat/SerifFont",
162     "StandardFormat/SansFont",
163     "StandardFormat/FixedFont"
164 };
165 
166 
lcl_GetPropertyNames(const char * aPropNames[],sal_uInt16 nCount)167 static Sequence< OUString > lcl_GetPropertyNames(
168         const char * aPropNames[], sal_uInt16 nCount )
169 {
170 
171 	const char** ppPropName = aPropNames;
172 
173     Sequence< OUString > aNames( nCount );
174 	OUString *pNames = aNames.getArray();
175     for (sal_Int32 i = 0;  i < nCount;  ++i, ++ppPropName)
176 	{
177 		pNames[i] = A2OU( *ppPropName );
178 	}
179 	//aNames.realloc( i );
180 	return aNames;
181 }
182 
183 
GetFormatPropertyNames()184 static Sequence< OUString > GetFormatPropertyNames()
185 {
186     sal_uInt16 nCnt = sizeof(aFormatPropNames) / sizeof(aFormatPropNames[0]);
187     return lcl_GetPropertyNames( aFormatPropNames, nCnt );
188 }
189 
190 
GetOtherPropertyNames()191 static Sequence< OUString > GetOtherPropertyNames()
192 {
193     sal_uInt16 nCnt = sizeof(aMathPropNames) / sizeof(aMathPropNames[0]);
194     return lcl_GetPropertyNames( aMathPropNames, nCnt );
195 }
196 
197 /////////////////////////////////////////////////////////////////
198 
199 struct SmCfgOther
200 {
201     SmPrintSize     ePrintSize;
202     sal_uInt16      nPrintZoomFactor;
203     sal_Bool        bPrintTitle;
204     sal_Bool        bPrintFormulaText;
205     sal_Bool        bPrintFrame;
206     sal_Bool        bIsSaveOnlyUsedSymbols;
207     sal_Bool        bIgnoreSpacesRight;
208     sal_Bool        bToolboxVisible;
209     sal_Bool        bAutoRedraw;
210     sal_Bool        bFormulaCursor;
211     //sal_Bool            bNoSymbolsWarning;
212 
213     SmCfgOther();
214 };
215 
216 
SmCfgOther()217 SmCfgOther::SmCfgOther()
218 {
219     ePrintSize          = PRINT_SIZE_NORMAL;
220     nPrintZoomFactor    = 100;
221     bPrintTitle         = bPrintFormulaText   =
222     bPrintFrame         = bIgnoreSpacesRight  =
223     bToolboxVisible     = bAutoRedraw         =
224     bFormulaCursor      = bIsSaveOnlyUsedSymbols = sal_True;
225 }
226 
227 /////////////////////////////////////////////////////////////////
228 
229 
SmFontFormat()230 SmFontFormat::SmFontFormat()
231 {
232     aName.AssignAscii( FONTNAME_MATH );
233     nCharSet    = RTL_TEXTENCODING_UNICODE;
234     nFamily     = FAMILY_DONTKNOW;
235     nPitch      = PITCH_DONTKNOW;
236     nWeight     = WEIGHT_DONTKNOW;
237     nItalic     = ITALIC_NONE;
238 }
239 
240 
SmFontFormat(const Font & rFont)241 SmFontFormat::SmFontFormat( const Font &rFont )
242 {
243     aName       = rFont.GetName();
244     nCharSet    = (sal_Int16) rFont.GetCharSet();
245     nFamily     = (sal_Int16) rFont.GetFamily();
246     nPitch      = (sal_Int16) rFont.GetPitch();
247     nWeight     = (sal_Int16) rFont.GetWeight();
248     nItalic     = (sal_Int16) rFont.GetItalic();
249 }
250 
251 
GetFont() const252 const Font SmFontFormat::GetFont() const
253 {
254     Font aRes;
255     aRes.SetName( aName );
256     aRes.SetCharSet( (rtl_TextEncoding) nCharSet );
257     aRes.SetFamily( (FontFamily) nFamily );
258     aRes.SetPitch( (FontPitch) nPitch );
259     aRes.SetWeight( (FontWeight) nWeight );
260     aRes.SetItalic( (FontItalic) nItalic );
261     return aRes;
262 }
263 
264 
operator ==(const SmFontFormat & rFntFmt) const265 sal_Bool SmFontFormat::operator == ( const SmFontFormat &rFntFmt ) const
266 {
267     return  aName    == rFntFmt.aName       &&
268             nCharSet == rFntFmt.nCharSet    &&
269             nFamily  == rFntFmt.nFamily     &&
270             nPitch   == rFntFmt.nPitch      &&
271             nWeight  == rFntFmt.nWeight     &&
272             nItalic  == rFntFmt.nItalic;
273 }
274 
275 
276 /////////////////////////////////////////////////////////////////
277 
SmFntFmtListEntry(const String & rId,const SmFontFormat & rFntFmt)278 SmFntFmtListEntry::SmFntFmtListEntry( const String &rId, const SmFontFormat &rFntFmt ) :
279     aId     (rId),
280     aFntFmt (rFntFmt)
281 {
282 }
283 
284 
SmFontFormatList()285 SmFontFormatList::SmFontFormatList()
286 {
287     bModified = sal_False;
288 }
289 
290 
Clear()291 void SmFontFormatList::Clear()
292 {
293     if (!aEntries.empty())
294     {
295         aEntries.clear();
296         SetModified( sal_True );
297     }
298 }
299 
300 
AddFontFormat(const String & rFntFmtId,const SmFontFormat & rFntFmt)301 void SmFontFormatList::AddFontFormat( const String &rFntFmtId,
302         const SmFontFormat &rFntFmt )
303 {
304     const SmFontFormat *pFntFmt = GetFontFormat( rFntFmtId );
305     DBG_ASSERT( !pFntFmt, "FontFormatId already exists" );
306     if (!pFntFmt)
307     {
308         SmFntFmtListEntry aEntry( rFntFmtId, rFntFmt );
309         aEntries.push_back( aEntry );
310         SetModified( sal_True );
311     }
312 }
313 
314 
RemoveFontFormat(const String & rFntFmtId)315 void SmFontFormatList::RemoveFontFormat( const String &rFntFmtId )
316 {
317 
318     // search for entry
319     for (size_t i = 0;  i < aEntries.size();  ++i)
320     {
321         if (aEntries[i].aId == rFntFmtId)
322         {
323             // remove entry if found
324             aEntries.erase( aEntries.begin() + i );
325             SetModified( sal_True );
326             break;
327         }
328     }
329 }
330 
331 
GetFontFormat(const String & rFntFmtId) const332 const SmFontFormat * SmFontFormatList::GetFontFormat( const String &rFntFmtId ) const
333 {
334     const SmFontFormat *pRes = 0;
335 
336     for (size_t i = 0;  i < aEntries.size();  ++i)
337     {
338         if (aEntries[i].aId == rFntFmtId)
339         {
340             pRes = &aEntries[i].aFntFmt;
341             break;
342         }
343     }
344 
345     return pRes;
346 }
347 
348 
349 
GetFontFormat(size_t nPos) const350 const SmFontFormat * SmFontFormatList::GetFontFormat( size_t nPos ) const
351 {
352     const SmFontFormat *pRes = 0;
353     if (nPos < aEntries.size())
354         pRes = &aEntries[nPos].aFntFmt;
355     return pRes;
356 }
357 
358 
GetFontFormatId(const SmFontFormat & rFntFmt) const359 const String SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt ) const
360 {
361     String aRes;
362 
363     for (size_t i = 0;  i < aEntries.size();  ++i)
364     {
365         if (aEntries[i].aFntFmt == rFntFmt)
366         {
367             aRes = aEntries[i].aId;
368             break;
369         }
370     }
371 
372     return aRes;
373 }
374 
375 
GetFontFormatId(const SmFontFormat & rFntFmt,sal_Bool bAdd)376 const String SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, sal_Bool bAdd )
377 {
378     String aRes( GetFontFormatId( rFntFmt) );
379     if (0 == aRes.Len()  &&  bAdd)
380     {
381         aRes = GetNewFontFormatId();
382         AddFontFormat( aRes, rFntFmt );
383     }
384     return aRes;
385 }
386 
387 
GetFontFormatId(size_t nPos) const388 const String SmFontFormatList::GetFontFormatId( size_t nPos ) const
389 {
390     String aRes;
391     if (nPos < aEntries.size())
392         aRes = aEntries[nPos].aId;
393     return aRes;
394 }
395 
396 
GetNewFontFormatId() const397 const String SmFontFormatList::GetNewFontFormatId() const
398 {
399     // returns first unused FormatId
400 
401     String aRes;
402 
403     String aPrefix( RTL_CONSTASCII_STRINGPARAM( "Id" ) );
404     sal_Int32 nCnt = GetCount();
405     for (sal_Int32 i = 1;  i <= nCnt + 1;  ++i)
406     {
407         String aTmpId( aPrefix );
408         aTmpId += String::CreateFromInt32( i );
409         if (!GetFontFormat( aTmpId ))
410         {
411             aRes = aTmpId;
412             break;
413         }
414     }
415     DBG_ASSERT( 0 != aRes.Len(), "failed to create new FontFormatId" );
416 
417     return aRes;
418 }
419 
420 /////////////////////////////////////////////////////////////////
421 
SmMathConfig()422 SmMathConfig::SmMathConfig() :
423     ConfigItem( String::CreateFromAscii( aRootName ))
424 {
425     pFormat         = 0;
426     pOther          = 0;
427     pFontFormatList = 0;
428     pSymbolMgr      = 0;
429 
430     bIsOtherModified = bIsFormatModified = sal_False;
431 }
432 
433 
~SmMathConfig()434 SmMathConfig::~SmMathConfig()
435 {
436     Save();
437     delete pFormat;
438     delete pOther;
439     delete pFontFormatList;
440     delete pSymbolMgr;
441 }
442 
443 
SetOtherModified(sal_Bool bVal)444 void SmMathConfig::SetOtherModified( sal_Bool bVal )
445 {
446     bIsOtherModified = bVal;
447 }
448 
449 
SetFormatModified(sal_Bool bVal)450 void SmMathConfig::SetFormatModified( sal_Bool bVal )
451 {
452     bIsFormatModified = bVal;
453 }
454 
455 
SetFontFormatListModified(sal_Bool bVal)456 void SmMathConfig::SetFontFormatListModified( sal_Bool bVal )
457 {
458     if (pFontFormatList)
459         pFontFormatList->SetModified( bVal );
460 }
461 
462 
ReadSymbol(SmSym & rSymbol,const rtl::OUString & rSymbolName,const rtl::OUString & rBaseNode) const463 void SmMathConfig::ReadSymbol( SmSym &rSymbol,
464 						const rtl::OUString &rSymbolName,
465 						const rtl::OUString &rBaseNode ) const
466 {
467 	Sequence< OUString > aNames = lcl_GetSymbolPropertyNames();
468 	sal_Int32 nProps = aNames.getLength();
469 
470 	OUString aDelim( OUString::valueOf( (sal_Unicode) '/' ) );
471 	OUString *pName = aNames.getArray();
472 	for (sal_Int32 i = 0;  i < nProps;  ++i)
473 	{
474 		OUString &rName = pName[i];
475 		OUString aTmp( rName );
476 		rName = rBaseNode;
477 		rName += aDelim;
478 		rName += rSymbolName;
479 		rName += aDelim;
480 		rName += aTmp;
481 	}
482 
483     const Sequence< Any > aValues = ((SmMathConfig*) this)->GetProperties( aNames );
484 
485 	if (nProps  &&  aValues.getLength() == nProps)
486 	{
487 		const Any * pValue = aValues.getConstArray();
488         Font        aFont;
489         sal_UCS4    cChar = '\0';
490         String      aSet;
491         sal_Bool        bPredefined = sal_False;
492 
493         OUString    aTmpStr;
494         sal_Int32       nTmp32 = 0;
495         sal_Bool        bTmp = sal_False;
496 
497         sal_Bool bOK = sal_True;
498         if (pValue->hasValue()  &&  (*pValue >>= nTmp32))
499             cChar = static_cast< sal_UCS4 >( nTmp32 );
500         else
501             bOK = sal_False;
502         ++pValue;
503         if (pValue->hasValue()  &&  (*pValue >>= aTmpStr))
504             aSet = aTmpStr;
505         else
506             bOK = sal_False;
507 		++pValue;
508         if (pValue->hasValue()  &&  (*pValue >>= bTmp))
509             bPredefined = bTmp;
510         else
511             bOK = sal_False;
512 		++pValue;
513         if (pValue->hasValue()  &&  (*pValue >>= aTmpStr))
514         {
515             const SmFontFormat *pFntFmt = GetFontFormatList().GetFontFormat( aTmpStr );
516             DBG_ASSERT( pFntFmt, "unknown FontFormat" );
517             if (pFntFmt)
518                 aFont = pFntFmt->GetFont();
519         }
520         else
521             bOK = sal_False;
522         ++pValue;
523 
524         if (bOK)
525         {
526             String aUiName( rSymbolName );
527             String aUiSetName( aSet );
528             if (bPredefined)
529             {
530                 String aTmp;
531                 aTmp = GetUiSymbolName( rSymbolName );
532                 DBG_ASSERT( aTmp.Len(), "localized symbol-name not found" );
533                 if (aTmp.Len())
534                     aUiName = aTmp;
535                 aTmp = GetUiSymbolSetName( aSet );
536                 DBG_ASSERT( aTmp.Len(), "localized symbolset-name not found" );
537                 if (aTmp.Len())
538                     aUiSetName = aTmp;
539             }
540 
541             rSymbol = SmSym( aUiName, aFont, cChar, aUiSetName, bPredefined );
542             if (aUiName != String(rSymbolName))
543                 rSymbol.SetExportName( rSymbolName );
544         }
545         else
546         {
547             DBG_ERROR( "symbol read error" );
548         }
549 	}
550 }
551 
552 
GetSymbolManager()553 SmSymbolManager & SmMathConfig::GetSymbolManager()
554 {
555     if (!pSymbolMgr)
556     {
557         pSymbolMgr = new SmSymbolManager;
558         pSymbolMgr->Load();
559     }
560     return *pSymbolMgr;
561 }
562 
563 
Commit()564 void SmMathConfig::Commit()
565 {
566     Save();
567 }
568 
569 
Save()570 void SmMathConfig::Save()
571 {
572     SaveOther();
573     SaveFormat();
574     SaveFontFormatList();
575 }
576 
577 
GetSymbols(std::vector<SmSym> & rSymbols) const578 void SmMathConfig::GetSymbols( std::vector< SmSym > &rSymbols ) const
579 {
580     Sequence< OUString > aNodes( ((SmMathConfig*) this)->GetNodeNames( A2OU( SYMBOL_LIST ) ) );
581     const OUString *pNode = aNodes.getConstArray();
582     sal_Int32 nNodes = aNodes.getLength();
583 
584     rSymbols.resize( nNodes );
585     std::vector< SmSym >::iterator aIt( rSymbols.begin() );
586     std::vector< SmSym >::iterator aEnd( rSymbols.end() );
587     while (aIt != aEnd)
588     {
589         ReadSymbol( *aIt++, *pNode++, A2OU( SYMBOL_LIST ) );
590     }
591 }
592 
593 
SetSymbols(const std::vector<SmSym> & rNewSymbols)594 void SmMathConfig::SetSymbols( const std::vector< SmSym > &rNewSymbols )
595 {
596     sal_uIntPtr nCount = rNewSymbols.size();
597 
598     Sequence< OUString > aNames = lcl_GetSymbolPropertyNames();
599     const OUString *pNames = aNames.getConstArray();
600     sal_uIntPtr nSymbolProps = sal::static_int_cast< sal_uInt32 >(aNames.getLength());
601 
602     Sequence< PropertyValue > aValues( nCount * nSymbolProps );
603     PropertyValue *pValues = aValues.getArray();
604 
605     PropertyValue *pVal = pValues;
606     OUString aDelim( OUString::valueOf( (sal_Unicode) '/' ) );
607     std::vector< SmSym >::const_iterator aIt( rNewSymbols.begin() );
608     std::vector< SmSym >::const_iterator aEnd( rNewSymbols.end() );
609     while (aIt != aEnd)
610     {
611         const SmSym &rSymbol = *aIt++;
612         //const Font  &rFont = rSymbol.GetFace();
613         OUString  aNodeNameDelim( A2OU( SYMBOL_LIST ) );
614         aNodeNameDelim += aDelim;
615         aNodeNameDelim += rSymbol.GetExportName();
616         aNodeNameDelim += aDelim;
617 
618         const OUString *pName = pNames;
619 
620         // Char
621         pVal->Name  = aNodeNameDelim;
622         pVal->Name += *pName++;
623         pVal->Value <<= static_cast< sal_UCS4 >( rSymbol.GetCharacter() );
624         pVal++;
625         // Set
626         pVal->Name  = aNodeNameDelim;
627         pVal->Name += *pName++;
628         OUString aTmp( rSymbol.GetSymbolSetName() );
629         if (rSymbol.IsPredefined())
630             aTmp = GetExportSymbolSetName( aTmp );
631         pVal->Value <<= aTmp;
632         pVal++;
633         // Predefined
634         pVal->Name  = aNodeNameDelim;
635         pVal->Name += *pName++;
636         pVal->Value <<= (sal_Bool) rSymbol.IsPredefined();
637         pVal++;
638         // FontFormatId
639         SmFontFormat aFntFmt( rSymbol.GetFace() );
640         String aFntFmtId( GetFontFormatList().GetFontFormatId( aFntFmt, sal_True ) );
641         DBG_ASSERT( aFntFmtId.Len(), "FontFormatId not found" );
642         pVal->Name  = aNodeNameDelim;
643         pVal->Name += *pName++;
644         pVal->Value <<= OUString( aFntFmtId );
645         pVal++;
646     }
647     DBG_ASSERT( pVal - pValues == sal::static_int_cast< ptrdiff_t >(nCount * nSymbolProps), "properties missing" );
648     ReplaceSetProperties( A2OU( SYMBOL_LIST ) , aValues );
649 
650     StripFontFormatList( rNewSymbols );
651     SaveFontFormatList();
652 }
653 
654 
GetFontFormatList()655 SmFontFormatList & SmMathConfig::GetFontFormatList()
656 {
657     if (!pFontFormatList)
658     {
659         LoadFontFormatList();
660     }
661     return *pFontFormatList;
662 }
663 
664 
LoadFontFormatList()665 void SmMathConfig::LoadFontFormatList()
666 {
667     if (!pFontFormatList)
668         pFontFormatList = new SmFontFormatList;
669     else
670         pFontFormatList->Clear();
671 
672     Sequence< OUString > aNodes( GetNodeNames( A2OU( FONT_FORMAT_LIST ) ) );
673 	const OUString *pNode = aNodes.getConstArray();
674 	sal_Int32 nNodes = aNodes.getLength();
675 
676 	for (sal_Int32 i = 0;  i < nNodes;  ++i)
677 	{
678         SmFontFormat aFntFmt;
679         ReadFontFormat( aFntFmt, pNode[i], A2OU( FONT_FORMAT_LIST ) );
680         if (!pFontFormatList->GetFontFormat( pNode[i] ))
681         {
682             DBG_ASSERT( 0 == pFontFormatList->GetFontFormat( pNode[i] ),
683                     "FontFormat ID already exists" );
684             pFontFormatList->AddFontFormat( pNode[i], aFntFmt );
685         }
686 	}
687     pFontFormatList->SetModified( sal_False );
688 }
689 
690 
ReadFontFormat(SmFontFormat & rFontFormat,const OUString & rSymbolName,const OUString & rBaseNode) const691 void SmMathConfig::ReadFontFormat( SmFontFormat &rFontFormat,
692         const OUString &rSymbolName, const OUString &rBaseNode ) const
693 {
694     Sequence< OUString > aNames = lcl_GetFontPropertyNames();
695 	sal_Int32 nProps = aNames.getLength();
696 
697 	OUString aDelim( OUString::valueOf( (sal_Unicode) '/' ) );
698 	OUString *pName = aNames.getArray();
699 	for (sal_Int32 i = 0;  i < nProps;  ++i)
700 	{
701 		OUString &rName = pName[i];
702 		OUString aTmp( rName );
703 		rName = rBaseNode;
704 		rName += aDelim;
705 		rName += rSymbolName;
706 		rName += aDelim;
707 		rName += aTmp;
708 	}
709 
710     const Sequence< Any > aValues = ((SmMathConfig*) this)->GetProperties( aNames );
711 
712 	if (nProps  &&  aValues.getLength() == nProps)
713 	{
714 		const Any * pValue = aValues.getConstArray();
715 
716         OUString    aTmpStr;
717         sal_Int16       nTmp16 = 0;
718 
719         sal_Bool bOK = sal_True;
720         if (pValue->hasValue()  &&  (*pValue >>= aTmpStr))
721             rFontFormat.aName = aTmpStr;
722         else
723             bOK = sal_False;
724         ++pValue;
725         if (pValue->hasValue()  &&  (*pValue >>= nTmp16))
726             rFontFormat.nCharSet = nTmp16; // 6.0 file-format GetSOLoadTextEncoding not needed
727         else
728             bOK = sal_False;
729 		++pValue;
730         if (pValue->hasValue()  &&  (*pValue >>= nTmp16))
731             rFontFormat.nFamily = nTmp16;
732         else
733             bOK = sal_False;
734 		++pValue;
735         if (pValue->hasValue()  &&  (*pValue >>= nTmp16))
736             rFontFormat.nPitch = nTmp16;
737         else
738             bOK = sal_False;
739 		++pValue;
740         if (pValue->hasValue()  &&  (*pValue >>= nTmp16))
741             rFontFormat.nWeight = nTmp16;
742         else
743             bOK = sal_False;
744 		++pValue;
745         if (pValue->hasValue()  &&  (*pValue >>= nTmp16))
746             rFontFormat.nItalic = nTmp16;
747         else
748             bOK = sal_False;
749 		++pValue;
750 
751         DBG_ASSERT( bOK, "read FontFormat failed" );
752 	}
753 }
754 
755 
SaveFontFormatList()756 void SmMathConfig::SaveFontFormatList()
757 {
758     SmFontFormatList &rFntFmtList = GetFontFormatList();
759 
760     if (!rFntFmtList.IsModified())
761         return;
762 
763     Sequence< OUString > aNames = lcl_GetFontPropertyNames();
764     sal_Int32 nSymbolProps = aNames.getLength();
765 
766     size_t nCount = rFntFmtList.GetCount();
767 
768     Sequence< PropertyValue > aValues( nCount * nSymbolProps );
769     PropertyValue *pValues = aValues.getArray();
770 
771     PropertyValue *pVal = pValues;
772     OUString aDelim( OUString::valueOf( (sal_Unicode) '/' ) );
773     for (size_t i = 0;  i < nCount;  ++i)
774     {
775         String aFntFmtId( rFntFmtList.GetFontFormatId( i ) );
776         const SmFontFormat aFntFmt( *rFntFmtList.GetFontFormat( aFntFmtId ) );
777 
778         OUString  aNodeNameDelim( A2OU( FONT_FORMAT_LIST ) );
779         aNodeNameDelim += aDelim;
780         aNodeNameDelim += aFntFmtId;
781         aNodeNameDelim += aDelim;
782 
783         const OUString *pName = aNames.getConstArray();;
784 
785         // Name
786         pVal->Name  = aNodeNameDelim;
787         pVal->Name += *pName++;
788         pVal->Value <<= OUString( aFntFmt.aName );
789         pVal++;
790         // CharSet
791         pVal->Name  = aNodeNameDelim;
792         pVal->Name += *pName++;
793         pVal->Value <<= (sal_Int16) aFntFmt.nCharSet; // 6.0 file-format GetSOStoreTextEncoding not needed
794         pVal++;
795         // Family
796         pVal->Name  = aNodeNameDelim;
797         pVal->Name += *pName++;
798         pVal->Value <<= (sal_Int16) aFntFmt.nFamily;
799         pVal++;
800         // Pitch
801         pVal->Name  = aNodeNameDelim;
802         pVal->Name += *pName++;
803         pVal->Value <<= (sal_Int16) aFntFmt.nPitch;
804         pVal++;
805         // Weight
806         pVal->Name  = aNodeNameDelim;
807         pVal->Name += *pName++;
808         pVal->Value <<= (sal_Int16) aFntFmt.nWeight;
809         pVal++;
810         // Italic
811         pVal->Name  = aNodeNameDelim;
812         pVal->Name += *pName++;
813         pVal->Value <<= (sal_Int16) aFntFmt.nItalic;
814         pVal++;
815     }
816     DBG_ASSERT( static_cast<size_t>(pVal - pValues) == (nCount * nSymbolProps),
817             "properties missing" );
818     ReplaceSetProperties( A2OU( FONT_FORMAT_LIST ) , aValues );
819 
820     rFntFmtList.SetModified( sal_False );
821 }
822 
823 
StripFontFormatList(const std::vector<SmSym> & rSymbols)824 void SmMathConfig::StripFontFormatList( const std::vector< SmSym > &rSymbols )
825 {
826     size_t i;
827 
828     // build list of used font-formats only
829     //!! font-format IDs may be different !!
830     SmFontFormatList aUsedList;
831     for (i = 0;  i < rSymbols.size();  ++i)
832     {
833         DBG_ASSERT( rSymbols[i].GetName().Len() > 0, "non named symbol" );
834         aUsedList.GetFontFormatId( SmFontFormat( rSymbols[i].GetFace() ) , sal_True );
835     }
836     const SmFormat & rStdFmt = GetStandardFormat();
837     for (i = FNT_BEGIN;  i <= FNT_END;  ++i)
838     {
839         aUsedList.GetFontFormatId( SmFontFormat( rStdFmt.GetFont( i ) ) , sal_True );
840     }
841 
842     // remove unused font-formats from list
843     SmFontFormatList &rFntFmtList = GetFontFormatList();
844     size_t nCnt = rFntFmtList.GetCount();
845     SmFontFormat *pTmpFormat = new SmFontFormat[ nCnt ];
846     String       *pId     = new String      [ nCnt ];
847     size_t k;
848     for (k = 0;  k < nCnt;  ++k)
849     {
850         pTmpFormat[k] = *rFntFmtList.GetFontFormat( k );
851         pId[k]     = rFntFmtList.GetFontFormatId( k );
852     }
853     for (k = 0;  k < nCnt;  ++k)
854     {
855         if (0 == aUsedList.GetFontFormatId( pTmpFormat[k] ).Len())
856         {
857             rFntFmtList.RemoveFontFormat( pId[k] );
858         }
859     }
860     delete [] pId;
861     delete [] pTmpFormat;
862 }
863 
864 
LoadOther()865 void SmMathConfig::LoadOther()
866 {
867     if (!pOther)
868         pOther = new SmCfgOther;
869 
870     Sequence< OUString > aNames( GetOtherPropertyNames() );
871     sal_Int32 nProps = aNames.getLength();
872 
873     Sequence< Any > aValues( GetProperties( aNames ) );
874     if (nProps  &&  aValues.getLength() == nProps)
875     {
876         const Any *pValues = aValues.getConstArray();
877         const Any *pVal = pValues;
878 
879         sal_Int16   nTmp16 = 0;
880         sal_Bool    bTmp = sal_False;
881 
882         // Print/Title
883         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
884             pOther->bPrintTitle = bTmp;
885         ++pVal;
886         // Print/FormulaText
887         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
888             pOther->bPrintFormulaText = bTmp;
889         ++pVal;
890         // Print/Frame
891         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
892             pOther->bPrintFrame = bTmp;
893         ++pVal;
894         // Print/Size
895         if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
896             pOther->ePrintSize = (SmPrintSize) nTmp16;
897         ++pVal;
898         // Print/ZoomFactor
899         if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
900             pOther->nPrintZoomFactor = nTmp16;
901         ++pVal;
902         // LoadSave/IsSaveOnlyUsedSymbols
903         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
904             pOther->bIsSaveOnlyUsedSymbols = bTmp;
905 /*        ++pVal;
906         // Misc/NoSymbolsWarning
907         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
908             pOther->bNoSymbolsWarning = bTmp;
909 */
910         ++pVal;
911         // Misc/IgnoreSpacesRight
912         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
913             pOther->bIgnoreSpacesRight = bTmp;
914         ++pVal;
915         // View/ToolboxVisible
916         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
917             pOther->bToolboxVisible = bTmp;
918         ++pVal;
919         // View/AutoRedraw
920         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
921             pOther->bAutoRedraw = bTmp;
922         ++pVal;
923         // View/FormulaCursor
924         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
925             pOther->bFormulaCursor = bTmp;
926         ++pVal;
927 
928         DBG_ASSERT( pVal - pValues == nProps, "property mismatch" );
929         SetOtherModified( sal_False );
930     }
931 }
932 
933 
SaveOther()934 void SmMathConfig::SaveOther()
935 {
936     if (!pOther || !IsOtherModified())
937         return;
938 
939     const Sequence< OUString > aNames( GetOtherPropertyNames() );
940     sal_Int32 nProps = aNames.getLength();
941 
942     Sequence< Any > aValues( nProps );
943     Any *pValues = aValues.getArray();
944     Any *pValue  = pValues;
945 
946     // Print/Title
947     *pValue++ <<= (sal_Bool) pOther->bPrintTitle;
948     // Print/FormulaText
949     *pValue++ <<= (sal_Bool) pOther->bPrintFormulaText;
950     // Print/Frame
951     *pValue++ <<= (sal_Bool) pOther->bPrintFrame;
952     // Print/Size
953     *pValue++ <<= (sal_Int16) pOther->ePrintSize;
954     // Print/ZoomFactor
955     *pValue++ <<= (sal_Int16) pOther->nPrintZoomFactor;
956     // LoadSave/IsSaveOnlyUsedSymbols
957     *pValue++ <<= (sal_Bool) pOther->bIsSaveOnlyUsedSymbols;
958 /*    // Misc/NoSymbolsWarning
959     *pValue++ <<= (sal_Bool) pOther->bNoSymbolsWarning;
960 */
961     // Misc/IgnoreSpacesRight
962     *pValue++ <<= (sal_Bool) pOther->bIgnoreSpacesRight;
963     // View/ToolboxVisible
964     *pValue++ <<= (sal_Bool) pOther->bToolboxVisible;
965     // View/AutoRedraw
966     *pValue++ <<= (sal_Bool) pOther->bAutoRedraw;
967     // View/FormulaCursor
968     *pValue++ <<= (sal_Bool) pOther->bFormulaCursor;
969 
970     DBG_ASSERT( pValue - pValues == nProps, "property mismatch" );
971     PutProperties( aNames , aValues );
972 
973     SetOtherModified( sal_False );
974 }
975 
LoadFormat()976 void SmMathConfig::LoadFormat()
977 {
978     if (!pFormat)
979         pFormat = new SmFormat;
980 
981 
982     Sequence< OUString > aNames( GetFormatPropertyNames() );
983     sal_Int32 nProps = aNames.getLength();
984 
985     Sequence< Any > aValues( GetProperties( aNames ) );
986     if (nProps  &&  aValues.getLength() == nProps)
987     {
988         const Any *pValues = aValues.getConstArray();
989         const Any *pVal = pValues;
990 
991         OUString    aTmpStr;
992         sal_Int16       nTmp16 = 0;
993         sal_Bool        bTmp = sal_False;
994 
995         // StandardFormat/Textmode
996         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
997             pFormat->SetTextmode( bTmp );
998         ++pVal;
999         // StandardFormat/GreekCharStyle
1000         if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
1001             pFormat->SetGreekCharStyle( nTmp16 );
1002         ++pVal;
1003         // StandardFormat/ScaleNormalBracket
1004         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
1005             pFormat->SetScaleNormalBrackets( bTmp );
1006         ++pVal;
1007         // StandardFormat/HorizontalAlignment
1008         if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
1009             pFormat->SetHorAlign( (SmHorAlign) nTmp16 );
1010         ++pVal;
1011         // StandardFormat/BaseSize
1012         if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
1013             pFormat->SetBaseSize( Size(0, SmPtsTo100th_mm( nTmp16 )) );
1014         ++pVal;
1015 
1016         sal_uInt16 i;
1017         for (i = SIZ_BEGIN;  i <= SIZ_END;  ++i)
1018         {
1019             if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
1020                 pFormat->SetRelSize( i, nTmp16 );
1021             ++pVal;
1022         }
1023 
1024         for (i = DIS_BEGIN;  i <= DIS_END;  ++i)
1025         {
1026             if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
1027                 pFormat->SetDistance( i, nTmp16 );
1028             ++pVal;
1029         }
1030 
1031         LanguageType nLang = Application::GetSettings().GetUILanguage();
1032         for (i = FNT_BEGIN;  i < FNT_END;  ++i)
1033         {
1034             Font aFnt;
1035             sal_Bool bUseDefaultFont = sal_True;
1036             if (pVal->hasValue()  &&  (*pVal >>= aTmpStr))
1037             {
1038                 bUseDefaultFont = 0 == aTmpStr.getLength();
1039                 if (bUseDefaultFont)
1040                 {
1041                     aFnt = pFormat->GetFont( i );
1042                     aFnt.SetName( GetDefaultFontName( nLang, i ) );
1043                 }
1044                 else
1045                 {
1046                     const SmFontFormat *pFntFmt = GetFontFormatList().GetFontFormat( aTmpStr );
1047                     DBG_ASSERT( pFntFmt, "unknown FontFormat" );
1048                     if (pFntFmt)
1049                         aFnt = pFntFmt->GetFont();
1050                 }
1051             }
1052             ++pVal;
1053 
1054             aFnt.SetSize( pFormat->GetBaseSize() );
1055             pFormat->SetFont( i, aFnt, bUseDefaultFont );
1056         }
1057 
1058         DBG_ASSERT( pVal - pValues == nProps, "property mismatch" );
1059         SetFormatModified( sal_False );
1060     }
1061 }
1062 
1063 
SaveFormat()1064 void SmMathConfig::SaveFormat()
1065 {
1066     if (!pFormat || !IsFormatModified())
1067         return;
1068 
1069     const Sequence< OUString > aNames( GetFormatPropertyNames() );
1070     sal_Int32 nProps = aNames.getLength();
1071 
1072     Sequence< Any > aValues( nProps );
1073     Any *pValues = aValues.getArray();
1074     Any *pValue  = pValues;
1075 
1076     // StandardFormat/Textmode
1077     *pValue++ <<= (sal_Bool) pFormat->IsTextmode();
1078     // StandardFormat/GreekCharStyle
1079     *pValue++ <<= (sal_Int16) pFormat->GetGreekCharStyle();
1080     // StandardFormat/ScaleNormalBracket
1081     *pValue++ <<= (sal_Bool) pFormat->IsScaleNormalBrackets();
1082     // StandardFormat/HorizontalAlignment
1083     *pValue++ <<= (sal_Int16) pFormat->GetHorAlign();
1084     // StandardFormat/BaseSize
1085     *pValue++ <<= (sal_Int16) SmRoundFraction( Sm100th_mmToPts(
1086                                     pFormat->GetBaseSize().Height() ) );
1087 
1088     sal_uInt16 i;
1089     for (i = SIZ_BEGIN;  i <= SIZ_END;  ++i)
1090         *pValue++ <<= (sal_Int16) pFormat->GetRelSize( i );
1091 
1092     for (i = DIS_BEGIN;  i <= DIS_END;  ++i)
1093         *pValue++ <<= (sal_Int16) pFormat->GetDistance( i );
1094 
1095     for (i = FNT_BEGIN;  i < FNT_END;  ++i)
1096     {
1097         OUString aFntFmtId;
1098 
1099         if (!pFormat->IsDefaultFont( i ))
1100         {
1101             SmFontFormat aFntFmt( pFormat->GetFont( i ) );
1102             aFntFmtId = GetFontFormatList().GetFontFormatId( aFntFmt, sal_True );
1103             DBG_ASSERT( aFntFmtId.getLength(), "FontFormatId not found" );
1104         }
1105 
1106         *pValue++ <<= aFntFmtId;
1107     }
1108 
1109     DBG_ASSERT( pValue - pValues == nProps, "property mismatch" );
1110     PutProperties( aNames , aValues );
1111 
1112     SetFormatModified( sal_False );
1113 }
1114 
1115 
GetStandardFormat() const1116 const SmFormat & SmMathConfig::GetStandardFormat() const
1117 {
1118     if (!pFormat)
1119         ((SmMathConfig *) this)->LoadFormat();
1120     return *pFormat;
1121 }
1122 
1123 
SetStandardFormat(const SmFormat & rFormat,sal_Bool bSaveFontFormatList)1124 void SmMathConfig::SetStandardFormat( const SmFormat &rFormat, sal_Bool bSaveFontFormatList )
1125 {
1126     if (!pFormat)
1127         LoadFormat();
1128     if (rFormat != *pFormat)
1129     {
1130         *pFormat = rFormat;
1131         SetFormatModified( sal_True );
1132 		SaveFormat();
1133 
1134         if (bSaveFontFormatList)
1135         {
1136             // needed for SmFontTypeDialog's DefaultButtonClickHdl
1137             SetFontFormatListModified( sal_True );
1138             SaveFontFormatList();
1139         }
1140     }
1141 }
1142 
1143 
GetPrintSize() const1144 SmPrintSize SmMathConfig::GetPrintSize() const
1145 {
1146     if (!pOther)
1147         ((SmMathConfig *) this)->LoadOther();
1148     return pOther->ePrintSize;
1149 }
1150 
1151 
SetPrintSize(SmPrintSize eSize)1152 void SmMathConfig::SetPrintSize( SmPrintSize eSize )
1153 {
1154     if (!pOther)
1155         LoadOther();
1156     if (eSize != pOther->ePrintSize)
1157     {
1158         pOther->ePrintSize = eSize;
1159         SetOtherModified( sal_True );
1160     }
1161 }
1162 
1163 
GetPrintZoomFactor() const1164 sal_uInt16 SmMathConfig::GetPrintZoomFactor() const
1165 {
1166     if (!pOther)
1167         ((SmMathConfig *) this)->LoadOther();
1168     return pOther->nPrintZoomFactor;
1169 }
1170 
1171 
SetPrintZoomFactor(sal_uInt16 nVal)1172 void SmMathConfig::SetPrintZoomFactor( sal_uInt16 nVal )
1173 {
1174     if (!pOther)
1175         LoadOther();
1176     if (nVal != pOther->nPrintZoomFactor)
1177     {
1178         pOther->nPrintZoomFactor = nVal;
1179         SetOtherModified( sal_True );
1180     }
1181 }
1182 
1183 
SetOtherIfNotEqual(sal_Bool & rbItem,sal_Bool bNewVal)1184 void SmMathConfig::SetOtherIfNotEqual( sal_Bool &rbItem, sal_Bool bNewVal )
1185 {
1186     if (bNewVal != rbItem)
1187     {
1188         rbItem = bNewVal;
1189         SetOtherModified( sal_True );
1190     }
1191 }
1192 
1193 
IsPrintTitle() const1194 sal_Bool SmMathConfig::IsPrintTitle() const
1195 {
1196     if (!pOther)
1197         ((SmMathConfig *) this)->LoadOther();
1198     return pOther->bPrintTitle;
1199 }
1200 
1201 
SetPrintTitle(sal_Bool bVal)1202 void SmMathConfig::SetPrintTitle( sal_Bool bVal )
1203 {
1204     if (!pOther)
1205         LoadOther();
1206     SetOtherIfNotEqual( pOther->bPrintTitle, bVal );
1207 }
1208 
1209 
IsPrintFormulaText() const1210 sal_Bool SmMathConfig::IsPrintFormulaText() const
1211 {
1212     if (!pOther)
1213         ((SmMathConfig *) this)->LoadOther();
1214     return pOther->bPrintFormulaText;
1215 }
1216 
1217 
SetPrintFormulaText(sal_Bool bVal)1218 void SmMathConfig::SetPrintFormulaText( sal_Bool bVal )
1219 {
1220     if (!pOther)
1221         LoadOther();
1222     SetOtherIfNotEqual( pOther->bPrintFormulaText, bVal );
1223 }
1224 
1225 
IsPrintFrame() const1226 sal_Bool SmMathConfig::IsPrintFrame() const
1227 {
1228     if (!pOther)
1229         ((SmMathConfig *) this)->LoadOther();
1230     return pOther->bPrintFrame;
1231 }
1232 
1233 
SetPrintFrame(sal_Bool bVal)1234 void SmMathConfig::SetPrintFrame( sal_Bool bVal )
1235 {
1236     if (!pOther)
1237         LoadOther();
1238     SetOtherIfNotEqual( pOther->bPrintFrame, bVal );
1239 }
1240 
1241 
IsSaveOnlyUsedSymbols() const1242 sal_Bool SmMathConfig::IsSaveOnlyUsedSymbols() const
1243 {
1244     if (!pOther)
1245         ((SmMathConfig *) this)->LoadOther();
1246     return pOther->bIsSaveOnlyUsedSymbols;
1247 }
1248 
1249 
SetSaveOnlyUsedSymbols(sal_Bool bVal)1250 void SmMathConfig::SetSaveOnlyUsedSymbols( sal_Bool bVal )
1251 {
1252     if (!pOther)
1253         LoadOther();
1254     SetOtherIfNotEqual( pOther->bIsSaveOnlyUsedSymbols, bVal );
1255 }
1256 
1257 
IsIgnoreSpacesRight() const1258 sal_Bool SmMathConfig::IsIgnoreSpacesRight() const
1259 {
1260     if (!pOther)
1261         ((SmMathConfig *) this)->LoadOther();
1262     return pOther->bIgnoreSpacesRight;
1263 }
1264 
1265 
SetIgnoreSpacesRight(sal_Bool bVal)1266 void SmMathConfig::SetIgnoreSpacesRight( sal_Bool bVal )
1267 {
1268     if (!pOther)
1269         LoadOther();
1270     SetOtherIfNotEqual( pOther->bIgnoreSpacesRight, bVal );
1271 }
1272 
1273 
IsAutoRedraw() const1274 sal_Bool SmMathConfig::IsAutoRedraw() const
1275 {
1276     if (!pOther)
1277         ((SmMathConfig *) this)->LoadOther();
1278     return pOther->bAutoRedraw;
1279 }
1280 
1281 
SetAutoRedraw(sal_Bool bVal)1282 void SmMathConfig::SetAutoRedraw( sal_Bool bVal )
1283 {
1284     if (!pOther)
1285         LoadOther();
1286     SetOtherIfNotEqual( pOther->bAutoRedraw, bVal );
1287 }
1288 
1289 
IsShowFormulaCursor() const1290 sal_Bool SmMathConfig::IsShowFormulaCursor() const
1291 {
1292     if (!pOther)
1293         ((SmMathConfig *) this)->LoadOther();
1294     return pOther->bFormulaCursor;
1295 }
1296 
1297 
SetShowFormulaCursor(sal_Bool bVal)1298 void SmMathConfig::SetShowFormulaCursor( sal_Bool bVal )
1299 {
1300     if (!pOther)
1301         LoadOther();
1302     SetOtherIfNotEqual( pOther->bFormulaCursor, bVal );
1303 }
1304 
Notify(const com::sun::star::uno::Sequence<rtl::OUString> &)1305 void SmMathConfig::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& )
1306 {}
1307 
1308 /////////////////////////////////////////////////////////////////
1309 
1310