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

Gabor Kelemen kelemeng at ubuntu.com
Thu Mar 1 10:27:26 UTC 2018


 sw/source/core/view/vprint.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit c77e01d63b4bd4805c4a499e4e0cab917d0eb403
Author: Gabor Kelemen <kelemeng at ubuntu.com>
Date:   Wed Feb 28 00:34:00 2018 +0100

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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();


More information about the Libreoffice-commits mailing list