Kaydet (Commit) e9164b9b authored tarafından Marco Cecchetti's avatar Marco Cecchetti Kaydeden (comit) Jan Holesovsky

lok: shape scaling rework

Now shape scaling is handled through the transform dialog instead of
simulating a drag and drop event in core.

For Impress the unit used for length is '100th mm' instead of twips,
so we need to transform positions and size from twips to '100th mm'.
Anyway since we don't know in SetGeoAttrToMarked if the new data is
due to a mouse event or by entering a new value in the transormation
dialog or in the side pane, for Impress we need to convert the new
values sent by the dialogs from '100th mm' to twips which are
converted back in SetGeoAttrToMarked.

For performing a uniform scaling when the shape/image is rotated we
need to inform the client about the rotation angle for the selected
graphic object that has been achieved but appending an angle argument
to the graphic selection callback.

Now it is also possible to reverse shapes/images through negative
scaling.

Change-Id: I8a32f3e4b28f36e884a59c59b7e1351e85ef4489
Reviewed-on: https://gerrit.libreoffice.org/64696
Tested-by: Jenkins
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst dd89dc8d
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <svl/rectitem.hxx> #include <svl/rectitem.hxx>
#include <svl/aeitem.hxx> #include <svl/aeitem.hxx>
#include <swpossizetabpage.hxx> #include <swpossizetabpage.hxx>
#include <comphelper/lok.hxx>
// static ---------------------------------------------------------------- // static ----------------------------------------------------------------
...@@ -83,6 +84,28 @@ const sal_uInt16 SvxSlantTabPage::pSlantRanges[] = ...@@ -83,6 +84,28 @@ const sal_uInt16 SvxSlantTabPage::pSlantRanges[] =
0 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 |* constructor of the tab dialog: adds the pages to the dialog
...@@ -252,9 +275,18 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet) ...@@ -252,9 +275,18 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale); const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
const double fTmpY((GetCoreValue(*m_xMtrPosY, ePoolUnit) + maAnchor.getY()) * 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_ANGLE), m_aCtlAngle.GetRotation()));
rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX))); rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), nRotateX));
rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY))); rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), nRotateY));
bModified = true; bModified = true;
} }
...@@ -938,6 +970,12 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) ...@@ -938,6 +970,12 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
// #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions // #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions
GetTopLeftPosition(fX, fY, maRange); 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_X), basegfx::fround(fX)));
rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY))); rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY)));
...@@ -977,6 +1015,12 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) ...@@ -977,6 +1015,12 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit ); lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
lHeight = static_cast<long>(m_xMtrHeight->denormalize( lHeight )); 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 // 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_WIDTH ), static_cast<sal_uInt32>(lWidth) ) );
rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast<sal_uInt32>(lHeight) ) ); rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast<sal_uInt32>(lHeight) ) );
......
...@@ -161,9 +161,11 @@ typedef enum ...@@ -161,9 +161,11 @@ typedef enum
*/ */
LOK_CALLBACK_CURSOR_VISIBLE = 5, LOK_CALLBACK_CURSOR_VISIBLE = 5,
/** /**
* The size and/or the position of the graphic selection changed. * The size and/or the position of the graphic selection changed and
* the rotation angle of the embedded graphic object
* *
* Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. * Format is "x, y, width, height, angle", where angle is in 100th
* of degree.
*/ */
LOK_CALLBACK_GRAPHIC_SELECTION = 6, LOK_CALLBACK_GRAPHIC_SELECTION = 6,
......
...@@ -8504,7 +8504,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE ...@@ -8504,7 +8504,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE
SfxVoidItem TransformDialog SID_ATTR_TRANSFORM SfxVoidItem TransformDialog SID_ATTR_TRANSFORM
(SfxUInt32Item TransformRotationDeltaAngle SID_ATTR_TRANSFORM_DELTA_ANGLE,SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y) (SfxUInt32Item TransformPosX SID_ATTR_TRANSFORM_POS_X,SfxUInt32Item TransformPosY SID_ATTR_TRANSFORM_POS_Y,SfxUInt32Item TransformWidth SID_ATTR_TRANSFORM_WIDTH, SfxUInt32Item TransformHeight SID_ATTR_TRANSFORM_HEIGHT,SfxUInt32Item TransformRotationDeltaAngle SID_ATTR_TRANSFORM_DELTA_ANGLE,SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y)
[ [
AutoUpdate = FALSE, AutoUpdate = FALSE,
FastCall = TRUE, FastCall = TRUE,
......
...@@ -38,15 +38,35 @@ ...@@ -38,15 +38,35 @@
#include <svl/aeitem.hxx> #include <svl/aeitem.hxx>
#include <svx/svdview.hxx> #include <svx/svdview.hxx>
#include <svx/transfrmhelper.hxx> #include <svx/transfrmhelper.hxx>
#include <sal/log.hxx> #include <comphelper/lok.hxx>
using namespace css; using namespace css;
using namespace css::uno; using namespace css::uno;
const char USERITEM_NAME[] = "FitItem"; const char USERITEM_NAME[] = "FitItem";
namespace svx { namespace sidebar { 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
namespace svx { namespace sidebar {
PosSizePropertyPanel::PosSizePropertyPanel( PosSizePropertyPanel::PosSizePropertyPanel(
vcl::Window* pParent, vcl::Window* pParent,
...@@ -373,6 +393,11 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl, Edit&, void ) ...@@ -373,6 +393,11 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl, Edit&, void )
Fraction aUIScale = mpView->GetModel()->GetUIScale(); Fraction aUIScale = mpView->GetModel()->GetUIScale();
lX = long( lX * aUIScale ); lX = long( lX * aUIScale );
if (lcl_twipsNeeded(mpView))
{
lX = OutputDevice::LogicToLogic(lX, MapUnit::Map100thMM, MapUnit::MapTwip);
}
SfxInt32Item aPosXItem( SID_ATTR_TRANSFORM_POS_X,static_cast<sal_uInt32>(lX)); SfxInt32Item aPosXItem( SID_ATTR_TRANSFORM_POS_X,static_cast<sal_uInt32>(lX));
GetBindings()->GetDispatcher()->ExecuteList( GetBindings()->GetDispatcher()->ExecuteList(
...@@ -390,6 +415,11 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl, Edit&, void ) ...@@ -390,6 +415,11 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl, Edit&, void )
Fraction aUIScale = mpView->GetModel()->GetUIScale(); Fraction aUIScale = mpView->GetModel()->GetUIScale();
lY = long( lY * aUIScale ); lY = long( lY * aUIScale );
if (lcl_twipsNeeded(mpView))
{
lY = OutputDevice::LogicToLogic(lY, MapUnit::Map100thMM, MapUnit::MapTwip);
}
SfxInt32Item aPosYItem( SID_ATTR_TRANSFORM_POS_Y,static_cast<sal_uInt32>(lY)); SfxInt32Item aPosYItem( SID_ATTR_TRANSFORM_POS_Y,static_cast<sal_uInt32>(lY));
GetBindings()->GetDispatcher()->ExecuteList( GetBindings()->GetDispatcher()->ExecuteList(
...@@ -447,9 +477,18 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, AngleModifiedHdl, Edit&, void ) ...@@ -447,9 +477,18 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, AngleModifiedHdl, Edit&, void )
// #i123993# Need to take UIScale into account when executing rotations // #i123993# Need to take UIScale into account when executing rotations
const double fUIScale(mpView && mpView->GetModel() ? double(mpView->GetModel()->GetUIScale()) : 1.0); const double fUIScale(mpView && mpView->GetModel() ? double(mpView->GetModel()->GetUIScale()) : 1.0);
long nRotateX = basegfx::fround(mlRotX * fUIScale);
long nRotateY = basegfx::fround(mlRotY * fUIScale);
if (lcl_twipsNeeded(mpView))
{
nRotateX = OutputDevice::LogicToLogic(nRotateX, MapUnit::Map100thMM, MapUnit::MapTwip);
nRotateY = OutputDevice::LogicToLogic(nRotateY, MapUnit::Map100thMM, MapUnit::MapTwip);
}
SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,static_cast<sal_uInt32>(nTmp)); SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,static_cast<sal_uInt32>(nTmp));
SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X, basegfx::fround(mlRotX * fUIScale)); SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X, nRotateX);
SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y, basegfx::fround(mlRotY * fUIScale)); SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y, nRotateY);
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM, GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM,
SfxCallMode::RECORD, { &aAngleItem, &aRotXItem, &aRotYItem }); SfxCallMode::RECORD, { &aAngleItem, &aRotXItem, &aRotYItem });
...@@ -462,9 +501,18 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, RotationHdl, DialControl*, void ) ...@@ -462,9 +501,18 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, RotationHdl, DialControl*, void )
// #i123993# Need to take UIScale into account when executing rotations // #i123993# Need to take UIScale into account when executing rotations
const double fUIScale(mpView && mpView->GetModel() ? double(mpView->GetModel()->GetUIScale()) : 1.0); const double fUIScale(mpView && mpView->GetModel() ? double(mpView->GetModel()->GetUIScale()) : 1.0);
long nRotateX = basegfx::fround(mlRotX * fUIScale);
long nRotateY = basegfx::fround(mlRotY * fUIScale);
if (lcl_twipsNeeded(mpView))
{
nRotateX = OutputDevice::LogicToLogic(nRotateX, MapUnit::Map100thMM, MapUnit::MapTwip);
nRotateY = OutputDevice::LogicToLogic(nRotateY, MapUnit::Map100thMM, MapUnit::MapTwip);
}
SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,static_cast<sal_uInt32>(nTmp)); SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,static_cast<sal_uInt32>(nTmp));
SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X, basegfx::fround(mlRotX * fUIScale)); SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X, nRotateX);
SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y, basegfx::fround(mlRotY * fUIScale)); SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y, nRotateY);
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM, GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_TRANSFORM,
SfxCallMode::RECORD, { &aAngleItem, &aRotXItem, &aRotYItem }); SfxCallMode::RECORD, { &aAngleItem, &aRotXItem, &aRotYItem });
...@@ -831,6 +879,12 @@ void PosSizePropertyPanel::executeSize() ...@@ -831,6 +879,12 @@ void PosSizePropertyPanel::executeSize()
lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit ); lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
lHeight = static_cast<long>(mpMtrWidth->Denormalize( lHeight )); lHeight = static_cast<long>(mpMtrWidth->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 // put Width & Height to itemset
SfxUInt32Item aWidthItem( SID_ATTR_TRANSFORM_WIDTH, static_cast<sal_uInt32>(lWidth)); SfxUInt32Item aWidthItem( SID_ATTR_TRANSFORM_WIDTH, static_cast<sal_uInt32>(lWidth));
SfxUInt32Item aHeightItem( SID_ATTR_TRANSFORM_HEIGHT, static_cast<sal_uInt32>(lHeight)); SfxUInt32Item aHeightItem( SID_ATTR_TRANSFORM_HEIGHT, static_cast<sal_uInt32>(lHeight));
......
...@@ -1425,6 +1425,20 @@ static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP) ...@@ -1425,6 +1425,20 @@ static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP)
void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
{ {
bool bDealingWithTwips = false;
const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
if (bTiledRendering)
{
// We gets the position in twips
if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
{
if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
{
bDealingWithTwips = true;
}
}
}
tools::Rectangle aRect(GetMarkedObjRect()); tools::Rectangle aRect(GetMarkedObjRect());
if(GetSdrPageView()) if(GetSdrPageView())
...@@ -1439,8 +1453,14 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) ...@@ -1439,8 +1453,14 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
SdrObject* pObj=nullptr; SdrObject* pObj=nullptr;
RectPoint eSizePoint=RectPoint::MM; RectPoint eSizePoint=RectPoint::MM;
long nPosDX=0; long nPosX=aRect.Left();
long nPosDY=0; long nPosY=aRect.Top();
if (bDealingWithTwips)
{
nPosX = OutputDevice::LogicToLogic(nPosX, MapUnit::Map100thMM, MapUnit::MapTwip);
nPosY = OutputDevice::LogicToLogic(nPosY, MapUnit::Map100thMM, MapUnit::MapTwip);
}
long nSizX=0; long nSizX=0;
long nSizY=0; long nSizY=0;
long nRotateAngle=0; long nRotateAngle=0;
...@@ -1482,26 +1502,29 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) ...@@ -1482,26 +1502,29 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
// position // position
if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)) { if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)) {
nPosDX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-aRect.Left(); nPosX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
bChgPos=true; bChgPos=true;
} }
if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)){ if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)){
nPosDY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-aRect.Top(); nPosY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
bChgPos=true; bChgPos=true;
} }
// size // size
if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) { if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) {
nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); nSizX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
bChgSiz=true; bChgSiz=true;
bChgWdh=true; bChgWdh=true;
} }
if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) { if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) {
nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); nSizY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
bChgSiz=true; bChgSiz=true;
bChgHgt=true; bChgHgt=true;
} }
if (bChgSiz) { if (bChgSiz) {
eSizePoint=static_cast<RectPoint>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue()); if (bTiledRendering && SfxItemState::SET != rAttr.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT, true, &pPoolItem))
eSizePoint = RectPoint::LT;
else
eSizePoint = static_cast<RectPoint>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT).GetValue());
} }
// rotation // rotation
...@@ -1573,6 +1596,18 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) ...@@ -1573,6 +1596,18 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
bSetAttr=true; bSetAttr=true;
} }
if(bDealingWithTwips) {
nPosX = OutputDevice::LogicToLogic(nPosX, MapUnit::MapTwip, MapUnit::Map100thMM);
nPosY = OutputDevice::LogicToLogic(nPosY, MapUnit::MapTwip, MapUnit::Map100thMM);
nSizX = OutputDevice::LogicToLogic(nSizX, MapUnit::MapTwip, MapUnit::Map100thMM);
nSizY = OutputDevice::LogicToLogic(nSizY, MapUnit::MapTwip, MapUnit::Map100thMM);
nRotateX = OutputDevice::LogicToLogic(nRotateX, MapUnit::MapTwip, MapUnit::Map100thMM);
nRotateY = OutputDevice::LogicToLogic(nRotateY, MapUnit::MapTwip, MapUnit::Map100thMM);
}
long nPosDX = nPosX - aRect.Left();
long nPosDY = nPosY - aRect.Top();
ForcePossibilities(); ForcePossibilities();
BegUndo(SvxResId(STR_EditTransform),GetDescriptionOfMarkedObjects()); BegUndo(SvxResId(STR_EditTransform),GetDescriptionOfMarkedObjects());
...@@ -1601,15 +1636,6 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) ...@@ -1601,15 +1636,6 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
if(GetSdrPageView()) if(GetSdrPageView())
{ {
const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
if(bTiledRendering) {
// We gets the position in twips
if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
{
if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
aRef = OutputDevice::LogicToLogic(aRef, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
}
}
GetSdrPageView()->PagePosToLogic(aRef); GetSdrPageView()->PagePosToLogic(aRef);
} }
......
...@@ -782,6 +782,17 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell) ...@@ -782,6 +782,17 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
} }
if(SfxViewShell* pViewShell = GetSfxViewShell()) if(SfxViewShell* pViewShell = GetSfxViewShell())
{ {
long nRotAngle(0);
if(GetMarkedObjectCount())
{
SdrMark* pM = GetSdrMarkByIndex(0);
SdrObject* pO = pM->GetMarkedSdrObj();
nRotAngle = pO->GetRotateAngle();
sSelection += OString(", ") + OString::number(nRotAngle);
}
if (pOtherShell) if (pOtherShell)
{ {
// Another shell wants to know about our existing // Another shell wants to know about our existing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment