diff options
author | Gabor Kelemen <kelemeng@ubuntu.com> | 2018-02-28 00:34:00 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-03-01 11:27:01 +0100 |
commit | c77e01d63b4bd4805c4a499e4e0cab917d0eb403 (patch) | |
tree | 8b417c97f1c704e28eae7cb5b684e26363a84e17 | |
parent | c3074cb5784329eaf558c2f58d96a64085b42d48 (diff) |
tdf#91680 Reserve space in margin for comments only if there are comments
Change-Id: Ida08737cf537d85a94a72572e8cbc7e2bfad9333
Reviewed-on: https://gerrit.libreoffice.org/50505
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/source/core/view/vprint.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 4683d9ad984d..d772f7acdac0 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -466,7 +466,12 @@ bool SwViewShell::PrintOrPDFExport( GDIMetaFile *pOrigRecorder(nullptr); GDIMetaFile *pMetaFile(nullptr); SwPostItMode nPostItMode = rPrintData.GetPrintPostIts(); - if (nPostItMode == SwPostItMode::InMargins) + + // tdf#91680 Reserve space in margin for comments only if there are comments + const bool bHasPostItsToPrintInMargins = ( nPostItMode == SwPostItMode::InMargins ) && + sw_GetPostIts( &GetDoc()->getIDocumentFieldsAccess(), nullptr ); + + if ( bHasPostItsToPrintInMargins ) { //get and disable the existing recorder pOrigRecorder = pOutDev->GetConnectMetaFile(); @@ -537,8 +542,8 @@ bool SwViewShell::PrintOrPDFExport( SwPaintQueue::Repaint(); - SwPostItMgr *pPostItManager = (nPostItMode == SwPostItMode::InMargins) ? - pShell->GetPostItMgr() : nullptr; + SwPostItMgr *pPostItManager = bHasPostItsToPrintInMargins ? pShell->GetPostItMgr() : nullptr; + if (pPostItManager) { pPostItManager->CalcRects(); |