sw/source/core/doc/DocumentStylePoolManager.cxx |   32 ++++++++++++------------
 1 file changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 0ae4cf5a6811c86a0aed4ba0e01562f34ab584fd
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Tue Dec 27 11:25:28 2022 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Thu Apr 20 00:53:21 2023 +0200

    tdf#56258 tdf#106988 sw numbering ivx: make style useable
    
    In the current state, the style was basically unusable.
    The first two levels had numbering at the same indent,
    the third level started with a c),
    and the fourth level started earlier than the 3rd level.
    
    I took my formatting queues from Numbering IVX.
    These right-aligned roman-numerals can grow very wide
    when getting to number 7 and 8, so I designed the
    style with a wide indent theme.
    
    Now the first two levels have the same width as
    ROMAN_UPPER. Since this style is a mixed bag,
    I changed the second level to use ROMAN_UPPER,
    which keeps the roman theme, but fits better with
    the following character and bullet sublevels.
    The third level switches back to left-aligned
    with similar indents to CHAR_LOWER_LETTER,
    (and starts with letter "a" - good grief)
    while the bullet levels are a nice, breezy half-indent width
    (which is 50%-100% wider than the bullet styles).
    
    Change-Id: Ie3ac386c360e804dde6c295dd39a3c02d3ba9b79
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144841
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>
    Reviewed-by: Vernon, Stuart Foote <vsfo...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150649
    Tested-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 62c08bae7b8b..966e696e6877 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -2105,9 +2105,9 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( 
sal_uInt16 nId )
             // [ First, LSpace ]
             static const sal_uInt16 aAbsSpace0to2[] =
                 {
-                    174,  754,      // 0.33, 1.33,
-                    567,  1151,      // 1.03, 2.03,
-                    397,  1548       // 2.03, 2.73
+                    174,  754,  // 0.33, 1.33cm
+                    174,  1508, // 0.33, 2.66cm
+                    397,  2262  // 0.70, 4.00cm
                 };
 
             const sal_uInt16* pArr0to2 = aAbsSpace0to2;
@@ -2127,8 +2127,8 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( 
sal_uInt16 nId )
 
             if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
             {
-                aFormat.SetFirstLineOffset( -pArr0to2[0] );    // == 0.33 cm
-                aFormat.SetAbsLSpace( pArr0to2[1] );           // == 1.33 cm
+                aFormat.SetFirstLineOffset(- pArr0to2[0]); // num ends at 1.00 
cm
+                aFormat.SetAbsLSpace(pArr0to2[1]);         // text starts at 
1.33 cm
             }
             else if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_ALIGNMENT )
             {
@@ -2140,14 +2140,14 @@ SwNumRule* 
DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
             aFormat.SetCharFormat( pNumCFormat );
             pNewRule->Set( 0, aFormat );
 
+            aFormat.SetNumberingType(SVX_NUM_ROMAN_UPPER);
             aFormat.SetIncludeUpperLevels( 1 );
-            aFormat.SetStart( 1 );
             aFormat.SetListFormat("", ".", 1);
 
             if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
             {
-                aFormat.SetFirstLineOffset( -pArr0to2[2] );    // == 1.03 cm
-                aFormat.SetAbsLSpace( pArr0to2[3] );           // == 2.03 cm
+                aFormat.SetFirstLineOffset(- pArr0to2[2]); // num ends at 2.33 
cm
+                aFormat.SetAbsLSpace(pArr0to2[3]);         // text starts at 
2.66 cm
             }
             else if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_ALIGNMENT )
             {
@@ -2160,13 +2160,13 @@ SwNumRule* 
DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
 
             aFormat.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER);
             aFormat.SetIncludeUpperLevels( 1 );
-            aFormat.SetStart( 3 );
             aFormat.SetListFormat("", u")", 2);
+            aFormat.SetNumAdjust( SvxAdjust::Left );
 
             if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
             {
-                aFormat.SetFirstLineOffset( - pArr0to2[4] );   // == 2.03 cm
-                aFormat.SetAbsLSpace( pArr0to2[5] );           // == 2.73 cm
+                aFormat.SetFirstLineOffset(- pArr0to2[4]); // num starts at 
3.30 cm
+                aFormat.SetAbsLSpace(pArr0to2[5]);         // text starts at 
4.00 cm
             }
             else if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_ALIGNMENT )
             {
@@ -2181,8 +2181,8 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( 
sal_uInt16 nId )
             aFormat.SetCharFormat( pBullCFormat );
             aFormat.SetBulletFont(  &numfunc::GetDefBulletFont() );
             aFormat.SetBulletChar( cBulletChar );
-            sal_Int16 nOffs = o3tl::convert(4, o3tl::Length::mm, 
o3tl::Length::twip),
-                      nOffs2 = o3tl::convert(2, o3tl::Length::cm, 
o3tl::Length::twip);
+            sal_Int16 nOffs = o3tl::convert(660, o3tl::Length::mm100, 
o3tl::Length::twip),
+                      nOffs2 = o3tl::convert(4000, o3tl::Length::mm100, 
o3tl::Length::twip);
 
             if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
             {
@@ -2200,11 +2200,11 @@ SwNumRule* 
DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
 
                 if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
                 {
-                    aFormat.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) );
+                    aFormat.SetAbsLSpace(nOffs2 + ((n - 2) * 
static_cast<tools::Long>(nOffs)));
                 }
                 else if ( eNumberFormatPositionAndSpaceMode == 
SvxNumberFormat::LABEL_ALIGNMENT )
                 {
-                    tools::Long nPos = nOffs2 + ((n-3) * 
static_cast<tools::Long>(nOffs));
+                    tools::Long nPos = nOffs2 + ((n - 2) * 
static_cast<tools::Long>(nOffs));
                     aFormat.SetListtabPos(nPos);
                     aFormat.SetIndentAt(nPos);
                 }
commit 2368dc80c6648b09c18d37718531c0f8daf610a3
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Mon Dec 26 19:34:06 2022 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Thu Apr 20 00:53:13 2023 +0200

    tdf#56258 tdf#106988 sw numbering IVX: fix bad indent/tab value
    
    The comment (and the previous code) indicates a progressive
    increment by 1.3cm for each level. Well, the third level
    was some mid-way-between-level1-and-level2 anomaly.
    So just drop it and add the proper indent for the last level.
    
    The tenth level should be 10 times larger than the first indent.
    Previously it was 283 and 2835, so the current values
    of 754 and 7541 sound perfect.
    
    This was a LO 6.0 regression by
    commit 3d6fca942063fe5e398c3a09f9336dc5aa549138
    
    Change-Id: I41623424ab5c768bdc3914ae9b95d02631bb1a2e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144827
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150648
    Tested-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 1d2bb17e3e54..62c08bae7b8b 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -2069,7 +2069,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( 
sal_uInt16 nId )
             static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
                 {
 //              cm: 1.33 cm intervals
-                    754, 1508, 1191, 2262, 3016, 3771, 4525, 5279, 6033, 6787
+                    754, 1508, 2262, 3016, 3771, 4525, 5279, 6033, 6787, 7541
                 };
             const sal_uInt16* pArr = aAbsSpace;
 

Reply via email to