Line data Source code
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 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : #include "ConfigurationTracer.hxx"
22 :
23 : #include <cstdio>
24 :
25 : using namespace ::com::sun::star::uno;
26 : using namespace ::com::sun::star::drawing::framework;
27 :
28 : namespace sd { namespace framework {
29 :
30 0 : void ConfigurationTracer::TraceConfiguration (
31 : const Reference<XConfiguration>& rxConfiguration,
32 : const char* pMessage)
33 : {
34 : #ifdef DEBUG
35 : OSL_TRACE("%s at %p {", pMessage, rxConfiguration.get());
36 : if (rxConfiguration.is())
37 : {
38 : TraceBoundResources(rxConfiguration, NULL, 0);
39 : }
40 : else
41 : {
42 : OSL_TRACE(" empty");
43 : }
44 : OSL_TRACE("}");
45 : #else
46 : (void)rxConfiguration;
47 : (void)pMessage;
48 : #endif
49 0 : }
50 :
51 :
52 :
53 :
54 : #ifdef DEBUG
55 : void ConfigurationTracer::TraceBoundResources (
56 : const Reference<XConfiguration>& rxConfiguration,
57 : const Reference<XResourceId>& rxResourceId,
58 : const int nIndentation)
59 : {
60 : Sequence<Reference<XResourceId> > aResourceList (
61 : rxConfiguration->getResources(rxResourceId, ::rtl::OUString(), AnchorBindingMode_DIRECT));
62 : const ::rtl::OUString sIndentation (" ");
63 : for (sal_Int32 nIndex=0; nIndex<aResourceList.getLength(); ++nIndex)
64 : {
65 : ::rtl::OUString sLine (aResourceList[nIndex]->getResourceURL());
66 : for (int i=0; i<nIndentation; ++i)
67 : sLine = sIndentation + sLine;
68 : OSL_TRACE("%s", OUStringToOString(sLine, RTL_TEXTENCODING_UTF8).getStr());
69 : TraceBoundResources(rxConfiguration, aResourceList[nIndex], nIndentation+1);
70 : }
71 : }
72 : #endif
73 :
74 : } } // end of namespace sd::framework
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|