Kaydet (Commit) 263790b8 authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) Jan Holesovsky

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/51357Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 8d7a250c
...@@ -192,6 +192,8 @@ public: ...@@ -192,6 +192,8 @@ public:
bool HasRuler() { return mbHasRulers;} bool HasRuler() { return mbHasRulers;}
void SetRuler(bool bRuler); 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 /** Set internal values of all scroll bars that determine thumb size and
position. The external values like size and position of the scroll position. The external values like size and position of the scroll
......
...@@ -2476,11 +2476,21 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs ...@@ -2476,11 +2476,21 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs
SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()); SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType());
pOptions->SetShowComments(comphelper::LibreOfficeKit::isTiledAnnotations()); pOptions->SetShowComments(comphelper::LibreOfficeKit::isTiledAnnotations());
// Disable map mode, so that it's possible to send mouse event coordinates pViewShell->SetRuler(false);
// in logic units. pViewShell->SetScrollBarsVisible(false);
if (sd::Window* pWindow = pViewShell->GetActiveWindow()) 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); 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 // Forces all images to be swapped in synchronously, this
......
...@@ -929,6 +929,18 @@ void ViewShell::SetRuler(bool bRuler) ...@@ -929,6 +929,18 @@ void ViewShell::SetRuler(bool bRuler)
GetViewShell()->InvalidateBorder(); 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 ( sal_Int8 ViewShell::AcceptDrop (
const AcceptDropEvent& rEvt, const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper, DropTargetHelper& rTargetHelper,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment