[Libreoffice-commits] core.git: cui/source drawinglayer/source editeng/source include/xmloff offapi/com sc/qa sc/source svtools/source xmloff/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Mar 18 21:29:36 PDT 2014


 cui/source/tabpages/border.cxx                          |   10 ++-
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |    2 
 editeng/source/items/borderline.cxx                     |    4 +
 include/xmloff/xmltoken.hxx                             |    2 
 offapi/com/sun/star/table/BorderLineStyle.idl           |    8 ++
 sc/qa/unit/subsequent_export-test.cxx                   |    2 
 sc/source/filter/excel/xestyle.cxx                      |   44 ++++++++++++----
 sc/source/filter/excel/xistyle.cxx                      |   28 +++++-----
 sc/source/filter/html/htmlexp.cxx                       |    2 
 sc/source/filter/inc/xlstyle.hxx                        |   23 +++++---
 sc/source/filter/oox/stylesbuffer.cxx                   |   10 ++-
 sc/source/ui/view/tabvwsha.cxx                          |    2 
 svtools/source/control/ctrlbox.cxx                      |   14 +++++
 xmloff/source/core/xmltoken.cxx                         |    2 
 xmloff/source/style/bordrhdl.cxx                        |    8 ++
 15 files changed, 120 insertions(+), 41 deletions(-)

