cui/source/tabpages/border.cxx                       |   18 +++++-
 cui/uiconfig/ui/borderpage.ui                        |    3 +
 editeng/source/rtf/rtfitem.cxx                       |    4 -
 include/editeng/borderline.hxx                       |   23 ++++---
 sc/source/core/data/stlpool.cxx                      |    2 
 sc/source/core/tool/autoform.cxx                     |    2 
 sc/source/filter/html/htmlpars.cxx                   |    4 -
 sc/source/filter/lotus/lotattr.cxx                   |    6 +-
 sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx |   18 +++---
 sc/source/ui/sidebar/CellBorderStyleControl.cxx      |   12 ++--
 sc/source/ui/sidebar/CellLineStyleControl.cxx        |   57 +++++++++----------
 svx/source/tbxctrls/tbcontrl.cxx                     |   10 +--
 sw/source/core/doc/DocumentStylePoolManager.cxx      |    2 
 sw/source/core/doc/tblafmt.cxx                       |    2 
 sw/source/core/docnode/ndtbl.cxx                     |    3 -
 sw/source/core/edit/autofmt.cxx                      |   24 ++++----
 sw/source/filter/html/htmltab.cxx                    |    8 --
 sw/source/filter/html/htmltabw.cxx                   |    4 -
 sw/source/filter/html/svxcss1.cxx                    |    7 +-
 sw/source/filter/html/swhtml.cxx                     |    4 -
 sw/source/filter/ww8/rtfattributeoutput.cxx          |    2 
 sw/source/filter/ww8/ww8atr.cxx                      |    2 
 sw/source/filter/xml/xmlithlp.cxx                    |    9 +--
 sw/source/uibase/shells/frmsh.cxx                    |    2 
 sw/source/uibase/shells/tabsh.cxx                    |    2 
 25 files changed, 123 insertions(+), 107 deletions(-)

New commits:
commit 41b99644e8913dd4797775f4931382e93fa12a00
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Mon Sep 27 11:59:54 2021 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Thu Nov 4 09:07:54 2021 +0100

    tdf#48622 Add new border line width defaults
    
    * Hairline (0.05pt)
    * Very thin (0.5pt)
    * Thin (0.75pt)
    * Medium (1.5pt)
    * Thick (2.25pt)
    * Extra thick (4.5pt)
    
    This unifies the default border line widths throughout the program.
    
    Users can still set any line width they want by chosing "Custom" in the 
"Border" tabpage.
    
    Also, existing documents won't be changed. The new defaults are just for 
newly added borders.
    
    Change-Id: I7af85dc189a688a749812824508c33c7814b50f5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122683
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 0cef50e3779a..0203cc7de375 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -77,7 +77,23 @@ const WhichRangesContainer SvxBorderTabPage::pRanges(
         SID_SW_COLLAPSING_BORDERS,  SID_SW_COLLAPSING_BORDERS,
         SID_ATTR_BORDER_DIAG_TLBR,  SID_ATTR_BORDER_DIAG_BLTR>);
 
-const std::vector<int> SvxBorderTabPage::m_aLineWidths = { 75, 200, 400, -1 };
+namespace
+{
+int lcl_twipsToPt(sal_Int64 nTwips)
+{
+    return vcl::ConvertDoubleValue(nTwips, 0, FieldUnit::TWIP, 
MapUnit::MapPoint) * 100;
+}
+}
+
+const std::vector<int> SvxBorderTabPage::m_aLineWidths = {
+    lcl_twipsToPt(SvxBorderLineWidth::Hairline),
+    lcl_twipsToPt(SvxBorderLineWidth::VeryThin),
+    lcl_twipsToPt(SvxBorderLineWidth::Thin),
+    lcl_twipsToPt(SvxBorderLineWidth::Medium),
+    lcl_twipsToPt(SvxBorderLineWidth::Thick),
+    lcl_twipsToPt(SvxBorderLineWidth::ExtraThick),
+    -1
+};
 
 static void lcl_SetDecimalDigitsTo1(weld::MetricSpinButton& rField)
 {
diff --git a/cui/uiconfig/ui/borderpage.ui b/cui/uiconfig/ui/borderpage.ui
index d748cd1ca395..5dde291c691d 100644
--- a/cui/uiconfig/ui/borderpage.ui
+++ b/cui/uiconfig/ui/borderpage.ui
@@ -266,9 +266,12 @@
                     <property name="can_focus">False</property>
                     <property name="hexpand">False</property>
                     <items>
+                      <item translatable="yes" 
context="borderpage|linewidthlb">Hairline</item>
+                      <item translatable="yes" 
context="borderpage|linewidthlb">Very thin</item>
                       <item translatable="yes" 
context="borderpage|linewidthlb">Thin</item>
                       <item translatable="yes" 
context="borderpage|linewidthlb">Medium</item>
                       <item translatable="yes" 
context="borderpage|linewidthlb">Thick</item>
+                      <item translatable="yes" 
context="borderpage|linewidthlb">Extra thick</item>
                       <item translatable="yes" 
context="borderpage|linewidthlb">Custom</item>
                     </items>
                   </object>
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 2f7f2fde29de..36e9bd16836e 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1350,7 +1350,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, 
SfxItemSet& rSet,
         aAttr.reset(static_cast<SvxBoxItem*>(pItem->Clone()));
     }
 
-    SvxBorderLine aBrd( nullptr, DEF_LINE_WIDTH_0 );  // Simple plain line
+    SvxBorderLine aBrd( nullptr, SvxBorderLineWidth::Hairline );
     bool bContinue = true;
     int nBorderTyp = 0;
 
@@ -1418,7 +1418,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, 
SfxItemSet& rSet,
         case RTF_BRDRHAIR:      // hairline border
             {
                 aBrd.SetBorderLineStyle( SvxBorderLineStyle::SOLID);
-                aBrd.SetWidth( DEF_LINE_WIDTH_0 );
+                aBrd.SetWidth( SvxBorderLineWidth::Hairline );
             }
             break;
         case RTF_BRDRDB:        // Double border
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx
index d22e0c586317..6cf1c45120be 100644
--- a/include/editeng/borderline.hxx
+++ b/include/editeng/borderline.hxx
@@ -30,16 +30,19 @@
 
 class IntlWrapper;
 
-// Line defaults in twips (former Writer defaults):
-
-#define DEF_LINE_WIDTH_0        1
-#define DEF_LINE_WIDTH_1        20
-#define DEF_LINE_WIDTH_2        50
-#define DEF_LINE_WIDTH_3        80
-#define DEF_LINE_WIDTH_4        100
-#define DEF_LINE_WIDTH_5        10
-#define DEF_LINE_WIDTH_6        5   // 0.25pt
-
+// Line width defaults in twips
+// Thin matches Excel's default values
+// See tdf#48622 for the discussion leading to these defaults.
+class SvxBorderLineWidth
+{
+public:
+    static const sal_Int16 Hairline = 1; // 0.05pt
+    static const sal_Int16 VeryThin = 10; // 0.5pt
+    static const sal_Int16 Thin = 15; // 0.75pt
+    static const sal_Int16 Medium = 30; // 1.5pt
+    static const sal_Int16 Thick = 45; // 2.25pt
+    static const sal_Int16 ExtraThick = 90; // 4.5pt
+};
 
 // Abstracts over values from css::table::BorderLineStyle
 enum class SvxBorderLineStyle : sal_Int16
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index a1082b6f5054..44d97f98d8e7 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -222,7 +222,7 @@ void ScStyleSheetPool::CreateStandardStyles()
     ScPageHFItem aHeaderItem( ATTR_PAGE_HEADERRIGHT );
     ScPageHFItem aFooterItem( ATTR_PAGE_FOOTERRIGHT );
     ScStyleSheet*   pSheet          = nullptr;
-    ::editeng::SvxBorderLine    aBorderLine     ( &aColBlack, DEF_LINE_WIDTH_2 
);
+    ::editeng::SvxBorderLine    aBorderLine     ( &aColBlack, 
SvxBorderLineWidth::Medium );
     SvxBoxItem      aBoxItem        ( ATTR_BORDER );
     SvxBoxInfoItem  aBoxInfoItem    ( ATTR_BORDER_INNER );
 
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 631747e5667c..e55b2028001c 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -689,7 +689,7 @@ ScAutoFormat::ScAutoFormat() :
 
     //  black thin border
     Color aBlack( COL_BLACK );
-    ::editeng::SvxBorderLine aLine( &aBlack, DEF_LINE_WIDTH_0 );
+    ::editeng::SvxBorderLine aLine( &aBlack, SvxBorderLineWidth::VeryThin );
     SvxBoxItem aBox( ATTR_BORDER );
     aBox.SetLine(&aLine, SvxBoxItemLine::LEFT);
     aBox.SetLine(&aLine, SvxBoxItemLine::TOP);
diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index fc61ea499279..13546336f270 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -2232,8 +2232,8 @@ void ScHTMLTable::ApplyCellBorders( ScDocument* pDoc, 
const ScAddress& rFirstPos
     {
         const SCCOL nLastCol = maSize.mnCols - 1;
         const SCROW nLastRow = maSize.mnRows - 1;
-        const tools::Long nOuterLine = DEF_LINE_WIDTH_2;
-        const tools::Long nInnerLine = DEF_LINE_WIDTH_0;
+        const tools::Long nOuterLine = SvxBorderLineWidth::Medium;
+        const tools::Long nInnerLine = SvxBorderLineWidth::Hairline;
         SvxBorderLine aOuterLine(nullptr, nOuterLine, 
SvxBorderLineStyle::SOLID);
         SvxBorderLine aInnerLine(nullptr, nInnerLine, 
SvxBorderLineStyle::SOLID);
         SvxBoxItem aBorderItem( ATTR_BORDER );
diff --git a/sc/source/filter/lotus/lotattr.cxx 
b/sc/source/filter/lotus/lotattr.cxx
index eaa6b4b61685..f87984056fe6 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -151,12 +151,12 @@ void LotAttrCache::LotusToScBorderLine( sal_uInt8 nLine, 
::editeng::SvxBorderLin
     switch ( nLine )
     {
         case 0: aBL.SetBorderLineStyle(SvxBorderLineStyle::NONE); break;
-        case 1: aBL.SetWidth( DEF_LINE_WIDTH_1 ); break;
-        case 2: aBL.SetWidth( DEF_LINE_WIDTH_2 ); break;
+        case 1: aBL.SetWidth( SvxBorderLineWidth::Thin ); break;
+        case 2: aBL.SetWidth( SvxBorderLineWidth::Medium ); break;
         case 3:
         {
             aBL.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE_THIN);
-            aBL.SetWidth( DEF_LINE_WIDTH_1 );
+            aBL.SetWidth( SvxBorderLineWidth::Thin );
         }
         break;
     }
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx 
b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 78745aa73c94..d09b8a5ca7be 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -372,23 +372,23 @@ void CellAppearancePropertyPanel::NotifyItemUpdate(
 void CellAppearancePropertyPanel::SetStyleIcon()
 {
     //FIXME: update for new line border possibilities
-    if(mnOutWidth == DEF_LINE_WIDTH_0 && mnInWidth == 0 && mnDistance == 0)    
//1
+    if(mnOutWidth == SvxBorderLineWidth::Hairline && mnInWidth == 0 && 
mnDistance == 0)    //1
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle1);
-    else if(mnOutWidth == DEF_LINE_WIDTH_2 && mnInWidth == 0 && mnDistance == 
0) //2
+    else if(mnOutWidth == SvxBorderLineWidth::Medium && mnInWidth == 0 && 
mnDistance == 0) //2
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle2);
-    else if(mnOutWidth == DEF_LINE_WIDTH_3 && mnInWidth == 0 && mnDistance == 
0) //3
+    else if(mnOutWidth == SvxBorderLineWidth::Thick && mnInWidth == 0 && 
mnDistance == 0) //3
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle3);
-    else if(mnOutWidth == DEF_LINE_WIDTH_4 && mnInWidth == 0 && mnDistance == 
0) //4
+    else if(mnOutWidth == SvxBorderLineWidth::ExtraThick && mnInWidth == 0 && 
mnDistance == 0) //4
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle4);
-    else if(mnOutWidth == DEF_LINE_WIDTH_0 && mnInWidth == DEF_LINE_WIDTH_0 && 
mnDistance == DEF_LINE_WIDTH_1) //5
+    else if(mnOutWidth == SvxBorderLineWidth::Hairline && mnInWidth == 
SvxBorderLineWidth::Hairline && mnDistance == SvxBorderLineWidth::Thin) //5
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle5);
-    else if(mnOutWidth == DEF_LINE_WIDTH_0 && mnInWidth == DEF_LINE_WIDTH_0 && 
mnDistance == DEF_LINE_WIDTH_2) //6
+    else if(mnOutWidth == SvxBorderLineWidth::Hairline && mnInWidth == 
SvxBorderLineWidth::Hairline && mnDistance == SvxBorderLineWidth::Medium) //6
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle6);
-    else if(mnOutWidth == DEF_LINE_WIDTH_1 && mnInWidth == DEF_LINE_WIDTH_2 && 
mnDistance == DEF_LINE_WIDTH_1) //7
+    else if(mnOutWidth == SvxBorderLineWidth::Thin && mnInWidth == 
SvxBorderLineWidth::Medium && mnDistance == SvxBorderLineWidth::Thin) //7
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle7);
-    else if(mnOutWidth == DEF_LINE_WIDTH_2 && mnInWidth == DEF_LINE_WIDTH_0 && 
mnDistance == DEF_LINE_WIDTH_2) //8
+    else if(mnOutWidth == SvxBorderLineWidth::Medium && mnInWidth == 
SvxBorderLineWidth::Hairline && mnDistance == SvxBorderLineWidth::Medium) //8
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle8);
-    else if(mnOutWidth == DEF_LINE_WIDTH_2 && mnInWidth == DEF_LINE_WIDTH_2 && 
mnDistance == DEF_LINE_WIDTH_2) //9
+    else if(mnOutWidth == SvxBorderLineWidth::Medium && mnInWidth == 
SvxBorderLineWidth::Medium && mnDistance == SvxBorderLineWidth::Medium) //9
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle9);
     else
         mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle1);
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx 
b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index b1725610b2e7..d460b4d0a404 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -103,7 +103,7 @@ IMPL_LINK(CellBorderStylePopup, TB1SelectHdl, const 
OString&, rId, void)
     }
     else if (rId == "thickbox")
     {
-        theDefLine.SetWidth(DEF_LINE_WIDTH_2);
+        theDefLine.SetWidth(SvxBorderLineWidth::Thick);
         pLeft = pRight = pTop = pBottom = &theDefLine;
         nValidFlags |= FRM_VALID_OUTER;
     }
