[Libreoffice-commits] core.git: sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 30 08:46:01 UTC 2021


 sw/source/core/attr/format.cxx |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

New commits:
commit 6340862e0c0eaff3ef1cf5161b2115a858a4ae4a
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Mar 30 08:54:30 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Mar 30 10:45:24 2021 +0200

    Simplify SwFormat::SetPageFormatToDefault
    
    Change-Id: I5a85a3f32cd88cb8306d54e2fafa4156056cc577
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113334
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index cfbf3a2ba77e..d5c3a3833f0d 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -693,16 +693,9 @@ void SwFormat::DelDiffs( const SfxItemSet& rSet )
 
 void SwFormat::SetPageFormatToDefault()
 {
-
-    SvxLRSpaceItem aLR(RES_LR_SPACE);
     const sal_Int32 nSize = o3tl::convert(2, o3tl::Length::cm, o3tl::Length::twip);
-    aLR.SetLeft(nSize);
-    aLR.SetRight(nSize);
-    SvxULSpaceItem aUL(RES_UL_SPACE);
-    aUL.SetUpper(static_cast<sal_uInt16>(nSize));
-    aUL.SetLower(static_cast<sal_uInt16>(nSize));
-    SetFormatAttr(aLR);
-    SetFormatAttr(aUL);
+    SetFormatAttr(SvxLRSpaceItem(nSize, nSize, nSize, 0, RES_LR_SPACE));
+    SetFormatAttr(SvxULSpaceItem(nSize, nSize, RES_UL_SPACE));
 }
 
 /** SwFormat::IsBackgroundTransparent


More information about the Libreoffice-commits mailing list