summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorEilidh McAdam <eilidh@lanedo.com>2012-11-15 00:29:58 +0000
committerFridrich Strba <fridrich@documentfoundation.org>2012-12-04 10:59:20 +0000
commit7d632ff29e601c2e680c4a689997fbf552592a4b (patch)
treee632de620c11503eb80ae84704fd107cdd348dba /editeng
parent67f42de08bb5d075d554cf5aa1a4c106fe9e4f5c (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>
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 1904916f832d..646a3480724c 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -128,9 +128,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;
@@ -216,6 +218,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
@@ -270,6 +276,7 @@ ConvertBorderWidthToWord(SvxBorderStyle const eStyle, double const fWidth)
case SOLID:
case DOTTED:
case DASHED:
+ case FINE_DASHED:
return fWidth;
break;
@@ -335,6 +342,7 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle )
case SOLID:
case DOTTED:
case DASHED:
+ case FINE_DASHED:
aImpl = BorderWidthImpl( CHANGE_LINE1, 1.0 );
break;
@@ -514,6 +522,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 6f410c64a08f..5ee12a8b6139 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1794,7 +1794,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;