@@ -228,25 +228,27 @@ IMPL_LINK(CellBorderStylePopup, TB4SelectHdl, const 
OString&, rId, void)
 
     if (rId == "thickbottom")
     {
-        pBottom.reset(new editeng::SvxBorderLine(nullptr, DEF_LINE_WIDTH_2 ));
+        pBottom.reset(new editeng::SvxBorderLine(nullptr, 
SvxBorderLineWidth::Thick));
         nValidFlags |= FRM_VALID_BOTTOM;
     }
     else if (rId == "doublebottom")
     {
         pBottom.reset(new editeng::SvxBorderLine(nullptr));
-        pBottom->GuessLinesWidths(SvxBorderLineStyle::DOUBLE, 
DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_1);
+        pBottom->GuessLinesWidths(SvxBorderLineStyle::DOUBLE, 
SvxBorderLineWidth::Hairline,
+                                  SvxBorderLineWidth::Hairline, 
SvxBorderLineWidth::Thin);
         nValidFlags |= FRM_VALID_BOTTOM;
     }
     else if (rId == "topthickbottom")
     {
-        pBottom.reset(new editeng::SvxBorderLine(nullptr, DEF_LINE_WIDTH_2 ));
+        pBottom.reset(new editeng::SvxBorderLine(nullptr, 
SvxBorderLineWidth::Thick));
         pTop.reset(new editeng::SvxBorderLine(nullptr, 1));
         nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP;
     }
     else if (rId == "topdoublebottom")
     {
         pBottom.reset(new editeng::SvxBorderLine(nullptr));
-        pBottom->GuessLinesWidths(SvxBorderLineStyle::DOUBLE, 
DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_1);
+        pBottom->GuessLinesWidths(SvxBorderLineStyle::DOUBLE, 
SvxBorderLineWidth::Hairline,
+                                  SvxBorderLineWidth::Hairline, 
SvxBorderLineWidth::Thin);
         pTop.reset(new editeng::SvxBorderLine(nullptr, 1));
         nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP;
     }
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx 
b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index 9c078994dd36..2f7e255f5eaf 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -105,45 +105,45 @@ IMPL_LINK_NOARG(CellLineStylePopup, VSSelectHdl, 
ValueSet*, void)
     switch(iPos)
     {
         case 1:
-            n1 = DEF_LINE_WIDTH_0;
+            n1 = SvxBorderLineWidth::Hairline;
             break;
         case 2:
-            n1 = DEF_LINE_WIDTH_2;
+            n1 = SvxBorderLineWidth::Medium;
             break;
         case 3:
-            n1 = DEF_LINE_WIDTH_3;
+            n1 = SvxBorderLineWidth::Thick;
             break;
         case 4:
-            n1 = DEF_LINE_WIDTH_4;
+            n1 = SvxBorderLineWidth::ExtraThick;
             break;
         case 5:
-            n1 = DEF_LINE_WIDTH_0;
-            n2 = DEF_LINE_WIDTH_0;
-            n3 = DEF_LINE_WIDTH_1;
+            n1 = SvxBorderLineWidth::Hairline;
+            n2 = SvxBorderLineWidth::Hairline;
+            n3 = SvxBorderLineWidth::Medium;
             nStyle = SvxBorderLineStyle::DOUBLE;
             break;
         case 6:
-            n1 = DEF_LINE_WIDTH_0;
-            n2 = DEF_LINE_WIDTH_0;
-            n3 = DEF_LINE_WIDTH_2;
+            n1 = SvxBorderLineWidth::Hairline;
+            n2 = SvxBorderLineWidth::Hairline;
+            n3 = SvxBorderLineWidth::Thick;
             nStyle = SvxBorderLineStyle::DOUBLE;
             break;
         case 7:
-            n1 = DEF_LINE_WIDTH_1;
-            n2 = DEF_LINE_WIDTH_2;
-            n3 = DEF_LINE_WIDTH_1;
+            n1 = SvxBorderLineWidth::Thin;
+            n2 = SvxBorderLineWidth::Medium;
+            n3 = SvxBorderLineWidth::Thin;
             nStyle = SvxBorderLineStyle::DOUBLE;
             break;
         case 8:
-            n1 = DEF_LINE_WIDTH_2;
-            n2 = DEF_LINE_WIDTH_0;
-            n3 = DEF_LINE_WIDTH_2;
+            n1 = SvxBorderLineWidth::Medium;
+            n2 = SvxBorderLineWidth::Hairline;
+            n3 = SvxBorderLineWidth::Medium;
             nStyle = SvxBorderLineStyle::DOUBLE;
             break;
         case 9:
-            n1 = DEF_LINE_WIDTH_2;
-            n2 = DEF_LINE_WIDTH_2;
-            n3 = DEF_LINE_WIDTH_2;
+            n1 = SvxBorderLineWidth::Medium;
+            n2 = SvxBorderLineWidth::Medium;
+            n3 = SvxBorderLineWidth::Medium;
             nStyle = SvxBorderLineStyle::DOUBLE;
             break;
         default:
@@ -173,42 +173,43 @@ void CellLineStylePopup::SetLineStyleSelect(sal_uInt16 
out, sal_uInt16 in, sal_u
 
     //FIXME: fully for new border line possibilities
 
-    if(out == DEF_LINE_WIDTH_0 && in == 0 && dis == 0)  //1
+    if(out == SvxBorderLineWidth::Hairline && in == 0 && dis == 0)  //1
     {
         mxCellLineStyleValueSet->SetSelItem(1);
     }
-    else if(out == DEF_LINE_WIDTH_2 && in == 0 && dis == 0) //2
+    else if(out == SvxBorderLineWidth::Medium && in == 0 && dis == 0) //2
     {
         mxCellLineStyleValueSet->SetSelItem(2);
     }
-    else if(out == DEF_LINE_WIDTH_3 && in == 0 && dis == 0) //3
+    else if(out == SvxBorderLineWidth::Thick && in == 0 && dis == 0) //3
     {
         mxCellLineStyleValueSet->SetSelItem(3);
     }
-    else if(out == DEF_LINE_WIDTH_4 && in == 0 && dis == 0) //4
+    else if(out == SvxBorderLineWidth::ExtraThick && in == 0 && dis == 0) //4
     {
         mxCellLineStyleValueSet->SetSelItem(4);
     }
-    else if(out == DEF_LINE_WIDTH_0 && in == DEF_LINE_WIDTH_0 && dis == 
DEF_LINE_WIDTH_1) //5
+    else if(out == SvxBorderLineWidth::Hairline && in == 
SvxBorderLineWidth::Hairline && dis == SvxBorderLineWidth::Thin) //5
     {
         mxCellLineStyleValueSet->SetSelItem(5);
     }
-    else if(out == DEF_LINE_WIDTH_0 && in == DEF_LINE_WIDTH_0 && dis == 
DEF_LINE_WIDTH_2) //6
+    else if(out == SvxBorderLineWidth::Hairline && in == 
SvxBorderLineWidth::Hairline && dis == SvxBorderLineWidth::Medium) //6
     {
         mxCellLineStyleValueSet->SetSelItem(6);
     }
-    else if(out == DEF_LINE_WIDTH_1 && in == DEF_LINE_WIDTH_2 && dis == 
DEF_LINE_WIDTH_1) //7
+    else if(out == SvxBorderLineWidth::Thin && in == 
SvxBorderLineWidth::Medium && dis == SvxBorderLineWidth::Thin) //7
     {
         mxCellLineStyleValueSet->SetSelItem(7);
     }
-    else if(out == DEF_LINE_WIDTH_2 && in == DEF_LINE_WIDTH_0 && dis == 
DEF_LINE_WIDTH_2) //8
+    else if(out == SvxBorderLineWidth::Medium && in == 
SvxBorderLineWidth::Hairline && dis == SvxBorderLineWidth::Medium) //8
     {
         mxCellLineStyleValueSet->SetSelItem(8);
     }
-    else if(out == DEF_LINE_WIDTH_2 && in == DEF_LINE_WIDTH_2 && dis == 
DEF_LINE_WIDTH_2) //9
+    else if(out == SvxBorderLineWidth::Medium && in == 
SvxBorderLineWidth::Medium && dis == SvxBorderLineWidth::Medium) //9
     {
         mxCellLineStyleValueSet->SetSelItem(9);
     }
+
     else
     {
         mxCellLineStyleValueSet->SetSelItem(0);
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 8327fe48cf61..5a1239bdea77 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2228,11 +2228,11 @@ IMPL_LINK_NOARG(SvxFrameWindow_Impl, SelectHdl, 
ValueSet*, void)
     SvxBorderLine       theDefLine;
 
     // diagonal down border
-    SvxBorderLine       dDownBorderLine(nullptr, 1);
+    SvxBorderLine       dDownBorderLine(nullptr, SvxBorderLineWidth::Hairline);
     SvxLineItem         dDownLineItem(SID_ATTR_BORDER_DIAG_TLBR);
 
     // diagonal up border
-    SvxBorderLine       dUpBorderLine(nullptr, 1);
+    SvxBorderLine       dUpBorderLine(nullptr, SvxBorderLineWidth::Hairline);
     SvxLineItem         dUpLineItem(SID_ATTR_BORDER_DIAG_BLTR);
 
     bool                bIsDiagonalBorder = false;
@@ -2245,8 +2245,8 @@ IMPL_LINK_NOARG(SvxFrameWindow_Impl, SelectHdl, 
ValueSet*, void)
     sal_uInt16           nModifier = mxFrameSet->GetModifier();
     FrmValidFlags        nValidFlags = FrmValidFlags::NONE;
 
-    theDefLine.GuessLinesWidths(theDefLine.GetBorderLineStyle(),
-            DEF_LINE_WIDTH_0);
+    theDefLine.GuessLinesWidths(theDefLine.GetBorderLineStyle(), 
SvxBorderLineWidth::Hairline);
+
     switch ( nSel )
     {
         case 1: nValidFlags |= FrmValidFlags::AllMask;
@@ -2534,7 +2534,7 @@ IMPL_LINK_NOARG(SvxLineWindow_Impl, SelectHdl, ValueSet*, 
void)
     {
         SvxBorderLine aTmp;
         aTmp.SetBorderLineStyle( nStyle );
-        aTmp.SetWidth( 20 ); // TODO Make it depend on a width field
+        aTmp.SetWidth( SvxBorderLineWidth::Thin ); // TODO Make it depend on a 
width field
         aLineItem.SetLine( &aTmp );
     }
     else
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index e1c20bc0a377..f5d2aa7918df 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1630,7 +1630,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( 
sal_uInt16 nId )
                 aSet.Put( SwFormatHoriOrient( 0, 
text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) );
                 aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, 
text::RelOrientation::PRINT_AREA ) );
                 Color aCol( COL_BLACK );
-                SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 );
+                SvxBorderLine aLine( &aCol, SvxBorderLineWidth::Hairline );
                 SvxBoxItem aBox( RES_BOX );
                 aBox.SetLine( &aLine, SvxBoxItemLine::TOP );
                 aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 5f4538fd176a..35b502337f20 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1006,7 +1006,7 @@ SwTableAutoFormatTable::SwTableAutoFormatTable()
     SvxBoxItem aBox( RES_BOX );
 
     aBox.SetAllDistances(55);
-    SvxBorderLine aLn( &aColor, DEF_LINE_WIDTH_5 );
+    SvxBorderLine aLn( &aColor, SvxBorderLineWidth::VeryThin );
     aBox.SetLine( &aLn, SvxBoxItemLine::LEFT );
     aBox.SetLine( &aLn, SvxBoxItemLine::BOTTOM );
 
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 2ff83dfb8ce3..ca153b598dde 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -117,11 +117,10 @@ static void lcl_SetDfltBoxAttr( SwFrameFormat& rFormat, 
sal_uInt8 nId )
 
     const bool bHTML = 
rFormat.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE);
     Color aCol( bHTML ? COL_GRAY : COL_BLACK );
