summaryrefslogtreecommitdiff
path: root/sw/source/core/doc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-14 00:09:43 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-13 23:38:37 +0100
commit7b8f630db30ee0066a9f4b6e540368d2fcad7fa8 (patch)
treee40626d45db8a228defeca6e66aba9055974d0a6 /sw/source/core/doc
parent44f20abf66ce3f9806ad95522d7d9ae698350499 (diff)
Use o3tl::convert
Change-Id: I78db3001d602ec1a0847785b3c127b9d345f5af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125173 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r--sw/source/core/doc/docdesc.cxx10
-rw-r--r--sw/source/core/doc/number.cxx30
2 files changed, 27 insertions, 13 deletions
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 31058b4caf62..d22fee74ca79 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -90,17 +90,17 @@ static void lcl_DefaultPageFormat( sal_uInt16 nPoolFormatId,
sal_Int32 nMinTop, nMinBottom, nMinLeft, nMinRight;
if( RES_POOLPAGE_HTML == nPoolFormatId )
{
- nMinRight = nMinTop = nMinBottom = o3tl::convert(1, o3tl::Length::cm, o3tl::Length::twip);
- nMinLeft = o3tl::convert(2, o3tl::Length::cm, o3tl::Length::twip);
+ nMinRight = nMinTop = nMinBottom = o3tl::toTwips(1, o3tl::Length::cm);
+ nMinLeft = o3tl::toTwips(2, o3tl::Length::cm);
}
else if (!utl::ConfigManager::IsFuzzing() && MeasurementSystem::Metric == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() )
{
- nMinTop = nMinBottom = nMinLeft = nMinRight = 1134; // 2 centimeters
+ nMinTop = nMinBottom = nMinLeft = nMinRight = o3tl::toTwips(2, o3tl::Length::cm);
}
else
{
- nMinTop = nMinBottom = 1440; // as in MS Word: 1 Inch
- nMinLeft = nMinRight = 1800; // 1,25 Inch
+ nMinTop = nMinBottom = o3tl::toTwips(1, o3tl::Length::in); // as in MS Word
+ nMinLeft = nMinRight = o3tl::toTwips(1.25, o3tl::Length::in);
}
// set margins
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 2f4cdf32b304..acb142b09988 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -66,9 +66,16 @@ SwNumFormat* SwNumRule::saLabelAlignmentBaseFormats[ RULE_END ][ MAXLEVEL ] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr } };
const sal_uInt16 SwNumRule::saDefNumIndents[ MAXLEVEL ] = {
-//inch: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
- 1440/4, 1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2, 1440*7/4, 1440*2,
- 1440*9/4, 1440*5/2
+ o3tl::toTwips(25, o3tl::Length::in100),
+ o3tl::toTwips(50, o3tl::Length::in100),
+ o3tl::toTwips(75, o3tl::Length::in100),
+ o3tl::toTwips(100, o3tl::Length::in100),
+ o3tl::toTwips(125, o3tl::Length::in100),
+ o3tl::toTwips(150, o3tl::Length::in100),
+ o3tl::toTwips(175, o3tl::Length::in100),
+ o3tl::toTwips(200, o3tl::Length::in100),
+ o3tl::toTwips(225, o3tl::Length::in100),
+ o3tl::toTwips(250, o3tl::Length::in100),
};
OUString SwNumRule::GetOutlineRuleName()
@@ -391,13 +398,20 @@ SwNumRule::SwNumRule( const OUString& rNm,
}
// position-and-space mode LABEL_ALIGNMENT
// first line indent of general numbering in inch: -0,25 inch
- const tools::Long cFirstLineIndent = -1440/4;
+ const tools::Long cFirstLineIndent = o3tl::toTwips(-0.25, o3tl::Length::in);
// indent values of general numbering in inch:
- // 0,5 0,75 1,0 1,25 1,5
- // 1,75 2,0 2,25 2,5 2,75
const tools::Long cIndentAt[ MAXLEVEL ] = {
- 1440/2, 1440*3/4, 1440, 1440*5/4, 1440*3/2,
- 1440*7/4, 1440*2, 1440*9/4, 1440*5/2, 1440*11/4 };
+ o3tl::toTwips(50, o3tl::Length::in100),
+ o3tl::toTwips(75, o3tl::Length::in100),
+ o3tl::toTwips(100, o3tl::Length::in100),
+ o3tl::toTwips(125, o3tl::Length::in100),
+ o3tl::toTwips(150, o3tl::Length::in100),
+ o3tl::toTwips(175, o3tl::Length::in100),
+ o3tl::toTwips(200, o3tl::Length::in100),
+ o3tl::toTwips(225, o3tl::Length::in100),
+ o3tl::toTwips(250, o3tl::Length::in100),
+ o3tl::toTwips(275, o3tl::Length::in100),
+ };
for( n = 0; n < MAXLEVEL; ++n )
{
pFormat = new SwNumFormat;