summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-13 10:53:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-14 09:59:27 +0100
commit52b15945ac14ae3ef8dd99a6b3067d61085e1315 (patch)
tree10f2d288b527696326a3a711e5d500bd9c17653a
parentf7e53fe4912218afa531b2062431b6e20528ec54 (diff)
remove user-added page in remove_page
Change-Id: I22e2449fb8c15790f7396af6f94d03d48bf334f6 Reviewed-on: https://gerrit.libreoffice.org/82640 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/app/salvtables.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 327853bba1d1..4836f14af52e 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2277,7 +2277,13 @@ public:
virtual void remove_page(const OString& rIdent) override
{
- m_xNotebook->RemovePage(m_xNotebook->GetPageId(rIdent));
+ sal_uInt16 nPageId = m_xNotebook->GetPageId(rIdent);
+ sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(nPageId);
+ if (nPageIndex == TAB_PAGE_NOTFOUND)
+ return;
+ m_xNotebook->RemovePage(nPageId);
+ if (nPageIndex < m_aPages.size())
+ m_aPages.erase(m_aPages.begin() + nPageIndex);
}
virtual void append_page(const OString& rIdent, const OUString& rLabel) override
@@ -2392,7 +2398,12 @@ public:
virtual void remove_page(const OString& rIdent) override
{
+ sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(rIdent);
+ if (nPageIndex == TAB_PAGE_NOTFOUND)
+ return;
m_xNotebook->RemovePage(rIdent);
+ if (nPageIndex < m_aPages.size())
+ m_aPages.erase(m_aPages.begin() + nPageIndex);
}
virtual void append_page(const OString& rIdent, const OUString& rLabel) override