-    SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 );
+    SvxBorderLine aLine( &aCol, SvxBorderLineWidth::Hairline );
     if ( bHTML )
     {
         aLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
-        aLine.SetWidth( DEF_LINE_WIDTH_0 );
     }
     SvxBoxItem aBox(RES_BOX);
     aBox.SetAllDistances(55);
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 791430271b07..27b6b1c79108 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -563,29 +563,29 @@ bool SwAutoFormat::DoUnderline()
         editeng::SvxBorderLine aLine;
         switch( eState )
         {
-        case 1:         // single, 0.05 pt
+        case 1:         // single, hairline
             aLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
-            aLine.SetWidth( DEF_LINE_WIDTH_0 );
+            aLine.SetWidth( SvxBorderLineWidth::Hairline );
             break;
-        case 2:         // single, 1.0 pt
+        case 2:         // single, thin
             aLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
-            aLine.SetWidth( DEF_LINE_WIDTH_1 );
+            aLine.SetWidth( SvxBorderLineWidth::Thin );
             break;
-        case 3:         // double, 1.0 pt
+        case 3:         // double, thin
             aLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
-            aLine.SetWidth( DEF_LINE_WIDTH_1 );
+            aLine.SetWidth( SvxBorderLineWidth::Thin );
             break;
-        case 4:         // double (thick/thin), 4.0 pt
+        case 4:         // double, thick/thin
             aLine.SetBorderLineStyle(SvxBorderLineStyle::THICKTHIN_SMALLGAP);
-            aLine.SetWidth( DEF_LINE_WIDTH_3  );
+            aLine.SetWidth( SvxBorderLineWidth::Thick  );
             break;
-        case 5:         // double (thin/thick), 4.0 pt
+        case 5:         // double, thin/thick
             aLine.SetBorderLineStyle(SvxBorderLineStyle::THINTHICK_SMALLGAP);
-            aLine.SetWidth( DEF_LINE_WIDTH_3 );
+            aLine.SetWidth( SvxBorderLineWidth::Thick );
             break;
-        case 6:         // double, 2.5 pt
+        case 6:         // double, medium
             aLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
-            aLine.SetWidth( DEF_LINE_WIDTH_2 );
+            aLine.SetWidth( SvxBorderLineWidth::Medium );
             break;
         }
         SfxItemSetFixed<RES_PARATR_CONNECT_BORDER, RES_PARATR_CONNECT_BORDER,
diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index 473db0ea1548..1276d2a69654 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -975,14 +975,8 @@ void HTMLTable::InitCtor(const HTMLTableOptions& rOptions)
     m_aRightBorderLine = m_aLeftBorderLine;
 
     if( rOptions.nCellSpacing != 0 )
-    {
         m_aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
-        m_aBorderLine.SetWidth( DEF_LINE_WIDTH_0 );
-    }
-    else
-    {
-        m_aBorderLine.SetWidth( DEF_LINE_WIDTH_0 );
-    }
+    m_aBorderLine.SetWidth(SvxBorderLineWidth::Hairline);
     m_aBorderLine.SetColor( rBorderColor );
 
     if( m_nCellPadding )
diff --git a/sw/source/filter/html/htmltabw.cxx 
b/sw/source/filter/html/htmltabw.cxx
index de0501203a92..b35fcc91bf79 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -822,9 +822,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 
eAlign,
 
         OutTableCells( rWrt, pRow2->GetCells(), pRow2->GetBackground() );
         if( !m_nCellSpacing && nRow < m_aRows.size()-1 && 
pRow2->m_bBottomBorder &&
-            pRow2->m_nBottomBorder > DEF_LINE_WIDTH_1 )
+            pRow2->m_nBottomBorder > SvxBorderLineWidth::Hairline )
         {
-            for( auto nCnt = (pRow2->m_nBottomBorder / DEF_LINE_WIDTH_1) - 1; 
nCnt; --nCnt )
+            for( auto nCnt = (pRow2->m_nBottomBorder / 
SvxBorderLineWidth::Hairline) - 1; nCnt; --nCnt )
             {
                 rWrt.OutNewLine();
                 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), 
OStringConcatenation(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow ));
diff --git a/sw/source/filter/html/svxcss1.cxx 
b/sw/source/filter/html/svxcss1.cxx
index 3ed3a1505135..11f0d8425567 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -245,12 +245,11 @@ CSS1PropertyEnum const aBulletStyleTable[] =
     { nullptr,       0                        }
 };
 
