summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-09-27 11:59:54 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-12-05 12:03:15 +0100
commit837f43f5c0e3456eb30afe51f8248e6e6c93308f (patch)
tree1b34acc04f26409d2f32de0a43d6d5c2c1864d58
parenttdf#48622 add border line thickness predefined values in UI (diff)
downloadcore-837f43f5c0e3456eb30afe51f8248e6e6c93308f.tar.gz
core-837f43f5c0e3456eb30afe51f8248e6e6c93308f.zip
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.mehrbrodt@allotropia.de> (cherry picked from commit 41b99644e8913dd4797775f4931382e93fa12a00) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126056 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--cui/source/tabpages/border.cxx18
-rw-r--r--cui/uiconfig/ui/borderpage.ui3
-rw-r--r--editeng/source/rtf/rtfitem.cxx4
-rw-r--r--include/editeng/borderline.hxx23
-rw-r--r--sc/source/core/data/stlpool.cxx2
-rw-r--r--sc/source/core/tool/autoform.cxx2
-rw-r--r--sc/source/filter/html/htmlpars.cxx4
-rw-r--r--sc/source/filter/lotus/lotattr.cxx6
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx18
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.cxx12
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.cxx57
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx6
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx2
-rw-r--r--sw/source/core/doc/tblafmt.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx3
-rw-r--r--sw/source/core/edit/autofmt.cxx24
-rw-r--r--sw/source/filter/html/htmltab.cxx8
-rw-r--r--sw/source/filter/html/htmltabw.cxx4
-rw-r--r--sw/source/filter/html/svxcss1.cxx6
-rw-r--r--sw/source/filter/html/swhtml.cxx4
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx2
-rw-r--r--sw/source/filter/xml/xmlithlp.cxx9
-rw-r--r--sw/source/uibase/shells/frmsh.cxx2
-rw-r--r--sw/source/uibase/shells/tabsh.cxx2
25 files changed, 121 insertions, 104 deletions
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index f00bcac95b82..639c7493ab38 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -74,7 +74,23 @@ const sal_uInt16 SvxBorderTabPage::pRanges[] =
0
};
-const std::vector<int> SvxBorderTabPage::m_aLineWidths = { 75, 200, 400, -1 };
+namespace
+{
+int lcl_twipsToPt(sal_Int64 nTwips)
+{
+ return MetricField::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 d26ecdd339e7..9aea90aa306e 100644
--- a/cui/uiconfig/ui/borderpage.ui
+++ b/cui/uiconfig/ui/borderpage.ui
@@ -270,9 +270,12 @@
<property name="visible">True</property>
<property name="can_focus">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 345c0da1b754..dbdbd5f0cdd0 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1392,7 +1392,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;
@@ -1460,7 +1460,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 64d7f2c5c3cb..5b3b20574483 100644
--- a/include/editeng/borderline.hxx
+++ b/include/editeng/borderline.hxx
@@ -29,16 +29,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 2a701c1b26e8..e815baecf83c 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -220,7 +220,7 @@ void ScStyleSheetPool::CreateStandardStyles()
std::unique_ptr<ScPageHFItem> pHeaderItem(new ScPageHFItem( ATTR_PAGE_HEADERRIGHT ));
std::unique_ptr<ScPageHFItem> pFooterItem(new ScPageHFItem( 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 254db1f14d6b..7376df23e631 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -700,7 +700,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 ae46949e4b21..51e4acefc21a 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -2224,8 +2224,8 @@ void ScHTMLTable::ApplyCellBorders( ScDocument* pDoc, const ScAddress& rFirstPos
{
const SCCOL nLastCol = maSize.mnCols - 1;
const SCROW nLastRow = maSize.mnRows - 1;
- const long nOuterLine = DEF_LINE_WIDTH_2;
- const long nInnerLine = DEF_LINE_WIDTH_0;
+ const long nOuterLine = SvxBorderLineWidth::Medium;
+ const 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 dd7725b40ec2..eff0efe6e5fc 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 d46275768db6..3069d5cf5e32 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -366,23 +366,23 @@ void CellAppearancePropertyPanel::SetStyleIcon()
const sal_uInt16 nIdBorderLineStyle = mpTBLineStyle->GetItemId( UNO_LINESTYLE );
//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
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle1);
- else if(mnOutWidth == DEF_LINE_WIDTH_2 && mnInWidth == 0 && mnDistance == 0) //2
+ else if(mnOutWidth == SvxBorderLineWidth::Medium && mnInWidth == 0 && mnDistance == 0) //2
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle2);
- else if(mnOutWidth == DEF_LINE_WIDTH_3 && mnInWidth == 0 && mnDistance == 0) //3
+ else if(mnOutWidth == SvxBorderLineWidth::Thick && mnInWidth == 0 && mnDistance == 0) //3
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle3);
- else if(mnOutWidth == DEF_LINE_WIDTH_4 && mnInWidth == 0 && mnDistance == 0) //4
+ else if(mnOutWidth == SvxBorderLineWidth::ExtraThick && mnInWidth == 0 && mnDistance == 0) //4
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle4);
- 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
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle5);
- 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
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle6);
- 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
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle7);
- 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
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle8);
- 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
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle9);
else
mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle1);
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index 48bc135173a0..1e4f177bec98 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -108,7 +108,7 @@ IMPL_LINK(CellBorderStylePopup, TB1SelectHdl, ToolBox*, pToolBox, void)
}
else if (nId == maTBBorder1->GetItemId("thickbox"))
{
- theDefLine.SetWidth(DEF_LINE_WIDTH_2);
+ theDefLine.SetWidth(SvxBorderLineWidth::Thick);
pLeft = pRight = pTop = pBottom = &theDefLine;
nValidFlags |= FRM_VALID_OUTER;
}
@@ -236,25 +236,27 @@ IMPL_LINK(CellBorderStylePopup, TB3SelectHdl, ToolBox *, pToolBox, void)
if (nId == maTBBorder3->GetItemId("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 (nId == maTBBorder3->GetItemId("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 (nId == maTBBorder3->GetItemId("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 (nId == maTBBorder3->GetItemId("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 8c9092f33fb4..c5da14c298d4 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -113,45 +113,45 @@ IMPL_LINK(CellLineStylePopup, VSSelectHdl, ValueSet*, pControl, 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:
@@ -184,42 +184,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
{
maCellLineStyleValueSet->SetSelItem(1);
}
- else if(out == DEF_LINE_WIDTH_2 && in == 0 && dis == 0) //2
+ else if(out == SvxBorderLineWidth::Medium && in == 0 && dis == 0) //2
{
maCellLineStyleValueSet->SetSelItem(2);
}
- else if(out == DEF_LINE_WIDTH_3 && in == 0 && dis == 0) //3
+ else if(out == SvxBorderLineWidth::Thick && in == 0 && dis == 0) //3
{
maCellLineStyleValueSet->SetSelItem(3);
}
- else if(out == DEF_LINE_WIDTH_4 && in == 0 && dis == 0) //4
+ else if(out == SvxBorderLineWidth::ExtraThick && in == 0 && dis == 0) //4
{
maCellLineStyleValueSet->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
{
maCellLineStyleValueSet->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
{
maCellLineStyleValueSet->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
{
maCellLineStyleValueSet->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
{
maCellLineStyleValueSet->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
{
maCellLineStyleValueSet->SetSelItem(9);
}
+
else
{
maCellLineStyleValueSet->SetSelItem(0);
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 7fc12c76a47d..b0ef5cbc7047 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2462,8 +2462,8 @@ IMPL_LINK_NOARG(SvxFrameWindow_Impl, SelectHdl, ValueSet*, void)
sal_uInt16 nModifier = aFrameSet->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;
@@ -2773,7 +2773,7 @@ IMPL_LINK_NOARG(SvxLineWindow_Impl, SelectHdl, ListBox&, 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 767af3a22010..b5bb128629e6 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1588,7 +1588,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 35e626a0f5a1..3ff7ef02b6d0 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1021,7 +1021,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 15a49729ce51..728a0a28e503 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -114,11 +114,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 cb905187faed..c07cf4ceb18b 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -571,29 +571,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;
}
SfxItemSet aSet(m_pDoc->GetAttrPool(),
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 670ed3ae7aeb..f0edba59c107 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -971,14 +971,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 577a9f5c7b11..18ad069e605b 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -811,9 +811,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
OutTableCells( rWrt, pRow2->GetCells(), pRow2->GetBackground() );
if( !m_nCellSpacing && nRow < m_aRows.size()-1 && pRow2->bBottomBorder &&
- pRow2->nBottomBorder > DEF_LINE_WIDTH_1 )
+ pRow2->nBottomBorder > SvxBorderLineWidth::Hairline )
{
- for( auto nCnt = (pRow2->nBottomBorder / DEF_LINE_WIDTH_1) - 1; nCnt; --nCnt )
+ for( auto nCnt = (pRow2->nBottomBorder / SvxBorderLineWidth::Hairline) - 1; nCnt; --nCnt )
{
rWrt.OutNewLine();
HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_tablerow );
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index c1a6f7312d30..e570d1a92c54 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -244,9 +244,9 @@ static CSS1PropertyEnum const aBulletStyleTable[] =
static 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 3f72a8a044e3..1a08be28684a 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -5305,12 +5305,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 6313472bf728..cebf1ffcf430 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -109,7 +109,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 5868928c5bf6..2cd9466715ce 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4322,7 +4322,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 6dc8f3830e77..f3d8df67e1e6 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -73,11 +73,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( const OUString& rValue,
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 32036351a5ee..ba6e91f12ec1 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1123,7 +1123,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 073fe280c924..da77b89e4189 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -530,7 +530,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 )