diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-09-17 21:49:21 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-20 12:10:44 +0200 |
commit | b22d4785310eac35696df771803dfba0871a50ac (patch) | |
tree | 56e394a3c38a2e1f17530fbc18dd8e6b3c5d5098 /desktop | |
parent | 3e2370260f2b79c43b4f8a86b123861aa95d3ef2 (diff) |
clean up ambiguous confusing rectangle APIs like IsInside()
Reading 'rectA.IsInside( rectB )' kind of suggests that the code
checks whether 'rectA is inside rectB', but it's actually the other
way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(),
which should make it clear which way the logic goes.
Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 6 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index dc5eafeefb5f..840b59968cf3 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -735,7 +735,7 @@ bool ExtensionBox_Impl::MouseMove( const MouseEvent& rMEvt ) if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) ) { const auto& rEntry = m_vEntries[nPos]; - bOverHyperlink = !rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.IsInside(rMEvt.GetPosPixel()); + bOverHyperlink = !rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.Contains(rMEvt.GetPosPixel()); } if (bOverHyperlink) @@ -752,7 +752,7 @@ OUString ExtensionBox_Impl::RequestHelp(tools::Rectangle& rRect) if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) ) { const auto& rEntry = m_vEntries[nPos]; - bool bOverHyperlink = !rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.IsInside(rRect); + bool bOverHyperlink = !rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.Contains(rRect); if (bOverHyperlink) { rRect = rEntry->m_aLinkRect; @@ -776,7 +776,7 @@ bool ExtensionBox_Impl::MouseButtonDown( const MouseEvent& rMEvt ) if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) ) { const auto& rEntry = m_vEntries[nPos]; - if (!rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.IsInside(rMEvt.GetPosPixel())) + if (!rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.Contains(rMEvt.GetPosPixel())) { try { diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6ab01d631910..c5b06a2eb6ee 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1721,7 +1721,7 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& a if (rcOld.m_nPart == -1 || rcOld.m_nPart == rcNew.m_nPart) { // If fully overlapping. - if (rcOld.m_aRectangle.IsInside(rcNew.m_aRectangle)) + if (rcOld.m_aRectangle.Contains(rcNew.m_aRectangle)) { SAL_INFO("lok", "Skipping queue [" << type << "]: [" << payload << "] since overlaps existing all-parts."); @@ -1767,7 +1767,7 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& a // Don't merge unless fully overlapped. SAL_INFO("lok", "New " << rcNew.toString() << " has " << rcOld.toString() << "?"); - if (rcNew.m_aRectangle.IsInside(rcOld.m_aRectangle)) + if (rcNew.m_aRectangle.Contains(rcOld.m_aRectangle)) { SAL_INFO("lok", "New " << rcNew.toString() << " engulfs old " << rcOld.toString() << "."); @@ -1779,7 +1779,7 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& a // Don't merge unless fully overlapped. SAL_INFO("lok", "Old " << rcOld.toString() << " has " << rcNew.toString() << "?"); - if (rcOld.m_aRectangle.IsInside(rcNew.m_aRectangle)) + if (rcOld.m_aRectangle.Contains(rcNew.m_aRectangle)) { SAL_INFO("lok", "New " << rcNew.toString() << " engulfs old " << rcOld.toString() << "."); @@ -1914,7 +1914,7 @@ bool CallbackFlushHandler::processWindowEvent(int type, CallbackData& aCallbackD return false; } // new one engulfs the old one? - else if (aNewRect.IsInside(aOldRect)) + else if (aNewRect.Contains(aOldRect)) { SAL_INFO("lok.dialog", "New rect [" << aNewRect.toString() << "] engulfs old [" @@ -1922,7 +1922,7 @@ bool CallbackFlushHandler::processWindowEvent(int type, CallbackData& aCallbackD return true; } // old one engulfs the new one? - else if (aOldRect.IsInside(aNewRect)) + else if (aOldRect.Contains(aNewRect)) { SAL_INFO("lok.dialog", "Old rect [" << aOldRect.toString() << "] engulfs new [" |