-
 sal_uInt16 const aBorderWidths[] =
 {
-    DEF_LINE_WIDTH_0,
-    DEF_LINE_WIDTH_5,
-    DEF_LINE_WIDTH_1
+    SvxBorderLineWidth::Hairline,
+    SvxBorderLineWidth::VeryThin,
+    SvxBorderLineWidth::Thin
 };
 
 #undef SBORDER_ENTRY
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 7250fb8e841d..5212159ae012 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -5354,12 +5354,12 @@ void SwHTMLParser::InsertHorzRule()
         }
         else if( bNoShade )
         {
-            aBorderLine.SetWidth( DEF_LINE_WIDTH_2 );
+            aBorderLine.SetWidth( SvxBorderLineWidth::Medium );
         }
         else
         {
             aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
-            aBorderLine.SetWidth( DEF_LINE_WIDTH_0 );
+            aBorderLine.SetWidth(SvxBorderLineWidth::Hairline);
         }
 
         SvxBoxItem aBoxItem(RES_BOX);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index c7f7210addcd..cc5d693bf3df 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -110,7 +110,7 @@ static OString OutTBLBorderLine(RtfExport const& rExport, 
const editeng::SvxBord
         {
             case SvxBorderLineStyle::SOLID:
             {
-                if (DEF_LINE_WIDTH_0 == pLine->GetWidth())
+                if (SvxBorderLineWidth::Hairline == pLine->GetWidth())
                     aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRHAIR);
                 else
                     aRet.append(OOO_STRING_SVTOOLS_RTF_BRDRS);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2f636f90540d..cbafa7a909a0 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4438,7 +4438,7 @@ WW8_BRCVer9 WW8Export::TranslateBorderLine(const 
SvxBorderLine& rLine,
         {
             case SvxBorderLineStyle::SOLID:
                 {
-                    if ( rLine.GetWidth( ) == DEF_LINE_WIDTH_0 )
+                    if ( rLine.GetWidth( ) == SvxBorderLineWidth::Hairline )
                         brcType = 5;
                     else
                         brcType = 1;
diff --git a/sw/source/filter/xml/xmlithlp.cxx 
b/sw/source/filter/xml/xmlithlp.cxx
index 16e2a1128b08..d629765d7843 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -68,11 +68,10 @@ const struct SvXMLEnumMapEntry<sal_uInt16> 
psXML_NamedBorderWidths[] =
 };
 // mapping tables to map external xml input to internal box line widths
 
-const sal_uInt16 aBorderWidths[] =
-{
-        DEF_LINE_WIDTH_0,
-        DEF_LINE_WIDTH_5,
-        DEF_LINE_WIDTH_1,
+const sal_uInt16 aBorderWidths[] = {
+    SvxBorderLineWidth::Hairline,
+    SvxBorderLineWidth::VeryThin,
+    SvxBorderLineWidth::Thin
 };
 
 bool sw_frmitems_parseXMLBorder( std::u16string_view rValue,
diff --git a/sw/source/uibase/shells/frmsh.cxx 
b/sw/source/uibase/shells/frmsh.cxx
index a4283b672008..05187b5964dc 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1129,7 +1129,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
                     {
                         aBorderLine.SetBorderLineStyle(
                                 SvxBorderLineStyle::SOLID);
-                        aBorderLine.SetWidth( DEF_LINE_WIDTH_0 );
+                        aBorderLine.SetWidth( SvxBorderLineWidth::Hairline );
                     }
                     //Set distance only if the request is received from the 
controller.
 
diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index 96b5b52e7439..7798b6c0da9c 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -522,7 +522,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
             if(aBorderLine.GetOutWidth() == 0)
             {
                 aBorderLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
-                aBorderLine.SetWidth( DEF_LINE_WIDTH_5 );
+                aBorderLine.SetWidth( SvxBorderLineWidth::VeryThin );
             }
 
             if( aBox->GetTop() != nullptr )

Reply via email to