summaryrefslogtreecommitdiff
path: root/cui
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 /cui
parentdfe497c0c7628ed2d2abb5dbae2bf8756a371f29 (diff)
lok: shape selection: perform the needed unit conversion in a clever way
Change-Id: I505bd41801b5fd1898a9eddc81b102f2f7ae20b5
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/transfrm.cxx48
1 files changed, 2 insertions, 46 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 5fbd368c7cd1..d9a3ff38ac85 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -38,7 +38,6 @@
#include <svl/rectitem.hxx>
#include <svl/aeitem.hxx>
#include <swpossizetabpage.hxx>
-#include <comphelper/lok.hxx>
// static ----------------------------------------------------------------
@@ -81,28 +80,6 @@ const sal_uInt16 SvxSlantTabPage::pSlantRanges[] =
0
};
-namespace {
-
-bool lcl_twipsNeeded(const SdrView* pView)
-{
- const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
- if (bTiledRendering)
- {
- // We gets the position in twips
- if (OutputDevice* pOutputDevice = pView->GetFirstOutputDevice())
- {
- if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
- {
- return true;
- }
- }
- }
- return false;
-}
-
-} // anonymouus ns
-
-
/*************************************************************************
|*
|* constructor of the tab dialog: adds the pages to the dialog
@@ -294,18 +271,9 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
const double fTmpX((GetCoreValue(*m_pMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
const double fTmpY((GetCoreValue(*m_pMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);
- long nRotateX = basegfx::fround(fTmpX);
- long nRotateY = basegfx::fround(fTmpY);
-
- if (lcl_twipsNeeded(pView))
- {
- nRotateX = OutputDevice::LogicToLogic(nRotateX, MapUnit::Map100thMM, MapUnit::MapTwip);
- nRotateY = OutputDevice::LogicToLogic(nRotateY, MapUnit::Map100thMM, MapUnit::MapTwip);
- }
-
rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_pCtlAngle->GetRotation()));
- rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), nRotateX));
- rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), nRotateY));
+ rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX)));
+ rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY)));
bModified = true;
}
@@ -968,12 +936,6 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
// #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions
GetTopLeftPosition(fX, fY, maRange);
- if (lcl_twipsNeeded(mpView))
- {
- fX = OutputDevice::LogicToLogic(fX, MapUnit::Map100thMM, MapUnit::MapTwip);
- fY = OutputDevice::LogicToLogic(fY, MapUnit::Map100thMM, MapUnit::MapTwip);
- }
-
rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_X), basegfx::fround(fX)));
rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY)));
@@ -1015,12 +977,6 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight ));
- if (lcl_twipsNeeded(mpView))
- {
- lWidth = OutputDevice::LogicToLogic(lWidth, MapUnit::Map100thMM, MapUnit::MapTwip);
- lHeight = OutputDevice::LogicToLogic(lHeight, MapUnit::Map100thMM, MapUnit::MapTwip);
- }
-
// put Width & Height to itemset
rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), (sal_uInt32) lWidth ) );
rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), (sal_uInt32) lHeight ) );