summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-03-31 12:26:54 +0200
committerJan Holesovsky <kendy@collabora.com>2016-03-31 15:52:26 +0200
commitee246512cb0103f22f8afc0de245ea7f82143776 (patch)
tree01bea27f52e655c3247a3b5ca6a8093e97ddf25b /sd
parent2d74cbe769e4562d6edcd0d35868fa80e6d9dd15 (diff)
sd lok bccu#1525: Don't rely on the window size in the LOK case.
Otherwise the table is inserted in the top left corner. Change-Id: Ia5d7099d4bace6f18cd7e8d3409427119240b756
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/table/tablefunction.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx
index 4d20312cc5c1..fd58cd4e1462 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/awt/KeyModifier.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
+#include <comphelper/lok.hxx>
#include <cppuhelper/basemutex.hxx>
#include <vcl/svapp.hxx>
@@ -149,16 +150,25 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
Size aSize( 14100, 2000 );
Point aPos;
- Rectangle aWinRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
+ Rectangle aWinRect(aPos, GetActiveWindow()->GetOutputSizePixel());
aWinRect = GetActiveWindow()->PixelToLogic(aWinRect);
// make sure that the default size of the table fits on the paper and is inside the viewing area.
// if zoomed in close, don't make the table bigger than the viewing window.
Size aMaxSize = getCurrentPage()->GetSize();
- if( aMaxSize.Height() > aWinRect.getHeight() )
- aMaxSize.setHeight( aWinRect.getHeight() );
- if( aMaxSize.Width() > aWinRect.getWidth() )
- aMaxSize.setWidth( aWinRect.getWidth() );
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // aWinRect is nonsensical in the LOK case
+ aWinRect = Rectangle(aPos, aMaxSize);
+ }
+ else
+ {
+ if( aMaxSize.Height() > aWinRect.getHeight() )
+ aMaxSize.setHeight( aWinRect.getHeight() );
+ if( aMaxSize.Width() > aWinRect.getWidth() )
+ aMaxSize.setWidth( aWinRect.getWidth() );
+ }
if( aSize.Width() > aMaxSize.getWidth() )
aSize.setWidth( aMaxSize.getWidth() );