sd/source/ui/inc/ViewShell.hxx   |    2 ++
 sd/source/ui/unoidl/unomodel.cxx |   14 ++++++++++++--
 sd/source/ui/view/viewshe2.cxx   |   12 ++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 263790b806794a69d8f13f470e6a1933a9ebe53c
Author: Pranav Kant <pran...@collabora.co.uk>
Date:   Thu Mar 15 20:09:26 2018 +0530

    sd lok: Set the view size to full page size and hide ruler, scrollbars
    
    ... such that during insertion of objects when sd calculates the center
    of the view to place the object, it is the center of the whole slide,
    not the center of the default rectangle of 800x600.
    
    It's also important to hide rulers, scrollbars so that correct center is
    calculated; we don't need them anyways in LOK.
    
    Change-Id: I1180541c1b8c8a35f39112ca0a670c9d96d1320b
    Reviewed-on: https://gerrit.libreoffice.org/51357
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 075cb634389c..a8175fd2d660 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -192,6 +192,8 @@ public:
 
     bool HasRuler() { return mbHasRulers;}
     void SetRuler(bool bRuler);
+    // Hides horizontal, vertical scrollbar as well as scrollbox
+    void SetScrollBarsVisible(bool bVisible);
 
     /** Set internal values of all scroll bars that determine thumb size and
         position.  The external values like size and position of the scroll
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 597787533010..1ef0abf95111 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2476,11 +2476,21 @@ void 
SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs
         SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType());
         
pOptions->SetShowComments(comphelper::LibreOfficeKit::isTiledAnnotations());
 
-        // Disable map mode, so that it's possible to send mouse event 
coordinates
-        // in logic units.
+        pViewShell->SetRuler(false);
+        pViewShell->SetScrollBarsVisible(false);
+
         if (sd::Window* pWindow = pViewShell->GetActiveWindow())
         {
+            // get the full page size in pixels
+            pWindow->EnableMapMode();
+            Size 
aSize(pWindow->LogicToPixel(pDrawView->GetSdrPageView()->GetPage()->GetSize()));
+            // Disable map mode, so that it's possible to send mouse event
+            // coordinates in logic units
             pWindow->EnableMapMode(false);
+
+            // arrange UI elements again with new view size
+            pViewShell->GetParentWindow()->SetSizePixel(aSize);
+            pViewShell->Resize();
         }
 
         // Forces all images to be swapped in synchronously, this
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 82b529e869d3..52f7789dfde5 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -929,6 +929,18 @@ void ViewShell::SetRuler(bool bRuler)
         GetViewShell()->InvalidateBorder();
 }
 
+void ViewShell::SetScrollBarsVisible(bool bVisible)
+{
+    if (mpVerticalScrollBar.get() != nullptr)
+        mpVerticalScrollBar->Show( bVisible );
+
+    if (mpHorizontalScrollBar.get() != nullptr)
+        mpHorizontalScrollBar->Show( bVisible );
+
+    if (mpScrollBarBox.get() != nullptr)
+        mpScrollBarBox->Show(bVisible);
+}
+
 sal_Int8 ViewShell::AcceptDrop (
     const AcceptDropEvent& rEvt,
     DropTargetHelper& rTargetHelper,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to