summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2018-03-15 20:09:26 +0530
committerAndras Timar <andras.timar@collabora.com>2018-03-27 12:23:02 +0200
commit3b388ea53a73c2c62955338e7d03688c8ed9b26b (patch)
tree9b0d7b93e306e3a889d0e3b33581ef7e928ecda4 /sd/source
parentf1c5471d781f3f1549d23c9de8e09cdc7a2f4b84 (diff)
sd lok: Set the view size to full page size + fix unit tests
... 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. Reviewed-on: https://gerrit.libreoffice.org/51416 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk> (cherry picked from commit 21f56ccbd22ffa347edf931b7ed93c99988fbb8a) Change-Id: I2d1577bc963d324959b272ed3174571ab197d014
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/inc/ViewShell.hxx2
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx14
-rw-r--r--sd/source/ui/view/viewshe2.cxx12
3 files changed, 26 insertions, 2 deletions
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index ec5ff6514bd9..fbbfb5f4919e 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -190,6 +190,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 ae800a94f0ff..fd22e09ecd03 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2446,11 +2446,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 64a11a91cda0..fe8580ec4218 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -939,6 +939,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,