if (mpLineStyle)
{ auto& rLineDash = mpLineStyle->maLineDash; switch (rAttribs.getToken(XML_val, XML_TOKEN_INVALID))
{ case XML_solid: rLineDash.mePresetType = model::PresetDashType::Solid; break; case XML_dot: rLineDash.mePresetType = model::PresetDashType::Dot; break; case XML_dash: rLineDash.mePresetType = model::PresetDashType::Dash; break; case XML_lgDash: rLineDash.mePresetType = model::PresetDashType::LargeDash; break; case XML_dashDot: rLineDash.mePresetType = model::PresetDashType::DashDot; break; case XML_lgDashDot: rLineDash.mePresetType = model::PresetDashType::LargeDashDot; break; case XML_lgDashDotDot: rLineDash.mePresetType = model::PresetDashType::LargeDashDotDot; break; case XML_sysDash: rLineDash.mePresetType = model::PresetDashType::SystemDash; break; case XML_sysDot: rLineDash.mePresetType = model::PresetDashType::SystemDot; break; case XML_sysDashDot: rLineDash.mePresetType = model::PresetDashType::SystemDashDot; break; case XML_sysDashDotDot: rLineDash.mePresetType = model::PresetDashType::SystemDashDotDot; break; default:
rLineDash.mePresetType = model::PresetDashType::Unset; break;
}
}
} break; case A_TOKEN( custDash ): // CT_DashStopList returnthis; case A_TOKEN( ds ):
{ // 'a:ds' has 2 attributes : 'd' and 'sp' // both are of type 'a:ST_PositivePercentage' // according to the specs Office will read percentages formatted with a trailing percent sign // or formatted as 1000th of a percent without a trailing percent sign, but only write percentages // as 1000th's of a percent without a trailing percent sign. // The code below takes care of both scenarios by converting to '1000th of a percent' always
OUString aStr;
sal_Int32 nDashLength = 0;
aStr = rAttribs.getStringDefaulted( XML_d); if ( aStr.endsWith("%") )
{ // Ends with a '%'
aStr = aStr.copy(0, aStr.getLength() - 1);
aStr = aStr.trim();
nDashLength = aStr.toInt32();
// Convert to 1000th of a percent
nDashLength *= 1000;
} else
{
nDashLength = rAttribs.getInteger( XML_d, 0 );
}
sal_Int32 nSpaceLength = 0;
aStr = rAttribs.getStringDefaulted( XML_sp); if ( aStr.endsWith("%") )
{ // Ends with a '%'
aStr = aStr.copy(0, aStr.getLength() - 1);
aStr = aStr.trim();
nSpaceLength = aStr.toInt32();
// Convert to 1000th of a percent
nSpaceLength *= 1000;
} else
{
nSpaceLength = rAttribs.getInteger( XML_sp, 0 );
}
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.