summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-09-27 11:59:54 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-11-04 09:07:54 +0100
commit41b99644e8913dd4797775f4931382e93fa12a00 (patch)
tree38efbda4c2c76871fa5bdae1d95954bdb72a1305 /cui/source
parentb9e43ab25fe2d93c2487fd33ed3c0f583009b968 (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 'cui/source')
-rw-r--r--cui/source/tabpages/border.cxx18
1 files changed, 17 insertions, 1 deletions
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)
{