From f51811b96b08143573c7c489e5fe75b9d77d6467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Dupont?= Date: Thu, 28 Nov 2019 11:32:29 +0100 Subject: [PATCH] fix: documentation about paragraph indentation Documentation contained the wrong unit for Paragraph indentation. --- docs/styles.rst | 6 ++++-- src/PhpWord/Style/Paragraph.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/styles.rst b/docs/styles.rst index 27f8ee66ce..18a9c2eca3 100644 --- a/docs/styles.rst +++ b/docs/styles.rst @@ -75,8 +75,10 @@ Available Paragraph style options: - ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values. - ``basedOn``. Parent style. -- ``hanging``. Hanging in *twip*. -- ``indent``. Indent in *twip*. +- ``hanging``. Hanging indentation in *half inches*. +- ``indent``. Indent (left indentation) in *half inches*. +- ``indentation``. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine* and *hanging* indentation. + See ``\PhpOffice\PhpWord\Style\Indentation`` for possible identation types. - ``keepLines``. Keep all lines on one page, *true* or *false*. - ``keepNext``. Keep paragraph with next paragraph, *true* or *false*. - ``lineHeight``. Text line height, e.g. *1.0*, *1.5*, etc. diff --git a/src/PhpWord/Style/Paragraph.php b/src/PhpWord/Style/Paragraph.php index 6e9aaf15dc..72f0f8096c 100644 --- a/src/PhpWord/Style/Paragraph.php +++ b/src/PhpWord/Style/Paragraph.php @@ -198,7 +198,7 @@ public function setStyleValue($key, $value) { $key = Text::removeUnderscorePrefix($key); if ('indent' == $key || 'hanging' == $key) { - $value = $value * 720; + $value = $value * 720; // 720 twips is 0.5 inch } return parent::setStyleValue($key, $value);