1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sal/config.h>
22 #include <o3tl/string_view.hxx>
23 #include <officecfg/Office/Common.hxx>
24 #include <sax/tools/converter.hxx>
26 #include <com/sun/star/util/PathSubstitution.hpp>
27 #include <com/sun/star/util/XStringSubstitution.hpp>
29 #include <xmloff/DocumentSettingsContext.hxx>
30 #include <xmloff/xmlimp.hxx>
31 #include <xmloff/xmltoken.hxx>
32 #include <xmloff/xmlnamespace.hxx>
33 #include <xmloff/namespacemap.hxx>
34 #include <comphelper/base64.hxx>
37 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
38 #include <com/sun/star/container/XIndexContainer.hpp>
39 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
40 #include <com/sun/star/formula/SymbolDescriptor.hpp>
41 #include <com/sun/star/frame/XModel.hpp>
42 #include <com/sun/star/util/DateTime.hpp>
43 #include <com/sun/star/document/XViewDataSupplier.hpp>
44 #include <com/sun/star/document/PrinterIndependentLayout.hpp>
45 #include <com/sun/star/document/NamedPropertyValues.hpp>
46 #include <com/sun/star/beans/XPropertySet.hpp>
47 #include <comphelper/indexedpropertyvalues.hxx>
48 #include <sal/log.hxx>
49 #include <osl/diagnose.h>
50 #include <comphelper/diagnose_ex.hxx>
51 #include <unotools/configmgr.hxx>
52 #include "xmlenums.hxx"
54 using namespace com::sun::star
;
55 using namespace ::xmloff::token
;
61 std::vector
<beans::PropertyValue
> aProps
;
64 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
67 explicit XMLMyList(uno::Reference
<uno::XComponentContext
> xContext
);
69 void push_back(beans::PropertyValue
const & aProp
) { aProps
.push_back(aProp
); nCount
++; }
70 uno::Sequence
<beans::PropertyValue
> GetSequence();
71 uno::Reference
<container::XNameContainer
> GetNameContainer();
72 uno::Reference
<container::XIndexContainer
> GetIndexContainer();
77 XMLMyList::XMLMyList(uno::Reference
<uno::XComponentContext
> xContext
)
79 m_xContext(std::move(xContext
))
81 assert(m_xContext
.is());
84 uno::Sequence
<beans::PropertyValue
> XMLMyList::GetSequence()
86 uno::Sequence
<beans::PropertyValue
> aSeq
;
89 assert(nCount
== aProps
.size());
91 beans::PropertyValue
* pProps
= aSeq
.getArray();
92 for (auto const& prop
: aProps
)
101 uno::Reference
<container::XNameContainer
> XMLMyList::GetNameContainer()
103 uno::Reference
<container::XNameContainer
> xNameContainer
= document::NamedPropertyValues::create(m_xContext
);
104 for (auto const& prop
: aProps
)
106 xNameContainer
->insertByName(prop
.Name
, prop
.Value
);
109 return xNameContainer
;
112 uno::Reference
<container::XIndexContainer
> XMLMyList::GetIndexContainer()
114 rtl::Reference
< comphelper::IndexedPropertyValuesContainer
> xIndexContainer
= new comphelper::IndexedPropertyValuesContainer();
116 for (auto const& prop
: aProps
)
118 xIndexContainer
->insertByIndex(i
, prop
.Value
);
122 return xIndexContainer
;
127 class XMLConfigBaseContext
: public SvXMLImportContext
131 beans::PropertyValue maProp
;
132 css::uno::Any
& mrAny
;
133 XMLConfigBaseContext
* mpBaseContext
;
135 XMLConfigBaseContext(SvXMLImport
& rImport
,
137 XMLConfigBaseContext
* pBaseContext
);
139 void AddPropertyValue() { maProps
.push_back(maProp
); }
142 class XMLConfigItemContext
: public SvXMLImportContext
145 css::uno::Any
& mrAny
;
146 const OUString mrItemName
;
147 XMLConfigBaseContext
* mpBaseContext
;
148 OUStringBuffer maCharBuffer
;
151 XMLConfigItemContext(SvXMLImport
& rImport
,
152 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
,
155 XMLConfigBaseContext
* pBaseContext
);
157 virtual void SAL_CALL
characters( const OUString
& rChars
) override
;
159 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
161 void ManipulateConfigItem();
164 class XMLConfigItemSetContext
: public XMLConfigBaseContext
167 XMLConfigItemSetContext(SvXMLImport
& rImport
,
169 XMLConfigBaseContext
* pBaseContext
);
171 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
172 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
174 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
177 class XMLConfigItemMapNamedContext
: public XMLConfigBaseContext
180 XMLConfigItemMapNamedContext(SvXMLImport
& rImport
,
182 XMLConfigBaseContext
* pBaseContext
);
184 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
185 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
187 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
190 class XMLConfigItemMapIndexedContext
: public XMLConfigBaseContext
193 OUString maConfigItemName
;
196 XMLConfigItemMapIndexedContext(SvXMLImport
& rImport
,
198 OUString aConfigItemName
,
199 XMLConfigBaseContext
* pBaseContext
);
201 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
202 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
204 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
209 static SvXMLImportContext
*CreateSettingsContext(SvXMLImport
& rImport
, sal_Int32 nElement
,
210 const uno::Reference
<xml::sax::XFastAttributeList
>& xAttrList
,
211 beans::PropertyValue
& rProp
, XMLConfigBaseContext
* pBaseContext
)
213 SvXMLImportContext
*pContext
= nullptr;
216 for (auto &aIter
: sax_fastparser::castToFastAttributeList( xAttrList
))
218 if (aIter
.getToken() == XML_ELEMENT(CONFIG
, XML_NAME
))
219 rProp
.Name
= aIter
.toString();
222 if (nElement
== XML_ELEMENT(CONFIG
, XML_CONFIG_ITEM
))
223 pContext
= new XMLConfigItemContext(rImport
, xAttrList
, rProp
.Value
, rProp
.Name
, pBaseContext
);
224 else if(nElement
== XML_ELEMENT(CONFIG
, XML_CONFIG_ITEM_SET
) ||
225 nElement
== XML_ELEMENT(CONFIG
, XML_CONFIG_ITEM_MAP_ENTRY
) )
226 pContext
= new XMLConfigItemSetContext(rImport
, rProp
.Value
, pBaseContext
);
227 else if(nElement
== XML_ELEMENT(CONFIG
, XML_CONFIG_ITEM_MAP_NAMED
))
228 pContext
= new XMLConfigItemMapNamedContext(rImport
, rProp
.Value
, pBaseContext
);
229 else if(nElement
== XML_ELEMENT(CONFIG
, XML_CONFIG_ITEM_MAP_INDEXED
))
230 pContext
= new XMLConfigItemMapIndexedContext(rImport
, rProp
.Value
, rProp
.Name
, pBaseContext
);
235 XMLDocumentSettingsContext::XMLDocumentSettingsContext(SvXMLImport
& rImport
)
236 : SvXMLImportContext( rImport
)
238 // here are no attributes
241 XMLDocumentSettingsContext::~XMLDocumentSettingsContext()
245 css::uno::Reference
< css::xml::sax::XFastContextHandler
> XMLDocumentSettingsContext::createFastChildContext(
247 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
)
249 SvXMLImportContext
*pContext
= nullptr;
252 for (auto &aIter
: sax_fastparser::castToFastAttributeList( xAttrList
))
254 if (aIter
.getToken() == XML_ELEMENT(CONFIG
, XML_NAME
))
255 sName
= aIter
.toString();
258 if (nElement
== XML_ELEMENT(CONFIG
, XML_CONFIG_ITEM_SET
))
260 OUString aLocalConfigName
;
261 sal_uInt16 nConfigPrefix
=
262 GetImport().GetNamespaceMap().GetKeyByAttrValueQName(
263 sName
, &aLocalConfigName
);
265 if( XML_NAMESPACE_OOO
== nConfigPrefix
)
267 if (IsXMLToken(aLocalConfigName
, XML_VIEW_SETTINGS
))
268 pContext
= new XMLConfigItemSetContext(GetImport(),
269 maViewProps
, nullptr);
270 else if (IsXMLToken(aLocalConfigName
,
271 XML_CONFIGURATION_SETTINGS
))
272 pContext
= new XMLConfigItemSetContext(GetImport(),
273 maConfigProps
, nullptr);
276 maDocSpecificSettings
.push_back( {aLocalConfigName
, uno::Any()} );
278 pContext
= new XMLConfigItemSetContext(GetImport(),
279 maDocSpecificSettings
.back().aSettings
, nullptr);
287 void XMLDocumentSettingsContext::endFastElement(sal_Int32
)
289 uno::Sequence
<beans::PropertyValue
> aSeqViewProps
;
290 if (maViewProps
>>= aSeqViewProps
)
292 GetImport().SetViewSettings(aSeqViewProps
);
293 sal_Int32
i(aSeqViewProps
.getLength() - 1);
295 while((i
>= 0) && !bFound
)
297 if (aSeqViewProps
[i
].Name
== "Views")
300 uno::Reference
<container::XIndexAccess
> xIndexAccess
;
301 if (aSeqViewProps
[i
].Value
>>= xIndexAccess
)
303 uno::Reference
<document::XViewDataSupplier
> xViewDataSupplier(GetImport().GetModel(), uno::UNO_QUERY
);
304 if (xViewDataSupplier
.is())
305 xViewDataSupplier
->setViewData(xIndexAccess
);
313 uno::Sequence
<beans::PropertyValue
> aSeqConfigProps
;
314 if ( maConfigProps
>>= aSeqConfigProps
)
316 if (!utl::ConfigManager::IsFuzzing() && !officecfg::Office::Common::Save::Document::LoadPrinter::get())
318 auto aSeqConfigPropsRange
= asNonConstRange(aSeqConfigProps
);
319 sal_Int32 i
= aSeqConfigProps
.getLength() - 1;
322 while ( ( i
>= 0 ) && nFound
< 2 )
324 OUString
sProp( aSeqConfigProps
[i
].Name
);
326 if ( sProp
== "PrinterName" )
328 aSeqConfigPropsRange
[i
].Value
<<= OUString();
331 else if ( sProp
== "PrinterSetup" )
333 uno::Sequence
< sal_Int8
> aEmpty
;
334 aSeqConfigPropsRange
[i
].Value
<<= aEmpty
;
342 GetImport().SetConfigurationSettings( aSeqConfigProps
);
345 for (auto const& settings
: maDocSpecificSettings
)
347 uno::Sequence
< beans::PropertyValue
> aDocSettings
;
348 OSL_VERIFY( settings
.aSettings
>>= aDocSettings
);
349 GetImport().SetDocumentSpecificSettings( settings
.sGroupName
, aDocSettings
);
353 XMLConfigBaseContext::XMLConfigBaseContext(SvXMLImport
& rImport
,
354 css::uno::Any
& rTempAny
,
355 XMLConfigBaseContext
* pTempBaseContext
)
356 : SvXMLImportContext( rImport
),
357 maProps( rImport
.GetComponentContext() ),
359 mpBaseContext(pTempBaseContext
)
363 XMLConfigItemSetContext::XMLConfigItemSetContext(SvXMLImport
& rImport
,
365 XMLConfigBaseContext
* pBaseContext
)
366 : XMLConfigBaseContext( rImport
, rAny
, pBaseContext
)
368 // here are no attributes
371 css::uno::Reference
< css::xml::sax::XFastContextHandler
> XMLConfigItemSetContext::createFastChildContext(
373 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
)
375 return CreateSettingsContext(GetImport(), nElement
, xAttrList
, maProp
, this);
378 void XMLConfigItemSetContext::endFastElement(sal_Int32
)
380 mrAny
<<= maProps
.GetSequence();
382 mpBaseContext
->AddPropertyValue();
385 XMLConfigItemContext::XMLConfigItemContext(SvXMLImport
& rImport
,
386 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
,
387 css::uno::Any
& rTempAny
,
388 OUString aTempItemName
,
389 XMLConfigBaseContext
* pTempBaseContext
)
390 : SvXMLImportContext(rImport
),
392 mrItemName(std::move(aTempItemName
)),
393 mpBaseContext(pTempBaseContext
)
395 for (auto &aIter
: sax_fastparser::castToFastAttributeList( xAttrList
))
397 if (aIter
.getToken() == XML_ELEMENT(CONFIG
, XML_TYPE
))
398 msType
= aIter
.toString();
402 void XMLConfigItemContext::characters( const OUString
& rChars
)
404 maCharBuffer
.append(rChars
);
407 void XMLConfigItemContext::endFastElement(sal_Int32
)
410 uno::Sequence
<sal_Int8
> aDecoded
;
411 if (IsXMLToken(msType
, XML_BASE64BINARY
))
413 std::u16string_view sChars
= o3tl::trim(maCharBuffer
);
414 if( !sChars
.empty() )
415 ::comphelper::Base64::decodeSomeChars( aDecoded
, sChars
);
416 maCharBuffer
.setLength(0);
419 sValue
= maCharBuffer
.makeStringAndClear();
423 if (IsXMLToken(msType
, XML_BOOLEAN
))
426 if (IsXMLToken(sValue
, XML_TRUE
))
430 else if (IsXMLToken(msType
, XML_BYTE
))
433 ::sax::Converter::convertNumber(nValue
, sValue
);
434 mrAny
<<= static_cast<sal_Int8
>(nValue
);
436 else if (IsXMLToken(msType
, XML_SHORT
))
439 ::sax::Converter::convertNumber(nValue
, sValue
);
440 mrAny
<<= static_cast<sal_Int16
>(nValue
);
442 else if (IsXMLToken(msType
, XML_INT
))
445 ::sax::Converter::convertNumber(nValue
, sValue
);
448 else if (IsXMLToken(msType
, XML_LONG
))
450 sal_Int64
nValue(sValue
.toInt64());
453 else if (IsXMLToken(msType
, XML_DOUBLE
))
456 ::sax::Converter::convertDouble(fValue
, sValue
);
459 else if (IsXMLToken(msType
, XML_STRING
))
463 else if (IsXMLToken(msType
, XML_DATETIME
))
465 util::DateTime aDateTime
;
466 if (::sax::Converter::parseDateTime(aDateTime
, sValue
))
469 SAL_WARN("xmloff.core", "XMLConfigItemContext: broken DateTime '" << sValue
<< "'");
471 else if (IsXMLToken(msType
, XML_BASE64BINARY
))
476 SAL_INFO("xmloff.core",
477 "XMLConfigItemContext: unknown type: " << msType
);
480 ManipulateConfigItem();
482 mpBaseContext
->AddPropertyValue();
485 assert(false && "no BaseContext");
489 /** There are some instances where there is a mismatch between API and
490 * XML mapping of a setting. In this case, this method allows us to
491 * manipulate the values accordingly. */
492 void XMLConfigItemContext::ManipulateConfigItem()
494 if( mrItemName
== "PrinterIndependentLayout" )
499 sal_Int16 nTmp
= document::PrinterIndependentLayout::HIGH_RESOLUTION
;
501 if( sValue
== "enabled" || sValue
== "low-resolution" )
503 nTmp
= document::PrinterIndependentLayout::LOW_RESOLUTION
;
505 else if ( sValue
== "disabled" )
507 nTmp
= document::PrinterIndependentLayout::DISABLED
;
509 // else: default to high_resolution
513 else if( (mrItemName
== "ColorTableURL") || (mrItemName
== "LineEndTableURL") || (mrItemName
== "HatchTableURL")
514 || (mrItemName
== "DashTableURL") || (mrItemName
== "GradientTableURL") || (mrItemName
== "BitmapTableURL") )
518 uno::Reference
< uno::XComponentContext
> xContext( GetImport().GetComponentContext() );
519 uno::Reference
< util::XStringSubstitution
> xStringSubstitution( util::PathSubstitution::create(xContext
) );
523 aURL
= xStringSubstitution
->substituteVariables( aURL
, false );
526 catch( uno::Exception
& )
532 XMLConfigItemMapNamedContext::XMLConfigItemMapNamedContext(SvXMLImport
& rImport
,
534 XMLConfigBaseContext
* pBaseContext
)
535 : XMLConfigBaseContext(rImport
, rAny
, pBaseContext
)
539 css::uno::Reference
< css::xml::sax::XFastContextHandler
> XMLConfigItemMapNamedContext::createFastChildContext(
541 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
)
543 return CreateSettingsContext(GetImport(), nElement
, xAttrList
, maProp
, this);
546 void XMLConfigItemMapNamedContext::endFastElement(sal_Int32
)
550 mrAny
<<= maProps
.GetNameContainer();
551 mpBaseContext
->AddPropertyValue();
554 assert(false && "no BaseContext");
558 XMLConfigItemMapIndexedContext::XMLConfigItemMapIndexedContext(SvXMLImport
& rImport
,
560 OUString aConfigItemName
,
561 XMLConfigBaseContext
* pBaseContext
)
562 : XMLConfigBaseContext(rImport
, rAny
, pBaseContext
),
563 maConfigItemName(std::move( aConfigItemName
))
567 css::uno::Reference
< css::xml::sax::XFastContextHandler
> XMLConfigItemMapIndexedContext::createFastChildContext(
569 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
)
571 return CreateSettingsContext(GetImport(), nElement
, xAttrList
, maProp
, this);
574 void XMLConfigItemMapIndexedContext::endFastElement(sal_Int32
)
578 if ( maConfigItemName
== "ForbiddenCharacters" )
580 uno::Reference
< i18n::XForbiddenCharacters
> xForbChars
;
582 // get the forbidden characters from the document
583 uno::Reference
< lang::XMultiServiceFactory
> xFac( GetImport().GetModel(), uno::UNO_QUERY
);
586 uno::Reference
< beans::XPropertySet
> xProps( xFac
->createInstance( "com.sun.star.document.Settings" ), uno::UNO_QUERY
);
587 if( xProps
.is() && xProps
->getPropertySetInfo()->hasPropertyByName( maConfigItemName
) )
589 xProps
->getPropertyValue( maConfigItemName
) >>= xForbChars
;
593 if( xForbChars
.is() )
596 uno::Reference
< container::XIndexAccess
> xIndex
= maProps
.GetIndexContainer();
598 const sal_Int32 nCount
= xIndex
->getCount();
599 uno::Sequence
< beans::PropertyValue
> aProps
;
600 for (sal_Int32 i
= 0; i
< nCount
; i
++)
602 if ((xIndex
->getByIndex( i
) >>= aProps
) && (aProps
.getLength() == XML_FORBIDDEN_CHARACTER_MAX
) )
604 /* FIXME-BCP47: this stupid and counterpart in
605 * xmloff/source/core/SettingsExportHelper.cxx
606 * XMLSettingsExportHelper::exportForbiddenCharacters()
609 beans::PropertyValue
*pForChar
= aProps
.getArray();
610 i18n::ForbiddenCharacters aForbid
;
611 lang::Locale aLocale
;
612 bool bHaveLanguage
= false, bHaveCountry
= false, bHaveVariant
= false,
613 bHaveBegin
= false, bHaveEnd
= false;
615 for ( sal_Int32 j
= 0 ; j
< XML_FORBIDDEN_CHARACTER_MAX
; j
++ )
617 if (pForChar
->Name
== "Language")
619 pForChar
->Value
>>= aLocale
.Language
;
620 bHaveLanguage
= true;
622 else if (pForChar
->Name
== "Country")
624 pForChar
->Value
>>= aLocale
.Country
;
627 else if (pForChar
->Name
== "Variant")
629 pForChar
->Value
>>= aLocale
.Variant
;
632 else if (pForChar
->Name
== "BeginLine")
634 pForChar
->Value
>>= aForbid
.beginLine
;
637 else if (pForChar
->Name
== "EndLine")
639 pForChar
->Value
>>= aForbid
.endLine
;
645 if ( bHaveLanguage
&& bHaveCountry
&& bHaveVariant
&& bHaveBegin
&& bHaveEnd
)
649 xForbChars
->setForbiddenCharacters( aLocale
, aForbid
);
651 catch (uno::Exception
const&)
653 TOOLS_WARN_EXCEPTION("xmloff.core",
654 "Exception while importing forbidden characters");
662 SAL_WARN("xmloff.core", "could not get the XForbiddenCharacters from document!");
663 mrAny
<<= maProps
.GetIndexContainer();
666 else if ( maConfigItemName
== "Symbols" )
668 uno::Reference
< container::XIndexAccess
> xIndex
= maProps
.GetIndexContainer();
670 const sal_Int32 nCount
= xIndex
->getCount();
671 uno::Sequence
< beans::PropertyValue
> aProps
;
672 uno::Sequence
< formula::SymbolDescriptor
> aSymbolList ( nCount
);
674 formula::SymbolDescriptor
*pDescriptor
= aSymbolList
.getArray();
676 sal_Int16 nNumFullEntries
= 0;
678 for ( sal_Int32 i
= 0; i
< nCount
; i
++ )
680 if ((xIndex
->getByIndex( i
) >>= aProps
) && (aProps
.getLength() == XML_SYMBOL_DESCRIPTOR_MAX
) )
682 bool bHaveName
= false, bHaveExportName
= false, bHaveCharSet
= false,
683 bHaveFontName
= false, bHaveFamily
= false, bHavePitch
= false,
684 bHaveWeight
= false, bHaveItalic
= false, bHaveSymbolSet
= false,
685 bHaveCharacter
= false;
686 beans::PropertyValue
*pSymbol
= aProps
.getArray();
688 for ( sal_Int32 j
= 0 ; j
< XML_SYMBOL_DESCRIPTOR_MAX
; j
++ )
690 if (pSymbol
->Name
== "Name")
692 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].sName
;
695 else if (pSymbol
->Name
== "ExportName")
697 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].sExportName
;
698 bHaveExportName
= true;
700 else if (pSymbol
->Name
== "FontName")
702 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].sFontName
;
703 bHaveFontName
= true;
705 else if (pSymbol
->Name
== "CharSet")
707 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].nCharSet
;
710 else if (pSymbol
->Name
== "Family")
712 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].nFamily
;
715 else if (pSymbol
->Name
== "Pitch")
717 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].nPitch
;
720 else if (pSymbol
->Name
== "Weight")
722 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].nWeight
;
725 else if (pSymbol
->Name
== "Italic")
727 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].nItalic
;
730 else if (pSymbol
->Name
== "SymbolSet")
732 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].sSymbolSet
;
733 bHaveSymbolSet
= true;
735 else if (pSymbol
->Name
== "Character")
737 pSymbol
->Value
>>= pDescriptor
[nNumFullEntries
].nCharacter
;
738 bHaveCharacter
= true;
742 if ( bHaveName
&& bHaveExportName
&& bHaveCharSet
&& bHaveFontName
&& bHaveCharacter
743 && bHaveFamily
&& bHavePitch
&& bHaveWeight
&& bHaveItalic
&& bHaveSymbolSet
)
747 aSymbolList
.realloc (nNumFullEntries
);
748 mrAny
<<= aSymbolList
;
752 mrAny
<<= maProps
.GetIndexContainer();
754 mpBaseContext
->AddPropertyValue();
757 assert(false && "no BaseContext");
761 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */