LibreOffice Module sw (master)  1
ModelTraverser.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  */
10 
11 #include <ModelTraverser.hxx>
12 #include <node.hxx>
13 #include <ndarr.hxx>
15 #include <svx/svdpage.hxx>
16 #include <drawdoc.hxx>
17 
18 namespace sw
19 {
21 {
22  if (m_pDoc == nullptr)
23  return;
24 
25  auto const& pNodes = m_pDoc->GetNodes();
26  SwNode* pNode = nullptr;
27 
28  for (SwNodeOffset n(0); n < pNodes.Count(); ++n)
29  {
30  pNode = pNodes[n];
31  if (pNode)
32  {
33  for (auto& pNodeHandler : mpNodeHandler)
34  {
35  pNodeHandler->handleNode(pNode);
36  }
37  }
38  }
39 
41  auto* pModel = rDrawModelAccess.GetDrawModel();
42  for (sal_uInt16 nPage = 0; nPage < pModel->GetPageCount(); ++nPage)
43  {
44  SdrPage* pPage = pModel->GetPage(nPage);
45  for (size_t nObject = 0; nObject < pPage->GetObjCount(); ++nObject)
46  {
47  SdrObject* pObject = pPage->GetObj(nObject);
48  if (pObject)
49  {
50  for (auto& pNodeHandler : mpNodeHandler)
51  {
52  pNodeHandler->handleSdrObject(pObject);
53  }
54  }
55  }
56  }
57 }
58 
59 } // end sw namespace
60 
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int64 n
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
Dialog to specify the properties of date form field.
EmbeddedObjectRef * pObject
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
SwNodes & GetNodes()
Definition: doc.hxx:409
std::vector< std::shared_ptr< ModelTraverseHandler > > mpNodeHandler
Base class of the Writer document model elements.
Definition: node.hxx:81