diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-08-13 16:58:10 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-08-27 14:05:28 +0200 |
commit | c2f3f7566464fb291697172a96cb3ea39f51e86f (patch) | |
tree | e4f913dc8ae0cbbbff510f65b5a2d6a2b6911e50 /svx | |
parent | cae89c4d95a9f5cf5ae217ea48e469362e4e3310 (diff) |
Share common code
Change-Id: I98089cf93ba229f723628f8a70ef67ec7739c686
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 117 |
1 files changed, 36 insertions, 81 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 73d6c6175b49..bad9f41cb71d 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -417,102 +417,57 @@ double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double double fSingleDashLen = (double)GetDashLen(); double fSingleDotLen = (double)GetDotLen(); + if (fLineWidth == 0.0) + fLineWidth = SMALLEST_DASH_WIDTH; + if(GetDashStyle() == css::drawing::DashStyle_RECTRELATIVE || GetDashStyle() == css::drawing::DashStyle_ROUNDRELATIVE) { - if(fLineWidth != 0.0) - { - double fFactor = fLineWidth / 100.0; + double fFactor = fLineWidth / 100.0; - if(GetDashes()) + if(GetDashes()) + { + if(GetDashLen()) { - if(GetDashLen()) - { - // is a dash - fSingleDashLen *= fFactor; - } - else - { - // is a dot - fSingleDashLen = fLineWidth; - } + // is a dash + fSingleDashLen *= fFactor; } - - if(GetDots()) + else { - if(GetDotLen()) - { - // is a dash - fSingleDotLen *= fFactor; - } - else - { - // is a dot - fSingleDotLen = fLineWidth; - } + // is a dot + fSingleDashLen = fLineWidth; } + } - if(GetDashes() || GetDots()) + if(GetDots()) + { + if(GetDotLen()) { - if(GetDistance()) - { - fDashDotDistance *= fFactor; - } - else - { - fDashDotDistance = fLineWidth; - } + // is a dash + fSingleDotLen *= fFactor; } - } - else - { - if(GetDashes()) + else { - if(GetDashLen()) - { - // is a dash - fSingleDashLen = (SMALLEST_DASH_WIDTH * fSingleDashLen) / 100.0; - } - else - { - // is a dot - fSingleDashLen = SMALLEST_DASH_WIDTH; - } + // is a dot + fSingleDotLen = fLineWidth; } + } - if(GetDots()) + if(GetDashes() || GetDots()) + { + if(GetDistance()) { - if(GetDotLen()) - { - // is a dash - fSingleDotLen = (SMALLEST_DASH_WIDTH * fSingleDotLen) / 100.0; - } - else - { - // is a dot - fSingleDotLen = SMALLEST_DASH_WIDTH; - } + // dash as distance + fDashDotDistance *= fFactor; } - - if(GetDashes() || GetDots()) + else { - if(GetDistance()) - { - // dash as distance - fDashDotDistance = (SMALLEST_DASH_WIDTH * fDashDotDistance) / 100.0; - } - else - { - // dot as distance - fDashDotDistance = SMALLEST_DASH_WIDTH; - } + // dot as distance + fDashDotDistance = fLineWidth; } } } else { - // smallest dot size compare value - double fDotCompVal(fLineWidth != 0.0 ? fLineWidth : SMALLEST_DASH_WIDTH); - // absolute values if(GetDashes()) { @@ -527,9 +482,9 @@ double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double else { // is a dot - if(fSingleDashLen < fDotCompVal) + if(fSingleDashLen < fLineWidth) { - fSingleDashLen = fDotCompVal; + fSingleDashLen = fLineWidth; } } } @@ -547,9 +502,9 @@ double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double else { // is a dot - if(fSingleDotLen < fDotCompVal) + if(fSingleDotLen < fLineWidth) { - fSingleDotLen = fDotCompVal; + fSingleDotLen = fLineWidth; } } } @@ -567,9 +522,9 @@ double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double else { // dot as distance - if(fDashDotDistance < fDotCompVal) + if(fDashDotDistance < fLineWidth) { - fDashDotDistance = fDotCompVal; + fDashDotDistance = fLineWidth; } } } |