[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sd/inc sd/qa sd/source

Vasily Melenchuk Vasily.Melenchuk at cib.de
Fri Feb 23 10:28:44 UTC 2018


 sd/inc/sdpage.hxx            |    1 -
 sd/qa/unoapi/knownissues.xcl |    5 +++++
 sd/source/core/sdpage.cxx    |   39 +++++++++++----------------------------
 sd/source/core/sdpage2.cxx   |    3 +--
 4 files changed, 17 insertions(+), 31 deletions(-)

New commits:
commit dbf2a83a386a54060da64c44207c84ad72da1b5c
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date:   Tue Jan 30 10:26:27 2018 +0300

    tdf#115345: removed slide orientation setting method.
    
    Slide orientation is dependent value and can be easily calculated
    based on slide dimensions.
    
    Also modification of slide orientation without changing of page
    dimensions brings page in inconsistent state.
    
    Reviewed-on: https://gerrit.libreoffice.org/49334
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    
     Conflicts:
            sd/source/core/sdpage.cxx
            sd/source/core/sdpage2.cxx
    
    Change-Id: I86921668b648a8110d16b31507f2ce5d6c88484a

diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index d7da289b6392..9e0bd32b25c1 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -123,7 +123,6 @@ protected:
     bool    mbBackgroundFullSize;     ///< Background object to represent the whole page.
     rtl_TextEncoding meCharSet;           ///< Text encoding
     sal_uInt16  mnPaperBin;               ///< PaperBin
-    Orientation meOrientation;            ///< Print orientation.
     SdPageLink* mpPageLink;               ///< Page link (at left sides only)
 
     sd::AnnotationVector    maAnnotations;
diff --git a/sd/qa/unoapi/knownissues.xcl b/sd/qa/unoapi/knownissues.xcl
index a7ec4216100a..d9e0690013a1 100644
--- a/sd/qa/unoapi/knownissues.xcl
+++ b/sd/qa/unoapi/knownissues.xcl
@@ -16,6 +16,11 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 
+### tdf#115345 - not useful to set Orientation ###
+sd.SdDrawPage::com::sun::star::drawing::GenericDrawPage
+sd.SdGenericDrawPage::com::sun::star::drawing::GenericDrawPage
+sd.SdMasterPage::com::sun::star::drawing::GenericDrawPage
+
 ### i84994 ###
 sd.SdXImpressDocument::com::sun::star::view::XPrintable
 # -> disabled in sd.sce
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 001994566324..45dab0ed5a39 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -120,17 +120,6 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage)
     OUStringBuffer aBuf(SdResId(STR_LAYOUT_DEFAULT_NAME).toString());
     aBuf.append(SD_LT_SEPARATOR).append(SdResId(STR_LAYOUT_OUTLINE).toString());
     maLayoutName = aBuf.makeStringAndClear();
-
-    Size aPageSize(GetSize());
-
-    if (aPageSize.Width() > aPageSize.Height())
-    {
-        meOrientation = ORIENTATION_LANDSCAPE;
-    }
-    else
-    {
-        meOrientation = ORIENTATION_PORTRAIT;
-    }
 }
 
 /*************************************************************************
@@ -1724,20 +1713,6 @@ void SdPage::SetSize(const Size& aSize)
     if (aSize != aOldSize)
     {
         FmFormPage::SetSize(aSize);
-
-        if (aOldSize.Height() == 10 && aOldSize.Width() == 10)
-        {
-            // this page gets a valid size for the first time. Therefore
-            // we initialize the orientation.
-            if (aSize.Width() > aSize.Height())
-            {
-                meOrientation = ORIENTATION_LANDSCAPE;
-            }
-            else
-            {
-                meOrientation = ORIENTATION_PORTRAIT;
-            }
-        }
     }
 }
 
@@ -2585,14 +2560,22 @@ const OUString& SdPage::GetName() const
     return maCreatedPageName;
 }
 
-void SdPage::SetOrientation( Orientation eOrient)
+void SdPage::SetOrientation( Orientation /*eOrient*/)
 {
-    meOrientation = eOrient;
+    // Do nothing
 }
 
 Orientation SdPage::GetOrientation() const
 {
-    return meOrientation;
+    Size aSize = GetSize();
+    if ( aSize.getWidth() > aSize.getHeight() )
+    {
+        return ORIENTATION_LANDSCAPE;
+    }
+    else
+    {
+        return ORIENTATION_PORTRAIT;
+    }
 }
 
 /*************************************************************************
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index f3ca063dc0b7..4ebebacbf004 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -396,7 +396,6 @@ SdPage::SdPage(const SdPage& rSrcPage)
     mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize;
     meCharSet            = rSrcPage.meCharSet;
     mnPaperBin           = rSrcPage.mnPaperBin;
-    meOrientation        = rSrcPage.meOrientation;
 
     mpPageLink           = nullptr;    // is set when inserting via ConnectLink()
 
@@ -568,7 +567,7 @@ OString SdPage::stringify() const
              append(OUStringToOString(maFileName, RTL_TEXTENCODING_UTF8)).*/
              append(OUStringToOString(maBookmarkName, RTL_TEXTENCODING_UTF8)).
              append(mbScaleObjects).append(mbBackgroundFullSize).append((sal_Int32)meCharSet).append((sal_Int32)mnPaperBin).
-             append((sal_Int32)meOrientation).append((sal_Int32)mnTransitionType).append((sal_Int32)mnTransitionSubtype).append(mbTransitionDirection).
+             append((sal_Int32)mnTransitionType).append((sal_Int32)mnTransitionSubtype).append(mbTransitionDirection).
              append(mnTransitionFadeColor).append(mfTransitionDuration);//.append(mbIsPrecious);
 
     const size_t n = GetObjCount();


More information about the Libreoffice-commits mailing list