diff options
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 2b56a7a76ad0..1918f676a15d 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -41,6 +41,7 @@ #include <svl/rectitem.hxx> #include <svl/aeitem.hxx> #include <swpossizetabpage.hxx> +#include <comphelper/lok.hxx> // static ---------------------------------------------------------------- @@ -83,6 +84,28 @@ 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 @@ -252,9 +275,18 @@ 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), basegfx::fround(fTmpX))); - rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY))); + rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), nRotateX)); + rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), nRotateY)); bModified = true; } @@ -938,6 +970,12 @@ 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))); @@ -977,6 +1015,12 @@ 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) ) ); |