XMLUnderlineTypePropHdl::~XMLUnderlineTypePropHdl()
{ // nothing to do
}
bool XMLUnderlineTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
sal_uInt16 eNewUnderline(0); bool bRet = SvXMLUnitConverter::convertEnum(
eNewUnderline, rStrImpValue, pXML_UnderlineType_Enum ); if( bRet )
{ // multi property: style and width might be set already. // If the old value is NONE, the new is used unchanged.
sal_Int16 eUnderline = sal_Int16(); if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
{ switch( eNewUnderline )
{ case awt::FontUnderline::NONE: case awt::FontUnderline::SINGLE: // keep existing line style
eNewUnderline = eUnderline; break; case awt::FontUnderline::DOUBLE: // A double line style has priority over a bold line style, // but not over the line style itself. switch( eUnderline )
{ case awt::FontUnderline::SINGLE: case awt::FontUnderline::BOLD: break; case awt::FontUnderline::WAVE: case awt::FontUnderline::BOLDWAVE:
eNewUnderline = awt::FontUnderline::DOUBLEWAVE; break; default: // If a double line style is not supported for the existing // value, keep the new one
eNewUnderline = eUnderline; break;
} break; default:
OSL_ENSURE( bRet, "unexpected line type value" ); break;
} if( eNewUnderline != eUnderline )
rValue <<= static_cast<sal_Int16>(eNewUnderline);
} else
{
rValue <<= static_cast<sal_Int16>(eNewUnderline);
}
}
XMLUnderlineWidthPropHdl::~XMLUnderlineWidthPropHdl()
{ // nothing to do
}
bool XMLUnderlineWidthPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
sal_uInt16 eNewUnderline(0); bool bRet = SvXMLUnitConverter::convertEnum(
eNewUnderline, rStrImpValue, pXML_UnderlineWidth_Enum ); if( bRet )
{ // multi property: style and width might be set already. // If the old value is NONE, the new is used unchanged.
sal_Int16 eUnderline = sal_Int16(); if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
{ switch( eNewUnderline )
{ case awt::FontUnderline::NONE: // keep existing line style
eNewUnderline = eUnderline; break; case awt::FontUnderline::BOLD: // A double line style has priority over a bold line style, // but not over the line style itself. switch( eUnderline )
{ case awt::FontUnderline::SINGLE: break; case awt::FontUnderline::DOTTED:
eNewUnderline = awt::FontUnderline::BOLDDOTTED; break; case awt::FontUnderline::DASH:
eNewUnderline = awt::FontUnderline::BOLDDASH; break; case awt::FontUnderline::LONGDASH:
eNewUnderline = awt::FontUnderline::BOLDLONGDASH; break; case awt::FontUnderline::DASHDOT:
eNewUnderline = awt::FontUnderline::BOLDDASHDOT; break; case awt::FontUnderline::DASHDOTDOT:
eNewUnderline = awt::FontUnderline::BOLDDASHDOTDOT; break; case awt::FontUnderline::WAVE:
eNewUnderline = awt::FontUnderline::BOLDWAVE; break; default: // a double line style overwrites a bold one
eNewUnderline = eUnderline; break;
} break; default:
OSL_ENSURE( bRet, "unexpected line width value" ); break;
} if( eNewUnderline != eUnderline )
rValue <<= static_cast<sal_Int16>(eNewUnderline);
} else
{
rValue <<= static_cast<sal_Int16>(eNewUnderline);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.