[Libreoffice-commits] core.git: Branch 'private/kohei/double-border-fix' - cui/source drawinglayer/source editeng/source include/xmloff sc/qa sc/source xmloff/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Mar 4 18:22:24 PST 2014


 cui/source/tabpages/border.cxx                          |    1 +
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |    4 ++--
 editeng/source/items/borderline.cxx                     |    5 +++++
 editeng/source/items/frmitems.cxx                       |    2 +-
 include/xmloff/xmltoken.hxx                             |    1 +
 sc/qa/unit/subsequent_export-test.cxx                   |    4 ++--
 sc/source/filter/excel/xistyle.cxx                      |    2 +-
 sc/source/filter/html/htmlexp.cxx                       |    1 +
 sc/source/filter/lotus/lotattr.cxx                      |    2 +-
 sc/source/filter/oox/stylesbuffer.cxx                   |    2 +-
 sc/source/ui/view/tabvwsha.cxx                          |    2 +-
 xmloff/source/core/xmltoken.cxx                         |    1 +
 xmloff/source/style/bordrhdl.cxx                        |    5 +++++
 13 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit 97c8db9ab9b0d9285fa190ed0b9ee90d4ff2e071
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Mar 4 21:18:04 2014 -0500

    Use DOUBLE_THIN in lieu of DOUBLE for Calc's double border line type.
    
    Change-Id: I2161fe63ff1e9b8aa9dc33153efd108913f91347

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 3f8881b..fd7b905 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1045,6 +1045,7 @@ void SvxBorderTabPage::FillLineListBox_Impl()
 
         // Double lines
         { DOUBLE,              10, &sameColor, &sameColor, &sameDistColor },
+        { DOUBLE_THIN,         10, &sameColor, &sameColor, &sameDistColor },
         { THINTHICK_SMALLGAP,  20, &sameColor, &sameColor, &sameDistColor },
         { THINTHICK_MEDIUMGAP,  0, &sameColor, &sameColor, &sameDistColor },
         { THINTHICK_LARGEGAP,   0, &sameColor, &sameColor, &sameDistColor },
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 4605aee..e7c5e76 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -297,13 +297,13 @@ namespace drawinglayer
             switch (rSource.getStyle())
             {
                 case table::BorderLineStyle::SOLID:
-                case table::BorderLineStyle::DOUBLE:
+                case table::BorderLineStyle::DOUBLE_THIN:
                 {
                     const basegfx::BColor aLineColor =
                         maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
                     double nThick = rtl::math::round(rSource.getLeftWidth());
 
-                    bool bDouble = rSource.getStyle() == table::BorderLineStyle::DOUBLE;
+                    bool bDouble = rSource.getStyle() == table::BorderLineStyle::DOUBLE_THIN;
 
                     basegfx::B2DPolygon aTarget;
 
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 2da1753..b919e58 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -316,6 +316,10 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle )
                     1.0/3.0, 1.0/3.0, 1.0/3.0 );
             break;
 
+        case DOUBLE_THIN:
+            aImpl = BorderWidthImpl(CHANGE_DIST, 10.0, 10.0, 1.0);
+            break;
+
         case THINTHICK_SMALLGAP:
             aImpl = BorderWidthImpl( CHANGE_LINE1, 1.0,
                     THINTHICK_SMALLGAP_line2, THINTHICK_SMALLGAP_gap );