New commits:
commit 402fffa1b42e8b54704bab5442590d192dea67ca
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Mar 18 23:28:42 2014 -0400

    Add dash-dot and dash-dot-dot line styles.
    
    We need these for Excel interop.
    
    Change-Id: I91450c1d205f28636edfb4392aa6ae5091b1d7b7

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 869bf09..8466aa6 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1038,10 +1038,12 @@ void SvxBorderTabPage::FillLineListBox_Impl()
         LineListBox::ColorDistFunc mpColorDistFn;
     } aLines[] = {
         // Simple lines
-        { SOLID,       0, &sameColor, &sameColor, &sameDistColor },
-        { DOTTED,      0, &sameColor, &sameColor, &sameDistColor },
-        { DASHED,      0, &sameColor, &sameColor, &sameDistColor },
-        { FINE_DASHED, 0, &sameColor, &sameColor, &sameDistColor },
+        { SOLID,        0, &sameColor, &sameColor, &sameDistColor },
+        { DOTTED,       0, &sameColor, &sameColor, &sameDistColor },
+        { DASHED,       0, &sameColor, &sameColor, &sameDistColor },
+        { FINE_DASHED,  0, &sameColor, &sameColor, &sameDistColor },
+        { DASH_DOT,     0, &sameColor, &sameColor, &sameDistColor },
+        { DASH_DOT_DOT, 0, &sameColor, &sameColor, &sameDistColor },
 
         // Double lines
         { DOUBLE,              10, &sameColor, &sameColor, &sameDistColor },
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index e7c5e76..a701c2a 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -402,6 +402,8 @@ namespace drawinglayer
                 break;
                 case table::BorderLineStyle::DOTTED:
                 case table::BorderLineStyle::DASHED:
+                case table::BorderLineStyle::DASH_DOT:
+                case table::BorderLineStyle::DASH_DOT_DOT:
                 case table::BorderLineStyle::FINE_DASHED:
                 {
                     std::vector<double> aPattern =
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index d58f8c3..3280988 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -305,6 +305,8 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle )
         case DOTTED:
         case DASHED:
         case FINE_DASHED:
+        case DASH_DOT:
+        case DASH_DOT_DOT:
             aImpl = BorderWidthImpl( CHANGE_LINE1, 1.0 );
             break;
 
@@ -490,6 +492,8 @@ void SvxBorderLine::GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sa
                 case DOTTED:
                 case DASHED:
                 case FINE_DASHED:
+                case DASH_DOT:
+                case DASH_DOT_DOT:
                     ::std::swap( nOut, nIn);
                     break;
                 default:
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 6e3ae7f..8935eb4 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -532,6 +532,8 @@ namespace xmloff { namespace token {
         XML_CYLINDER,
         XML_D,
         XML_DASH,
+        XML_DASH_DOT,
+        XML_DASH_DOT_DOT,
         XML_DASHED,
         XML_DATA,
         XML_DATA_BAR,
diff --git a/offapi/com/sun/star/table/BorderLineStyle.idl b/offapi/com/sun/star/table/BorderLineStyle.idl
index 0c37c67..90d5930 100644
--- a/offapi/com/sun/star/table/BorderLineStyle.idl
+++ b/offapi/com/sun/star/table/BorderLineStyle.idl
@@ -101,9 +101,15 @@ constants BorderLineStyle
      */
     const short DOUBLE_THIN = 15;
 
+    /** Line consisting of a repetition of one dash and one dot. */
+    const short DASH_DOT = 16;
+
+    /** Line consisting of a repetition of one dash and 2 dots. */
+    const short DASH_DOT_DOT = 17;
+
     /** Maximum valid border line style value.
      */
-    const short BORDER_LINE_STYLE_MAX = 15;
+    const short BORDER_LINE_STYLE_MAX = 17;
 };
 
 
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index defacfb..ce1e9d5 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -1022,6 +1022,8 @@ const char* toBorderName( sal_Int16 eStyle )
         case table::BorderLineStyle::SOLID: return "SOLID";
         case table::BorderLineStyle::DOTTED: return "DOTTED";
         case table::BorderLineStyle::DASHED: return "DASHED";
+        case table::BorderLineStyle::DASH_DOT: return "DASH_DOT";
+        case table::BorderLineStyle::DASH_DOT_DOT: return "DASH_DOT_DOT";
         case table::BorderLineStyle::DOUBLE_THIN: return "DOUBLE_THIN";
         case table::BorderLineStyle::FINE_DASHED: return "FINE_DASHED";
         default:
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index fcf9e69..573ca8a 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1561,8 +1561,20 @@ void lclGetBorderLine(
         else if( nOuterWidth >= EXC_BORDER_MEDIUM )
         {
             rnXclLine = EXC_LINE_MEDIUM;
-            if (pLine->GetBorderLineStyle( ) == table::BorderLineStyle::DASHED)
-                rnXclLine = EXC_LINE_MEDIUMDASHED;
+            switch (pLine->GetBorderLineStyle())
+            {
+                case table::BorderLineStyle::DASHED:
+                    rnXclLine = EXC_LINE_MEDIUM_DASHED;
+                break;
+                case table::BorderLineStyle::DASH_DOT:
+                    rnXclLine = EXC_LINE_MEDIUM_DASHDOT;
+                    break;
+                case table::BorderLineStyle::DASH_DOT_DOT:
+                    rnXclLine = EXC_LINE_MEDIUM_DASHDOTDOT;
+                    break;
+                default:
+                    ;
+            }
         }
         else if( nOuterWidth >= EXC_BORDER_THIN )
         {
@@ -1573,6 +1585,12 @@ void lclGetBorderLine(
                 case table::BorderLineStyle::FINE_DASHED:
                     rnXclLine = EXC_LINE_DASHED;
                     break;
+                case table::BorderLineStyle::DASH_DOT:
+                    rnXclLine = EXC_LINE_THIN_DASHDOT;
+                    break;
+                case table::BorderLineStyle::DASH_DOT_DOT:
+                    rnXclLine = EXC_LINE_THIN_DASHDOTDOT;
+                    break;
                 case table::BorderLineStyle::DOTTED:
                     rnXclLine = EXC_LINE_DOTTED;
                     break;
@@ -1718,15 +1736,19 @@ static const char* ToLineStyle( sal_uInt8 nLineStyle )
 {
     switch( nLineStyle )
     {
-        case EXC_LINE_NONE:     return "none";
-        case EXC_LINE_THIN:     return "thin";
-        case EXC_LINE_MEDIUM:   return "medium";
-        case EXC_LINE_THICK:    return "thick";
-        case EXC_LINE_DOUBLE:   return "double";
-        case EXC_LINE_HAIR:     return "hair";
-        case EXC_LINE_DOTTED:     return "dotted";
-        case EXC_LINE_DASHED:     return "dashed";
-        case EXC_LINE_MEDIUMDASHED: return "mediumDashed";
+        case EXC_LINE_NONE:              return "none";
+        case EXC_LINE_THIN:              return "thin";
+        case EXC_LINE_MEDIUM:            return "medium";
+        case EXC_LINE_THICK:             return "thick";
+        case EXC_LINE_DOUBLE:            return "double";
+        case EXC_LINE_HAIR:              return "hair";
+        case EXC_LINE_DOTTED:            return "dotted";
+        case EXC_LINE_DASHED:            return "dashed";
+        case EXC_LINE_MEDIUM_DASHED:     return "mediumDashed";
+        case EXC_LINE_THIN_DASHDOT:      return "dashDot";
+        case EXC_LINE_THIN_DASHDOTDOT:   return "dashDotDot";
+        case EXC_LINE_MEDIUM_DASHDOT:    return "mediumDashDot";
+        case EXC_LINE_MEDIUM_DASHDOTDOT: return "mediumDashDotDot";
     }
     return "*unknown*";
 }
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index f1cae7f..9afaf91 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -897,20 +897,20 @@ bool lclConvertBorderLine( ::editeng::SvxBorderLine& rLine, const XclImpPalette&
     static const sal_uInt16 ppnLineParam[][ 4 ] =
     {
         //  outer width,        type
-        {   0,                  table::BorderLineStyle::SOLID },  // 0 = none
-        {   EXC_BORDER_THIN,    table::BorderLineStyle::SOLID },  // 1 = thin
-        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::SOLID },  // 2 = medium
-        {   EXC_BORDER_THIN,    table::BorderLineStyle::FINE_DASHED }, // 3 = dashed
-        {   EXC_BORDER_THIN,    table::BorderLineStyle::DOTTED }, // 4 = dotted
-        {   EXC_BORDER_THICK,   table::BorderLineStyle::SOLID },  // 5 = thick
-        {   EXC_BORDER_THICK,   table::BorderLineStyle::DOUBLE_THIN }, // 6 = double
-        {   EXC_BORDER_HAIR,    table::BorderLineStyle::SOLID },  // 7 = hair
-        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::DASHED }, // 8 = med dash
-        {   EXC_BORDER_THIN,    table::BorderLineStyle::SOLID },  // 9 = thin dashdot
-        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::SOLID },  // A = med dashdot
-        {   EXC_BORDER_THIN,    table::BorderLineStyle::SOLID },  // B = thin dashdotdot
-        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::SOLID },  // C = med dashdotdot
-        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::SOLID }   // D = med slant dashdot
+        {   0,                  table::BorderLineStyle::SOLID        }, // 0 = none
+        {   EXC_BORDER_THIN,    table::BorderLineStyle::SOLID        }, // 1 = thin
+        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::SOLID        }, // 2 = medium
+        {   EXC_BORDER_THIN,    table::BorderLineStyle::FINE_DASHED  }, // 3 = dashed
+        {   EXC_BORDER_THIN,    table::BorderLineStyle::DOTTED       }, // 4 = dotted
+        {   EXC_BORDER_THICK,   table::BorderLineStyle::SOLID        }, // 5 = thick
+        {   EXC_BORDER_THICK,   table::BorderLineStyle::DOUBLE_THIN  }, // 6 = double
+        {   EXC_BORDER_HAIR,    table::BorderLineStyle::SOLID        }, // 7 = hair
+        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::DASHED       }, // 8 = med dash
+        {   EXC_BORDER_THIN,    table::BorderLineStyle::DASH_DOT     }, // 9 = thin dashdot
+        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::DASH_DOT     }, // A = med dashdot
+        {   EXC_BORDER_THIN,    table::BorderLineStyle::DASH_DOT_DOT }, // B = thin dashdotdot
+        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::DASH_DOT_DOT }, // C = med dashdotdot
+        {   EXC_BORDER_MEDIUM,  table::BorderLineStyle::DASH_DOT     }  // D = med slant dashdot
     };
 
     if( nXclLine == EXC_LINE_NONE )
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 00e160d..0787d20 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -510,6 +510,8 @@ OString ScHTMLExport::BorderToStyle(const char* pBorderName,
                 aOut.append("dotted");
                 break;
             case table::BorderLineStyle::DASHED:
+            case table::BorderLineStyle::DASH_DOT:
+            case table::BorderLineStyle::DASH_DOT_DOT:
                 aOut.append("dashed");
                 break;
             case table::BorderLineStyle::DOUBLE:
diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx
index f389b054..76caec7 100644
--- a/sc/source/filter/inc/xlstyle.hxx
+++ b/sc/source/filter/inc/xlstyle.hxx
@@ -37,15 +37,20 @@ class XclRoot;
 
 // Line styles ----------------------------------------------------------------
 
-const sal_uInt8 EXC_LINE_NONE               = 0x00;
-const sal_uInt8 EXC_LINE_THIN               = 0x01;
-const sal_uInt8 EXC_LINE_MEDIUM             = 0x02;
-const sal_uInt8 EXC_LINE_DASHED             = 0x03;
-const sal_uInt8 EXC_LINE_DOTTED             = 0x04;
-const sal_uInt8 EXC_LINE_THICK              = 0x05;
-const sal_uInt8 EXC_LINE_DOUBLE             = 0x06;
-const sal_uInt8 EXC_LINE_HAIR               = 0x07;
-const sal_uInt8 EXC_LINE_MEDIUMDASHED       = 0x08;
+const sal_uInt8 EXC_LINE_NONE                 = 0x00;
+const sal_uInt8 EXC_LINE_THIN                 = 0x01;
+const sal_uInt8 EXC_LINE_MEDIUM               = 0x02;
+const sal_uInt8 EXC_LINE_DASHED               = 0x03;
+const sal_uInt8 EXC_LINE_DOTTED               = 0x04;
+const sal_uInt8 EXC_LINE_THICK                = 0x05;
+const sal_uInt8 EXC_LINE_DOUBLE               = 0x06;
+const sal_uInt8 EXC_LINE_HAIR                 = 0x07;
+const sal_uInt8 EXC_LINE_MEDIUM_DASHED        = 0x08;
+const sal_uInt8 EXC_LINE_THIN_DASHDOT         = 0x09;
+const sal_uInt8 EXC_LINE_MEDIUM_DASHDOT       = 0x0A;
+const sal_uInt8 EXC_LINE_THIN_DASHDOTDOT      = 0x0B;
+const sal_uInt8 EXC_LINE_MEDIUM_DASHDOTDOT    = 0x0C;
+const sal_uInt8 EXC_LINE_MEDIUM_SLANT_DASHDOT = 0x0D;
 
 // Background patterns --------------------------------------------------------
 
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index dfa5570..ee0542e 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1725,8 +1725,14 @@ bool Border::convertBorderLine( BorderLine2& rBorderLine, const BorderLineModel&
     rBorderLine.Color = rModel.maColor.getColor( getBaseFilter().getGraphicHelper(), API_RGB_BLACK );
     switch( rModel.mnStyle )
     {
-        case XML_dashDot:           lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );    break;
-        case XML_dashDotDot:        lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );    break;
+        case XML_dashDot:
+            lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );
+            rBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT;
+        break;
+        case XML_dashDotDot:
+            lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );
+            rBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT_DOT;
+        break;
         case XML_dashed:
             lclSetBorderLineWidth( rBorderLine, API_LINE_THIN );
             rBorderLine.LineStyle = table::BorderLineStyle::FINE_DASHED;
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 7dae366..af5cd66 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -490,6 +490,8 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
     aBorderStyles.push_back(table::BorderLineStyle::DOTTED);
     aBorderStyles.push_back(table::BorderLineStyle::DASHED);
     aBorderStyles.push_back(table::BorderLineStyle::FINE_DASHED);
