summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-07-25 22:25:46 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-07-25 22:25:46 +0200
commit0542f8229ec7cb5b887546b0db6996f6aa4e906b (patch)
tree3ca43f1e5d5e7f0e9a7484bb361b790cf5e01fb1
parentd27133e8b7a429d98950cdc0a51f6b61eec9875c (diff)
Order of pages is their order of arrival
-rw-r--r--src/lib/VSDXPages.cpp8
-rw-r--r--src/lib/VSDXPages.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/VSDXPages.cpp b/src/lib/VSDXPages.cpp
index 432f3b3..56da18a 100644
--- a/src/lib/VSDXPages.cpp
+++ b/src/lib/VSDXPages.cpp
@@ -74,12 +74,13 @@ void libvisio::VSDXPage::draw(libwpg::WPGPaintInterface *painter) const
}
libvisio::VSDXPages::VSDXPages()
- : m_pages()
+ : m_pages(), m_pagesOrder()
{
}
void libvisio::VSDXPages::addPage(const libvisio::VSDXPage &page)
{
+ m_pagesOrder.push_back(page.m_currentPageID);
m_pages[page.m_currentPageID] = page;
}
@@ -88,8 +89,11 @@ void libvisio::VSDXPages::draw(libwpg::WPGPaintInterface *painter)
if (!painter)
return;
- for (std::map<unsigned, libvisio::VSDXPage>::iterator iter = m_pages.begin(); iter != m_pages.end(); ++iter)
+ for (unsigned i = 0; i < m_pagesOrder.size(); ++i)
{
+ std::map<unsigned, libvisio::VSDXPage>::iterator iter = m_pages.find(m_pagesOrder[i]);
+ if (iter == m_pages.end())
+ continue;
WPXPropertyList pageProps;
pageProps.insert("svg:width", iter->second.m_pageWidth);
pageProps.insert("svg:height", iter->second.m_pageHeight);
diff --git a/src/lib/VSDXPages.h b/src/lib/VSDXPages.h
index aaea8db..e18287a 100644
--- a/src/lib/VSDXPages.h
+++ b/src/lib/VSDXPages.h
@@ -60,6 +60,7 @@ public:
private:
void _drawWithBackground(libwpg::WPGPaintInterface *painter, const VSDXPage &page);
std::map<unsigned, VSDXPage> m_pages;
+ std::vector<unsigned> m_pagesOrder;
};