diff options
author | Marco Cecchetti <mrcekets@gmail.com> | 2018-11-30 17:20:37 +0100 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2019-05-20 10:31:05 +0200 |
commit | 89189743b9795cae13c69f69cdf6901b9ed354a7 (patch) | |
tree | cdbfb674de6826458220ae42a1f5502b68108300 /cui | |
parent | 9c7fac47aacb0877c7d212217089a680400c1377 (diff) |
lok: shape selection: perform the needed unit conversion in a clever way
Change-Id: I505bd41801b5fd1898a9eddc81b102f2f7ae20b5
Reviewed-on: https://gerrit.libreoffice.org/70563
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 9adcea111d85..397803c96e5c 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -88,28 +88,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; -} - -} // anonymous ns - - /************************************************************************* |* |* constructor of the tab dialog: adds the pages to the dialog @@ -279,18 +257,9 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet) const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale); const double fTmpY((GetCoreValue(*m_xMtrPosY, 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_aCtlAngle.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; } @@ -965,12 +934,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))); @@ -1010,12 +973,6 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit ); lHeight = static_cast<long>(m_xMtrHeight->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 ), static_cast<sal_uInt32>(lWidth) ) ); rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast<sal_uInt32>(lHeight) ) ); |