Kaydet (Commit) 5eb7759d authored tarafından Miklos Vajna's avatar Miklos Vajna

SwPageFrm::IsOverHeaderFooterArea: check for IsActive() only later

Checking for a bool is certainly cheaper than a chain of member function
calls.

Change-Id: I9520194e58e75264f3fcbb413a618e3995f59a4e
üst 6f493f9e
...@@ -2262,10 +2262,10 @@ bool SwPageFrm::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rCon ...@@ -2262,10 +2262,10 @@ bool SwPageFrm::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rCon
Size( Frm().Width(), nUpperLimit - Frm().Top() ) ); Size( Frm().Width(), nUpperLimit - Frm().Top() ) );
SwViewShell* pViewShell = getRootFrm()->GetCurrShell(); SwViewShell* pViewShell = getRootFrm()->GetCurrShell();
bool bHideWhitespaceMode = pViewShell->GetViewOptions()->IsHideWhitespaceMode(); const bool bHideWhitespaceMode = pViewShell->GetViewOptions()->IsHideWhitespaceMode();
if ( aHeaderArea.IsInside( rPt ) ) if ( aHeaderArea.IsInside( rPt ) )
{ {
if (static_cast<const SwFrameFormat*>(GetRegisteredIn())->GetHeader().IsActive() || !bHideWhitespaceMode) if (!bHideWhitespaceMode || static_cast<const SwFrameFormat*>(GetRegisteredIn())->GetHeader().IsActive())
{ {
rControl = Header; rControl = Header;
return true; return true;
...@@ -2277,7 +2277,7 @@ bool SwPageFrm::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rCon ...@@ -2277,7 +2277,7 @@ bool SwPageFrm::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rCon
Size( Frm().Width(), Frm().Bottom() - nLowerLimit ) ); Size( Frm().Width(), Frm().Bottom() - nLowerLimit ) );
if ( aFooterArea.IsInside( rPt ) && if ( aFooterArea.IsInside( rPt ) &&
(static_cast<const SwFrameFormat*>(GetRegisteredIn())->GetFooter().IsActive() || !bHideWhitespaceMode) ) (!bHideWhitespaceMode || static_cast<const SwFrameFormat*>(GetRegisteredIn())->GetFooter().IsActive()) )
{ {
rControl = Footer; rControl = Footer;
return true; return true;
......
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