summaryrefslogtreecommitdiff
path: root/sd/source/ui/framework/configuration/ConfigurationTracer.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2007-04-03 14:46:18 +0000
committerRüdiger Timm <rt@openoffice.org>2007-04-03 14:46:18 +0000
commitf5e5b2578065d5b1f5075fd78cdc50df52ad136c (patch)
tree11fda5752e7dfb3fa80054d4f052be5fc94bd975 /sd/source/ui/framework/configuration/ConfigurationTracer.cxx
parent4abc10b07633c1ab4f099f7b44364dc670e4f94c (diff)
INTEGRATION: CWS components1 (1.1.2); FILE ADDED
2007/03/07 09:55:35 af 1.1.2.3: #i75056# Using OSL_TRACE instead of printf. 2007/02/14 10:43:24 af 1.1.2.2: #i68075# Resolved compiler problems. 2007/01/31 13:36:46 af 1.1.2.1: #i68075# Initial revision.
Diffstat (limited to 'sd/source/ui/framework/configuration/ConfigurationTracer.cxx')
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationTracer.cxx95
1 files changed, 95 insertions, 0 deletions
diff --git a/sd/source/ui/framework/configuration/ConfigurationTracer.cxx b/sd/source/ui/framework/configuration/ConfigurationTracer.cxx
new file mode 100644
index 000000000000..f98d5250567c
--- /dev/null
+++ b/sd/source/ui/framework/configuration/ConfigurationTracer.cxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ConfigurationTracer.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-04-03 15:46:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "ConfigurationTracer.hxx"
+
+#include <cstdio>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::drawing::framework;
+
+namespace sd { namespace framework {
+
+void ConfigurationTracer::TraceConfiguration (
+ const Reference<XConfiguration>& rxConfiguration,
+ const char* pMessage)
+{
+#ifdef DEBUG
+ OSL_TRACE("%s at %p {", pMessage, rxConfiguration.get());
+ if (rxConfiguration.is())
+ {
+ TraceBoundResources(rxConfiguration, NULL, 0);
+ }
+ else
+ {
+ OSL_TRACE(" empty");
+ }
+ OSL_TRACE("}");
+#else
+ (void)rxConfiguration;
+ (void)pMessage;
+#endif
+}
+
+
+
+
+void ConfigurationTracer::TraceBoundResources (
+ const Reference<XConfiguration>& rxConfiguration,
+ const Reference<XResourceId>& rxResourceId,
+ const int nIndentation)
+{
+#ifdef DEBUG
+ Sequence<Reference<XResourceId> > aResourceList (
+ rxConfiguration->getResources(rxResourceId, ::rtl::OUString(), AnchorBindingMode_DIRECT));
+ const ::rtl::OUString sIndentation (::rtl::OUString::createFromAscii(" "));
+ for (sal_Int32 nIndex=0; nIndex<aResourceList.getLength(); ++nIndex)
+ {
+ ::rtl::OUString sLine (aResourceList[nIndex]->getResourceURL());
+ for (int i=0; i<nIndentation; ++i)
+ sLine = sIndentation + sLine;
+ OSL_TRACE("%s", OUStringToOString(sLine, RTL_TEXTENCODING_UTF8).getStr());
+ TraceBoundResources(rxConfiguration, aResourceList[nIndex], nIndentation+1);
+ }
+#else
+ (void)rxConfiguration;
+ (void)rxResourceId;
+ (void)nIndentation;
+#endif
+}
+
+} } // end of namespace sd::framework