LibreOffice Module starmath (master) 1
cfgitem.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <svl/itemset.hxx>
21#include <svl/intitem.hxx>
22#include <svl/eitem.hxx>
25#include <utility>
26#include <vcl/outdev.hxx>
27#include <vcl/svapp.hxx>
28#include <vcl/settings.hxx>
29#include <sal/log.hxx>
30#include <osl/diagnose.h>
32
33#include <com/sun/star/beans/PropertyValue.hpp>
34
35#include <cfgitem.hxx>
36
37#include <starmath.hrc>
38#include <smmod.hxx>
39#include <symbol.hxx>
40#include <format.hxx>
41
42using namespace com::sun::star::uno;
43using namespace com::sun::star::beans;
44
45constexpr OUStringLiteral SYMBOL_LIST = u"SymbolList";
46constexpr OUStringLiteral FONT_FORMAT_LIST = u"FontFormatList";
47
49{
51 "Name",
52 "CharSet",
53 "Family",
54 "Pitch",
55 "Weight",
56 "Italic"
57 };
58}
59
61{
63 "Char",
64 "Set",
65 "Predefined",
66 "FontFormatId"
67 };
68}
69
71{
72 return Sequence<OUString>{ "LoadSave/IsSaveOnlyUsedSymbols",
73 "Misc/AutoCloseBrackets",
74 "Misc/DefaultSmSyntaxVersion",
75 "Misc/IgnoreSpacesRight",
76 "Misc/SmEditWindowZoomFactor",
77 "Print/FormulaText",
78 "Print/Frame",
79 "Print/Size",
80 "Print/Title",
81 "Print/ZoomFactor",
82 "View/AutoRedraw",
83 "View/FormulaCursor",
84 "View/ToolboxVisible" };
85}
86
88{
92 "StandardFormat/Textmode",
93 "StandardFormat/GreekCharStyle",
94 "StandardFormat/ScaleNormalBracket",
95 "StandardFormat/HorizontalAlignment",
96 "StandardFormat/BaseSize",
97 "StandardFormat/TextSize",
98 "StandardFormat/IndexSize",
99 "StandardFormat/FunctionSize",
100 "StandardFormat/OperatorSize",
101 "StandardFormat/LimitsSize",
102 "StandardFormat/Distance/Horizontal",
103 "StandardFormat/Distance/Vertical",
104 "StandardFormat/Distance/Root",
105 "StandardFormat/Distance/SuperScript",
106 "StandardFormat/Distance/SubScript",
107 "StandardFormat/Distance/Numerator",
108 "StandardFormat/Distance/Denominator",
109 "StandardFormat/Distance/Fraction",
110 "StandardFormat/Distance/StrokeWidth",
111 "StandardFormat/Distance/UpperLimit",
112 "StandardFormat/Distance/LowerLimit",
113 "StandardFormat/Distance/BracketSize",
114 "StandardFormat/Distance/BracketSpace",
115 "StandardFormat/Distance/MatrixRow",
116 "StandardFormat/Distance/MatrixColumn",
117 "StandardFormat/Distance/OrnamentSize",
118 "StandardFormat/Distance/OrnamentSpace",
119 "StandardFormat/Distance/OperatorSize",
120 "StandardFormat/Distance/OperatorSpace",
121 "StandardFormat/Distance/LeftSpace",
122 "StandardFormat/Distance/RightSpace",
123 "StandardFormat/Distance/TopSpace",
124 "StandardFormat/Distance/BottomSpace",
125 "StandardFormat/Distance/NormalBracketSize",
126 "StandardFormat/VariableFont",
127 "StandardFormat/FunctionFont",
128 "StandardFormat/NumberFont",
129 "StandardFormat/TextFont",
130 "StandardFormat/SerifFont",
131 "StandardFormat/SansFont",
132 "StandardFormat/FixedFont"
133 };
134}
135
137{
151
152 SmCfgOther();
153};
154
155constexpr sal_uInt16 nDefaultSmSyntaxVersion(5);
156
158 : ePrintSize(PRINT_SIZE_NORMAL)
159 , nPrintZoomFactor(100)
160 , nSmEditWindowZoomFactor(100)
161 // Defaulted as 5 so I have time to code the parser 6
162 , nSmSyntaxVersion(nDefaultSmSyntaxVersion)
163 , bPrintTitle(true)
164 , bPrintFormulaText(true)
165 , bPrintFrame(true)
166 , bIsSaveOnlyUsedSymbols(true)
167 , bIsAutoCloseBrackets(true)
168 , bIgnoreSpacesRight(true)
169 , bToolboxVisible(true)
170 , bAutoRedraw(true)
171 , bFormulaCursor(true)
172{
173}
174
175
178 , nCharSet(RTL_TEXTENCODING_UNICODE)
179 , nFamily(FAMILY_DONTKNOW)
180 , nPitch(PITCH_DONTKNOW)
181 , nWeight(WEIGHT_DONTKNOW)
182 , nItalic(ITALIC_NONE)
183{
184}
185
186
188 : aName(rFont.GetFamilyName())
189 , nCharSet(static_cast<sal_Int16>(rFont.GetCharSet()))
190 , nFamily(static_cast<sal_Int16>(rFont.GetFamilyType()))
191 , nPitch(static_cast<sal_Int16>(rFont.GetPitch()))
192 , nWeight(static_cast<sal_Int16>(rFont.GetWeight()))
193 , nItalic(static_cast<sal_Int16>(rFont.GetItalic()))
194{
195}
196
197
199{
200 vcl::Font aRes;
201 aRes.SetFamilyName( aName );
202 aRes.SetCharSet( static_cast<rtl_TextEncoding>(nCharSet) );
203 aRes.SetFamily( static_cast<FontFamily>(nFamily) );
204 aRes.SetPitch( static_cast<FontPitch>(nPitch) );
205 aRes.SetWeight( static_cast<FontWeight>(nWeight) );
206 aRes.SetItalic( static_cast<FontItalic>(nItalic) );
207 return aRes;
208}
209
210
211bool SmFontFormat::operator == ( const SmFontFormat &rFntFmt ) const
212{
213 return aName == rFntFmt.aName &&
214 nCharSet == rFntFmt.nCharSet &&
215 nFamily == rFntFmt.nFamily &&
216 nPitch == rFntFmt.nPitch &&
217 nWeight == rFntFmt.nWeight &&
218 nItalic == rFntFmt.nItalic;
219}
220
221
223 aId (std::move(_aId)),
224 aFntFmt (std::move(_aFntFmt))
225{
226}
227
228
230 : bModified(false)
231{
232}
233
234
236{
237 if (!aEntries.empty())
238 {
239 aEntries.clear();
240 SetModified( true );
241 }
242}
243
244
245void SmFontFormatList::AddFontFormat( const OUString &rFntFmtId,
246 const SmFontFormat &rFntFmt )
247{
248 const SmFontFormat *pFntFmt = GetFontFormat( rFntFmtId );
249 OSL_ENSURE( !pFntFmt, "FontFormatId already exists" );
250 if (!pFntFmt)
251 {
252 SmFntFmtListEntry aEntry( rFntFmtId, rFntFmt );
253 aEntries.push_back( aEntry );
254 SetModified( true );
255 }
256}
257
258
259void SmFontFormatList::RemoveFontFormat( std::u16string_view rFntFmtId )
260{
261
262 // search for entry
263 for (size_t i = 0; i < aEntries.size(); ++i)
264 {
265 if (aEntries[i].aId == rFntFmtId)
266 {
267 // remove entry if found
268 aEntries.erase( aEntries.begin() + i );
269 SetModified( true );
270 break;
271 }
272 }
273}
274
275
276const SmFontFormat * SmFontFormatList::GetFontFormat( std::u16string_view rFntFmtId ) const
277{
278 const SmFontFormat *pRes = nullptr;
279
280 for (const auto & rEntry : aEntries)
281 {
282 if (rEntry.aId == rFntFmtId)
283 {
284 pRes = &rEntry.aFntFmt;
285 break;
286 }
287 }
288
289 return pRes;
290}
291
292
294{
295 const SmFontFormat *pRes = nullptr;
296 if (nPos < aEntries.size())
297 pRes = &aEntries[nPos].aFntFmt;
298 return pRes;
299}
300
301
302OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt ) const
303{
304 OUString aRes;
305
306 for (const auto & rEntry : aEntries)
307 {
308 if (rEntry.aFntFmt == rFntFmt)
309 {
310 aRes = rEntry.aId;
311 break;
312 }
313 }
314
315 return aRes;
316}
317
318
319OUString SmFontFormatList::GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd )
320{
321 OUString aRes( GetFontFormatId( rFntFmt) );
322 if (aRes.isEmpty() && bAdd)
323 {
324 aRes = GetNewFontFormatId();
325 AddFontFormat( aRes, rFntFmt );
326 }
327 return aRes;
328}
329
330
331OUString SmFontFormatList::GetFontFormatId( size_t nPos ) const
332{
333 OUString aRes;
334 if (nPos < aEntries.size())
335 aRes = aEntries[nPos].aId;
336 return aRes;
337}
338
339
341{
342 // returns first unused FormatId
343
344 sal_Int32 nCnt = GetCount();
345 for (sal_Int32 i = 1; i <= nCnt + 1; ++i)
346 {
347 OUString aTmpId = "Id" + OUString::number(i);
348 if (!GetFontFormat(aTmpId))
349 return aTmpId;
350 }
351 OSL_ENSURE( false, "failed to create new FontFormatId" );
352
353 return OUString();
354}
355
356
358 ConfigItem("Office.Math")
359 , bIsOtherModified(false)
360 , bIsFormatModified(false)
361{
362 EnableNotification({ {} }); // Listen to everything under the node
363}
364
365
367{
368 Save();
369}
370
371
373{
374 bIsOtherModified = bVal;
375}
376
377
379{
380 bIsFormatModified = bVal;
381}
382
383
385 const OUString &rSymbolName,
386 std::u16string_view rBaseNode ) const
387{
389 sal_Int32 nProps = aNames.getLength();
390
391 OUString aDelim( "/" );
392 for (auto& rName : asNonConstRange(aNames))
393 rName = rBaseNode + aDelim + rSymbolName + aDelim + rName;
394
395 const Sequence< Any > aValues = const_cast<SmMathConfig*>(this)->GetProperties(aNames);
396
397 if (!(nProps && aValues.getLength() == nProps))
398 return;
399
400 const Any * pValue = aValues.getConstArray();
401 vcl::Font aFont;
402 sal_UCS4 cChar = '\0';
403 OUString aSet;
404 bool bPredefined = false;
405
406 OUString aTmpStr;
407 sal_Int32 nTmp32 = 0;
408 bool bTmp = false;
409
410 bool bOK = true;
411 if (pValue->hasValue() && (*pValue >>= nTmp32))
412 cChar = static_cast< sal_UCS4 >( nTmp32 );
413 else
414 bOK = false;
415 ++pValue;
416 if (pValue->hasValue() && (*pValue >>= aTmpStr))
417 aSet = aTmpStr;
418 else
419 bOK = false;
420 ++pValue;
421 if (pValue->hasValue() && (*pValue >>= bTmp))
422 bPredefined = bTmp;
423 else
424 bOK = false;
425 ++pValue;
426 if (pValue->hasValue() && (*pValue >>= aTmpStr))
427 {
428 const SmFontFormat *pFntFmt = GetFontFormatList().GetFontFormat( aTmpStr );
429 OSL_ENSURE( pFntFmt, "unknown FontFormat" );
430 if (pFntFmt)
431 aFont = pFntFmt->GetFont();
432 }
433 else
434 bOK = false;
435 ++pValue;
436
437 if (bOK)
438 {
439 OUString aUiName( rSymbolName );
440 OUString aUiSetName( aSet );
441 if (bPredefined)
442 {
443 OUString aTmp;
444 aTmp = SmLocalizedSymbolData::GetUiSymbolName( rSymbolName );
445 OSL_ENSURE( !aTmp.isEmpty(), "localized symbol-name not found" );
446 if (!aTmp.isEmpty())
447 aUiName = aTmp;
449 OSL_ENSURE( !aTmp.isEmpty(), "localized symbolset-name not found" );
450 if (!aTmp.isEmpty())
451 aUiSetName = aTmp;
452 }
453
454 rSymbol = SmSym( aUiName, aFont, cChar, aUiSetName, bPredefined );
455 if (aUiName != rSymbolName)
456 rSymbol.SetExportName( rSymbolName );
457 }
458 else
459 {
460 SAL_WARN("starmath", "symbol read error");
461 }
462}
463
464
466{
467 if (!pSymbolMgr)
468 {
469 pSymbolMgr.reset(new SmSymbolManager);
470 pSymbolMgr->Load();
471 }
472 return *pSymbolMgr;
473}
474
475
477{
478 Save();
479}
480
481
483{
484 SaveOther();
485 SaveFormat();
487}
488
489
491{
492 if (--m_nCommitLock == 0)
493 Commit();
494}
495
496
498{
499 // Re-read data on next request
500 pOther.reset();
501 pFormat.reset();
502 pFontFormatList.reset();
503}
504
505
506void SmMathConfig::GetSymbols( std::vector< SmSym > &rSymbols ) const
507{
508 Sequence< OUString > aNodes(const_cast<SmMathConfig*>(this)->GetNodeNames(SYMBOL_LIST));
509 const OUString *pNode = aNodes.getConstArray();
510 sal_Int32 nNodes = aNodes.getLength();
511
512 rSymbols.resize( nNodes );
513 for (auto& rSymbol : rSymbols)
514 {
515 ReadSymbol( rSymbol, *pNode++, SYMBOL_LIST );
516 }
517}
518
519
520void SmMathConfig::SetSymbols( const std::vector< SmSym > &rNewSymbols )
521{
522 CommitLocker aLock(*this);
523 auto nCount = sal::static_int_cast<sal_Int32>(rNewSymbols.size());
524
526 const OUString *pNames = aNames.getConstArray();
527 sal_Int32 nSymbolProps = aNames.getLength();
528
529 Sequence< PropertyValue > aValues( nCount * nSymbolProps );
530 PropertyValue *pValues = aValues.getArray();
531
532 PropertyValue *pVal = pValues;
533 OUString aDelim( "/" );
534 for (const SmSym& rSymbol : rNewSymbols)
535 {
536 OUString aNodeNameDelim = SYMBOL_LIST +
537 aDelim +
538 rSymbol.GetExportName() +
539 aDelim;
540
541 const OUString *pName = pNames;
542
543 // Char
544 pVal->Name = aNodeNameDelim;
545 pVal->Name += *pName++;
546 pVal->Value <<= rSymbol.GetCharacter();
547 pVal++;
548 // Set
549 pVal->Name = aNodeNameDelim;
550 pVal->Name += *pName++;
551 OUString aTmp( rSymbol.GetSymbolSetName() );
552 if (rSymbol.IsPredefined())
554 pVal->Value <<= aTmp;
555 pVal++;
556 // Predefined
557 pVal->Name = aNodeNameDelim;
558 pVal->Name += *pName++;
559 pVal->Value <<= rSymbol.IsPredefined();
560 pVal++;
561 // FontFormatId
562 SmFontFormat aFntFmt( rSymbol.GetFace() );
563 OUString aFntFmtId( GetFontFormatList().GetFontFormatId( aFntFmt, true ) );
564 OSL_ENSURE( !aFntFmtId.isEmpty(), "FontFormatId not found" );
565 pVal->Name = aNodeNameDelim;
566 pVal->Name += *pName++;
567 pVal->Value <<= aFntFmtId;
568 pVal++;
569 }
570 OSL_ENSURE( pVal - pValues == sal::static_int_cast< ptrdiff_t >(nCount * nSymbolProps), "properties missing" );
572
573 StripFontFormatList( rNewSymbols );
574}
575
576
578{
579 if (!pFontFormatList)
580 {
582 }
583 return *pFontFormatList;
584}
585
586
588{
589 if (!pFontFormatList)
591 else
592 pFontFormatList->Clear();
593
595
596 for (const OUString& rNode : aNodes)
597 {
598 SmFontFormat aFntFmt;
599 ReadFontFormat( aFntFmt, rNode, FONT_FORMAT_LIST );
600 if (!pFontFormatList->GetFontFormat( rNode ))
601 pFontFormatList->AddFontFormat( rNode, aFntFmt );
602 }
603 pFontFormatList->SetModified( false );
604}
605
606
608 std::u16string_view rSymbolName, std::u16string_view rBaseNode ) const
609{
611 sal_Int32 nProps = aNames.getLength();
612
613 OUString aDelim( "/" );
614 for (auto& rName : asNonConstRange(aNames))
615 rName = rBaseNode + aDelim + rSymbolName + aDelim + rName;
616
617 const Sequence< Any > aValues = const_cast<SmMathConfig*>(this)->GetProperties(aNames);
618
619 if (!(nProps && aValues.getLength() == nProps))
620 return;
621
622 const Any * pValue = aValues.getConstArray();
623
624 OUString aTmpStr;
625 sal_Int16 nTmp16 = 0;
626
627 bool bOK = true;
628 if (pValue->hasValue() && (*pValue >>= aTmpStr))
629 rFontFormat.aName = aTmpStr;
630 else
631 bOK = false;
632 ++pValue;
633 if (pValue->hasValue() && (*pValue >>= nTmp16))
634 rFontFormat.nCharSet = nTmp16; // 6.0 file-format GetSOLoadTextEncoding not needed
635 else
636 bOK = false;
637 ++pValue;
638 if (pValue->hasValue() && (*pValue >>= nTmp16))
639 rFontFormat.nFamily = nTmp16;
640 else
641 bOK = false;
642 ++pValue;
643 if (pValue->hasValue() && (*pValue >>= nTmp16))
644 rFontFormat.nPitch = nTmp16;
645 else
646 bOK = false;
647 ++pValue;
648 if (pValue->hasValue() && (*pValue >>= nTmp16))
649 rFontFormat.nWeight = nTmp16;
650 else
651 bOK = false;
652 ++pValue;
653 if (pValue->hasValue() && (*pValue >>= nTmp16))
654 rFontFormat.nItalic = nTmp16;
655 else
656 bOK = false;
657 ++pValue;
658
659 OSL_ENSURE( bOK, "read FontFormat failed" );
660}
661
662
664{
665 SmFontFormatList &rFntFmtList = GetFontFormatList();
666
667 if (!rFntFmtList.IsModified())
668 return;
669
671 sal_Int32 nSymbolProps = aNames.getLength();
672
673 size_t nCount = rFntFmtList.GetCount();
674
675 Sequence< PropertyValue > aValues( nCount * nSymbolProps );
676 PropertyValue *pValues = aValues.getArray();
677
678 PropertyValue *pVal = pValues;
679 OUString aDelim( "/" );
680 for (size_t i = 0; i < nCount; ++i)
681 {
682 OUString aFntFmtId(rFntFmtList.GetFontFormatId(i));
683 const SmFontFormat *pFntFmt = rFntFmtList.GetFontFormat(i);
684 assert(pFntFmt);
685 const SmFontFormat aFntFmt(*pFntFmt);
686
687 OUString aNodeNameDelim = FONT_FORMAT_LIST +
688 aDelim +
689 aFntFmtId +
690 aDelim;
691
692 const OUString *pName = aNames.getConstArray();
693
694 // Name
695 pVal->Name = aNodeNameDelim;
696 pVal->Name += *pName++;
697 pVal->Value <<= aFntFmt.aName;
698 pVal++;
699 // CharSet
700 pVal->Name = aNodeNameDelim;
701 pVal->Name += *pName++;
702 pVal->Value <<= aFntFmt.nCharSet; // 6.0 file-format GetSOStoreTextEncoding not needed
703 pVal++;
704 // Family
705 pVal->Name = aNodeNameDelim;
706 pVal->Name += *pName++;
707 pVal->Value <<= aFntFmt.nFamily;
708 pVal++;
709 // Pitch
710 pVal->Name = aNodeNameDelim;
711 pVal->Name += *pName++;
712 pVal->Value <<= aFntFmt.nPitch;
713 pVal++;
714 // Weight
715 pVal->Name = aNodeNameDelim;
716 pVal->Name += *pName++;
717 pVal->Value <<= aFntFmt.nWeight;
718 pVal++;
719 // Italic
720 pVal->Name = aNodeNameDelim;
721 pVal->Name += *pName++;
722 pVal->Value <<= aFntFmt.nItalic;
723 pVal++;
724 }
725 OSL_ENSURE( sal::static_int_cast<size_t>(pVal - pValues) == nCount * nSymbolProps, "properties missing" );
727
728 rFntFmtList.SetModified( false );
729}
730
731
732void SmMathConfig::StripFontFormatList( const std::vector< SmSym > &rSymbols )
733{
734 size_t i;
735
736 // build list of used font-formats only
738 SmFontFormatList aUsedList;
739 for (i = 0; i < rSymbols.size(); ++i)
740 {
741 OSL_ENSURE( rSymbols[i].GetName().getLength() > 0, "non named symbol" );
742 aUsedList.GetFontFormatId( SmFontFormat( rSymbols[i].GetFace() ) , true );
743 }
744 const SmFormat & rStdFmt = GetStandardFormat();
745 for (i = FNT_BEGIN; i <= FNT_END; ++i)
746 {
747 aUsedList.GetFontFormatId( SmFontFormat( rStdFmt.GetFont( i ) ) , true );
748 }
749
750 // remove unused font-formats from list
751 SmFontFormatList &rFntFmtList = GetFontFormatList();
752 size_t nCnt = rFntFmtList.GetCount();
753 std::unique_ptr<SmFontFormat[]> pTmpFormat(new SmFontFormat[ nCnt ]);
754 std::unique_ptr<OUString[]> pId(new OUString[ nCnt ]);
755 size_t k;
756 for (k = 0; k < nCnt; ++k)
757 {
758 pTmpFormat[k] = *rFntFmtList.GetFontFormat( k );
759 pId[k] = rFntFmtList.GetFontFormatId( k );
760 }
761 for (k = 0; k < nCnt; ++k)
762 {
763 if (aUsedList.GetFontFormatId( pTmpFormat[k] ).isEmpty())
764 {
765 rFntFmtList.RemoveFontFormat( pId[k] );
766 }
767 }
768}
769
770
772{
773 if (!pOther)
774 pOther.reset(new SmCfgOther);
775
777 const Sequence<Any> aValues(GetProperties(aNames));
778 if (aNames.getLength() != aValues.getLength())
779 return;
780
781 const Any* pValues = aValues.getConstArray();
782 const Any* pVal = pValues;
783
784 // LoadSave/IsSaveOnlyUsedSymbols
785 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
786 pOther->bIsSaveOnlyUsedSymbols = bTmp;
787 ++pVal;
788 // Misc/AutoCloseBrackets
789 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
790 pOther->bIsAutoCloseBrackets = bTmp;
791 ++pVal;
792 // Misc/DefaultSmSyntaxVersion
793 if (sal_Int16 nTmp; pVal->hasValue() && (*pVal >>= nTmp))
794 pOther->nSmSyntaxVersion = nTmp;
795 ++pVal;
796 // Misc/IgnoreSpacesRight
797 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
798 pOther->bIgnoreSpacesRight = bTmp;
799 ++pVal;
800 // Misc/SmEditWindowZoomFactor
801 if (sal_Int16 nTmp; pVal->hasValue() && (*pVal >>= nTmp))
802 pOther->nSmEditWindowZoomFactor = nTmp;
803 ++pVal;
804 // Print/FormulaText
805 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
806 pOther->bPrintFormulaText = bTmp;
807 ++pVal;
808 // Print/Frame
809 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
810 pOther->bPrintFrame = bTmp;
811 ++pVal;
812 // Print/Size:
813 if (sal_Int16 nTmp; pVal->hasValue() && (*pVal >>= nTmp))
814 pOther->ePrintSize = static_cast<SmPrintSize>(nTmp);
815 ++pVal;
816 // Print/Title
817 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
818 pOther->bPrintTitle = bTmp;
819 ++pVal;
820 // Print/ZoomFactor
821 if (sal_Int16 nTmp; pVal->hasValue() && (*pVal >>= nTmp))
822 pOther->nPrintZoomFactor = nTmp;
823 ++pVal;
824 // View/AutoRedraw
825 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
826 pOther->bAutoRedraw = bTmp;
827 ++pVal;
828 // View/FormulaCursor
829 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
830 pOther->bFormulaCursor = bTmp;
831 ++pVal;
832 // View/ToolboxVisible
833 if (bool bTmp; pVal->hasValue() && (*pVal >>= bTmp))
834 pOther->bToolboxVisible = bTmp;
835 ++pVal;
836
837 OSL_ENSURE(pVal - pValues == aNames.getLength(), "property mismatch");
838 SetOtherModified( false );
839}
840
841
843{
844 if (!pOther || !IsOtherModified())
845 return;
846
848 Sequence<Any> aValues(aNames.getLength());
849
850 Any* pValues = aValues.getArray();
851 Any* pVal = pValues;
852
853 // LoadSave/IsSaveOnlyUsedSymbols
854 *pVal++ <<= pOther->bIsSaveOnlyUsedSymbols;
855 // Misc/AutoCloseBrackets
856 *pVal++ <<= pOther->bIsAutoCloseBrackets;
857 // Misc/DefaultSmSyntaxVersion
858 *pVal++ <<= pOther->nSmSyntaxVersion;
859 // Misc/IgnoreSpacesRight
860 *pVal++ <<= pOther->bIgnoreSpacesRight;
861 // Misc/SmEditWindowZoomFactor
862 *pVal++ <<= pOther->nSmEditWindowZoomFactor;
863 // Print/FormulaText
864 *pVal++ <<= pOther->bPrintFormulaText;
865 // Print/Frame
866 *pVal++ <<= pOther->bPrintFrame;
867 // Print/Size:
868 *pVal++ <<= static_cast<sal_Int16>(pOther->ePrintSize);
869 // Print/Title
870 *pVal++ <<= pOther->bPrintTitle;
871 // Print/ZoomFactor
872 *pVal++ <<= pOther->nPrintZoomFactor;
873 // View/AutoRedraw
874 *pVal++ <<= pOther->bAutoRedraw;
875 // View/FormulaCursor
876 *pVal++ <<= pOther->bFormulaCursor;
877 // View/ToolboxVisible
878 *pVal++ <<= pOther->bToolboxVisible;
879
880 OSL_ENSURE(pVal - pValues == aNames.getLength(), "property mismatch");
881 PutProperties(aNames, aValues);
882
883 SetOtherModified( false );
884}
885
886namespace {
887
888// Latin default-fonts
889const DefaultFontType aLatinDefFnts[FNT_END] =
890{
891 DefaultFontType::SERIF, // FNT_VARIABLE
892 DefaultFontType::SERIF, // FNT_FUNCTION
893 DefaultFontType::SERIF, // FNT_NUMBER
894 DefaultFontType::SERIF, // FNT_TEXT
895 DefaultFontType::SERIF, // FNT_SERIF
896 DefaultFontType::SANS, // FNT_SANS
897 DefaultFontType::FIXED // FNT_FIXED
898 //OpenSymbol, // FNT_MATH
899};
900
901// CJK default-fonts
905const DefaultFontType aCJKDefFnts[FNT_END] =
906{
907 DefaultFontType::SERIF, // FNT_VARIABLE
908 DefaultFontType::SERIF, // FNT_FUNCTION
909 DefaultFontType::SERIF, // FNT_NUMBER
910 DefaultFontType::CJK_TEXT, // FNT_TEXT
911 DefaultFontType::CJK_TEXT, // FNT_SERIF
912 DefaultFontType::CJK_DISPLAY, // FNT_SANS
913 DefaultFontType::CJK_TEXT // FNT_FIXED
914 //OpenSymbol, // FNT_MATH
915};
916
917// CTL default-fonts
918const DefaultFontType aCTLDefFnts[FNT_END] =
919{
920 DefaultFontType::CTL_TEXT, // FNT_VARIABLE
921 DefaultFontType::CTL_TEXT, // FNT_FUNCTION
922 DefaultFontType::CTL_TEXT, // FNT_NUMBER
923 DefaultFontType::CTL_TEXT, // FNT_TEXT
924 DefaultFontType::CTL_TEXT, // FNT_SERIF
925 DefaultFontType::CTL_TEXT, // FNT_SANS
926 DefaultFontType::CTL_TEXT // FNT_FIXED
927 //OpenSymbol, // FNT_MATH
928};
929
930
931OUString lcl_GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent )
932{
933 assert(nIdent < FNT_END);
934 const DefaultFontType *pTable;
936 {
937 case SvtScriptType::LATIN : pTable = aLatinDefFnts; break;
938 case SvtScriptType::ASIAN : pTable = aCJKDefFnts; break;
939 case SvtScriptType::COMPLEX : pTable = aCTLDefFnts; break;
940 default :
941 pTable = aLatinDefFnts;
942 SAL_WARN("starmath", "unknown script-type");
943 }
944
945 return OutputDevice::GetDefaultFont(pTable[ nIdent ], nLang,
946 GetDefaultFontFlags::OnlyOne ).GetFamilyName();
947}
948
949}
950
951
953{
954 if (!pFormat)
955 pFormat.reset(new SmFormat);
956
957
959
960 sal_Int32 nProps = aNames.getLength();
961
962 Sequence< Any > aValues( GetProperties( aNames ) );
963 if (!(nProps && aValues.getLength() == nProps))
964 return;
965
966 const Any *pValues = aValues.getConstArray();
967 const Any *pVal = pValues;
968
969 OUString aTmpStr;
970 sal_Int16 nTmp16 = 0;
971 bool bTmp = false;
972
973 // StandardFormat/Textmode
974 if (pVal->hasValue() && (*pVal >>= bTmp))
975 pFormat->SetTextmode( bTmp );
976 ++pVal;
977 // StandardFormat/GreekCharStyle
978 if (pVal->hasValue() && (*pVal >>= nTmp16))
979 pFormat->SetGreekCharStyle( nTmp16 );
980 ++pVal;
981 // StandardFormat/ScaleNormalBracket
982 if (pVal->hasValue() && (*pVal >>= bTmp))
983 pFormat->SetScaleNormalBrackets( bTmp );
984 ++pVal;
985 // StandardFormat/HorizontalAlignment
986 if (pVal->hasValue() && (*pVal >>= nTmp16))
987 pFormat->SetHorAlign( static_cast<SmHorAlign>(nTmp16) );
988 ++pVal;
989 // StandardFormat/BaseSize
990 if (pVal->hasValue() && (*pVal >>= nTmp16))
991 pFormat->SetBaseSize(Size(0, o3tl::convert(nTmp16, o3tl::Length::pt, SmO3tlLengthUnit())));
992 ++pVal;
993
994 sal_uInt16 i;
995 for (i = SIZ_BEGIN; i <= SIZ_END; ++i)
996 {
997 if (pVal->hasValue() && (*pVal >>= nTmp16))
998 pFormat->SetRelSize( i, nTmp16 );
999 ++pVal;
1000 }
1001
1002 for (i = DIS_BEGIN; i <= DIS_END; ++i)
1003 {
1004 if (pVal->hasValue() && (*pVal >>= nTmp16))
1005 pFormat->SetDistance( i, nTmp16 );
1006 ++pVal;
1007 }
1008
1010 for (i = FNT_BEGIN; i < FNT_END; ++i)
1011 {
1012 vcl::Font aFnt;
1013 bool bUseDefaultFont = true;
1014 if (pVal->hasValue() && (*pVal >>= aTmpStr))
1015 {
1016 bUseDefaultFont = aTmpStr.isEmpty();
1017 if (bUseDefaultFont)
1018 {
1019 aFnt = pFormat->GetFont( i );
1020 aFnt.SetFamilyName( lcl_GetDefaultFontName( nLang, i ) );
1021 }
1022 else
1023 {
1024 const SmFontFormat *pFntFmt = GetFontFormatList().GetFontFormat( aTmpStr );
1025 OSL_ENSURE( pFntFmt, "unknown FontFormat" );
1026 if (pFntFmt)
1027 aFnt = pFntFmt->GetFont();
1028 }
1029 }
1030 ++pVal;
1031
1032 aFnt.SetFontSize( pFormat->GetBaseSize() );
1033 pFormat->SetFont( i, aFnt, bUseDefaultFont );
1034 }
1035
1036 OSL_ENSURE( pVal - pValues == nProps, "property mismatch" );
1037 SetFormatModified( false );
1038}
1039
1040
1042{
1043 if (!pFormat || !IsFormatModified())
1044 return;
1045
1047 sal_Int32 nProps = aNames.getLength();
1048
1049 Sequence< Any > aValues( nProps );
1050 Any *pValues = aValues.getArray();
1051 Any *pValue = pValues;
1052
1053 // StandardFormat/Textmode
1054 *pValue++ <<= pFormat->IsTextmode();
1055 // StandardFormat/GreekCharStyle
1056 *pValue++ <<= pFormat->GetGreekCharStyle();
1057 // StandardFormat/ScaleNormalBracket
1058 *pValue++ <<= pFormat->IsScaleNormalBrackets();
1059 // StandardFormat/HorizontalAlignment
1060 *pValue++ <<= static_cast<sal_Int16>(pFormat->GetHorAlign());
1061 // StandardFormat/BaseSize
1062 *pValue++ <<= static_cast<sal_Int16>(
1063 o3tl::convert(pFormat->GetBaseSize().Height(), SmO3tlLengthUnit(), o3tl::Length::pt));
1064
1065 sal_uInt16 i;
1066 for (i = SIZ_BEGIN; i <= SIZ_END; ++i)
1067 *pValue++ <<= static_cast<sal_Int16>(pFormat->GetRelSize( i ));
1068
1069 for (i = DIS_BEGIN; i <= DIS_END; ++i)
1070 *pValue++ <<= static_cast<sal_Int16>(pFormat->GetDistance( i ));
1071
1072 for (i = FNT_BEGIN; i < FNT_END; ++i)
1073 {
1074 OUString aFntFmtId;
1075
1076 if (!pFormat->IsDefaultFont( i ))
1077 {
1078 SmFontFormat aFntFmt( pFormat->GetFont( i ) );
1079 aFntFmtId = GetFontFormatList().GetFontFormatId( aFntFmt, true );
1080 OSL_ENSURE( !aFntFmtId.isEmpty(), "FontFormatId not found" );
1081 }
1082
1083 *pValue++ <<= aFntFmtId;
1084 }
1085
1086 OSL_ENSURE( pValue - pValues == nProps, "property mismatch" );
1087 PutProperties( aNames , aValues );
1088
1089 SetFormatModified( false );
1090}
1091
1092
1094{
1095 if (!pFormat)
1096 const_cast<SmMathConfig*>(this)->LoadFormat();
1097 return *pFormat;
1098}
1099
1100
1101void SmMathConfig::SetStandardFormat( const SmFormat &rFormat, bool bSaveFontFormatList )
1102{
1103 if (!pFormat)
1104 LoadFormat();
1105 if (rFormat == *pFormat)
1106 return;
1107
1108 CommitLocker aLock(*this);
1109 *pFormat = rFormat;
1110 SetFormatModified( true );
1111
1112 if (bSaveFontFormatList)
1113 {
1114 // needed for SmFontTypeDialog's DefaultButtonClickHdl
1115 if (pFontFormatList)
1116 pFontFormatList->SetModified( true );
1117 }
1118}
1119
1120
1122{
1123 if (!pOther)
1124 const_cast<SmMathConfig*>(this)->LoadOther();
1125 return pOther->ePrintSize;
1126}
1127
1128
1130{
1131 if (!pOther)
1132 LoadOther();
1133 if (eSize != pOther->ePrintSize)
1134 {
1135 CommitLocker aLock(*this);
1136 pOther->ePrintSize = eSize;
1137 SetOtherModified( true );
1138 }
1139}
1140
1141
1143{
1144 if (!pOther)
1145 const_cast<SmMathConfig*>(this)->LoadOther();
1146 return pOther->nPrintZoomFactor;
1147}
1148
1149
1151{
1152 if (!pOther)
1153 LoadOther();
1154 if (nVal != pOther->nPrintZoomFactor)
1155 {
1156 CommitLocker aLock(*this);
1157 pOther->nPrintZoomFactor = nVal;
1158 SetOtherModified( true );
1159 }
1160}
1161
1162
1164{
1165 sal_uInt16 smzoomfactor;
1166 if (!pOther)
1167 const_cast<SmMathConfig*>(this)->LoadOther();
1168 smzoomfactor = pOther->nSmEditWindowZoomFactor;
1169 return smzoomfactor < 10 || smzoomfactor > 1000 ? 100 : smzoomfactor;
1170}
1171
1172
1174{
1175 if (!pOther)
1176 LoadOther();
1177 if (nVal != pOther->nSmEditWindowZoomFactor)
1178 {
1179 CommitLocker aLock(*this);
1180 pOther->nSmEditWindowZoomFactor = nVal;
1181 SetOtherModified( true );
1182 }
1183}
1184
1185
1186bool SmMathConfig::SetOtherIfNotEqual( bool &rbItem, bool bNewVal )
1187{
1188 if (bNewVal != rbItem)
1189 {
1190 CommitLocker aLock(*this);
1191 rbItem = bNewVal;
1192 SetOtherModified( true );
1193 return true;
1194 }
1195 return false;
1196}
1197
1198
1200{
1201 if (!pOther)
1202 const_cast<SmMathConfig*>(this)->LoadOther();
1203 return pOther->bPrintTitle;
1204}
1205
1206
1208{
1209 if (!pOther)
1210 LoadOther();
1211 SetOtherIfNotEqual( pOther->bPrintTitle, bVal );
1212}
1213
1214
1216{
1217 if (!pOther)
1218 const_cast<SmMathConfig*>(this)->LoadOther();
1219 return pOther->bPrintFormulaText;
1220}
1221
1222
1224{
1225 if (!pOther)
1226 LoadOther();
1227 SetOtherIfNotEqual( pOther->bPrintFormulaText, bVal );
1228}
1229
1231{
1232 if (!pOther)
1233 const_cast<SmMathConfig*>(this)->LoadOther();
1234 return pOther->bIsSaveOnlyUsedSymbols;
1235}
1236
1238{
1239 if (!pOther)
1240 const_cast<SmMathConfig*>(this)->LoadOther();
1241 return pOther->bIsAutoCloseBrackets;
1242}
1243
1245{
1248 if (!pOther)
1249 const_cast<SmMathConfig*>(this)->LoadOther();
1250 return pOther->nSmSyntaxVersion;
1251}
1252
1254{
1255 if (!pOther)
1256 const_cast<SmMathConfig*>(this)->LoadOther();
1257 return pOther->bPrintFrame;
1258}
1259
1260
1262{
1263 if (!pOther)
1264 LoadOther();
1265 SetOtherIfNotEqual( pOther->bPrintFrame, bVal );
1266}
1267
1268
1270{
1271 if (!pOther)
1272 LoadOther();
1273 SetOtherIfNotEqual( pOther->bIsSaveOnlyUsedSymbols, bVal );
1274}
1275
1276
1278{
1279 if (!pOther)
1280 LoadOther();
1281 SetOtherIfNotEqual( pOther->bIsAutoCloseBrackets, bVal );
1282}
1283
1285{
1286 if (!pOther)
1287 LoadOther();
1288 if (nVal != pOther->nSmSyntaxVersion)
1289 {
1290 CommitLocker aLock(*this);
1291 pOther->nSmSyntaxVersion = nVal;
1292 SetOtherModified( true );
1293 }
1294}
1295
1297{
1299 return false;
1300 if (!pOther)
1301 const_cast<SmMathConfig*>(this)->LoadOther();
1302 return pOther->bIgnoreSpacesRight;
1303}
1304
1305
1307{
1308 if (!pOther)
1309 LoadOther();
1310 if (SetOtherIfNotEqual( pOther->bIgnoreSpacesRight, bVal ))
1311 {
1312 // reformat (displayed) formulas accordingly
1313 Broadcast(SfxHint(SfxHintId::MathFormatChanged));
1314 }
1315
1316}
1317
1318
1320{
1321 if (!pOther)
1322 const_cast<SmMathConfig*>(this)->LoadOther();
1323 return pOther->bAutoRedraw;
1324}
1325
1326
1328{
1329 if (!pOther)
1330 LoadOther();
1331 SetOtherIfNotEqual( pOther->bAutoRedraw, bVal );
1332}
1333
1334
1336{
1337 if (!pOther)
1338 const_cast<SmMathConfig*>(this)->LoadOther();
1339 return pOther->bFormulaCursor;
1340}
1341
1342
1344{
1345 if (!pOther)
1346 LoadOther();
1347 SetOtherIfNotEqual( pOther->bFormulaCursor, bVal );
1348}
1349
1350void SmMathConfig::Notify( const css::uno::Sequence< OUString >& rNames )
1351{
1352 Clear();
1353 if (std::find(rNames.begin(), rNames.end(), "Misc/IgnoreSpacesRight") != rNames.end())
1354 Broadcast(SfxHint(SfxHintId::MathFormatChanged));
1355}
1356
1357
1359{
1360 CommitLocker aLock(*this);
1361
1362 sal_uInt16 nU16;
1363 bool bVal;
1364 if (const SfxUInt16Item* pPrintSizeItem = rSet.GetItemIfSet(SID_PRINTSIZE))
1365 { nU16 = pPrintSizeItem->GetValue();
1366 SetPrintSize( static_cast<SmPrintSize>(nU16) );
1367 }
1368 if (const SfxUInt16Item* pPrintZoomItem = rSet.GetItemIfSet(SID_PRINTZOOM))
1369 { nU16 = pPrintZoomItem->GetValue();
1370 SetPrintZoomFactor( nU16 );
1371 }
1372 if (const SfxUInt16Item* pPrintZoomItem = rSet.GetItemIfSet(SID_SMEDITWINDOWZOOM))
1373 { nU16 = pPrintZoomItem->GetValue();
1375 }
1376 if (const SfxBoolItem* pPrintTitleItem = rSet.GetItemIfSet(SID_PRINTTITLE))
1377 { bVal = pPrintTitleItem->GetValue();
1378 SetPrintTitle( bVal );
1379 }
1380 if (const SfxBoolItem* pPrintTextItem = rSet.GetItemIfSet(SID_PRINTTEXT))
1381 { bVal = pPrintTextItem->GetValue();
1382 SetPrintFormulaText( bVal );
1383 }
1384 if (const SfxBoolItem* pPrintZoomItem = rSet.GetItemIfSet(SID_PRINTFRAME))
1385 { bVal = pPrintZoomItem->GetValue();
1386 SetPrintFrame( bVal );
1387 }
1388 if (const SfxBoolItem* pRedrawItem = rSet.GetItemIfSet(SID_AUTOREDRAW))
1389 { bVal = pRedrawItem->GetValue();
1390 SetAutoRedraw( bVal );
1391 }
1392 if (const SfxBoolItem* pSpacesItem = rSet.GetItemIfSet(SID_NO_RIGHT_SPACES))
1393 { bVal = pSpacesItem->GetValue();
1394 SetIgnoreSpacesRight( bVal );
1395 }
1396 if (const SfxBoolItem* pSymbolsItem = rSet.GetItemIfSet(SID_SAVE_ONLY_USED_SYMBOLS))
1397 { bVal = pSymbolsItem->GetValue();
1398 SetSaveOnlyUsedSymbols( bVal );
1399 }
1400
1401 if (const SfxBoolItem* pBracketsItem = rSet.GetItemIfSet(SID_AUTO_CLOSE_BRACKETS))
1402 {
1403 bVal = pBracketsItem->GetValue();
1404 SetAutoCloseBrackets( bVal );
1405 }
1406
1407 if (const SfxUInt16Item* pSyntaxItem = rSet.GetItemIfSet(SID_DEFAULT_SM_SYNTAX_VERSION))
1408 {
1409 nU16 = pSyntaxItem->GetValue();
1411 }
1412}
1413
1414
1416{
1417 rSet.Put(SfxUInt16Item(SID_PRINTSIZE,
1418 sal::static_int_cast<sal_uInt16>(GetPrintSize())));
1419 rSet.Put(SfxUInt16Item(SID_PRINTZOOM,
1421 rSet.Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM,
1423
1424 rSet.Put(SfxBoolItem(SID_PRINTTITLE, IsPrintTitle()));
1425 rSet.Put(SfxBoolItem(SID_PRINTTEXT, IsPrintFormulaText()));
1426 rSet.Put(SfxBoolItem(SID_PRINTFRAME, IsPrintFrame()));
1427 rSet.Put(SfxBoolItem(SID_AUTOREDRAW, IsAutoRedraw()));
1428 rSet.Put(SfxBoolItem(SID_NO_RIGHT_SPACES, IsIgnoreSpacesRight()));
1429 rSet.Put(SfxBoolItem(SID_SAVE_ONLY_USED_SYMBOLS, IsSaveOnlyUsedSymbols()));
1430 rSet.Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, IsAutoCloseBrackets()));
1431 rSet.Put(SfxBoolItem(SID_DEFAULT_SM_SYNTAX_VERSION, GetDefaultSmSyntaxVersion()));
1432}
1433
1434/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const PropertyValue * pValues
const char * pName
constexpr OUStringLiteral FONT_FORMAT_LIST
Definition: cfgitem.cxx:46
static Sequence< OUString > lcl_GetFontPropertyNames()
Definition: cfgitem.cxx:48
static Sequence< OUString > lcl_GetSymbolPropertyNames()
Definition: cfgitem.cxx:60
static Sequence< OUString > lcl_GetOtherPropertyNames()
Definition: cfgitem.cxx:70
static Sequence< OUString > lcl_GetFormatPropertyNames()
Definition: cfgitem.cxx:87
constexpr OUStringLiteral SYMBOL_LIST
Definition: cfgitem.cxx:45
constexpr sal_uInt16 nDefaultSmSyntaxVersion(5)
const LanguageTag & GetUILanguageTag() const
static const AllSettings & GetSettings()
LanguageType getLanguageType(bool bResolveSystem=true) const
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
void Broadcast(const SfxHint &rHint)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
OUString GetFontFormatId(const SmFontFormat &rFntFmt) const
Definition: cfgitem.cxx:302
const SmFontFormat * GetFontFormat(std::u16string_view rFntFmtId) const
Definition: cfgitem.cxx:276
size_t GetCount() const
Definition: cfgitem.hxx:91
void SetModified(bool bVal)
Definition: cfgitem.hxx:94
void AddFontFormat(const OUString &rFntFmtId, const SmFontFormat &rFntFmt)
Definition: cfgitem.cxx:245
std::vector< SmFntFmtListEntry > aEntries
Definition: cfgitem.hxx:72
OUString GetNewFontFormatId() const
Definition: cfgitem.cxx:340
void RemoveFontFormat(std::u16string_view rFntFmtId)
Definition: cfgitem.cxx:259
bool IsModified() const
Definition: cfgitem.hxx:93
const SmFace & GetFont(sal_uInt16 nIdent) const
Definition: format.hxx:110
void LoadFormat()
Definition: cfgitem.cxx:952
void StripFontFormatList(const std::vector< SmSym > &rSymbols)
Definition: cfgitem.cxx:732
void SetSaveOnlyUsedSymbols(bool bVal)
Definition: cfgitem.cxx:1269
bool SetOtherIfNotEqual(bool &rbItem, bool bNewVal)
Definition: cfgitem.cxx:1186
void ReadFontFormat(SmFontFormat &rFontFormat, std::u16string_view rSymbolName, std::u16string_view rBaseNode) const
Definition: cfgitem.cxx:607
void UnlockCommit()
Definition: cfgitem.cxx:490
bool IsPrintFrame() const
Definition: cfgitem.cxx:1253
void SetDefaultSmSyntaxVersion(sal_uInt16 nVal)
Definition: cfgitem.cxx:1284
void SetSymbols(const std::vector< SmSym > &rNewSymbols)
Definition: cfgitem.cxx:520
bool bIsOtherModified
Definition: cfgitem.hxx:103
SmFontFormatList & GetFontFormatList()
Definition: cfgitem.cxx:577
void ItemSetToConfig(const SfxItemSet &rSet)
Definition: cfgitem.cxx:1358
sal_uInt16 GetSmEditWindowZoomFactor() const
Definition: cfgitem.cxx:1163
void SetFormatModified(bool bVal)
Definition: cfgitem.cxx:378
std::unique_ptr< SmCfgOther > pOther
Definition: cfgitem.hxx:100
void ConfigToItemSet(SfxItemSet &rSet) const
Definition: cfgitem.cxx:1415
void SaveFormat()
Definition: cfgitem.cxx:1041
void LoadOther()
Definition: cfgitem.cxx:771
const SmFormat & GetStandardFormat() const
Definition: cfgitem.cxx:1093
void Save()
Definition: cfgitem.cxx:482
bool IsFormatModified() const
Definition: cfgitem.hxx:132
bool IsPrintTitle() const
Definition: cfgitem.cxx:1199
bool IsAutoCloseBrackets() const
Definition: cfgitem.cxx:1237
virtual void Notify(const css::uno::Sequence< OUString > &rPropertyNames) override
Definition: cfgitem.cxx:1350
void GetSymbols(std::vector< SmSym > &rSymbols) const
Definition: cfgitem.cxx:506
bool IsAutoRedraw() const
Definition: cfgitem.cxx:1319
bool IsIgnoreSpacesRight() const
Definition: cfgitem.cxx:1296
void SetAutoRedraw(bool bVal)
Definition: cfgitem.cxx:1327
sal_Int32 m_nCommitLock
Definition: cfgitem.hxx:106
void LoadFontFormatList()
Definition: cfgitem.cxx:587
virtual void ImplCommit() override
Definition: cfgitem.cxx:476
bool IsShowFormulaCursor() const
Definition: cfgitem.cxx:1335
void SaveOther()
Definition: cfgitem.cxx:842
void SetAutoCloseBrackets(bool bVal)
Definition: cfgitem.cxx:1277
sal_uInt16 GetPrintZoomFactor() const
Definition: cfgitem.cxx:1142
void SetPrintFormulaText(bool bVal)
Definition: cfgitem.cxx:1223
void SetOtherModified(bool bVal)
Definition: cfgitem.cxx:372
void SetPrintSize(SmPrintSize eSize)
Definition: cfgitem.cxx:1129
void ReadSymbol(SmSym &rSymbol, const OUString &rSymbolName, std::u16string_view rBaseNode) const
Definition: cfgitem.cxx:384
bool IsPrintFormulaText() const
Definition: cfgitem.cxx:1215
SmPrintSize GetPrintSize() const
Definition: cfgitem.cxx:1121
void SetIgnoreSpacesRight(bool bVal)
Definition: cfgitem.cxx:1306
std::unique_ptr< SmFormat > pFormat
Definition: cfgitem.hxx:99
bool IsOtherModified() const
Definition: cfgitem.hxx:130
std::unique_ptr< SmFontFormatList > pFontFormatList
Definition: cfgitem.hxx:101
std::unique_ptr< SmSymbolManager > pSymbolMgr
Definition: cfgitem.hxx:102
SmSymbolManager & GetSymbolManager()
Definition: cfgitem.cxx:465
void SetShowFormulaCursor(bool bVal)
Definition: cfgitem.cxx:1343
void SetPrintFrame(bool bVal)
Definition: cfgitem.cxx:1261
void SetStandardFormat(const SmFormat &rFormat, bool bSaveFontFormatList=false)
Definition: cfgitem.cxx:1101
void SetPrintTitle(bool bVal)
Definition: cfgitem.cxx:1207
void Clear()
Definition: cfgitem.cxx:497
bool IsSaveOnlyUsedSymbols() const
Definition: cfgitem.cxx:1230
void SetPrintZoomFactor(sal_uInt16 nVal)
Definition: cfgitem.cxx:1150
bool bIsFormatModified
Definition: cfgitem.hxx:104
void SaveFontFormatList()
Definition: cfgitem.cxx:663
virtual ~SmMathConfig() override
Definition: cfgitem.cxx:366
void SetSmEditWindowZoomFactor(sal_uInt16 nVal)
Definition: cfgitem.cxx:1173
sal_uInt16 GetDefaultSmSyntaxVersion() const
Definition: cfgitem.cxx:1244
Definition: symbol.hxx:37
void SetExportName(const OUString &rName)
Definition: symbol.hxx:61
static bool PutProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues, bool bAllLocales)
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
static css::uno::Sequence< css::uno::Any > GetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
static bool ReplaceSetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, const css::uno::Sequence< css::beans::PropertyValue > &rValues, bool bAllLocales)
static css::uno::Sequence< OUString > GetNodeNames(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, ConfigNameFormat eFormat)
static bool IsFuzzing()
void SetFontSize(const Size &)
void SetPitch(FontPitch ePitch)
void SetItalic(FontItalic)
void SetWeight(FontWeight)
const OUString & GetFamilyName() const
void SetFamily(FontFamily)
void SetCharSet(rtl_TextEncoding)
void SetFamilyName(const OUString &rFamilyName)
int nCount
virtual OUString GetName() const override
float u
DefaultFontType
FontPitch
PITCH_DONTKNOW
FontItalic
ITALIC_NONE
FontFamily
FAMILY_DONTKNOW
WEIGHT_DONTKNOW
#define DIS_BEGIN
Definition: format.hxx:57
#define SIZ_END
Definition: format.hxx:42
#define FNT_BEGIN
Definition: format.hxx:45
SmHorAlign
Definition: format.hxx:85
#define SIZ_BEGIN
Definition: format.hxx:36
#define DIS_END
Definition: format.hxx:82
#define FNT_END
Definition: format.hxx:54
OUString aName
sal_uInt16 nPos
#define SAL_WARN(area, stream)
OUString GetExportSymbolSetName(std::u16string_view rUiName)
Definition: smmod.cxx:96
OUString GetUiSymbolName(std::u16string_view rExportName)
Definition: smmod.cxx:47
OUString GetUiSymbolSetName(std::u16string_view rExportName)
Definition: smmod.cxx:80
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
double getLength(const B2DPolygon &rCandidate)
int i
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
FontWeight
static SfxItemSet & rSet
bool bToolboxVisible
Definition: cfgitem.cxx:148
SmPrintSize ePrintSize
Definition: cfgitem.cxx:138
bool bIsAutoCloseBrackets
Definition: cfgitem.cxx:146
bool bAutoRedraw
Definition: cfgitem.cxx:149
bool bPrintFrame
Definition: cfgitem.cxx:144
bool bPrintTitle
Definition: cfgitem.cxx:142
sal_uInt16 nSmEditWindowZoomFactor
Definition: cfgitem.cxx:140
bool bIgnoreSpacesRight
Definition: cfgitem.cxx:147
sal_uInt16 nPrintZoomFactor
Definition: cfgitem.cxx:139
bool bFormulaCursor
Definition: cfgitem.cxx:150
sal_uInt16 nSmSyntaxVersion
Definition: cfgitem.cxx:141
bool bPrintFormulaText
Definition: cfgitem.cxx:143
bool bIsSaveOnlyUsedSymbols
Definition: cfgitem.cxx:145
SmFntFmtListEntry(OUString aId, SmFontFormat rFntFmt)
Definition: cfgitem.cxx:222
sal_Int16 nCharSet
Definition: cfgitem.hxx:49
sal_Int16 nWeight
Definition: cfgitem.hxx:52
sal_Int16 nPitch
Definition: cfgitem.hxx:51
sal_Int16 nItalic
Definition: cfgitem.hxx:53
OUString aName
Definition: cfgitem.hxx:48
sal_Int16 nFamily
Definition: cfgitem.hxx:50
bool operator==(const SmFontFormat &rFntFmt) const
Definition: cfgitem.cxx:211
vcl::Font GetFont() const
Definition: cfgitem.cxx:198
constexpr OUStringLiteral FONTNAME_MATH
Definition: types.hxx:25
SmPrintSize
Definition: types.hxx:28
@ PRINT_SIZE_NORMAL
Definition: types.hxx:29
o3tl::Length SmO3tlLengthUnit()
Definition: utility.hxx:125
sal_uInt32 sal_UCS4