[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Nov 14 09:00:26 UTC 2019
vcl/source/app/salvtables.cxx | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
New commits:
commit 52b15945ac14ae3ef8dd99a6b3067d61085e1315
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 13 10:53:22 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 14 09:59:27 2019 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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
More information about the Libreoffice-commits
mailing list