summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMarco Cecchetti <mrcekets@gmail.com>2018-11-30 17:20:37 +0100
committerAndras Timar <andras.timar@collabora.com>2018-12-15 12:33:16 +0100
commit0be31ab89261524a6c979332e45ae1eb6dcbe5e4 (patch)
treef4f38ee54e9554df149bd04ce1e73ba85f253b8b /desktop
parentdfe497c0c7628ed2d2abb5dbae2bf8756a371f29 (diff)
lok: shape selection: perform the needed unit conversion in a clever way
Change-Id: I505bd41801b5fd1898a9eddc81b102f2f7ae20b5
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 42a06ce2be6c..33bac792668f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -97,6 +97,7 @@
#include <svx/dialogs.hrc>
#include <svx/strings.hrc>
#include <svx/ruler.hxx>
+#include <svx/svdview.hxx>
#include <svx/svxids.hrc>
#include <svx/ucsubset.hxx>
#include <vcl/vclevent.hxx>
@@ -2766,6 +2767,37 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
return;
}
}
+ else if (gImpl && aCommand == ".uno:TransformDialog")
+ {
+ bool bNeedConversion = false;
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (const SdrView* pView = pViewShell->GetDrawView())
+ {
+ if (OutputDevice* pOutputDevice = pView->GetFirstOutputDevice())
+ {
+ bNeedConversion = (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM);
+ }
+ }
+ if (bNeedConversion)
+ {
+ sal_Int32 value;
+ for (beans::PropertyValue& rPropValue: aPropertyValuesVector)
+ {
+ if (rPropValue.Name == "TransformPosX"
+ || rPropValue.Name == "TransformPosY"
+ || rPropValue.Name == "TransformWidth"
+ || rPropValue.Name == "TransformHeight"
+ || rPropValue.Name == "TransformRotationX"
+ || rPropValue.Name == "TransformRotationY")
+ {
+ rPropValue.Value >>= value;
+ value = OutputDevice::LogicToLogic(value, MapUnit::MapTwip, MapUnit::Map100thMM);
+ rPropValue.Value <<= value;
+ }
+
+ }
+ }
+ }
bool bResult = false;
if (bNotifyWhenFinished && pDocument->mpCallbackFlushHandlers[nView])