summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-09-25 16:30:56 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-09-26 07:11:35 +0200
commitc3e89c03d340db7b80a36ada7cbd2ea9009ac075 (patch)
tree03a13dafdf83677f912adb920dabacc2f440e985
parent22393b8f71d3a46a60ff0be5c938a5da6e5fabb0 (diff)
tdf#160837 win: Replace some direct access to SalFrame::maGeometry
Replace some direct access to the (currently still, but soon no longer public) SalFrame::maGeometry member in Windows-specific code by using the public getter SalFrame::GetUnmirroredGeometry, or more specific getters for the height and width (SalFrame::GetWidth, SalFrame::GetHeight). Change-Id: I49babdc0f40fe41b44f968ce0a7d3c219a3f93d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173957 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
-rw-r--r--vcl/win/gdi/gdiimpl.cxx6
-rw-r--r--vcl/win/window/salframe.cxx16
2 files changed, 11 insertions, 11 deletions
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 1a186fc4ae8c..db936ae39bef 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -957,11 +957,11 @@ tools::Long WinSalGraphicsImpl::GetGraphicsWidth() const
WinSalFrame* pFrame = GetWindowPtr( mrParent.gethWnd() );
if( pFrame )
{
- if (pFrame->maGeometry.width())
- return pFrame->maGeometry.width();
+ if (pFrame->GetWidth())
+ return pFrame->GetWidth();
else
{
- // TODO: perhaps not needed, maGeometry should always be up-to-date
+ // TODO: perhaps not needed, width should always be up-to-date
RECT aRect;
GetClientRect( mrParent.gethWnd(), &aRect );
return aRect.right;
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index eeb588c2a228..cb718ff66bbc 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -3367,7 +3367,7 @@ static bool ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
UpdateWindow( hWnd );
if( AllSettings::GetLayoutRTL() )
- aMouseEvt.mnX = pFrame->maGeometry.width() - 1 - aMouseEvt.mnX;
+ aMouseEvt.mnX = pFrame->GetWidth() - 1 - aMouseEvt.mnX;
nRet = pFrame->CallCallback( nEvent, &aMouseEvt );
if ( nMsg == WM_MOUSEMOVE )
@@ -3450,7 +3450,7 @@ static bool ImplHandleWheelMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
aWheelEvt.mnCode |= KEY_MOD2;
if( AllSettings::GetLayoutRTL() )
- aWheelEvt.mnX = pFrame->maGeometry.width() - 1 - aWheelEvt.mnX;
+ aWheelEvt.mnX = pFrame->GetWidth() - 1 - aWheelEvt.mnX;
nRet = pFrame->CallCallback( SalEvent::WheelMouse, &aWheelEvt );
}
@@ -4315,13 +4315,13 @@ static void ImplHandleMoveMsg(HWND hWnd, LPARAM lParam)
#ifdef NDEBUG
(void) lParam;
#endif
- SAL_WARN_IF(!IsIconic(hWnd) && pFrame->maGeometry.x() != static_cast<sal_Int16>(LOWORD(lParam)),
+ SAL_WARN_IF(!IsIconic(hWnd) && pFrame->GetUnmirroredGeometry().x() != static_cast<sal_Int16>(LOWORD(lParam)),
"vcl",
- "Unexpected X: " << pFrame->maGeometry.x() << " instead of "
+ "Unexpected X: " << pFrame->GetUnmirroredGeometry().x() << " instead of "
<< static_cast<sal_Int16>(LOWORD(lParam)));
- SAL_WARN_IF(!IsIconic(hWnd) && pFrame->maGeometry.y() != static_cast<sal_Int16>(HIWORD(lParam)),
+ SAL_WARN_IF(!IsIconic(hWnd) && pFrame->GetUnmirroredGeometry().y() != static_cast<sal_Int16>(HIWORD(lParam)),
"vcl",
- "Unexpected Y: " << pFrame->maGeometry.y() << " instead of "
+ "Unexpected Y: " << pFrame->GetUnmirroredGeometry().y() << " instead of "
<< static_cast<sal_Int16>(HIWORD(lParam)));
if (GetWindowStyle(hWnd) & WS_VISIBLE)
@@ -4370,8 +4370,8 @@ static void ImplHandleSizeMsg(HWND hWnd, WPARAM wParam, LPARAM lParam)
#ifdef NDEBUG
(void) lParam;
#endif
- assert(pFrame->maGeometry.width() == static_cast<sal_Int16>(LOWORD(lParam)));
- assert(pFrame->maGeometry.height() == static_cast<sal_Int16>(HIWORD(lParam)));
+ assert(pFrame->GetWidth() == static_cast<sal_Int16>(LOWORD(lParam)));
+ assert(pFrame->GetHeight() == static_cast<sal_Int16>(HIWORD(lParam)));
pFrame->UpdateFrameState();