Kaydet (Commit) 57991f88 authored tarafından Vasily Melenchuk's avatar Vasily Melenchuk Kaydeden (comit) Thorsten Behrens

tdf#91362: Use document paper size for printing slides.

By default for priniting slides we use not default A4, but size provided
in slide properties.

Additinally renamed IsPageSize() -> IsPaperSize(): it is less ambiguous.

Change-Id: Iaf38dedb32b14cd6fbdd2ad355ecf3208e32663e
Reviewed-on: https://gerrit.libreoffice.org/46407Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst c73f88de
...@@ -144,7 +144,7 @@ namespace { ...@@ -144,7 +144,7 @@ namespace {
return nQuality; return nQuality;
} }
bool IsPageSize() const bool IsPaperSize() const
{ {
return GetBoolValue("PageOptions", sal_Int32(1)); return GetBoolValue("PageOptions", sal_Int32(1));
} }
...@@ -164,10 +164,10 @@ namespace { ...@@ -164,10 +164,10 @@ namespace {
return GetBoolValue("PrintProspect", false); return GetBoolValue("PrintProspect", false);
} }
bool IsPrinterPreferred(DocumentType eDocType) const bool IsPrinterPreferred() const
{ {
bool bIsDraw = eDocType == DocumentType::Draw; return IsTilePage() || IsPaperSize() || IsBooklet() ||
return IsTilePage() || IsPageSize() || IsBooklet() || (!bIsDraw && !IsNotes()); IsNotes() || IsHandout() || IsOutline();
} }
bool IsPrintExcluded() const bool IsPrintExcluded() const
...@@ -1352,7 +1352,7 @@ private: ...@@ -1352,7 +1352,7 @@ private:
// Draw and Notes should usually abide by their specified paper size // Draw and Notes should usually abide by their specified paper size
Size aPaperSize; Size aPaperSize;
if (!mpOptions->IsPrinterPreferred(pDocument->GetDocumentType())) if (!mpOptions->IsPrinterPreferred())
{ {
aPaperSize.setWidth(rInfo.maPageSize.Width()); aPaperSize.setWidth(rInfo.maPageSize.Width());
aPaperSize.setHeight(rInfo.maPageSize.Height()); aPaperSize.setHeight(rInfo.maPageSize.Height());
...@@ -1365,7 +1365,7 @@ private: ...@@ -1365,7 +1365,7 @@ private:
maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height()); maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType())) if (mpOptions->IsPrinterPreferred())
{ {
if( (rInfo.meOrientation == Orientation::Landscape && if( (rInfo.meOrientation == Orientation::Landscape &&
(aPaperSize.Width() < aPaperSize.Height())) (aPaperSize.Width() < aPaperSize.Height()))
...@@ -1428,7 +1428,7 @@ private: ...@@ -1428,7 +1428,7 @@ private:
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( ::tools::Time( ::tools::Time::SYSTEM ), false ); aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( ::tools::Time( ::tools::Time::SYSTEM ), false );
// Draw and Notes should usually use specified paper size when printing // Draw and Notes should usually use specified paper size when printing
if (!mpOptions->IsPrinterPreferred(mrBase.GetDocShell()->GetDocumentType())) if (!mpOptions->IsPrinterPreferred())
{ {
aInfo.maPrintSize = mrBase.GetDocument()->GetSdPage(0, PageKind::Standard)->GetSize(); aInfo.maPrintSize = mrBase.GetDocument()->GetSdPage(0, PageKind::Standard)->GetSize();
maPrintSize = awt::Size(aInfo.maPrintSize.Width(), maPrintSize = awt::Size(aInfo.maPrintSize.Width(),
...@@ -1741,7 +1741,7 @@ private: ...@@ -1741,7 +1741,7 @@ private:
OSL_ASSERT(pDocument != nullptr); OSL_ASSERT(pDocument != nullptr);
SdPage& rHandoutPage (*pDocument->GetSdPage(0, PageKind::Handout)); SdPage& rHandoutPage (*pDocument->GetSdPage(0, PageKind::Handout));
const bool bScalePage (mpOptions->IsPageSize()); const bool bScalePage (mpOptions->IsPaperSize());
sal_uInt16 nPaperBin; sal_uInt16 nPaperBin;
if ( ! mpOptions->IsPaperBin()) if ( ! mpOptions->IsPaperBin())
...@@ -1902,7 +1902,7 @@ private: ...@@ -1902,7 +1902,7 @@ private:
// is it possible that the page size changed? // is it possible that the page size changed?
const Size aPageSize = pPage->GetSize(); const Size aPageSize = pPage->GetSize();
if (mpOptions->IsPageSize()) if (mpOptions->IsPrinterPreferred())
{ {
const double fHorz (static_cast<double>(rInfo.maPrintSize.Width()) / aPageSize.Width()); const double fHorz (static_cast<double>(rInfo.maPrintSize.Width()) / aPageSize.Width());
const double fVert (static_cast<double>(rInfo.maPrintSize.Height()) / aPageSize.Height()); const double fVert (static_cast<double>(rInfo.maPrintSize.Height()) / aPageSize.Height());
...@@ -2133,7 +2133,7 @@ private: ...@@ -2133,7 +2133,7 @@ private:
// (without the unprintable borders). // (without the unprintable borders).
// 3. Split the page into parts of the size of the // 3. Split the page into parts of the size of the
// printable area. // printable area.
const bool bScalePage (mpOptions->IsPageSize()); const bool bScalePage (mpOptions->IsPaperSize());
const bool bCutPage (mpOptions->IsCutPage()); const bool bCutPage (mpOptions->IsCutPage());
MapMode aMap (rInfo.maMap); MapMode aMap (rInfo.maMap);
if (bScalePage || bCutPage) if (bScalePage || bCutPage)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment