summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorEilidh McAdam <eilidh@lanedo.com>2012-11-15 00:29:58 +0000
committerMiklos Vajna <vmiklos@suse.cz>2013-05-30 16:51:53 +0200
commit487e34c741231b939b314442b091edb6ab7216a8 (patch)
tree4b91e0ac0ee72d9fcc73fa29ae77a1ea4989a0b3 /editeng
parentc2bd5aab1ccd7c58b59b3fc8d29a0f055bb466e7 (diff)
Support added for fine dashing on table borders.
When reading in docx documents, fine dashing provides a better visual match for some border types. Added in this patch: - FINE_DASHED in BorderLineStyle UNO enum and in internals - Import of docx table borders using this border style Change-Id: I39cfa18c915ec94d8e4ecfc6a2ca637076d1e468 Reviewed-on: https://gerrit.libreoffice.org/1123 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org> (cherry picked from commit 7d632ff29e601c2e680c4a689997fbf552592a4b)
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/borderline.cxx11
-rw-r--r--editeng/source/items/frmitems.cxx2
2 files changed, 11 insertions, 2 deletions
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 6fdefe2f8e47..0ce62a7d4c62 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -140,9 +140,11 @@ ConvertBorderStyleFromWord(int const nWordLineStyle)
return DOTTED;
break;
case 7:
- case 22:
return DASHED;
break;
+ case 22:
+ return FINE_DASHED;
+ break;
// then the shading beams which we represent by a double line
case 23:
return DOUBLE;
@@ -228,6 +230,10 @@ ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const fWidth,
case DOTTED:
case DASHED:
return fWidth;
+
+ // Display a minimum effective border width of 1pt
+ case FINE_DASHED:
+ return (fWidth > 0 && fWidth < 20) ? 20 : fWidth;
break;
// Double lines
@@ -282,6 +288,7 @@ ConvertBorderWidthToWord(SvxBorderStyle const eStyle, double const fWidth)
case SOLID:
case DOTTED:
case DASHED:
+ case FINE_DASHED:
return fWidth;
break;
@@ -347,6 +354,7 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle )
case SOLID:
case DOTTED:
case DASHED:
+ case FINE_DASHED:
aImpl = BorderWidthImpl( CHANGE_LINE1, 1.0 );
break;
@@ -526,6 +534,7 @@ void SvxBorderLine::GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sa
case SOLID:
case DOTTED:
case DASHED:
+ case FINE_DASHED:
::std::swap( nOut, nIn);
break;
default:
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index dbcde63d82a9..c1953dff4dd0 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1808,7 +1808,7 @@ sal_Bool
SvxBoxItem::LineToSvxLine(const ::com::sun::star::table::BorderLine2& rLine, SvxBorderLine& rSvxLine, sal_Bool bConvert)
{
SvxBorderStyle const nStyle =
- (rLine.LineStyle < 0 || INSET < rLine.LineStyle)
+ (rLine.LineStyle < 0 || BORDER_LINE_STYLE_MAX < rLine.LineStyle)
? SOLID // default
: rLine.LineStyle;