+    aBorderStyles.push_back(table::BorderLineStyle::DASH_DOT);
+    aBorderStyles.push_back(table::BorderLineStyle::DASH_DOT_DOT);
     aBorderStyles.push_back(table::BorderLineStyle::DOUBLE_THIN);
 
     SfxIntegerListItem aBorderStylesItem(SID_ATTR_BORDER_STYLES, aBorderStyles);
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 1065b34..f8ae79d 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -608,6 +608,20 @@ std::vector<double> GetDashing( sal_uInt16 nDashing )
             aPattern.push_back( 6.0 ); // line
             aPattern.push_back( 2.0 ); // blank
         break;
+        case table::BorderLineStyle::DASH_DOT:
+            aPattern.push_back( 16.0 ); // line
+            aPattern.push_back( 5.0 );  // blank
+            aPattern.push_back( 5.0 );  // line
+            aPattern.push_back( 5.0 );  // blank
+        break;
+        case table::BorderLineStyle::DASH_DOT_DOT:
+            aPattern.push_back( 16.0 ); // line
+            aPattern.push_back( 5.0 );  // blank
+            aPattern.push_back( 5.0 );  // line
+            aPattern.push_back( 5.0 );  // blank
+            aPattern.push_back( 5.0 );  // line
+            aPattern.push_back( 5.0 );  // blank
+        break;
         default:
             ;
     }
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index c3559d3..cedae88 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -536,6 +536,8 @@ namespace xmloff { namespace token {
         TOKEN( "cylinder",                        XML_CYLINDER ),
         TOKEN( "d",                               XML_D ),
         TOKEN( "dash",                            XML_DASH ),
+        TOKEN( "dash-dot",                        XML_DASH_DOT ),
+        TOKEN( "dash-dot-dot",                    XML_DASH_DOT_DOT ),
         TOKEN( "dashed",                          XML_DASHED ),
         TOKEN( "data",                            XML_DATA ),
         TOKEN( "data-bar",                        XML_DATA_BAR ),
diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx
index 6d6caf2..41b94c9 100644
--- a/xmloff/source/style/bordrhdl.cxx
+++ b/xmloff/source/style/bordrhdl.cxx
@@ -51,6 +51,8 @@ SvXMLEnumMapEntry pXML_BorderStyles[] =
     { XML_INSET,         table::BorderLineStyle::INSET  },
     { XML_OUTSET,        table::BorderLineStyle::OUTSET },
     { XML_FINE_DASHED,   table::BorderLineStyle::FINE_DASHED },
+    { XML_DASH_DOT,      table::BorderLineStyle::DASH_DOT },
+    { XML_DASH_DOT_DOT,  table::BorderLineStyle::DASH_DOT_DOT },
     { XML_TOKEN_INVALID, 0 }
 };
 
@@ -325,6 +327,12 @@ bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, co
             case table::BorderLineStyle::FINE_DASHED:
                 eStyleToken = XML_FINE_DASHED;
                 break;
+            case table::BorderLineStyle::DASH_DOT:
+                eStyleToken = XML_DASH_DOT;
+                break;
+            case table::BorderLineStyle::DASH_DOT_DOT:
+                eStyleToken = XML_DASH_DOT_DOT;
+                break;
             case table::BorderLineStyle::DOUBLE_THIN:
                 eStyleToken = XML_DOUBLE_THIN;
                 break;


More information about the Libreoffice-commits mailing list