23#include <rtl/ustrbuf.hxx>
25#include <rtl/math.hxx>
37 return (fabs(
scale.getX()) + fabs(
scale.getY())) / 2.0;
42 size_t pairCount = dashArray.size() / 2;
45 for (
size_t i = 0;
i < pairCount;
i++)
49 props[
"draw:style"] =
"rect";
53 int dotCounts[3] = {0, 0, 0};
54 double dotLengths[3] = {0.0, 0.0, 0.0};
56 for (
size_t i = 0;
i < pairCount;
i++)
58 if (!rtl::math::approxEqual(dotLengths[dotStage], dashArray[
i * 2]))
64 dotCounts[dotStage] = 1;
65 dotLengths[dotStage] = dashArray[
i * 2];
69 dotCounts[dotStage]++;
73 for (
int i = 1;
i < 3;
i++)
75 if (dotCounts[
i] == 0)
77 props[
"draw:dots" + OUString::number(
i)] = OUString::number(dotCounts[
i]);
78 props[
"draw:dots" + OUString::number(
i) +
"-length"] =
85 OUStringBuffer
aBuf( 7 );
92 aBuf.append( sal_Int32(nRed), 16 );
95 aBuf.append( sal_Int32(nGreen), 16 );
98 aBuf.append( sal_Int32(nBlue), 16 );
100 return aBuf.makeStringAndClear();
105 return OUString::number(
value) +
"%";
110 return OUString::number(rtl_math_round( fMM, 2, rtl_math_RoundingMode_Floor )) +
"mm";
115 return OUString::number( rtl_math_round(
convPx2mm( fPix ), 2, rtl_math_RoundingMode_Floor ) ) +
"mm";
def rotate(shapename, deg)
B2IRange fround(const B2DRange &rRange)
OUString convertPixelToUnitString(double fPix)
OUString getColorString(const css::rendering::ARGBColor &)
Convert color to "#FEFEFE" color notation.
double convPx2mm(double fPix)
OUString getPercentString(double value)
double GetAverageTransformationScale(const basegfx::B2DHomMatrix &matrix)
OUString unitMMString(double fMM)
std::unordered_map< OUString, OUString > PropertyMap
void FillDashStyleProps(PropertyMap &props, const std::vector< double > &dashArray, double scale)