Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sd / source / ui / framework / configuration / ConfigurationTracer.cxx
blob00ddd5ff1b398a7f2d303691dde90fa2a7420396
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 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "ConfigurationTracer.hxx"
22 #include <com/sun/star/drawing/framework/XConfiguration.hpp>
23 #include <sal/log.hxx>
25 using namespace ::com::sun::star::uno;
26 using namespace ::com::sun::star::drawing::framework;
28 namespace sd::framework {
30 void ConfigurationTracer::TraceConfiguration (
31 const Reference<XConfiguration>& rxConfiguration,
32 const char* pMessage)
34 #if OSL_DEBUG_LEVEL >=1
35 SAL_INFO("sd.ui","" << pMessage << " at " << rxConfiguration.get() << " {");
36 if (rxConfiguration.is())
38 TraceBoundResources(rxConfiguration, nullptr, 0);
40 else
42 SAL_INFO("sd.ui"," empty");
44 SAL_INFO("sd.ui","}");
45 #else
46 (void)rxConfiguration;
47 (void)pMessage;
48 #endif
51 #if OSL_DEBUG_LEVEL >=1
52 void ConfigurationTracer::TraceBoundResources (
53 const Reference<XConfiguration>& rxConfiguration,
54 const Reference<XResourceId>& rxResourceId,
55 const int nIndentation)
57 const Sequence<Reference<XResourceId> > aResourceList (
58 rxConfiguration->getResources(rxResourceId, OUString(), AnchorBindingMode_DIRECT));
59 static const OUStringLiteral sIndentation (u" ");
60 for (Reference<XResourceId> const & resourceId : aResourceList)
62 OUString sLine (resourceId->getResourceURL());
63 for (int i=0; i<nIndentation; ++i)
64 sLine = sIndentation + sLine;
65 SAL_INFO("sd.ui", "" << sLine);
66 TraceBoundResources(rxConfiguration, resourceId, nIndentation+1);
69 #endif
71 } // end of namespace sd::framework
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */