[Libreoffice-commits] .: editeng/source offapi/com svtools/inc svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 4 02:59:40 PST 2012


 editeng/source/items/borderline.cxx           |   11 ++++++++++-
 editeng/source/items/frmitems.cxx             |    2 +-
 offapi/com/sun/star/table/BorderLineStyle.idl |    8 ++++++++
 svtools/inc/svtools/ctrlbox.hxx               |    1 +
 svtools/source/control/ctrlbox.cxx            |    7 +++++++
 5 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit 7d632ff29e601c2e680c4a689997fbf552592a4b
Author: Eilidh McAdam <eilidh at lanedo.com>
Date:   Thu Nov 15 00:29:58 2012 +0000

    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 at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 1904916..646a348 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 6f410c6..5ee12a8 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;
 
diff --git a/offapi/com/sun/star/table/BorderLineStyle.idl b/offapi/com/sun/star/table/BorderLineStyle.idl
index 0007118..7613272 100644
--- a/offapi/com/sun/star/table/BorderLineStyle.idl
+++ b/offapi/com/sun/star/table/BorderLineStyle.idl
@@ -90,6 +90,14 @@ constants BorderLineStyle
     /** Inset border line.
      */
     const short INSET = 13;
+
+    /** Finely dashed border line.
+     */
+    const short FINE_DASHED = 14;
+
+    /** Maximum valid border line style value.
+     */
+    const short BORDER_LINE_STYLE_MAX = 14;
 };
 
 
diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx
index a6b26b8..2d6e6a2 100644
--- a/svtools/inc/svtools/ctrlbox.hxx
+++ b/svtools/inc/svtools/ctrlbox.hxx
@@ -44,6 +44,7 @@ typedef ::std::vector< FontInfo              > ImplFontList;
 #define STYLE_SOLID                ( ( sal_uInt16 ) 0 )
 #define STYLE_DOTTED               ( ( sal_uInt16 ) 1 )
 #define STYLE_DASHED               ( ( sal_uInt16 ) 2 )
+#define STYLE_FINE_DASHED          ( ( sal_uInt16 ) 14 )
 #define STYLE_NONE                 ( ( sal_uInt16 ) -1)
 
 #define CHANGE_LINE1               ( ( sal_uInt16 ) 1 )
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 017422f..dd739d4 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -615,6 +615,13 @@ namespace svtools
                     aPattern.push_back( 20 );
                 }
                 break;
+            case STYLE_FINE_DASHED:
+                if ( eUnit == MAP_PIXEL )
+                {
+                    aPattern.push_back( 4 );
+                    aPattern.push_back( 1 );
+                }
+                break;
             default:
                 break;
         }


More information about the Libreoffice-commits mailing list