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 /sw | |
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 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentStylePoolManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/tblafmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 24 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmltabw.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/svxcss1.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlithlp.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/shells/frmsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 2 |
13 files changed, 31 insertions, 40 deletions
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 ) |