LibreOffice Module oox (master)  1
Functions
oox::vml::ConversionHelper Namespace Reference

Functions

OOX_DLLPUBLIC bool separatePair (OUString &orValue1, OUString &orValue2, const OUString &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 (const OUString &rValue, double fDefValue)
 Converts the passed VML percentage measure string to a normalized floating-point value. More...
 
OOX_DLLPUBLIC Degree100 decodeRotation (const OUString &rValue)
 Converts the passed VML rotation value to degrees. More...
 
OOX_DLLPUBLIC sal_Int64 decodeMeasureToEmu (const GraphicHelper &rGraphicHelper, const OUString &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, const OUString &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, const OUString &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 OptValue< OUString > &roVmlColor, const OptValue< 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, const OUString &rPath)
 Converts VML path string into point and flag vectors. More...
 

Function Documentation

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 94 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 OptValue< OUString > &  roVmlColor,
const OptValue< double > &  roVmlOpacity,
::Color  nDefaultRgb,
::Color  nPrimaryRgb = API_RGB_TRANSPARENT 
)

Converts VML color attributes to a DrawingML color.

Parameters
roVmlColorThe 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)').
roVmlOpacityThe opacity of the color. If existing, this should be a floating-point value in the range [0.0;1.0].
nDefaultRgbDefault RGB color used if the parameter roVmlColor is empty.
nPrimaryRgbIf set to something else than API_RGB_TRANSPARENT, specifies the color to be used to resolve the color modifiers used in one-color gradients.
Returns
The resulting DrawingML color.

Definition at line 222 of file vmlformatting.cxx.

References oox::API_RGB_TRANSPARENT, oox::AttributeConversion::decodeToken(), oox::OptValue< Type >::get(), oox::GraphicHelper::getSystemColor(), oox::OptValue< Type >::has(), oox::drawingml::MAX_PERCENT, nValue, OUStringToOString(), separatePair(), toInt32(), 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,
const OUString &  rValue,
sal_Int32  nRefValue,
bool  bPixelX,
bool  bDefaultAsPixel 
)

Converts the passed VML measure string to EMU (English Metric Units).

Parameters
rGraphicHelperThe graphic helper needed to perform pixel conversion according to the current output device.
rValueThe VML measure value. This is a floating-point value with optional measure string following the value.
nRefValueReference value needed for percentage measure.
bPixelXSet 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.
bDefaultAsPixelSet to true if omitted measure unit means pixel. Set to false if omitted measure unit means EMU.

Definition at line 148 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 o3tl::saturating_cast().

Referenced by decodeMeasureToHmm(), and decodeMeasureToTwip().

sal_Int32 oox::vml::ConversionHelper::decodeMeasureToHmm ( const GraphicHelper rGraphicHelper,
const OUString &  rValue,
sal_Int32  nRefValue,
bool  bPixelX,
bool  bDefaultAsPixel 
)
sal_Int32 oox::vml::ConversionHelper::decodeMeasureToTwip ( const GraphicHelper rGraphicHelper,
const OUString &  rValue,
sal_Int32  nRefValue,
bool  bPixelX,
bool  bDefaultAsPixel 
)

Converts the passed VML measure string to Twip.

Parameters
rGraphicHelperSee above.
rValueSee above.
nRefValueSee above.
bPixelXSee above.
bDefaultAsPixelSee above.

Definition at line 213 of file vmlformatting.cxx.

References decodeMeasureToEmu(), o3tl::emu, and o3tl::twip.

Referenced by oox::vml::ShapeContext::setPoints().

double oox::vml::ConversionHelper::decodePercent ( const OUString &  rValue,
double  fDefValue 
)

Converts the passed VML percentage measure string to a normalized floating-point value.

Parameters
rValueThe 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 101 of file vmlformatting.cxx.

Degree100 oox::vml::ConversionHelper::decodeRotation ( const OUString &  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.

Parameters
rValueThe 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 124 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,
const OUString &  rPath 
)

Converts VML path string into point and flag vectors.

Parameters
rPointsThe point vector to fill with coordinates.
rFlagsThe flag vector to fill. PolygonFlags_NORMAL indicates a corresponding plain shape coordinate in rPoints and PolygonFlags_CONTROL indicates a bezier curve control point.
rPathThe VML path string.
rGraphicHelperSee above.

Referenced by oox::vml::BezierShape::implConvertAndInsert().

bool oox::vml::ConversionHelper::separatePair ( OUString &  orValue1,
OUString &  orValue2,
const OUString &  rValue,
sal_Unicode  cSep 
)