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

Hossein (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 16 06:26:10 UTC 2021


 desktop/source/lib/init.cxx |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit f34146b7d5d0bb66c805504a691cb70d5b3da6b2
Author:     Hossein <hossein at libreoffice.org>
AuthorDate: Mon Aug 16 00:53:12 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Aug 16 08:24:57 2021 +0200

    Cleaning up decleration and initialization of unique_ptr variables
    
    Cleaning up decleration and initialization of unique_ptr variables
    pPageSizeItem, pPageLRMarginItem, and pPageULMarginItem according to
    the request:
    https://gerrit.libreoffice.org/c/core/+/120456
    
    Change-Id: I0cf5149308fe06c10403bfb82ca6a1786096bf3e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120520
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9ca61d6c0a4d..be1682047ab9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -805,9 +805,7 @@ void ExecuteMarginULChange(
 void ExecuteOrientationChange()
 {
     std::unique_ptr<SvxPageItem> pPageItem(new SvxPageItem(SID_ATTR_PAGE));
-    std::unique_ptr<SvxSizeItem> pPageSizeItem(new SvxSizeItem(SID_ATTR_PAGE_SIZE));
-    std::unique_ptr<SvxLongLRSpaceItem> pPageLRMarginItem(new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ));
-    std::unique_ptr<SvxLongULSpaceItem> pPageULMarginItem(new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ));
+
     // 1mm in twips rounded
     // This should be in sync with MINBODY in sw/source/uibase/sidebar/PageMarginControl.hxx
     constexpr tools::Long MINBODY = 56;
@@ -823,18 +821,13 @@ void ExecuteOrientationChange()
 
 
     SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE, pItem);
-    pPageSizeItem.reset(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_SIZE));
-
-
+    std::unique_ptr<SvxSizeItem> pPageSizeItem(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_SIZE));
 
     SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE, pItem);
-    pPageLRMarginItem.reset(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_LRSPACE));
-
-
+    std::unique_ptr<SvxLongLRSpaceItem> pPageLRMarginItem(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_LRSPACE));
 
     SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_ULSPACE, pItem);
-    pPageULMarginItem.reset(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_ULSPACE));
-
+    std::unique_ptr<SvxLongULSpaceItem> pPageULMarginItem(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_ULSPACE));
 
     {
         bool bIsLandscape = false;


More information about the Libreoffice-commits mailing list