Kaydet (Commit) 36c84fa3 authored tarafından Caolán McNamara's avatar Caolán McNamara

restore original lock status of SwViewShell in correct order

in e1218439 "Resolves: rhbz#1081176: don't jump
to cursor pos" for some reason I collect the old state of the various
SwViewShells and then restore them in the opposite order.

Change-Id: Ibb7bcfb07cf5038dd2e9acbac26b3246ff483a92
üst ffa82c4d
......@@ -1657,7 +1657,7 @@ namespace
{
class LockAllViews
{
std::stack<bool> m_aViewWasLocked;
std::vector<SwViewShell*> m_aViewWasUnLocked;
SwViewShell* m_pViewShell;
public:
LockAllViews(SwViewShell *pViewShell)
......@@ -1668,22 +1668,21 @@ namespace
SwViewShell *pSh = m_pViewShell;
do
{
m_aViewWasLocked.push(pSh->IsViewLocked());
pSh->LockView(true);
if (!pSh->IsViewLocked())
{
m_aViewWasUnLocked.push_back(pSh);
pSh->LockView(true);
}
pSh = (SwViewShell*)pSh->GetNext();
} while (pSh != m_pViewShell);
}
~LockAllViews()
{
if (!m_pViewShell)
return;
SwViewShell *pSh = m_pViewShell;
do
for (std::vector<SwViewShell*>::iterator aI = m_aViewWasUnLocked.begin(); aI != m_aViewWasUnLocked.end(); ++aI)
{
pSh->LockView(m_aViewWasLocked.top());
m_aViewWasLocked.pop();
pSh = (SwViewShell*)pSh->GetNext();
} while (pSh != m_pViewShell);
SwViewShell *pSh = *aI;
pSh->LockView(false);
}
}
};
}
......
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