summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <Vasily.Melenchuk@cib.de>2018-01-30 10:26:27 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-02-15 14:04:02 +0100
commit3462a55f0696ae06ea6714723c54eb7c67c2cbaa (patch)
treeab12c1e9a276685a3352b648c685f5ea67af86b8
parent1647bfa019124aefd34d8ad231d19399e93a6096 (diff)
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. Change-Id: I86921668b648a8110d16b31507f2ce5d6c88484a Reviewed-on: https://gerrit.libreoffice.org/49334 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sd/inc/sdpage.hxx1
-rw-r--r--sd/qa/unoapi/knownissues.xcl5
-rw-r--r--sd/source/core/sdpage.cxx38
-rw-r--r--sd/source/core/sdpage2.cxx7
4 files changed, 19 insertions, 32 deletions
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index dcef647fb59e..42af131102c0 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -122,7 +122,6 @@ friend class sd::UndoAttrObject;
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 6e4c3dffbfee..867c4df6c3c0 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -129,16 +129,6 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage)
// presentation template of the outline objects. Therefore, it already
// contains the designator for the outline (STR_LAYOUT_OUTLINE).
maLayoutName = SdResId(STR_LAYOUT_DEFAULT_NAME)+ SD_LT_SEPARATOR STR_LAYOUT_OUTLINE;
- Size aPageSize(GetSize());
-
- if (aPageSize.Width() > aPageSize.Height())
- {
- meOrientation = Orientation::Landscape;
- }
- else
- {
- meOrientation = Orientation::Portrait;
- }
}
namespace
@@ -1757,20 +1747,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;
- }
- }
}
}
@@ -2614,14 +2590,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 21903145ea61..deab43fa74fa 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -397,7 +397,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()
@@ -573,9 +572,9 @@ bool SdPage::Equals(const SdPage& rOtherPage) const
mbLoopSound == rOtherPage.mbLoopSound && mbStopSound == rOtherPage.mbStopSound &&
maBookmarkName == rOtherPage.maBookmarkName && mbScaleObjects == rOtherPage.mbScaleObjects &&
mbBackgroundFullSize == rOtherPage.mbBackgroundFullSize && meCharSet == rOtherPage.meCharSet &&
- mnPaperBin == rOtherPage.mnPaperBin && meOrientation == rOtherPage.meOrientation &&
- mnTransitionType == rOtherPage.mnTransitionType && mnTransitionSubtype == rOtherPage.mnTransitionSubtype &&
- mbTransitionDirection == rOtherPage.mbTransitionDirection && mnTransitionFadeColor == rOtherPage.mnTransitionFadeColor &&
+ mnPaperBin == rOtherPage.mnPaperBin && mnTransitionType == rOtherPage.mnTransitionType &&
+ mnTransitionSubtype == rOtherPage.mnTransitionSubtype && mbTransitionDirection == rOtherPage.mbTransitionDirection &&
+ mnTransitionFadeColor == rOtherPage.mnTransitionFadeColor &&
rtl::math::approxEqual(mfTransitionDuration, rOtherPage.mfTransitionDuration));
}