1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #include <ModelTraverser.hxx>
14 #include <IDocumentDrawModelAccess.hxx>
15 #include <svx/svdpage.hxx>
16 #include <drawdoc.hxx>
20 void ModelTraverser::traverse()
22 if (m_pDoc
== nullptr)
25 auto const& pNodes
= m_pDoc
->GetNodes();
26 SwNode
* pNode
= nullptr;
28 for (SwNodeOffset
n(0); n
< pNodes
.Count(); ++n
)
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
);
50 for (auto& pNodeHandler
: mpNodeHandler
)
52 pNodeHandler
->handleSdrObject(pObject
);
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */