android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / core / model / ModelTraverser.cxx
blobb7d2b2200dd66c5c67e60a6d6f05228429ea73bc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
11 #include <ModelTraverser.hxx>
12 #include <node.hxx>
13 #include <ndarr.hxx>
14 #include <IDocumentDrawModelAccess.hxx>
15 #include <svx/svdpage.hxx>
16 #include <drawdoc.hxx>
18 namespace sw
20 void ModelTraverser::traverse()
22 if (m_pDoc == nullptr)
23 return;
25 auto const& pNodes = m_pDoc->GetNodes();
26 SwNode* pNode = nullptr;
28 for (SwNodeOffset n(0); n < pNodes.Count(); ++n)
30 pNode = pNodes[n];
31 if (pNode)
33 for (auto& pNodeHandler : mpNodeHandler)
35 pNodeHandler->handleNode(pNode);
40 IDocumentDrawModelAccess& rDrawModelAccess = m_pDoc->getIDocumentDrawModelAccess();
41 auto* pModel = rDrawModelAccess.GetDrawModel();
42 for (sal_uInt16 nPage = 0; nPage < pModel->GetPageCount(); ++nPage)
44 SdrPage* pPage = pModel->GetPage(nPage);
45 for (size_t nObject = 0; nObject < pPage->GetObjCount(); ++nObject)
47 SdrObject* pObject = pPage->GetObj(nObject);
48 if (pObject)
50 for (auto& pNodeHandler : mpNodeHandler)
52 pNodeHandler->handleSdrObject(pObject);
59 } // end sw namespace
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */