Drop tools::Rectangle::getX/getY, which are just duplicates of Left/Top
The change allowed to simplify many places where previously this API was used, to avoid inefficient calculations (e.g., moving rectangle keeping its size, and then immediately changing the size). Change-Id: Ica2dc594d91cae83e2c2740c1f4fb23f44998916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120461 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -401,8 +401,7 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
|
||||
Point aTopLeft = GetEditView()->GetWindowPos(aHelpRect.TopLeft());
|
||||
aTopLeft = GetEditView()->GetWindow()->OutputToScreenPixel(aTopLeft);
|
||||
|
||||
aHelpRect.setX(aTopLeft.X());
|
||||
aHelpRect.setY(aTopLeft.Y());
|
||||
aHelpRect.SetPos(aTopLeft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,10 +183,10 @@ namespace vclcanvas
|
||||
for (auto const& metric : aMetricVector)
|
||||
{
|
||||
aBoundingBoxes[nIndex++] = geometry::RealRectangle2D(
|
||||
metric.getX(),
|
||||
metric.getY(),
|
||||
metric.getX() + metric.getWidth(),
|
||||
metric.getY() + metric.getHeight());
|
||||
metric.Left(),
|
||||
metric.Top(),
|
||||
metric.Right(),
|
||||
metric.Bottom());
|
||||
}
|
||||
}
|
||||
return aBoundingBoxes;
|
||||
|
||||
@@ -655,7 +655,7 @@ awt::Rectangle SAL_CALL AccessibleBase::getBounds()
|
||||
awt::Point aOffset( aParentLocOnScreen.X - aULOnScreen.X,
|
||||
aParentLocOnScreen.Y - aULOnScreen.Y );
|
||||
|
||||
return awt::Rectangle( aRect.getX() - aOffset.X, aRect.getY() - aOffset.Y,
|
||||
return awt::Rectangle( aRect.Left() - aOffset.X, aRect.Top() - aOffset.Y,
|
||||
aRect.getWidth(), aRect.getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -871,9 +871,9 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
|
||||
|
||||
bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
|
||||
, getModel()
|
||||
, awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
|
||||
, awt::Rectangle(aOldObjectRect.getX(), aOldObjectRect.getY(), 0, 0)
|
||||
, awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
|
||||
, awt::Rectangle(aObjectRect.Left(),aObjectRect.Top(),aObjectRect.getWidth(),aObjectRect.getHeight())
|
||||
, awt::Rectangle(aOldObjectRect.Left(), aOldObjectRect.Top(), 0, 0)
|
||||
, awt::Rectangle(aPageRect.Left(),aPageRect.Top(),aPageRect.getWidth(),aPageRect.getHeight()) );
|
||||
|
||||
if( bMoved || bChanged )
|
||||
{
|
||||
@@ -1522,16 +1522,16 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
|
||||
{
|
||||
tools::Rectangle aRect = pObj->GetSnapRect();
|
||||
awt::Size aPageSize(ChartModelHelper::getPageSize(getModel()));
|
||||
if ((fShiftAmountX > 0.0 && (aRect.getX() + fShiftAmountX + aRect.getWidth() > aPageSize.Width)) ||
|
||||
(fShiftAmountX < 0.0 && (aRect.getX() + fShiftAmountX < 0)) ||
|
||||
(fShiftAmountY > 0.0 && (aRect.getY() + fShiftAmountY + aRect.getHeight() > aPageSize.Height)) ||
|
||||
(fShiftAmountY < 0.0 && (aRect.getY() + fShiftAmountY < 0)))
|
||||
if ((fShiftAmountX > 0.0 && (aRect.Right() + fShiftAmountX > aPageSize.Width)) ||
|
||||
(fShiftAmountX < 0.0 && (aRect.Left() + fShiftAmountX < 0)) ||
|
||||
(fShiftAmountY > 0.0 && (aRect.Bottom() + fShiftAmountY > aPageSize.Height)) ||
|
||||
(fShiftAmountY < 0.0 && (aRect.Top() + fShiftAmountY < 0)))
|
||||
bReturn = false;
|
||||
else
|
||||
bReturn = PositionAndSizeHelper::moveObject(
|
||||
m_aSelection.getSelectedCID(), getModel(),
|
||||
awt::Rectangle(aRect.getX() + fShiftAmountX, aRect.getY() + fShiftAmountY, aRect.getWidth(), aRect.getHeight()),
|
||||
awt::Rectangle(aRect.getX(), aRect.getY(), 0, 0),
|
||||
awt::Rectangle(aRect.Left() + fShiftAmountX, aRect.Top() + fShiftAmountY, aRect.getWidth(), aRect.getHeight()),
|
||||
awt::Rectangle(aRect.Left(), aRect.Top(), 0, 0),
|
||||
awt::Rectangle(0, 0, aPageSize.Width, aPageSize.Height));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,7 @@ namespace
|
||||
{
|
||||
::tools::Rectangle lcl_AWTRectToVCLRect( const css::awt::Rectangle & rAWTRect )
|
||||
{
|
||||
::tools::Rectangle aResult;
|
||||
aResult.setX( rAWTRect.X );
|
||||
aResult.setY( rAWTRect.Y );
|
||||
::tools::Rectangle aResult(rAWTRect.X, rAWTRect.Y);
|
||||
aResult.setWidth( rAWTRect.Width );
|
||||
aResult.setHeight( rAWTRect.Height );
|
||||
return aResult;
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace dbaui
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
tools::Rectangle aRect(m_pLine ? m_pLine->GetBoundingRect() : tools::Rectangle());
|
||||
return awt::Rectangle(aRect.getX(),aRect.getY(),aRect.getWidth(),aRect.getHeight());
|
||||
return awt::Rectangle(aRect.Left(),aRect.Top(),aRect.getWidth(),aRect.getHeight());
|
||||
}
|
||||
awt::Point SAL_CALL OConnectionLineAccess::getLocation( )
|
||||
{
|
||||
|
||||
@@ -1994,12 +1994,12 @@ public:
|
||||
if (std::string_view("EMPTY") == pPayload)
|
||||
return;
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aSeq.getLength());
|
||||
m_aOwnCursor.setX(aSeq[0].toInt32());
|
||||
m_aOwnCursor.setY(aSeq[1].toInt32());
|
||||
m_aOwnCursor.SetLeft(aSeq[0].toInt32());
|
||||
m_aOwnCursor.SetTop(aSeq[1].toInt32());
|
||||
m_aOwnCursor.setWidth(aSeq[2].toInt32());
|
||||
m_aOwnCursor.setHeight(aSeq[3].toInt32());
|
||||
|
||||
if (m_aOwnCursor.getX() == 0 && m_aOwnCursor.getY() == 0)
|
||||
if (m_aOwnCursor.Left() == 0 && m_aOwnCursor.Top() == 0)
|
||||
m_bZeroCursor = true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -127,14 +127,6 @@ SystemWindow* getTopSystemWindow( const uno::Reference< awt::XWindow >& xWindow
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void setZeroRectangle( ::tools::Rectangle& rRect )
|
||||
{
|
||||
rRect.setX(0);
|
||||
rRect.setY(0);
|
||||
rRect.setWidth(0);
|
||||
rRect.setHeight(0);
|
||||
}
|
||||
|
||||
// ATTENTION!
|
||||
// This value is directly copied from the sfx2 project.
|
||||
// You have to change BOTH values, see sfx2/inc/sfx2/sfxsids.hrc (SID_DOCKWIN_START)
|
||||
|
||||
@@ -49,7 +49,6 @@ ToolBox* getToolboxPtr( vcl::Window* pWindow );
|
||||
vcl::Window* getWindowFromXUIElement( const css::uno::Reference< css::ui::XUIElement >& xUIElement );
|
||||
SystemWindow* getTopSystemWindow( const css::uno::Reference< css::awt::XWindow >& xWindow );
|
||||
bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 );
|
||||
void setZeroRectangle( ::tools::Rectangle& rRect );
|
||||
bool lcl_checkUIElement(const css::uno::Reference< css::ui::XUIElement >& xUIElement,css::awt::Rectangle& _rPosSize, css::uno::Reference< css::awt::XWindow >& _xWindow);
|
||||
css::uno::Reference< css::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::awt::XWindowPeer >& rParent, const char* pService );
|
||||
WindowAlign ImplConvertAlignment( css::ui::DockingArea aAlignment );
|
||||
|
||||
@@ -1140,12 +1140,8 @@ bool LayoutManager::implts_hideStatusBar( bool bStoreState )
|
||||
|
||||
void LayoutManager::implts_setOffset( const sal_Int32 nBottomOffset )
|
||||
{
|
||||
::tools::Rectangle aOffsetRect;
|
||||
setZeroRectangle( aOffsetRect );
|
||||
aOffsetRect.setHeight( nBottomOffset );
|
||||
|
||||
if ( m_xToolbarManager.is() )
|
||||
m_xToolbarManager->setDockingAreaOffsets( aOffsetRect );
|
||||
m_xToolbarManager->setDockingAreaOffsets({ 0, 0, 0, nBottomOffset });
|
||||
}
|
||||
|
||||
void LayoutManager::implts_setInplaceMenuBar( const Reference< XIndexAccess >& xMergedMenuBar )
|
||||
|
||||
@@ -57,6 +57,8 @@ ToolbarLayoutManager::ToolbarLayoutManager(
|
||||
m_xContext( rxContext),
|
||||
m_xUIElementFactoryManager( xUIElementFactory ),
|
||||
m_pParentLayouter( pParentLayouter ),
|
||||
m_aDockingArea(0, 0, 0, 0),
|
||||
m_aDockingAreaOffsets(0, 0, 0, 0),
|
||||
m_eDockOperation( DOCKOP_ON_COLROW ),
|
||||
m_ePreviewDetection( PREVIEWFRAME_UNKNOWN ),
|
||||
m_bComponentAttached( false ),
|
||||
@@ -66,9 +68,6 @@ ToolbarLayoutManager::ToolbarLayoutManager(
|
||||
m_bLayoutInProgress( false ),
|
||||
m_bToolbarCreation( false )
|
||||
{
|
||||
// initialize rectangles to zero values
|
||||
setZeroRectangle( m_aDockingAreaOffsets );
|
||||
setZeroRectangle( m_aDockingArea );
|
||||
}
|
||||
|
||||
ToolbarLayoutManager::~ToolbarLayoutManager()
|
||||
|
||||
@@ -568,8 +568,6 @@ public:
|
||||
friend inline tools::Rectangle operator - ( const tools::Rectangle& rRect, const Point& rPt );
|
||||
|
||||
// ONE
|
||||
tools::Long getX() const { return nLeft; }
|
||||
tools::Long getY() const { return nTop; }
|
||||
/// Returns the difference between right and left, assuming the range includes one end, but not the other.
|
||||
tools::Long getWidth() const { return Right() - Left(); }
|
||||
/// Returns the difference between bottom and top, assuming the range includes one end, but not the other.
|
||||
@@ -723,7 +721,7 @@ inline std::basic_ostream<charT, traits> & operator <<(
|
||||
return stream << "EMPTY";
|
||||
else
|
||||
return stream << rectangle.GetWidth() << 'x' << rectangle.GetHeight()
|
||||
<< "@(" << rectangle.getX() << ',' << rectangle.getY() << ")";
|
||||
<< "@(" << rectangle.Left() << ',' << rectangle.Top() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5319,9 +5319,10 @@ void DrawingML::WriteFromTo(const uno::Reference<css::drawing::XShape>& rXShape,
|
||||
// aTopLeft needs correction for rotated customshapes
|
||||
if (pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE)
|
||||
{
|
||||
const tools::Rectangle& aSnapRect(pObj->GetSnapRect()); // bounding box of the rotated shape
|
||||
aTopLeft.X = aSnapRect.getX() + (aSnapRect.GetWidth() / 2) - nHalfWidth;
|
||||
aTopLeft.Y = aSnapRect.getY() + (aSnapRect.GetHeight() / 2) - nHalfHeight;
|
||||
// Center of bounding box of the rotated shape
|
||||
const auto aSnapRectCenter(pObj->GetSnapRect().Center());
|
||||
aTopLeft.X = aSnapRectCenter.X() - nHalfWidth;
|
||||
aTopLeft.Y = aSnapRectCenter.Y() - nHalfHeight;
|
||||
}
|
||||
|
||||
// MSO changes the anchor positions at these angles and that does an extra 90 degrees
|
||||
|
||||
@@ -1347,13 +1347,13 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape
|
||||
tools::Rectangle aRect( Point( aStartPoint.X, aStartPoint.Y ), Point( aEndPoint.X, aEndPoint.Y ) );
|
||||
if( aRect.getWidth() < 0 ) {
|
||||
bFlipH = true;
|
||||
aRect.setX( aEndPoint.X );
|
||||
aRect.SetLeft(aEndPoint.X);
|
||||
aRect.setWidth( aStartPoint.X - aEndPoint.X );
|
||||
}
|
||||
|
||||
if( aRect.getHeight() < 0 ) {
|
||||
bFlipV = true;
|
||||
aRect.setY( aEndPoint.Y );
|
||||
aRect.SetTop(aEndPoint.Y);
|
||||
aRect.setHeight( aStartPoint.Y - aEndPoint.Y );
|
||||
}
|
||||
|
||||
|
||||
@@ -260,8 +260,8 @@ static void lcl_convertRectangle(const OUString& rString, Rectangle& rRectangle)
|
||||
{
|
||||
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(rString);
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aSeq.getLength());
|
||||
rRectangle.setX(aSeq[0].toInt32());
|
||||
rRectangle.setY(aSeq[1].toInt32());
|
||||
rRectangle.SetLeft(aSeq[0].toInt32());
|
||||
rRectangle.SetTop(aSeq[1].toInt32());
|
||||
rRectangle.setWidth(aSeq[2].toInt32());
|
||||
rRectangle.setHeight(aSeq[3].toInt32());
|
||||
}
|
||||
@@ -469,8 +469,8 @@ struct EditCursorMessage final {
|
||||
aVal = aTree.get_child("relrect").get_value<std::string>();
|
||||
aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(aVal.c_str()));
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aSeq.getLength());
|
||||
m_aRelRect.setX(aSeq[0].toInt32());
|
||||
m_aRelRect.setY(aSeq[1].toInt32());
|
||||
m_aRelRect.SetLeft(aSeq[0].toInt32());
|
||||
m_aRelRect.SetTop(aSeq[1].toInt32());
|
||||
m_aRelRect.setWidth(aSeq[2].toInt32());
|
||||
m_aRelRect.setHeight(aSeq[3].toInt32());
|
||||
}
|
||||
@@ -529,8 +529,8 @@ struct TextSelectionMessage
|
||||
aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(aRectString.c_str()));
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aSeq.getLength());
|
||||
tools::Rectangle aRect;
|
||||
aRect.setX(aSeq[0].toInt32());
|
||||
aRect.setY(aSeq[1].toInt32());
|
||||
aRect.SetLeft(aSeq[0].toInt32());
|
||||
aRect.SetTop(aSeq[1].toInt32());
|
||||
aRect.setWidth(aSeq[2].toInt32());
|
||||
aRect.setHeight(aSeq[3].toInt32());
|
||||
|
||||
@@ -621,8 +621,8 @@ public:
|
||||
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
|
||||
m_aCellCursorBounds = tools::Rectangle();
|
||||
if (aSeq.getLength() == 6) {
|
||||
m_aCellCursorBounds.setX(aSeq[0].toInt32());
|
||||
m_aCellCursorBounds.setY(aSeq[1].toInt32());
|
||||
m_aCellCursorBounds.SetLeft(aSeq[0].toInt32());
|
||||
m_aCellCursorBounds.SetTop(aSeq[1].toInt32());
|
||||
m_aCellCursorBounds.setWidth(aSeq[2].toInt32());
|
||||
m_aCellCursorBounds.setHeight(aSeq[3].toInt32());
|
||||
}
|
||||
@@ -669,8 +669,8 @@ public:
|
||||
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
|
||||
CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
|
||||
tools::Rectangle aInvalidationRect;
|
||||
aInvalidationRect.setX(aSeq[0].toInt32());
|
||||
aInvalidationRect.setY(aSeq[1].toInt32());
|
||||
aInvalidationRect.SetLeft(aSeq[0].toInt32());
|
||||
aInvalidationRect.SetTop(aSeq[1].toInt32());
|
||||
aInvalidationRect.setWidth(aSeq[2].toInt32());
|
||||
aInvalidationRect.setHeight(aSeq[3].toInt32());
|
||||
m_aInvalidations.push_back(aInvalidationRect);
|
||||
|
||||
@@ -868,9 +868,9 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData&
|
||||
// Prepare scale relative to top-left of aCurrentCellRect
|
||||
basegfx::B2DHomMatrix aChange;
|
||||
|
||||
aChange.translate(-aCurrentCellRect.getX(), -aCurrentCellRect.getY());
|
||||
aChange.translate(-aCurrentCellRect.Left(), -aCurrentCellRect.Top());
|
||||
aChange.scale(fWidthFactor, fHeightFactor);
|
||||
aChange.translate(aCurrentCellRect.getX(), aCurrentCellRect.getY());
|
||||
aChange.translate(aCurrentCellRect.Left(), aCurrentCellRect.Top());
|
||||
|
||||
// create B2DRange and transform by prepared scale
|
||||
basegfx::B2DRange aNewRange = vcl::unotools::b2DRectangleFromRectangle(aRect);
|
||||
@@ -1213,7 +1213,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
|
||||
}
|
||||
else
|
||||
{
|
||||
Point aPos( rData.getShapeRect().getX(), rData.getShapeRect().getY() );
|
||||
const Point aPos(rData.getShapeRect().TopLeft());
|
||||
if ( pObj->GetRelativePos() != aPos )
|
||||
{
|
||||
if (bRecording)
|
||||
|
||||
@@ -1112,9 +1112,10 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >&
|
||||
sal_Int16 nHalfWidth = aSize.Width / 2;
|
||||
sal_Int16 nHalfHeight = aSize.Height / 2;
|
||||
|
||||
const tools::Rectangle& aSnapRect(pObj->GetSnapRect()); // bounding box of the rotated shape
|
||||
aTopLeft.X = aSnapRect.getX() + (aSnapRect.GetWidth() / 2) - nHalfWidth;
|
||||
aTopLeft.Y = aSnapRect.getY() + (aSnapRect.GetHeight() / 2) - nHalfHeight;
|
||||
// Center of bounding box of the rotated shape
|
||||
const auto aSnapRectCenter(pObj->GetSnapRect().Center());
|
||||
aTopLeft.X = aSnapRectCenter.X() - nHalfWidth;
|
||||
aTopLeft.Y = aSnapRectCenter.Y() - nHalfHeight;
|
||||
|
||||
// MSO changes the anchor positions at these angles and that does an extra 90 degrees
|
||||
// rotation on our shapes, so we output it in such position that MSO
|
||||
|
||||
@@ -5173,9 +5173,9 @@ void ScXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
|
||||
tools::Rectangle aRect(pEmbeddedObj->GetVisArea());
|
||||
sal_uInt16 i(0);
|
||||
pProps[i].Name = "VisibleAreaTop";
|
||||
pProps[i].Value <<= static_cast<sal_Int32>(aRect.getY());
|
||||
pProps[i].Value <<= static_cast<sal_Int32>(aRect.Top());
|
||||
pProps[++i].Name = "VisibleAreaLeft";
|
||||
pProps[i].Value <<= static_cast<sal_Int32>(aRect.getX());
|
||||
pProps[i].Value <<= static_cast<sal_Int32>(aRect.Left());
|
||||
pProps[++i].Name = "VisibleAreaWidth";
|
||||
pProps[i].Value <<= static_cast<sal_Int32>(aRect.getWidth());
|
||||
pProps[++i].Name = "VisibleAreaHeight";
|
||||
|
||||
@@ -737,9 +737,7 @@ void ScXMLImport::SetViewSettings(const uno::Sequence<beans::PropertyValue>& aVi
|
||||
SfxObjectShell* pEmbeddedObj = pDocObj->GetEmbeddedObject();
|
||||
if (pEmbeddedObj)
|
||||
{
|
||||
tools::Rectangle aRect;
|
||||
aRect.setX( nLeft );
|
||||
aRect.setY( nTop );
|
||||
tools::Rectangle aRect{ nLeft, nTop };
|
||||
aRect.setWidth( nWidth );
|
||||
aRect.setHeight( nHeight );
|
||||
pEmbeddedObj->SetVisArea(aRect);
|
||||
|
||||
@@ -156,8 +156,7 @@ tools::Rectangle ScAccessibleCell::GetBoundingBoxOnScreen() const
|
||||
if (pWindow)
|
||||
{
|
||||
tools::Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr);
|
||||
aCellRect.setX(aCellRect.getX() + aRect.getX());
|
||||
aCellRect.setY(aCellRect.getY() + aRect.getY());
|
||||
aCellRect.Move(aRect.Left(), aRect.Top());
|
||||
}
|
||||
}
|
||||
return aCellRect;
|
||||
|
||||
@@ -309,8 +309,7 @@ tools::Rectangle ScAccessiblePageHeader::GetBoundingBoxOnScreen() const
|
||||
if (pWindow)
|
||||
{
|
||||
tools::Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr);
|
||||
aCellRect.setX(aCellRect.getX() + aRect.getX());
|
||||
aCellRect.setY(aCellRect.getY() + aRect.getY());
|
||||
aCellRect.Move(aRect.Left(), aRect.Top());
|
||||
}
|
||||
}
|
||||
return aCellRect;
|
||||
|
||||
@@ -202,8 +202,7 @@ tools::Rectangle ScAccessiblePreviewCell::GetBoundingBoxOnScreen() const
|
||||
if (pWindow)
|
||||
{
|
||||
tools::Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr);
|
||||
aCellRect.setX(aCellRect.getX() + aRect.getX());
|
||||
aCellRect.setY(aCellRect.getY() + aRect.getY());
|
||||
aCellRect.Move(aRect.Left(), aRect.Top());
|
||||
}
|
||||
}
|
||||
return aCellRect;
|
||||
@@ -223,8 +222,7 @@ tools::Rectangle ScAccessiblePreviewCell::GetBoundingBox() const
|
||||
if (xAccParentComp.is())
|
||||
{
|
||||
tools::Rectangle aParentRect (VCLRectangle(xAccParentComp->getBounds()));
|
||||
aCellRect.setX(aCellRect.getX() - aParentRect.getX());
|
||||
aCellRect.setY(aCellRect.getY() - aParentRect.getY());
|
||||
aCellRect.Move(-aParentRect.Left(), -aParentRect.Top());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,8 +303,7 @@ tools::Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScreen() const
|
||||
if (pWindow)
|
||||
{
|
||||
tools::Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr);
|
||||
aCellRect.setX(aCellRect.getX() + aRect.getX());
|
||||
aCellRect.setY(aCellRect.getY() + aRect.getY());
|
||||
aCellRect.Move(aRect.Left(), aRect.Top());
|
||||
}
|
||||
}
|
||||
return aCellRect;
|
||||
@@ -328,8 +327,7 @@ tools::Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBox() const
|
||||
if (xAccParentComp.is())
|
||||
{
|
||||
tools::Rectangle aParentRect (VCLRectangle(xAccParentComp->getBounds()));
|
||||
aCellRect.setX(aCellRect.getX() - aParentRect.getX());
|
||||
aCellRect.setY(aCellRect.getY() - aParentRect.getY());
|
||||
aCellRect.Move(-aParentRect.Left(), -aParentRect.Top());
|
||||
}
|
||||
}
|
||||
return aCellRect;
|
||||
|
||||
@@ -588,8 +588,7 @@ tools::Rectangle ScAccessiblePreviewTable::GetBoundingBoxOnScreen() const
|
||||
if (pWindow)
|
||||
{
|
||||
tools::Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr);
|
||||
aCellRect.setX(aCellRect.getX() + aRect.getX());
|
||||
aCellRect.setY(aCellRect.getY() + aRect.getY());
|
||||
aCellRect.Move(aRect.Left(), aRect.Top());
|
||||
}
|
||||
}
|
||||
return aCellRect;
|
||||
|
||||
@@ -445,8 +445,8 @@ void ScInputWindow::PixelInvalidate(const tools::Rectangle* pRectangle)
|
||||
|
||||
if (pRectangle)
|
||||
{
|
||||
const Point aPos(pRectangle->getX() - GetOutOffXPixel(), pRectangle->getY() - GetOutOffYPixel());
|
||||
const tools::Rectangle aRect(aPos, pRectangle->GetSize());
|
||||
tools::Rectangle aRect(*pRectangle);
|
||||
aRect.Move(-GetOutOffXPixel(), -GetOutOffYPixel());
|
||||
Window::PixelInvalidate(&aRect);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1845,7 +1845,6 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
|
||||
const ScRange* pSelRange = nullptr;
|
||||
if ( bSinglePageSheets )
|
||||
{
|
||||
awt::Size aPageSize;
|
||||
SCCOL nStartCol;
|
||||
SCROW nStartRow;
|
||||
const ScDocument* pDocument = &pDocShell->GetDocument();
|
||||
@@ -1864,11 +1863,8 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
|
||||
aRange.aStart.Col(), aRange.aStart.Row(),
|
||||
aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab()));
|
||||
|
||||
aPageSize.Width = aMMRect.GetWidth();
|
||||
aPageSize.Height = aMMRect.GetHeight();
|
||||
|
||||
awt::Size aCalcPageSize ( aMMRect.GetSize().Width(), aMMRect.GetSize().Height() );
|
||||
awt::Point aCalcPagePos( aMMRect.getX(), aMMRect.getY() );
|
||||
const awt::Size aPageSize(aMMRect.GetWidth(), aMMRect.GetHeight());
|
||||
const awt::Point aCalcPagePos(aMMRect.Left(), aMMRect.Top());
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aSequence(5);
|
||||
beans::PropertyValue* pArray = aSequence.getArray();
|
||||
@@ -1880,7 +1876,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
|
||||
pArray[2].Name = SC_UNONAME_SOURCERANGE;
|
||||
pArray[2].Value <<= aRangeAddress;
|
||||
pArray[3].Name = SC_UNONAME_CALCPAGESIZE;
|
||||
pArray[3].Value <<= aCalcPageSize;
|
||||
pArray[3].Value <<= aPageSize;
|
||||
pArray[4].Name = SC_UNONAME_CALCPAGEPOS;
|
||||
pArray[4].Value <<= aCalcPagePos;
|
||||
|
||||
@@ -1981,8 +1977,8 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
|
||||
aCellRange.aStart.Col(), aCellRange.aStart.Row(),
|
||||
aCellRange.aEnd.Col(), aCellRange.aEnd.Row(), aCellRange.aStart.Tab()));
|
||||
|
||||
awt::Size aCalcPageSize ( aMMRect.GetSize().Width(), aMMRect.GetSize().Height() );
|
||||
awt::Point aCalcPagePos( aMMRect.getX(), aMMRect.getY() );
|
||||
const awt::Size aCalcPageSize(aMMRect.GetWidth(), aMMRect.GetHeight());
|
||||
const awt::Point aCalcPagePos(aMMRect.Left(), aMMRect.Top());
|
||||
|
||||
pArray[2].Name = SC_UNONAME_SOURCERANGE;
|
||||
pArray[2].Value <<= aRangeAddress;
|
||||
|
||||
@@ -37,8 +37,8 @@ void lcl_convertRectangle(const OUString& rString, tools::Rectangle& rRectangle)
|
||||
{
|
||||
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(rString);
|
||||
CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
|
||||
rRectangle.setX(aSeq[0].toInt32());
|
||||
rRectangle.setY(aSeq[1].toInt32());
|
||||
rRectangle.SetLeft(aSeq[0].toInt32());
|
||||
rRectangle.SetTop(aSeq[1].toInt32());
|
||||
rRectangle.setWidth(aSeq[2].toInt32());
|
||||
rRectangle.setHeight(aSeq[3].toInt32());
|
||||
}
|
||||
|
||||
@@ -293,8 +293,8 @@ void lcl_convertRectangle(const OUString& rString, ::tools::Rectangle& rRectangl
|
||||
{
|
||||
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(rString);
|
||||
CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
|
||||
rRectangle.setX(aSeq[0].toInt32());
|
||||
rRectangle.setY(aSeq[1].toInt32());
|
||||
rRectangle.SetLeft(aSeq[0].toInt32());
|
||||
rRectangle.SetTop(aSeq[1].toInt32());
|
||||
rRectangle.setWidth(aSeq[2].toInt32());
|
||||
rRectangle.setHeight(aSeq[3].toInt32());
|
||||
}
|
||||
@@ -941,8 +941,8 @@ public:
|
||||
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
|
||||
CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
|
||||
tools::Rectangle aInvalidationRect;
|
||||
aInvalidationRect.setX(aSeq[0].toInt32());
|
||||
aInvalidationRect.setY(aSeq[1].toInt32());
|
||||
aInvalidationRect.SetLeft(aSeq[0].toInt32());
|
||||
aInvalidationRect.SetTop(aSeq[1].toInt32());
|
||||
aInvalidationRect.setWidth(aSeq[2].toInt32());
|
||||
aInvalidationRect.setHeight(aSeq[3].toInt32());
|
||||
m_aInvalidations.push_back(aInvalidationRect);
|
||||
@@ -1131,8 +1131,8 @@ void SdTiledRenderingTest::testCursorVisibility_SingleClick()
|
||||
|
||||
// Click once outside of the text (in the first quartile) => no editing.
|
||||
const ::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
|
||||
const auto cornerX = o3tl::toTwips(aRect.getX() + (aRect.getWidth() / 4), o3tl::Length::mm100);
|
||||
const auto cornerY = o3tl::toTwips(aRect.getY() + (aRect.getHeight() / 4), o3tl::Length::mm100);
|
||||
const auto cornerX = o3tl::toTwips(aRect.Left() + (aRect.getWidth() / 4), o3tl::Length::mm100);
|
||||
const auto cornerY = o3tl::toTwips(aRect.Top() + (aRect.getHeight() / 4), o3tl::Length::mm100);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
cornerX, cornerY,
|
||||
1, MOUSE_LEFT, 0);
|
||||
@@ -1146,8 +1146,8 @@ void SdTiledRenderingTest::testCursorVisibility_SingleClick()
|
||||
CPPUNIT_ASSERT(!aView1.m_bCursorVisible);
|
||||
|
||||
// Click again, now on the text, in the center, to start editing.
|
||||
const auto centerX = o3tl::toTwips(aRect.getX() + (aRect.getWidth() / 2), o3tl::Length::mm100);
|
||||
const auto centerY = o3tl::toTwips(aRect.getY() + (aRect.getHeight() / 2), o3tl::Length::mm100);
|
||||
const auto centerX = o3tl::toTwips(aRect.Left() + (aRect.getWidth() / 2), o3tl::Length::mm100);
|
||||
const auto centerY = o3tl::toTwips(aRect.Top() + (aRect.getHeight() / 2), o3tl::Length::mm100);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
centerX, centerY,
|
||||
1, MOUSE_LEFT, 0);
|
||||
@@ -1180,8 +1180,8 @@ void SdTiledRenderingTest::testCursorVisibility_DoubleClick()
|
||||
|
||||
// Double-click outside the text to enter edit mode.
|
||||
const ::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
|
||||
const auto cornerX = o3tl::toTwips(aRect.getX() + (aRect.getWidth() / 4), o3tl::Length::mm100);
|
||||
const auto cornerY = o3tl::toTwips(aRect.getY() + (aRect.getHeight() / 4), o3tl::Length::mm100);
|
||||
const auto cornerX = o3tl::toTwips(aRect.Left() + (aRect.getWidth() / 4), o3tl::Length::mm100);
|
||||
const auto cornerY = o3tl::toTwips(aRect.Top() + (aRect.getHeight() / 4), o3tl::Length::mm100);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
cornerX, cornerY,
|
||||
2, MOUSE_LEFT, 0);
|
||||
@@ -1224,8 +1224,8 @@ void SdTiledRenderingTest::testCursorVisibility_MultiView()
|
||||
SfxLokHelper::setView(nView1);
|
||||
|
||||
::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
|
||||
const auto centerX = o3tl::toTwips(aRect.getX() + (aRect.getWidth() / 2), o3tl::Length::mm100);
|
||||
const auto centerY = o3tl::toTwips(aRect.getY() + (aRect.getHeight() / 2), o3tl::Length::mm100);
|
||||
const auto centerX = o3tl::toTwips(aRect.Left() + (aRect.getWidth() / 2), o3tl::Length::mm100);
|
||||
const auto centerY = o3tl::toTwips(aRect.Top() + (aRect.getHeight() / 2), o3tl::Length::mm100);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
centerX, centerY,
|
||||
2, MOUSE_LEFT, 0);
|
||||
@@ -1260,8 +1260,8 @@ void SdTiledRenderingTest::testCursorVisibility_Escape()
|
||||
|
||||
// Click once on the text to start editing.
|
||||
const ::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
|
||||
const auto centerX = o3tl::toTwips(aRect.getX() + (aRect.getWidth() / 2), o3tl::Length::mm100);
|
||||
const auto centerY = o3tl::toTwips(aRect.getY() + (aRect.getHeight() / 2), o3tl::Length::mm100);
|
||||
const auto centerX = o3tl::toTwips(aRect.Left() + (aRect.getWidth() / 2), o3tl::Length::mm100);
|
||||
const auto centerY = o3tl::toTwips(aRect.Top() + (aRect.getHeight() / 2), o3tl::Length::mm100);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
centerX, centerY,
|
||||
1, MOUSE_LEFT, 0);
|
||||
@@ -1441,10 +1441,10 @@ void SdTiledRenderingTest::testTdf102223()
|
||||
// select contents of cell
|
||||
::tools::Rectangle aRect = pTableObject->GetCurrentBoundRect();
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
o3tl::toTwips(aRect.getX() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.getY() + 2, o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.Top() + 2, o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
|
||||
o3tl::toTwips(aRect.getX() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.getY() + 2, o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.Top() + 2, o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
pView->SdrBeginTextEdit(pTableObject);
|
||||
@@ -1484,10 +1484,10 @@ void SdTiledRenderingTest::testTdf118354()
|
||||
// Without the fix, it would crash here
|
||||
::tools::Rectangle aRect = pTableObject->GetCurrentBoundRect();
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
o3tl::toTwips(aRect.getX() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.getY() + 2, o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.Top() + 2, o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
|
||||
o3tl::toTwips(aRect.getX() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.getY() + 2, o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.Top() + 2, o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
|
||||
@@ -1554,10 +1554,10 @@ void SdTiledRenderingTest::testTdf103083()
|
||||
// select contents of bullet item
|
||||
::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
o3tl::toTwips(aRect.getX() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.getY() + 2, o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.Top() + 2, o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
|
||||
o3tl::toTwips(aRect.getX() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.getY() + 2, o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left() + 2, o3tl::Length::mm100), o3tl::toTwips(aRect.Top() + 2, o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
pView->SdrBeginTextEdit(pTextObject);
|
||||
@@ -1643,10 +1643,10 @@ void SdTiledRenderingTest::testTdf104405()
|
||||
rEditView2.SetSelection(ESelection(0, 0, 0, 3)); // start para, start char, end para, end char.
|
||||
::tools::Rectangle aRect = pTableObject->GetCurrentBoundRect();
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
o3tl::toTwips(aRect.getX(), o3tl::Length::mm100), o3tl::toTwips(aRect.getY(), o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left(), o3tl::Length::mm100), o3tl::toTwips(aRect.Top(), o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
|
||||
o3tl::toTwips(aRect.getX(), o3tl::Length::mm100), o3tl::toTwips(aRect.getY(), o3tl::Length::mm100),
|
||||
o3tl::toTwips(aRect.Left(), o3tl::Length::mm100), o3tl::toTwips(aRect.Top(), o3tl::Length::mm100),
|
||||
1, MOUSE_LEFT, 0);
|
||||
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
@@ -2025,8 +2025,8 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage2()
|
||||
|
||||
// Double-click outside the text to enter edit mode.
|
||||
const ::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
|
||||
const auto cornerX = o3tl::toTwips(aRect.getX() + (aRect.getWidth() / 4), o3tl::Length::mm100);
|
||||
const auto cornerY = o3tl::toTwips(aRect.getY() + (aRect.getHeight() / 4), o3tl::Length::mm100);
|
||||
const auto cornerX = o3tl::toTwips(aRect.Left() + (aRect.getWidth() / 4), o3tl::Length::mm100);
|
||||
const auto cornerY = o3tl::toTwips(aRect.Top() + (aRect.getHeight() / 4), o3tl::Length::mm100);
|
||||
pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
|
||||
cornerX, cornerY,
|
||||
2, MOUSE_LEFT, 0);
|
||||
|
||||
@@ -119,8 +119,8 @@ awt::Rectangle SAL_CALL AccessiblePageShape::getBounds()
|
||||
::tools::Rectangle aParentBBox (0,0, aParentSize.Width, aParentSize.Height);
|
||||
aBBox = aBBox.GetIntersection (aParentBBox);
|
||||
aBoundingBox = awt::Rectangle (
|
||||
aBBox.getX(),
|
||||
aBBox.getY(),
|
||||
aBBox.Left(),
|
||||
aBBox.Top(),
|
||||
aBBox.getWidth(),
|
||||
aBBox.getHeight());
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@ void EmojiViewItem::calculateItemsPosition (const tools::Long /*nThumbnailHeight
|
||||
css::lang::Locale() );
|
||||
|
||||
Size aRectSize = maDrawArea.GetSize();
|
||||
Point aPos = maDrawArea.TopLeft();
|
||||
Point aPos = maDrawArea.TopCenter();
|
||||
|
||||
// Calculate text position
|
||||
aPos.setY( maDrawArea.getY() + (aRectSize.Height() - aTextDev.getTextHeight())/3 );
|
||||
aPos.setX( maDrawArea.Left() + (aRectSize.Width() - aTextDev.getTextWidth(maTitle,0,nMaxTextLength))/2 );
|
||||
aPos.Move(-aTextDev.getTextWidth(maTitle, 0, nMaxTextLength) / 2,
|
||||
(aRectSize.Height() - aTextDev.getTextHeight()) / 3);
|
||||
maTextPos = aPos;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,19 +125,14 @@ void ThumbnailViewItem::calculateItemsPosition (const tools::Long nThumbnailHeig
|
||||
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
|
||||
css::lang::Locale() );
|
||||
|
||||
Size aRectSize = maDrawArea.GetSize();
|
||||
Size aImageSize = maPreview1.GetSizePixel();
|
||||
|
||||
// Calculate thumbnail position
|
||||
Point aPos = maDrawArea.TopLeft();
|
||||
aPos.setX( maDrawArea.getX() + (aRectSize.Width()-aImageSize.Width())/2 );
|
||||
aPos.setY( maDrawArea.getY() + nPadding + (nThumbnailHeight-aImageSize.Height())/2 );
|
||||
maPrev1Pos = aPos;
|
||||
const Point aPos = maDrawArea.TopCenter();
|
||||
maPrev1Pos = aPos + Point(-aImageSize.Width() / 2, nPadding + (nThumbnailHeight - aImageSize.Height()) / 2);
|
||||
|
||||
// Calculate text position
|
||||
aPos.setY( maDrawArea.getY() + nThumbnailHeight + nPadding * 2 );
|
||||
aPos.setX( maDrawArea.Left() + (aRectSize.Width() - aTextDev.getTextWidth(maTitle,0,nMaxTextLength))/2 );
|
||||
maTextPos = aPos;
|
||||
maTextPos = aPos + Point(-aTextDev.getTextWidth(maTitle, 0, nMaxTextLength) / 2, nThumbnailHeight + nPadding * 2);
|
||||
}
|
||||
|
||||
void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
|
||||
|
||||
@@ -154,8 +154,7 @@ tools::Rectangle ImplCalcActionBounds(const MetaAction& rAct, const OutputDevice
|
||||
{
|
||||
tools::Rectangle aBoundRect1(
|
||||
const_cast<OutputDevice&>(rOut).ImplGetTextBoundRect(*pSalLayout1));
|
||||
aActionBounds.SetLeft(rOut.PixelToLogic(aBoundRect1).getX()
|
||||
+ rOut.PixelToLogic(aBoundRect1).getWidth());
|
||||
aActionBounds.SetLeft(rOut.PixelToLogic(aBoundRect1).Right());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -456,8 +455,7 @@ void SfxRedactionHelper::searchInMetaFile(const RedactionTarget& rRedactionTarge
|
||||
// Calculate the difference between current wrong value and value should it be.
|
||||
// Add the difference to current value.
|
||||
// Then increase 10% of the new value to make it look better.
|
||||
aNewRect.SetTop(aNewRect.getY() + (aNewRect.getHeight() - aLastFontHeight)
|
||||
- aLastFontHeight / 10);
|
||||
aNewRect.SetTop(aNewRect.Bottom() - aLastFontHeight - aLastFontHeight / 10);
|
||||
aRedactionRectangles.push_back(aNewRect);
|
||||
}
|
||||
|
||||
@@ -502,7 +500,7 @@ void SfxRedactionHelper::addRedactionRectToPage(
|
||||
"LineStyle", css::uno::makeAny(css::drawing::LineStyle::LineStyle_NONE));
|
||||
|
||||
xRectShape->setSize(awt::Size(aNewRectangle.GetWidth(), aNewRectangle.GetHeight()));
|
||||
xRectShape->setPosition(awt::Point(aNewRectangle.getX(), aNewRectangle.getY()));
|
||||
xRectShape->setPosition(awt::Point(aNewRectangle.Left(), aNewRectangle.Top()));
|
||||
|
||||
xPage->add(xRectShape);
|
||||
}
|
||||
|
||||
@@ -78,14 +78,14 @@ bool SfxRectangleItem::QueryValue( css::uno::Any& rVal,
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
rVal <<= css::awt::Rectangle( aVal.getX(),
|
||||
aVal.getY(),
|
||||
rVal <<= css::awt::Rectangle( aVal.Left(),
|
||||
aVal.Top(),
|
||||
aVal.getWidth(),
|
||||
aVal.getHeight() );
|
||||
break;
|
||||
}
|
||||
case MID_RECT_LEFT: rVal <<= aVal.getX(); break;
|
||||
case MID_RECT_RIGHT: rVal <<= aVal.getY(); break;
|
||||
case MID_RECT_LEFT: rVal <<= aVal.Left(); break;
|
||||
case MID_RECT_RIGHT: rVal <<= aVal.Top(); break;
|
||||
case MID_WIDTH: rVal <<= aVal.getWidth(); break;
|
||||
case MID_HEIGHT: rVal <<= aVal.getHeight(); break;
|
||||
default: OSL_FAIL("Wrong MemberID!"); return false;
|
||||
@@ -112,8 +112,8 @@ bool SfxRectangleItem::PutValue( const css::uno::Any& rVal,
|
||||
switch ( nMemberId )
|
||||
{
|
||||
case 0:
|
||||
aVal.setX( aValue.X );
|
||||
aVal.setY( aValue.Y );
|
||||
aVal.SetLeft( aValue.X );
|
||||
aVal.SetTop( aValue.Y );
|
||||
aVal.setWidth( aValue.Width );
|
||||
aVal.setHeight( aValue.Height );
|
||||
break;
|
||||
|
||||
@@ -578,8 +578,8 @@ awt::Rectangle SAL_CALL AccessibleShape::getBounds()
|
||||
::tools::Rectangle aParentBBox (0,0, aParentSize.Width, aParentSize.Height);
|
||||
aBBox = aBBox.GetIntersection (aParentBBox);
|
||||
aBoundingBox = awt::Rectangle (
|
||||
aBBox.getX(),
|
||||
aBBox.getY(),
|
||||
aBBox.Left(),
|
||||
aBBox.Top(),
|
||||
aBBox.getWidth(),
|
||||
aBBox.getHeight());
|
||||
}
|
||||
|
||||
@@ -2947,7 +2947,7 @@ void SdrObjCustomShape::AdjustToMaxRect(const tools::Rectangle& rMaxRect, bool b
|
||||
aB2DRange = aB2DPolygon.getB2DRange();
|
||||
const double fPolygonLeft = aB2DRange.getMinX();
|
||||
const double fPolygonTop = aB2DRange.getMinY();
|
||||
aMathMatrix.translate(rMaxRect.getX() - fPolygonLeft, rMaxRect.getY() - fPolygonTop);
|
||||
aMathMatrix.translate(rMaxRect.Left() - fPolygonLeft, rMaxRect.Top() - fPolygonTop);
|
||||
|
||||
// Create a Matrix from aMathMatrix, which is usable with TRSetBaseGeometry
|
||||
aMathMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
|
||||
|
||||
@@ -321,7 +321,7 @@ css::awt::Rectangle SAL_CALL AccessibleCell::getBounds()
|
||||
awt::Size aParentSize (xParentComponent->getSize());
|
||||
::tools::Rectangle aParentBBox (0,0, aParentSize.Width, aParentSize.Height);
|
||||
aBBox = aBBox.GetIntersection (aParentBBox);
|
||||
aBoundingBox = awt::Rectangle ( aBBox.getX(), aBBox.getY(), aBBox.getWidth(), aBBox.getHeight());
|
||||
aBoundingBox = awt::Rectangle ( aBBox.Left(), aBBox.Top(), aBBox.getWidth(), aBBox.getHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -334,8 +334,8 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
|
||||
if (std::string_view("EMPTY") == pPayload)
|
||||
return;
|
||||
CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
|
||||
aInvalidation.setX(aSeq[0].toInt32());
|
||||
aInvalidation.setY(aSeq[1].toInt32());
|
||||
aInvalidation.SetLeft(aSeq[0].toInt32());
|
||||
aInvalidation.SetTop(aSeq[1].toInt32());
|
||||
aInvalidation.setWidth(aSeq[2].toInt32());
|
||||
aInvalidation.setHeight(aSeq[3].toInt32());
|
||||
if (m_aInvalidation.IsEmpty())
|
||||
@@ -889,11 +889,11 @@ namespace {
|
||||
if (std::string_view("EMPTY") == pPayload)
|
||||
return;
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aSeq.getLength());
|
||||
m_aOwnCursor.setX(aSeq[0].toInt32());
|
||||
m_aOwnCursor.setY(aSeq[1].toInt32());
|
||||
m_aOwnCursor.SetLeft(aSeq[0].toInt32());
|
||||
m_aOwnCursor.SetTop(aSeq[1].toInt32());
|
||||
m_aOwnCursor.setWidth(aSeq[2].toInt32());
|
||||
m_aOwnCursor.setHeight(aSeq[3].toInt32());
|
||||
if (m_aOwnCursor.getX() == 0 && m_aOwnCursor.getY() == 0)
|
||||
if (m_aOwnCursor.Left() == 0 && m_aOwnCursor.Top() == 0)
|
||||
m_bOwnCursorAtOrigin = true;
|
||||
}
|
||||
break;
|
||||
@@ -909,8 +909,8 @@ namespace {
|
||||
if (std::string_view("EMPTY") == pPayload)
|
||||
return;
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aSeq.getLength());
|
||||
m_aViewCursor.setX(aSeq[0].toInt32());
|
||||
m_aViewCursor.setY(aSeq[1].toInt32());
|
||||
m_aViewCursor.SetLeft(aSeq[0].toInt32());
|
||||
m_aViewCursor.SetTop(aSeq[1].toInt32());
|
||||
m_aViewCursor.setWidth(aSeq[2].toInt32());
|
||||
m_aViewCursor.setHeight(aSeq[3].toInt32());
|
||||
}
|
||||
@@ -1700,8 +1700,8 @@ void SwTiledRenderingTest::testCommentEndTextEdit()
|
||||
// no unexpected cursor callbacks are emitted at origin (top left corner of
|
||||
// the document).
|
||||
aView1.m_bOwnCursorAtOrigin = false;
|
||||
pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aBodyCursor.getX(), aBodyCursor.getY(), 1, MOUSE_LEFT, 0);
|
||||
pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aBodyCursor.getX(), aBodyCursor.getY(), 1, MOUSE_LEFT, 0);
|
||||
pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aBodyCursor.Left(), aBodyCursor.Top(), 1, MOUSE_LEFT, 0);
|
||||
pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aBodyCursor.Left(), aBodyCursor.Top(), 1, MOUSE_LEFT, 0);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
// This failed, the cursor was at 0, 0 at some point during end text edit
|
||||
// of the comment.
|
||||
@@ -2969,8 +2969,8 @@ void SwTiledRenderingTest::testTablePaintInvalidate()
|
||||
pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
|
||||
pDevice->SetOutputSizePixelScaleOffsetAndBuffer(Size(nCanvasWidth, nCanvasHeight),
|
||||
Fraction(1.0), Point(), aPixmap.data());
|
||||
pXTextDocument->paintTile(*pDevice, nCanvasWidth, nCanvasHeight, m_aInvalidation.getX(),
|
||||
m_aInvalidation.getY(), /*nTileWidth=*/1000,
|
||||
pXTextDocument->paintTile(*pDevice, nCanvasWidth, nCanvasHeight, m_aInvalidation.Left(),
|
||||
m_aInvalidation.Top(), /*nTileWidth=*/1000,
|
||||
/*nTileHeight=*/1000);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
|
||||
|
||||
@@ -817,10 +817,7 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
|
||||
sal_Int32 nValue;
|
||||
if (aValue >>= nValue)
|
||||
{
|
||||
if (bAdjustX)
|
||||
nValue += convertTwipToMm100(aRect.getX());
|
||||
else if (bAdjustY)
|
||||
nValue += convertTwipToMm100(aRect.getY());
|
||||
nValue += convertTwipToMm100(bAdjustX ? aRect.Left() : aRect.Top());
|
||||
aValue <<= nValue;
|
||||
}
|
||||
}
|
||||
@@ -925,7 +922,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet const&
|
||||
|
||||
tools::Rectangle aRect = getTextRectangle(&rShape, /*bAbsolute=*/false);
|
||||
if (!aRect.IsEmpty())
|
||||
aOrient.SetPos(aOrient.GetPos() + aRect.getY());
|
||||
aOrient.SetPos(aOrient.GetPos() + aRect.Top());
|
||||
|
||||
if (rShape.GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE
|
||||
&& rShape.GetAnchor().GetPageNum() != 0)
|
||||
@@ -953,7 +950,7 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet const&
|
||||
|
||||
tools::Rectangle aRect = getTextRectangle(&rShape, /*bAbsolute=*/false);
|
||||
if (!aRect.IsEmpty())
|
||||
aOrient.SetPos(aOrient.GetPos() + aRect.getX());
|
||||
aOrient.SetPos(aOrient.GetPos() + aRect.Left());
|
||||
|
||||
if (rShape.GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE
|
||||
&& rShape.GetAnchor().GetPageNum() != 0)
|
||||
@@ -976,8 +973,8 @@ void SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat& rShape, SfxItemSet const&
|
||||
{
|
||||
if (!bInlineAnchored)
|
||||
{
|
||||
aVertOrient.SetPos(aVertOrient.GetPos() + aRect.getY());
|
||||
aHoriOrient.SetPos(aHoriOrient.GetPos() + aRect.getX());
|
||||
aVertOrient.SetPos(aVertOrient.GetPos() + aRect.Top());
|
||||
aHoriOrient.SetPos(aHoriOrient.GetPos() + aRect.Left());
|
||||
|
||||
aTextBoxSet.Put(aVertOrient);
|
||||
aTextBoxSet.Put(aHoriOrient);
|
||||
@@ -1198,10 +1195,10 @@ bool SwTextBoxHelper::doTextBoxPositioning(SwFrameFormat* pShape)
|
||||
tools::Rectangle aRect(getTextRectangle(pShape, false));
|
||||
|
||||
SwFormatHoriOrient aNewHOri(pFormat->GetHoriOrient());
|
||||
aNewHOri.SetPos(aRect.getX());
|
||||
aNewHOri.SetPos(aRect.Left());
|
||||
|
||||
SwFormatVertOrient aNewVOri(pFormat->GetVertOrient());
|
||||
aNewVOri.SetPos(aRect.getY() + pShape->GetVertOrient().GetPos());
|
||||
aNewVOri.SetPos(aRect.Top() + pShape->GetVertOrient().GetPos());
|
||||
|
||||
// tdf#140598: Do not apply wrong rectangle position.
|
||||
if (aRect.TopLeft() != Point(0, 0))
|
||||
@@ -1220,9 +1217,9 @@ bool SwTextBoxHelper::doTextBoxPositioning(SwFrameFormat* pShape)
|
||||
if (aRect.TopLeft() != Point(0, 0))
|
||||
{
|
||||
SwFormatHoriOrient aNewHOri(pShape->GetHoriOrient());
|
||||
aNewHOri.SetPos(aNewHOri.GetPos() + aRect.getX());
|
||||
aNewHOri.SetPos(aNewHOri.GetPos() + aRect.Left());
|
||||
SwFormatVertOrient aNewVOri(pShape->GetVertOrient());
|
||||
aNewVOri.SetPos(aNewVOri.GetPos() + aRect.getY());
|
||||
aNewVOri.SetPos(aNewVOri.GetPos() + aRect.Top());
|
||||
|
||||
pFormat->SetFormatAttr(aNewHOri);
|
||||
pFormat->SetFormatAttr(aNewVOri);
|
||||
|
||||
@@ -538,8 +538,8 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext)
|
||||
SwFormatHoriOrient aHOri = pShapeFormat->GetHoriOrient();
|
||||
SwFormatVertOrient aVOri = pShapeFormat->GetVertOrient();
|
||||
// calc the right position of the shape depending on text area
|
||||
aHOri.SetPos(aHOri.GetPos() + aTextRectangle.getX());
|
||||
aVOri.SetPos(aVOri.GetPos() + aTextRectangle.getY());
|
||||
aHOri.SetPos(aHOri.GetPos() + aTextRectangle.Left());
|
||||
aVOri.SetPos(aVOri.GetPos() + aTextRectangle.Top());
|
||||
// save the new position for the shape
|
||||
GetFormat()->SetFormatAttr(aHOri);
|
||||
GetFormat()->SetFormatAttr(aVOri);
|
||||
|
||||
@@ -375,7 +375,7 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase,
|
||||
// Both rectangles are absolute, SwFormatHori/VertOrient's position
|
||||
// is relative to the print area of the anchor text frame.
|
||||
tools::Rectangle aTextRectangle = SwTextBoxHelper::getTextRectangle(pShape);
|
||||
tools::Long nXoffs = SwTextBoxHelper::getTextRectangle(pShape, false).getX();
|
||||
tools::Long nXoffs = SwTextBoxHelper::getTextRectangle(pShape, false).Left();
|
||||
|
||||
const auto aPos(pShape->GetAnchor().GetContentAnchor());
|
||||
SwFormatVertOrient aVert(pTextBox->GetVertOrient());
|
||||
@@ -388,14 +388,14 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase,
|
||||
{
|
||||
aVert.SetVertOrient(css::text::VertOrientation::NONE);
|
||||
aVert.SetRelationOrient(css::text::RelOrientation::FRAME);
|
||||
sal_Int32 const nTop = aTextRectangle.getY() - rFrame.getFrameArea().Top()
|
||||
auto const nTop = aTextRectangle.Top() - rFrame.getFrameArea().Top()
|
||||
- rFrame.getFramePrintArea().Top();
|
||||
aVert.SetPos(nTop);
|
||||
}
|
||||
else
|
||||
{
|
||||
aVert.SetVertOrient(css::text::VertOrientation::NONE);
|
||||
aVert.SetPos(SwTextBoxHelper::getTextRectangle(pShape, false).getY());
|
||||
aVert.SetPos(SwTextBoxHelper::getTextRectangle(pShape, false).Top());
|
||||
}
|
||||
|
||||
SwFormatAnchor aNewTxBxAnchor(pTextBox->GetAnchor());
|
||||
|
||||
@@ -877,7 +877,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
|
||||
if( rFnt.GetTopBorder() )
|
||||
{
|
||||
aRect.setHeight(aRect.GetHeight() + rFnt.GetTopBorderSpace());
|
||||
aRect.setY(aRect.getY() - rFnt.GetTopBorderSpace());
|
||||
aRect.setY(aRect.Top() - rFnt.GetTopBorderSpace());
|
||||
}
|
||||
|
||||
if( rFnt.GetBottomBorder() )
|
||||
|
||||
@@ -1183,25 +1183,25 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
|
||||
if ( rValue.Name == "ViewAreaTop" )
|
||||
{
|
||||
rValue.Value >>= nTmp;
|
||||
aRect.setY( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
|
||||
aRect.setY(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp);
|
||||
}
|
||||
else if ( rValue.Name == "ViewAreaLeft" )
|
||||
{
|
||||
rValue.Value >>= nTmp;
|
||||
aRect.setX( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
|
||||
aRect.setX(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp);
|
||||
}
|
||||
else if ( rValue.Name == "ViewAreaWidth" )
|
||||
{
|
||||
rValue.Value >>= nTmp;
|
||||
Size aSize( aRect.GetSize() );
|
||||
aSize.setWidth( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
|
||||
aSize.setWidth(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp);
|
||||
aRect.SetSize( aSize );
|
||||
}
|
||||
else if ( rValue.Name == "ViewAreaHeight" )
|
||||
{
|
||||
rValue.Value >>= nTmp;
|
||||
Size aSize( aRect.GetSize() );
|
||||
aSize.setHeight( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) );
|
||||
aSize.setHeight(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp);
|
||||
aRect.SetSize( aSize );
|
||||
}
|
||||
else if ( rValue.Name == "ShowRedlineChanges" )
|
||||
|
||||
@@ -1006,8 +1006,8 @@ css::awt::Rectangle VCLXToolkit::getWorkArea( )
|
||||
sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
|
||||
tools::Rectangle aWorkRect = Application::GetScreenPosSizePixel( nDisplay );
|
||||
css::awt::Rectangle aNotherRect;
|
||||
aNotherRect.X = aWorkRect.getX();
|
||||
aNotherRect.Y = aWorkRect.getY();
|
||||
aNotherRect.X = aWorkRect.Left();
|
||||
aNotherRect.Y = aWorkRect.Top();
|
||||
aNotherRect.Width = aWorkRect.getWidth();
|
||||
aNotherRect.Height = aWorkRect.getHeight();
|
||||
return aNotherRect;
|
||||
|
||||
@@ -47,8 +47,8 @@ void Test::test_rectangle()
|
||||
CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth());
|
||||
CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight());
|
||||
|
||||
// Annoyingly getWidth and getHeight returns the wrong size
|
||||
// that was explicitly input.
|
||||
// getWidth and getHeight return the size that excludes one of the bounds,
|
||||
// unlike the ctor and GetWidth / GetHeight that operate on inclusive size
|
||||
CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getWidth());
|
||||
CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getHeight());
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ OString tools::Rectangle::toString() const
|
||||
// Note that this is not just used for debugging output but the
|
||||
// format is parsed by external code (passed in callbacks to
|
||||
// LibreOfficeKit clients). So don't change.
|
||||
return OString::number(getX()) + ", " + OString::number(getY()) + ", " + OString::number(getWidth()) + ", " + OString::number(getHeight());
|
||||
return OString::number(Left()) + ", " + OString::number(Top()) + ", " + OString::number(getWidth()) + ", " + OString::number(getHeight());
|
||||
}
|
||||
|
||||
void tools::Rectangle::expand(tools::Long nExpandBy)
|
||||
|
||||
@@ -58,11 +58,10 @@ Bitmap OutputDeviceTestClip::setupClipB2DPolyPolygon()
|
||||
tools::Rectangle rectangle = maVDRectangle;
|
||||
rectangle.shrink(2);
|
||||
mpVirtualDevice->SetClipRegion(vcl::Region(basegfx::B2DPolyPolygon(basegfx::B2DPolygon{
|
||||
basegfx::B2DPoint(rectangle.getX(), rectangle.getY()),
|
||||
basegfx::B2DPoint(rectangle.getX(), rectangle.getY() + rectangle.getHeight()),
|
||||
basegfx::B2DPoint(rectangle.getX() + rectangle.getWidth(),
|
||||
rectangle.getY() + rectangle.getHeight()),
|
||||
basegfx::B2DPoint(rectangle.getX() + rectangle.getWidth(), rectangle.getY()),
|
||||
basegfx::B2DPoint(rectangle.Left(), rectangle.Top()),
|
||||
basegfx::B2DPoint(rectangle.Left(), rectangle.Bottom()),
|
||||
basegfx::B2DPoint(rectangle.Right(), rectangle.Bottom()),
|
||||
basegfx::B2DPoint(rectangle.Right(), rectangle.Top()),
|
||||
})));
|
||||
mpVirtualDevice->SetBackground(constFillColor);
|
||||
mpVirtualDevice->Erase(maVDRectangle);
|
||||
|
||||
@@ -135,8 +135,8 @@ std::map<Color, int> collectColors(Bitmap& bitmap, const tools::Rectangle& recta
|
||||
{
|
||||
std::map<Color, int> colors;
|
||||
BitmapScopedWriteAccess pAccess(bitmap);
|
||||
for( tools::Long y = rectangle.getY(); y < rectangle.GetHeight(); ++y)
|
||||
for( tools::Long x = rectangle.getX(); x < rectangle.GetWidth(); ++x)
|
||||
for (tools::Long y = rectangle.Top(); y < rectangle.Bottom(); ++y)
|
||||
for (tools::Long x = rectangle.Left(); x < rectangle.Right(); ++x)
|
||||
++colors[pAccess->GetPixel(y, x)]; // operator[] initializes to 0 (default ctor) if creating
|
||||
return colors;
|
||||
}
|
||||
|
||||
@@ -126,12 +126,11 @@ Bitmap OutputDeviceTestLine::setupDashedLine()
|
||||
std::vector<double> stroke({ 2.0, 1.0 });
|
||||
mpVirtualDevice->DrawPolyLineDirect( basegfx::B2DHomMatrix(),
|
||||
basegfx::B2DPolygon{
|
||||
basegfx::B2DPoint(rectangle.getX(), rectangle.getY()),
|
||||
basegfx::B2DPoint(rectangle.getX(), rectangle.getY() + rectangle.getHeight()),
|
||||
basegfx::B2DPoint(rectangle.getX() + rectangle.getWidth(),
|
||||
rectangle.getY() + rectangle.getHeight()),
|
||||
basegfx::B2DPoint(rectangle.getX() + rectangle.getWidth(), rectangle.getY()),
|
||||
basegfx::B2DPoint(rectangle.getX(), rectangle.getY())},
|
||||
basegfx::B2DPoint(rectangle.Left(), rectangle.Top()),
|
||||
basegfx::B2DPoint(rectangle.Left(), rectangle.Bottom()),
|
||||
basegfx::B2DPoint(rectangle.Right(), rectangle.Bottom()),
|
||||
basegfx::B2DPoint(rectangle.Right(), rectangle.Top()),
|
||||
basegfx::B2DPoint(rectangle.Left(), rectangle.Top())},
|
||||
1, 0, &stroke, basegfx::B2DLineJoin::NONE );
|
||||
|
||||
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
|
||||
|
||||
@@ -307,7 +307,7 @@ bool CustomWidgetDraw::getNativeControlRegion(
|
||||
{
|
||||
// Translate to POD rectangle and back.
|
||||
const rectangle_t aRegion
|
||||
= { rBoundingControlRegion.getX(), rBoundingControlRegion.getY(),
|
||||
= { rBoundingControlRegion.Left(), rBoundingControlRegion.Top(),
|
||||
rBoundingControlRegion.GetWidth(), rBoundingControlRegion.GetHeight() };
|
||||
if (s_pWidgetImplementation)
|
||||
{
|
||||
|
||||
@@ -821,7 +821,7 @@ public:
|
||||
m_xMenuButton->SetParent(pEventWindow);
|
||||
int nButtonWidth = get_menu_button_width();
|
||||
m_xMenuButton->SetSizePixel(Size(nButtonWidth, rRect.GetHeight()));
|
||||
m_xMenuButton->SetPosPixel(Point(rRect.GetWidth() - nButtonWidth, rRect.getY()));
|
||||
m_xMenuButton->SetPosPixel(Point(rRect.GetWidth() - nButtonWidth, rRect.Top()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@ void VclComplexTextTest::testArabic()
|
||||
// exact bounding rectangle, not essentially the same as text width/height
|
||||
tools::Rectangle aBoundRect;
|
||||
pOutDev->GetTextBoundRect(aBoundRect, aOneTwoThree);
|
||||
CPPUNIT_ASSERT_DOUBLES_EQUAL(0, aBoundRect.getX(), 1); // This sometimes equals to 1
|
||||
CPPUNIT_ASSERT_DOUBLES_EQUAL(1, aBoundRect.getY(), 1);
|
||||
CPPUNIT_ASSERT_DOUBLES_EQUAL(0, aBoundRect.Left(), 1); // This sometimes equals to 1
|
||||
CPPUNIT_ASSERT_DOUBLES_EQUAL(1, aBoundRect.Top(), 1);
|
||||
CPPUNIT_ASSERT_DOUBLES_EQUAL(71, aBoundRect.getWidth(), 1); // This sometimes equals to 70
|
||||
CPPUNIT_ASSERT_DOUBLES_EQUAL(15, aBoundRect.getHeight(), 1);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void Qt5Graphics::handleDamage(const tools::Rectangle& rDamagedRegion)
|
||||
QImage blit(*pImage);
|
||||
blit.setDevicePixelRatio(1);
|
||||
Qt5Painter aPainter(*m_pBackend);
|
||||
aPainter.drawImage(QPoint(rDamagedRegion.getX(), rDamagedRegion.getY()), blit);
|
||||
aPainter.drawImage(QPoint(rDamagedRegion.Left(), rDamagedRegion.Top()), blit);
|
||||
aPainter.update(toQRect(rDamagedRegion));
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@ void Qt5SvpGraphics::handleDamage(const tools::Rectangle& rDamagedRegion)
|
||||
|
||||
BitmapBuffer aBuffer;
|
||||
QImage2BitmapBuffer(*pImage, aBuffer);
|
||||
SalTwoRect aTR(0, 0, pImage->width(), pImage->height(), rDamagedRegion.getX(),
|
||||
rDamagedRegion.getY(), rDamagedRegion.GetWidth(), rDamagedRegion.GetHeight());
|
||||
SalTwoRect aTR(0, 0, pImage->width(), pImage->height(), rDamagedRegion.Left(),
|
||||
rDamagedRegion.Top(), rDamagedRegion.GetWidth(), rDamagedRegion.GetHeight());
|
||||
drawBitmap(aTR, &aBuffer, CAIRO_OPERATOR_OVER);
|
||||
}
|
||||
|
||||
|
||||
@@ -556,7 +556,7 @@ void SkiaSalGraphicsImpl::setCanvasClipRegion(SkCanvas* canvas, const vcl::Regio
|
||||
RectangleVector rectangles;
|
||||
region.GetRegionRectangles(rectangles);
|
||||
for (const tools::Rectangle& rectangle : rectangles)
|
||||
path.addRect(SkRect::MakeXYWH(rectangle.getX(), rectangle.getY(), rectangle.GetWidth(),
|
||||
path.addRect(SkRect::MakeXYWH(rectangle.Left(), rectangle.Top(), rectangle.GetWidth(),
|
||||
rectangle.GetHeight()));
|
||||
path.setFillType(SkPathFillType::kEvenOdd);
|
||||
canvas->clipPath(path);
|
||||
@@ -1960,7 +1960,7 @@ bool SkiaSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPolygon,
|
||||
if (rPolyPolygon.IsRect())
|
||||
{
|
||||
// Rect->Polygon conversion loses the right and bottom edge, fix that.
|
||||
path.addRect(SkRect::MakeXYWH(boundRect.getX(), boundRect.getY(), boundRect.GetWidth(),
|
||||
path.addRect(SkRect::MakeXYWH(boundRect.Left(), boundRect.Top(), boundRect.GetWidth(),
|
||||
boundRect.GetHeight()));
|
||||
boundRect.AdjustRight(1);
|
||||
boundRect.AdjustBottom(1);
|
||||
|
||||
@@ -6212,11 +6212,10 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
|
||||
|
||||
// The rectangle is the bounding box of the text, but also includes
|
||||
// ascent / descent to match the on-screen rendering.
|
||||
tools::Rectangle aRectangle;
|
||||
// This is the top left of the text without ascent / descent.
|
||||
aRectangle.SetPos(PixelToLogic(rLayout.GetDrawPosition()));
|
||||
aRectangle.setY(aRectangle.getY() - aRefDevFontMetric.GetAscent());
|
||||
aRectangle.SetSize(PixelToLogic(Size(rLayout.GetTextWidth(), 0)));
|
||||
tools::Rectangle aRectangle(PixelToLogic(rLayout.GetDrawPosition()),
|
||||
Size(ImplDevicePixelToLogicWidth(rLayout.GetTextWidth()), 0));
|
||||
aRectangle.AdjustTop(-aRefDevFontMetric.GetAscent());
|
||||
// This includes ascent / descent.
|
||||
aRectangle.setHeight(aRefDevFontMetric.GetLineHeight());
|
||||
|
||||
|
||||
@@ -1716,9 +1716,8 @@ void Menu::ImplPaintMenuTitle(vcl::RenderContext& rRenderContext, const tools::R
|
||||
// Draw background rectangle
|
||||
tools::Rectangle aBgRect(rRect);
|
||||
int nOuterSpaceX = ImplGetSVData()->maNWFData.mnMenuFormatBorderX;
|
||||
aBgRect.setX(aBgRect.getX() + SPACE_AROUND_TITLE);
|
||||
aBgRect.Move(SPACE_AROUND_TITLE, SPACE_AROUND_TITLE);
|
||||
aBgRect.setWidth(aBgRect.getWidth() - 2 * SPACE_AROUND_TITLE - 2 * nOuterSpaceX);
|
||||
aBgRect.setY(aBgRect.getY() + SPACE_AROUND_TITLE);
|
||||
aBgRect.setHeight(nTitleHeight - 2 * SPACE_AROUND_TITLE);
|
||||
rRenderContext.DrawRect(aBgRect);
|
||||
|
||||
|
||||
@@ -215,13 +215,8 @@ tools::Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, tools::
|
||||
gint buttonWidth = icon_size + padding.left + padding.right +
|
||||
border.left + border.right;
|
||||
|
||||
gint buttonHeight = icon_size + padding.top + padding.bottom +
|
||||
border.top + border.bottom;
|
||||
|
||||
tools::Rectangle buttonRect;
|
||||
buttonRect.SetSize(Size(buttonWidth, buttonHeight));
|
||||
buttonRect.setY(aAreaRect.Top());
|
||||
buttonRect.SetBottom( buttonRect.Top() + aAreaRect.GetHeight() );
|
||||
tools::Rectangle buttonRect(Point(0, aAreaRect.Top()), Size(buttonWidth, 0));
|
||||
buttonRect.setHeight(aAreaRect.GetHeight());
|
||||
tools::Rectangle partRect(buttonRect);
|
||||
if ( nPart == ControlPart::ButtonUp )
|
||||
{
|
||||
@@ -327,26 +322,26 @@ tools::Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, tools
|
||||
if (nPart == ControlPart::ButtonUp)
|
||||
{
|
||||
aSize.setHeight( aSize.Height() * nFirst );
|
||||
buttonRect.setX(aAreaRect.Left());
|
||||
buttonRect.setY(aAreaRect.Top());
|
||||
buttonRect.SetLeft(aAreaRect.Left());
|
||||
buttonRect.SetTop(aAreaRect.Top());
|
||||
}
|
||||
else if (nPart == ControlPart::ButtonLeft)
|
||||
{
|
||||
aSize.setWidth( aSize.Width() * nFirst );
|
||||
buttonRect.setX(aAreaRect.Left());
|
||||
buttonRect.setY(aAreaRect.Top());
|
||||
buttonRect.SetLeft(aAreaRect.Left());
|
||||
buttonRect.SetTop(aAreaRect.Top());
|
||||
}
|
||||
else if (nPart == ControlPart::ButtonDown)
|
||||
{
|
||||
aSize.setHeight( aSize.Height() * nSecond );
|
||||
buttonRect.setX(aAreaRect.Left());
|
||||
buttonRect.setY(aAreaRect.Top() + aAreaRect.GetHeight() - aSize.Height());
|
||||
buttonRect.SetLeft(aAreaRect.Left());
|
||||
buttonRect.SetTop(aAreaRect.Top() + aAreaRect.GetHeight() - aSize.Height());
|
||||
}
|
||||
else if (nPart == ControlPart::ButtonRight)
|
||||
{
|
||||
aSize.setWidth( aSize.Width() * nSecond );
|
||||
buttonRect.setX(aAreaRect.Left() + aAreaRect.GetWidth() - aSize.Width());
|
||||
buttonRect.setY(aAreaRect.Top());
|
||||
buttonRect.SetLeft(aAreaRect.Left() + aAreaRect.GetWidth() - aSize.Width());
|
||||
buttonRect.SetTop(aAreaRect.Top());
|
||||
}
|
||||
|
||||
buttonRect.SetSize(aSize);
|
||||
@@ -810,10 +805,8 @@ void GtkSalGraphics::PaintOneSpinButton( GtkStyleContext *context,
|
||||
|
||||
iconWidth = gdk_pixbuf_get_width(pixbuf)/scale;
|
||||
iconHeight = gdk_pixbuf_get_height(pixbuf)/scale;
|
||||
tools::Rectangle arrowRect;
|
||||
arrowRect.SetSize(Size(iconWidth, iconHeight));
|
||||
arrowRect.setX( buttonRect.Left() + (buttonRect.GetWidth() - arrowRect.GetWidth()) / 2 );
|
||||
arrowRect.setY( buttonRect.Top() + (buttonRect.GetHeight() - arrowRect.GetHeight()) / 2 );
|
||||
tools::Rectangle arrowRect(buttonRect.Center() - Point(iconWidth / 2, iconHeight / 2),
|
||||
Size(iconWidth, iconHeight));
|
||||
|
||||
gtk_style_context_save (context);
|
||||
gtk_style_context_set_scale (context, 1);
|
||||
|
||||
@@ -1782,7 +1782,7 @@ public:
|
||||
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override
|
||||
{
|
||||
mrRenderer.SetSizePixel(GetSizePixel());
|
||||
fprintf(stderr, "DemoWin::Paint(%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ")\n", sal_Int64(rRect.getX()), sal_Int64(rRect.getY()), sal_Int64(rRect.getWidth()), sal_Int64(rRect.getHeight()));
|
||||
fprintf(stderr, "DemoWin::Paint(%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ",%" SAL_PRIdINT64 ")\n", sal_Int64(rRect.Left()), sal_Int64(rRect.Top()), sal_Int64(rRect.getWidth()), sal_Int64(rRect.getHeight()));
|
||||
if (mrRenderer.getIterCount() == 0)
|
||||
mrRenderer.drawToDevice(rRenderContext, GetSizePixel(), false);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user