diff options
author | Ilhan Yesil <ilhanyesil@gmx.de> | 2019-07-10 15:41:27 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-10-01 22:13:09 +0200 |
commit | caeb7b141280a65e60525f11a7e6514b76e12e11 (patch) | |
tree | 4f7b1f0db28fc7229b89a7f198eb87596135c4d8 /sc/source | |
parent | 32f28dfa4c1de2b92664a5c0c3eca4fffecc0b28 (diff) |
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@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
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 |