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