LibreOffice Module oox (master) 1
|
Functions | |
OOX_DLLPUBLIC bool | separatePair (std::u16string_view &orValue1, std::u16string_view &orValue2, std::u16string_view rValue, sal_Unicode cSep) |
Returns two values contained in rValue separated by cSep. More... | |
OOX_DLLPUBLIC bool | decodeBool (std::u16string_view rValue) |
Returns the boolean value from the passed string of a VML attribute. More... | |
OOX_DLLPUBLIC double | decodePercent (std::u16string_view rValue, double fDefValue) |
Converts the passed VML percentage measure string to a normalized floating-point value. More... | |
OOX_DLLPUBLIC Degree100 | decodeRotation (std::u16string_view rValue) |
Converts the passed VML rotation value to degrees. More... | |
OOX_DLLPUBLIC sal_Int64 | decodeMeasureToEmu (const GraphicHelper &rGraphicHelper, std::u16string_view rValue, sal_Int32 nRefValue, bool bPixelX, bool bDefaultAsPixel) |
Converts the passed VML measure string to EMU (English Metric Units). More... | |
OOX_DLLPUBLIC sal_Int32 | decodeMeasureToHmm (const GraphicHelper &rGraphicHelper, std::u16string_view rValue, sal_Int32 nRefValue, bool bPixelX, bool bDefaultAsPixel) |
Converts the passed VML measure string to 1/100 mm. More... | |
OOX_DLLPUBLIC sal_Int32 | decodeMeasureToTwip (const GraphicHelper &rGraphicHelper, std::u16string_view rValue, sal_Int32 nRefValue, bool bPixelX, bool bDefaultAsPixel) |
Converts the passed VML measure string to Twip. More... | |
OOX_DLLPUBLIC::oox::drawingml::Color | decodeColor (const GraphicHelper &rGraphicHelper, const std::optional< OUString > &roVmlColor, const std::optional< double > &roVmlOpacity, ::Color nDefaultRgb, ::Color nPrimaryRgb=API_RGB_TRANSPARENT) |
Converts VML color attributes to a DrawingML color. More... | |
OOX_DLLPUBLIC void | decodeVmlPath (::std::vector< ::std::vector< css::awt::Point > > &rPoints, ::std::vector< ::std::vector< css::drawing::PolygonFlags > > &rFlags, std::u16string_view rPath) |
Converts VML path string into point and flag vectors. More... | |
bool oox::vml::ConversionHelper::decodeBool | ( | std::u16string_view | rValue | ) |
Returns the boolean value from the passed string of a VML attribute.
Supported values: 'f', 't', 'false', 'true'. False for anything else.
Definition at line 97 of file vmlformatting.cxx.
References oox::AttributeConversion::decodeToken(), and nToken.
Referenced by oox::vml::ShapeContext::onCreateContext().
Color oox::vml::ConversionHelper::decodeColor | ( | const GraphicHelper & | rGraphicHelper, |
const std::optional< OUString > & | roVmlColor, | ||
const std::optional< double > & | roVmlOpacity, | ||
::Color | nDefaultRgb, | ||
::Color | nPrimaryRgb = API_RGB_TRANSPARENT |
||
) |
Converts VML color attributes to a DrawingML color.
roVmlColor | The VML string representation of the color. If existing, this can be a 3-digit or 6-digit hexadecimal RGB value with leading '#' character, a predefined color name (e.g. 'black', 'red', etc.), the index into an application defined color palette in brackets with leading color name (e.g. 'red [9]' or 'windowColor [64]'), or a color modifier used in one-color gradients (e.g. 'fill darken(128)' or 'fill lighten(0)'). |
roVmlOpacity | The opacity of the color. If existing, this should be a floating-point value in the range [0.0;1.0]. |
nDefaultRgb | Default RGB color used if the parameter roVmlColor is empty. |
nPrimaryRgb | If set to something else than API_RGB_TRANSPARENT, specifies the color to be used to resolve the color modifiers used in one-color gradients. |
Definition at line 225 of file vmlformatting.cxx.
References oox::API_RGB_TRANSPARENT, oox::AttributeConversion::decodeToken(), oox::GraphicHelper::getSystemColor(), oox::drawingml::MAX_PERCENT, nValue, OUStringToOString(), separatePair(), o3tl::toInt32(), o3tl::toUInt32(), and XML_TOKEN_INVALID.
Referenced by oox::vml::StrokeModel::pushToPropMap(), oox::vml::FillModel::pushToPropMap(), and oox::vml::ShadowModel::pushToPropMap().
sal_Int64 oox::vml::ConversionHelper::decodeMeasureToEmu | ( | const GraphicHelper & | rGraphicHelper, |
std::u16string_view | rValue, | ||
sal_Int32 | nRefValue, | ||
bool | bPixelX, | ||
bool | bDefaultAsPixel | ||
) |
Converts the passed VML measure string to EMU (English Metric Units).
rGraphicHelper | The graphic helper needed to perform pixel conversion according to the current output device. |
rValue | The VML measure value. This is a floating-point value with optional measure string following the value. |
nRefValue | Reference value needed for percentage measure. |
bPixelX | Set to true if the value is oriented horizontally (e.g. X coordinates, widths). Set to false if the value is oriented vertically (e.g. Y coordinates, heights). This is needed because output devices may specify different width and height for a pixel. |
bDefaultAsPixel | Set to true if omitted measure unit means pixel. Set to false if omitted measure unit means EMU. |
Definition at line 151 of file vmlformatting.cxx.
References o3tl::cm, o3tl::convert(), oox::GraphicHelper::convertScreenPixelXToHmm(), oox::GraphicHelper::convertScreenPixelYToHmm(), o3tl::emu, o3tl::in, o3tl::mm, o3tl::mm100, o3tl::pc, o3tl::pt, and u.
Referenced by decodeMeasureToHmm(), and decodeMeasureToTwip().
sal_Int32 oox::vml::ConversionHelper::decodeMeasureToHmm | ( | const GraphicHelper & | rGraphicHelper, |
std::u16string_view | rValue, | ||
sal_Int32 | nRefValue, | ||
bool | bPixelX, | ||
bool | bDefaultAsPixel | ||
) |
Converts the passed VML measure string to 1/100 mm.
rGraphicHelper | See above. |
rValue | See above. |
nRefValue | See above. |
bPixelX | See above. |
bDefaultAsPixel | See above. |
Definition at line 210 of file vmlformatting.cxx.
References oox::drawingml::convertEmuToHmm(), and decodeMeasureToEmu().
Referenced by oox::vml::ShapeBase::convertShapeProperties(), oox::vml::SimpleShape::createPictureObject(), oox::vml::SimpleShape::finalImplConvertAndInsert(), oox::vml::ShapeType::getAbsRectangle(), oox::vml::LineShape::getAbsRectangle(), oox::vml::SimpleShape::implConvertAndInsert(), oox::vml::BezierShape::implConvertAndInsert(), oox::vml::lcl_setSurround(), oox::vml::ShadowModel::pushToPropMap(), and oox::vml::TextBoxContext::TextBoxContext().
sal_Int32 oox::vml::ConversionHelper::decodeMeasureToTwip | ( | const GraphicHelper & | rGraphicHelper, |
std::u16string_view | rValue, | ||
sal_Int32 | nRefValue, | ||
bool | bPixelX, | ||
bool | bDefaultAsPixel | ||
) |
Converts the passed VML measure string to Twip.
@param rGraphicHelper See above. @param rValue See above. @param nRefValue See above. @param bPixelX See above. @param bDefaultAsPixel See above.
Definition at line 216 of file vmlformatting.cxx.
References decodeMeasureToEmu(), o3tl::emu, and o3tl::twip.
Referenced by oox::vml::ShapeContext::setPoints().
double oox::vml::ConversionHelper::decodePercent | ( | std::u16string_view | rValue, |
double | fDefValue | ||
) |
Converts the passed VML percentage measure string to a normalized floating-point value.
rValue | The VML percentage value. This is a floating-point value with optional following '' or 'f' sign. If the sign is missing, the floating point value will be returned unmodified. If the '' sign is present, the value will be divided by 100. If the 'f' sign is present, the value will be divided by 65536. |
Definition at line 104 of file vmlformatting.cxx.
Degree100 oox::vml::ConversionHelper::decodeRotation | ( | std::u16string_view | rValue | ) |
Converts the passed VML rotation value to degrees.
See DffPropertyReader::Fix16ToAngle(): in VML, positive rotation angles are clockwise, we have them as counter-clockwise. Additionally, VML type is 0..360, our is 0..36000.
rValue | The VML rotation value. This is a floating-point value with optional 'fd' suffix. If the suffix is missing, the floating point value will be returned unmodified. If the 'fd' suffix is present, the value will be divided by 65536. |
Definition at line 127 of file vmlformatting.cxx.
References NormAngle36000().
Referenced by oox::vml::ShapeBase::convertAndInsert(), oox::vml::SimpleShape::createPictureObject(), oox::vml::SimpleShape::implConvertAndInsert(), and oox::vml::GroupShape::implConvertAndInsert().
OOX_DLLPUBLIC void oox::vml::ConversionHelper::decodeVmlPath | ( | ::std::vector< ::std::vector< css::awt::Point > > & | rPoints, |
::std::vector< ::std::vector< css::drawing::PolygonFlags > > & | rFlags, | ||
std::u16string_view | rPath | ||
) |
Converts VML path string into point and flag vectors.
rPoints | The point vector to fill with coordinates. |
rFlags | The flag vector to fill. PolygonFlags_NORMAL indicates a corresponding plain shape coordinate in rPoints and PolygonFlags_CONTROL indicates a bezier curve control point. |
rPath | The VML path string. |
rGraphicHelper | See above. |
Referenced by oox::vml::BezierShape::implConvertAndInsert().
bool oox::vml::ConversionHelper::separatePair | ( | std::u16string_view & | orValue1, |
std::u16string_view & | orValue2, | ||
std::u16string_view | rValue, | ||
sal_Unicode | cSep | ||
) |
Returns two values contained in rValue separated by cSep.
Definition at line 80 of file vmlformatting.cxx.
References o3tl::trim().
Referenced by decodeColor(), oox::vml::TextpathModel::pushToPropMap(), oox::vml::ShadowModel::pushToPropMap(), oox::vml::ShapeTypeContext::setStyle(), and oox::vml::TextBoxContext::TextBoxContext().