summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-09-26 15:20:57 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-09-28 09:31:47 +0200
commit54bdc8cb95584aba8de06564ea45f05d0babc032 (patch)
tree3f7475bcc2f701ce316d838ee90755d1a27c81ea /vcl
parentc9b7d8cc749884ce2c26a1b944413a1d301fbf1a (diff)
tdf#160837 qt: QtFrame: Use getters instead of SalFrame::maGeometry
Replace some direct uses of SalFrame::maGeometry in QtFrame with corresponding getters: * SalFrame::GetUnmirroredGeometry() to get the SalFrameGeometry * the more specific SalFrame::GetWidth() and SalFrame::GetHeight() where only the width/ height is of interest No change in behavior intended yet. Change-Id: I1b4e13c5efef7b78f082f6444e1e8d0ee591db41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173994 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/QtFrame.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 2e2bd9dd59ec..99375eb72a7f 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -546,9 +546,9 @@ void QtFrame::SetPosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, too
if (isChild(false) || !m_pQWidget->isMaximized())
{
if (!(nFlags & SAL_FRAME_POSSIZE_WIDTH))
- nWidth = maGeometry.width();
+ nWidth = GetWidth();
else if (!(nFlags & SAL_FRAME_POSSIZE_HEIGHT))
- nHeight = maGeometry.height();
+ nHeight = GetHeight();
if (nWidth > 0 && nHeight > 0)
{
@@ -579,18 +579,18 @@ void QtFrame::SetPosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, too
if (m_pParent)
{
- const SalFrameGeometry& aParentGeometry = m_pParent->maGeometry;
+ const SalFrameGeometry aParentGeometry = m_pParent->GetUnmirroredGeometry();
if (QGuiApplication::isRightToLeft())
- nX = aParentGeometry.x() + aParentGeometry.width() - nX - maGeometry.width() - 1;
+ nX = aParentGeometry.x() + aParentGeometry.width() - nX - GetWidth() - 1;
else
nX += aParentGeometry.x();
nY += aParentGeometry.y() + menuBarOffset();
}
if (!(nFlags & SAL_FRAME_POSSIZE_X))
- nX = maGeometry.x();
+ nX = GetUnmirroredGeometry().x();
else if (!(nFlags & SAL_FRAME_POSSIZE_Y))
- nY = maGeometry.y();
+ nY = GetUnmirroredGeometry().y();
// assume the reposition happened
// needed for calculations and will eventually be corrected by events later
@@ -856,7 +856,7 @@ bool QtFrame::ShowTooltip(const OUString& rText, const tools::Rectangle& rHelpAr
{
QRect aHelpArea(toQRect(rHelpArea));
if (QGuiApplication::isRightToLeft())
- aHelpArea.moveLeft(maGeometry.width() - aHelpArea.width() - aHelpArea.left() - 1);
+ aHelpArea.moveLeft(GetWidth() - aHelpArea.width() - aHelpArea.left() - 1);
m_aTooltipText = rText;
m_aTooltipArea = aHelpArea;
return true;
@@ -1273,7 +1273,8 @@ SalFrame::SalPointerState QtFrame::GetPointerState()
{
SalPointerState aState;
aState.maPos = toPoint(QCursor::pos() * devicePixelRatioF());
- aState.maPos.Move(-maGeometry.x(), -maGeometry.y());
+ SalFrameGeometry aGeometry = GetUnmirroredGeometry();
+ aState.maPos.Move(-aGeometry.x(), -aGeometry.y());
aState.mnState = GetMouseModCode(QGuiApplication::mouseButtons())
| GetKeyModCode(QGuiApplication::keyboardModifiers());
return aState;