31#include <rtl/ustrbuf.hxx>
32#include <com/sun/star/uno/Any.hxx>
51 return aFontFamilyGenericMapping;
70 OUStringBuffer sValue;
75 sal_Int32 nFirst =
nPos;
77 sal_Int32 nLast = (-1 ==
nPos ? rStrImpValue.getLength() - 1 :
nPos - 1);
80 while( nLast > nFirst &&
' ' == rStrImpValue[nLast] )
84 while(nFirst <= nLast &&
' ' == rStrImpValue[nFirst])
88 sal_Unicode c = nFirst > nLast ? 0 : rStrImpValue[nFirst];
89 if( nFirst < nLast && (
'\'' == c ||
'\"' == c) && rStrImpValue[nLast] == c )
97 if( !sValue.isEmpty() )
100 sValue.append(rStrImpValue.subView(nFirst, nLast-nFirst+1));
108 if (!sValue.isEmpty())
110 rValue <<= sValue.makeStringAndClear();
120 OUString aStrFamilyName;
122 if( rValue >>= aStrFamilyName )
124 OUStringBuffer sValue( aStrFamilyName.getLength() + 2 );
128 sal_Int32 nFirst =
nPos;
129 nPos = aStrFamilyName.indexOf(
';',
nPos );
130 sal_Int32 nLast = (-1 ==
nPos ? aStrFamilyName.getLength() :
nPos);
148 while( nLast > nFirst &&
' ' == aStrFamilyName[nLast] )
152 while( nFirst <= nLast &&
' ' == aStrFamilyName[nFirst] )
155 if( nFirst <= nLast )
157 if( !sValue.isEmpty() )
158 sValue.append(
", " );
159 sal_Int32 nLen = nLast-nFirst+1;
160 std::u16string_view sFamily( aStrFamilyName.subView( nFirst, nLen ) );
162 for( sal_Int32
i=0;
i < nLen;
i++ )
165 if(
' ' == c ||
',' == c )
172 sValue.append(
'\'' );
173 sValue.append( sFamily );
175 sValue.append(
'\'' );
180 rStrExpValue = sValue.makeStringAndClear();
199 rValue <<= static_cast<sal_Int16>(eNewFamily);
209 sal_Int16 nFamily = sal_Int16();
210 if( rValue >>= nFamily )
217 rStrExpValue = aOut.makeStringAndClear();
231 rValue <<= sal_Int16(RTL_TEXTENCODING_SYMBOL);
239 sal_Int16 nSet = sal_Int16();
241 if( rValue >>= nSet )
243 if(
static_cast<rtl_TextEncoding
>(nSet) == RTL_TEXTENCODING_SYMBOL )
264 rValue <<= static_cast<sal_Int16>(eNewPitch);
272 sal_Int16 nPitch = sal_Int16();
275 if( rValue >>= nPitch )
282 rStrExpValue = aOut.makeStringAndClear();
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLFontEncodingPropHdl() override
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLFontFamilyNamePropHdl() override
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLFontFamilyPropHdl() override
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLFontPitchPropHdl() override
static sal_Int32 indexOfComma(std::u16string_view rStr, sal_Int32 nPos)
static const SvXMLEnumMapEntry< FontFamily > * lcl_getFontFamilyGenericMapping()
SvXMLEnumMapEntry< FontPitch > const aFontPitchMapping[]
Handling of tokens in XML:
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken