diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-09-27 11:59:54 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-11-04 09:07:54 +0100 |
commit | 41b99644e8913dd4797775f4931382e93fa12a00 (patch) | |
tree | 38efbda4c2c76871fa5bdae1d95954bdb72a1305 /sc | |
parent | b9e43ab25fe2d93c2487fd33ed3c0f583009b968 (diff) |
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>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/stlpool.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/autoform.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/lotus/lotattr.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellBorderStyleControl.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellLineStyleControl.cxx | 57 |
7 files changed, 52 insertions, 49 deletions
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); |