[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sc/source

Ilhan Yesil (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 7 13:29:47 UTC 2019


 sc/source/ui/view/gridwin4.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 312383b311d6f1733b3750d279b54486dd64e3b9
Author:     Ilhan Yesil <ilhanyesil at gmx.de>
AuthorDate: Wed Jul 10 15:41:27 2019 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Mon Oct 7 15:29:08 2019 +0200

    tdf#124983 In calc make printable page borders also initially visible
    
    If option "LibreOfficeDev Calc/View/Page breaks"
    is enabled, breaks should be visible. But if the document
    is opened the first time, the breaks are not calculated yet
    and therefore not visible.
    
    Change-Id: I651e4df4a9c292aa953888498a5c9d0fb5b8c8d2
    Reviewed-on: https://gerrit.libreoffice.org/75355
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit caeb7b141280a65e60525f11a7e6514b76e12e11)
    Reviewed-on: https://gerrit.libreoffice.org/80353
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
    Tested-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 62ccfd036e27..7be9555961fb 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -68,6 +68,7 @@
 #include <sc.hrc>
 #include <vcl/virdev.hxx>
 #include <svx/sdrpaintwindow.hxx>
+#include <printfun.hxx>
 
 static void lcl_LimitRect( tools::Rectangle& rRect, const tools::Rectangle& rVisible )
 {
@@ -557,6 +558,23 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
     bool bGridFirst = !rOpts.GetOption( VOPT_GRID_ONTOP );
 
     bool bPage = rOpts.GetOption( VOPT_PAGEBREAKS );
+    // tdf#124983, if option LibreOfficeDev Calc/View/Visual Aids/Page breaks
+    // is enabled, breaks should be visible. If the document is opened the first
+    // time, the breaks are not calculated yet, so this initialization is
+    // done here.
+    if (bPage)
+    {
+        std::set<SCCOL> aColBreaks;
+        std::set<SCROW> aRowBreaks;
+        rDoc.GetAllColBreaks(aColBreaks, nTab, true, false);
+        rDoc.GetAllRowBreaks(aRowBreaks, nTab, true, false);
+        if (aColBreaks.size() == 0 || aRowBreaks.size() == 0)
+        {
+            ScDocShell* pDocSh = pViewData->GetDocShell();
+            ScPrintFunc aPrintFunc(pDocSh, pDocSh->GetPrinter(), nTab);
+            aPrintFunc.UpdatePages();
+        }
+    }
 
     bool bPageMode = pViewData->IsPagebreakMode();
     if (bPageMode)                                      // after FindChanged


More information about the Libreoffice-commits mailing list