@@ -429,6 +433,7 @@ void SvxBorderLine::GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sa
         static const SvxBorderStyle aDoubleStyles[] =
         {
             DOUBLE,
+            DOUBLE_THIN,
             THINTHICK_SMALLGAP,
             THINTHICK_MEDIUMGAP,
             THINTHICK_LARGEGAP,
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index e844320..57bd705 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1834,7 +1834,7 @@ SvxBoxItem::LineToSvxLine(const ::com::sun::star::table::BorderLine2& rLine, Svx
         rSvxLine.SetWidth( bConvert? MM100_TO_TWIP_UNSIGNED( rLine.LineWidth ) : rLine.LineWidth );
         // fdo#46112: double does not necessarily mean symmetric
         // for backwards compatibility
-        bGuessWidth = (DOUBLE == nStyle) &&
+        bGuessWidth = ((DOUBLE == nStyle || DOUBLE_THIN == nStyle)) &&
             (rLine.InnerLineWidth > 0) && (rLine.OuterLineWidth > 0);
     }
 
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 225e374..39a6dc9 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -647,6 +647,7 @@ namespace xmloff { namespace token {
         XML_DOTTED,
         XML_DOUBLE,
         XML_DOUBLE_SIDED,
+        XML_DOUBLE_THIN,
         XML_DOWN,
         XML_DRAFT,
         XML_DRAW,
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 3a669ba..f2f653b 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -1015,7 +1015,7 @@ 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::DOUBLE: return "DOUBLE";
+        case table::BorderLineStyle::DOUBLE_THIN: return "DOUBLE_THIN";
         case table::BorderLineStyle::FINE_DASHED: return "FINE_DASHED";
         default:
             ;
@@ -1046,7 +1046,7 @@ void ScExportTest::testExcelCellBorders( sal_uLong nFormatType )
         { 19, table::BorderLineStyle::DASHED,      35L }, // medium dashed
         { 21, table::BorderLineStyle::SOLID,       35L }, // medium
         { 23, table::BorderLineStyle::SOLID,       50L }, // thick
-        { 25, table::BorderLineStyle::DOUBLE,      -1L }, // double (don't check width)
+        { 25, table::BorderLineStyle::DOUBLE_THIN, -1L }, // double (don't check width)
     };
 
     for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index c72d5ef..31a740c 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -903,7 +903,7 @@ bool lclConvertBorderLine( ::editeng::SvxBorderLine& rLine, const XclImpPalette&
         {   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 }, // 6 = double
+        {   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
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 01faa7c..89ab2d2 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -513,6 +513,7 @@ OString ScHTMLExport::BorderToStyle(const char* pBorderName,
                 aOut.append("dashed");
                 break;
             case table::BorderLineStyle::DOUBLE:
+            case table::BorderLineStyle::DOUBLE_THIN:
             case table::BorderLineStyle::THINTHICK_SMALLGAP:
             case table::BorderLineStyle::THINTHICK_MEDIUMGAP:
             case table::BorderLineStyle::THINTHICK_LARGEGAP:
diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx
index bc17dff..cdc804a 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -169,7 +169,7 @@ void LotAttrCache::LotusToScBorderLine( sal_uInt8 nLine, ::editeng::SvxBorderLin
         case 2: aBL.SetWidth( DEF_LINE_WIDTH_2 ); break;
         case 3:
         {
-            aBL.SetBorderLineStyle(table::BorderLineStyle::DOUBLE);
+            aBL.SetBorderLineStyle(table::BorderLineStyle::DOUBLE_THIN);
             aBL.SetWidth( DEF_LINE_WIDTH_1 );
         }
         break;
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 996a459..4760481 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1737,7 +1737,7 @@ bool Border::convertBorderLine( BorderLine2& rBorderLine, const BorderLineModel&
         break;
         case XML_double:
             lclSetBorderLineWidth( rBorderLine, 10, 30, 10 );
-            rBorderLine.LineStyle = table::BorderLineStyle::DOUBLE;
+            rBorderLine.LineStyle = table::BorderLineStyle::DOUBLE_THIN;
         break;
         case XML_hair:              lclSetBorderLineWidth( rBorderLine, API_LINE_HAIR );    break;
         case XML_medium:            lclSetBorderLineWidth( rBorderLine, API_LINE_MEDIUM );  break;
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 7bd88ac..7dae366 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -490,7 +490,7 @@ 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::DOUBLE);
+    aBorderStyles.push_back(table::BorderLineStyle::DOUBLE_THIN);
 
     SfxIntegerListItem aBorderStylesItem(SID_ATTR_BORDER_STYLES, aBorderStyles);
     pOldSet->Put(aBorderStylesItem);
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 1e35261..56148dc 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -651,6 +651,7 @@ namespace xmloff { namespace token {
         TOKEN( "dotted",                          XML_DOTTED ),
         TOKEN( "double",                          XML_DOUBLE ),
         TOKEN( "double-sided",                    XML_DOUBLE_SIDED ),
+        TOKEN( "double-thin",                     XML_DOUBLE_THIN ),
         TOKEN( "down",                            XML_DOWN ),
         TOKEN( "draft",                           XML_DRAFT ),
         TOKEN( "draw",                            XML_DRAW ),
diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx
index 7ec68c0..6d6caf2 100644
--- a/xmloff/source/style/bordrhdl.cxx
+++ b/xmloff/source/style/bordrhdl.cxx
@@ -43,6 +43,7 @@ SvXMLEnumMapEntry pXML_BorderStyles[] =
     { XML_HIDDEN,        table::BorderLineStyle::NONE   },
     { XML_SOLID,         table::BorderLineStyle::SOLID  },
     { XML_DOUBLE,        table::BorderLineStyle::DOUBLE },
+    { XML_DOUBLE_THIN,   table::BorderLineStyle::DOUBLE_THIN },
     { XML_DOTTED,        table::BorderLineStyle::DOTTED },
     { XML_DASHED,        table::BorderLineStyle::DASHED },
     { XML_GROOVE,        table::BorderLineStyle::ENGRAVED },
@@ -136,6 +137,7 @@ bool XMLBorderWidthHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValu
     switch ( aBorderLine.LineStyle )
     {
         case table::BorderLineStyle::DOUBLE:
+        case table::BorderLineStyle::DOUBLE_THIN:
         case table::BorderLineStyle::THINTHICK_SMALLGAP:
         case table::BorderLineStyle::THINTHICK_MEDIUMGAP:
         case table::BorderLineStyle::THINTHICK_LARGEGAP:
@@ -323,6 +325,9 @@ bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, co
             case table::BorderLineStyle::FINE_DASHED:
                 eStyleToken = XML_FINE_DASHED;
                 break;
+            case table::BorderLineStyle::DOUBLE_THIN:
+                eStyleToken = XML_DOUBLE_THIN;
+                break;
             case table::BorderLineStyle::SOLID:
             default:
                 break;


More information about the Libreoffice-commits mailing list