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

Ilhan Yesil (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 1 20:14:04 UTC 2019


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

New commits:
commit caeb7b141280a65e60525f11a7e6514b76e12e11
Author:     Ilhan Yesil <ilhanyesil at gmx.de>
AuthorDate: Wed Jul 10 15:41:27 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Tue Oct 1 22:13:09 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>

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4893b31c6b1b..947961218438 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -69,6 +69,7 @@
 #include <vcl/virdev.hxx>
 #include <svx/sdrpaintwindow.hxx>
 #include <drwlayer.hxx>
+#include <printfun.hxx>
 
 static void lcl_LimitRect( tools::Rectangle& rRect, const tools::Rectangle& rVisible )
 {
@@ -560,6 +561,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