summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unotxdoc.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-01-17 14:46:47 +0100
committerJan Holesovsky <kendy@collabora.com>2019-01-18 15:39:05 +0100
commit74b23279c342f2484cdad64b211fb1972644d5a5 (patch)
tree33dafc263ff0ff95fa35cc91a14a320b2f10150a /sw/source/uibase/uno/unotxdoc.cxx
parenta40f12c3f18e4262336fcd51d26dd099eae1e070 (diff)
lok sw: When inserting shapes, do that in the middle of the visible area.
Instead of in the middle of the entire document, which may be far away. Change-Id: I50a1a5f159b73a3803cd7a549939b73a366e7dc5 Reviewed-on: https://gerrit.libreoffice.org/66584 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sw/source/uibase/uno/unotxdoc.cxx')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 49f6e4172c6a..a1324b36422d 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3266,12 +3266,16 @@ bool SwXTextDocument::isMimeTypeSupported()
void SwXTextDocument::setClientVisibleArea(const tools::Rectangle& rRectangle)
{
- SwView* pView = pDocShell->GetView();
- if (!pView)
- return;
+ if (SwView* pView = pDocShell->GetView())
+ {
+ // set the PgUp/PgDown offset
+ pView->ForcePageUpDownOffset(2 * rRectangle.GetHeight() / 3);
+ }
- // set the PgUp/PgDown offset
- pView->ForcePageUpDownOffset(2 * rRectangle.GetHeight() / 3);
+ if (SwViewShell* pViewShell = pDocShell->GetWrtShell())
+ {
+ pViewShell->setLOKVisibleArea(rRectangle);
+ }
}
void SwXTextDocument::setClientZoom(int nTilePixelWidth_, int /*nTilePixelHeight_*/,