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/.
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"
23 #include "sal/log.hxx"
25 using namespace ::com::sun::star::uno
;
26 using namespace ::com::sun::star::drawing::framework
;
28 namespace sd
{ namespace framework
{
30 void ConfigurationTracer::TraceConfiguration (
31 const Reference
<XConfiguration
>& rxConfiguration
,
35 SAL_INFO("sd.ui","" << pMessage
<< " at " << rxConfiguration
.get() << " {");
36 if (rxConfiguration
.is())
38 TraceBoundResources(rxConfiguration
, NULL
, 0);
42 SAL_INFO("sd.ui"," empty");
44 SAL_INFO("sd.ui","}");
46 (void)rxConfiguration
;
52 void ConfigurationTracer::TraceBoundResources (
53 const Reference
<XConfiguration
>& rxConfiguration
,
54 const Reference
<XResourceId
>& rxResourceId
,
55 const int nIndentation
)
57 Sequence
<Reference
<XResourceId
> > aResourceList (
58 rxConfiguration
->getResources(rxResourceId
, OUString(), AnchorBindingMode_DIRECT
));
59 const OUString
sIndentation (" ");
60 for (sal_Int32 nIndex
=0; nIndex
<aResourceList
.getLength(); ++nIndex
)
62 OUString
sLine (aResourceList
[nIndex
]->getResourceURL());
63 for (int i
=0; i
<nIndentation
; ++i
)
64 sLine
= sIndentation
+ sLine
;
65 SAL_INFO("sd.ui","" << OUStringToOString(sLine
, RTL_TEXTENCODING_UTF8
).getStr());
66 TraceBoundResources(rxConfiguration
, aResourceList
[nIndex
], nIndentation
+1);
71 } } // end of namespace sd::framework
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */