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 : #include <com/sun/star/text/TableColumnSeparator.hpp>
21 : #include "TagLogger.hxx"
22 : #include "PropertyMapHelper.hxx"
23 :
24 : namespace writerfilter
25 : {
26 : namespace dmapper
27 : {
28 :
29 : using namespace ::com::sun::star;
30 :
31 0 : void lcl_DumpTableColumnSeparators(const uno::Any & rTableColumnSeparators)
32 : {
33 : (void) rTableColumnSeparators;
34 : #ifdef DEBUG_WRITERFILTER
35 : uno::Sequence<text::TableColumnSeparator> aSeq;
36 : rTableColumnSeparators >>= aSeq;
37 :
38 : TagLogger::getInstance().startElement("property.TableColumnSeparators");
39 :
40 : sal_uInt32 nLength = aSeq.getLength();
41 : for (sal_uInt32 n = 0; n < nLength; ++n)
42 : {
43 : TagLogger::getInstance().startElement("separator");
44 :
45 : TagLogger::getInstance().attribute("position", aSeq[n].Position);
46 : TagLogger::getInstance().attribute("visible", sal_uInt32(aSeq[n].IsVisible));
47 :
48 : TagLogger::getInstance().endElement();
49 : }
50 :
51 : TagLogger::getInstance().endElement();
52 : #endif // DEBUG_WRITERFILTER
53 0 : }
54 :
55 : #ifdef DEBUG_WRITERFILTER
56 : void lcl_DumpPropertyValues(beans::PropertyValues & rValues)
57 : {
58 : TagLogger::getInstance().startElement("propertyValues");
59 :
60 : beans::PropertyValue * pValues = rValues.getArray();
61 :
62 : for (sal_Int32 n = 0; n < rValues.getLength(); ++n)
63 : {
64 : TagLogger::getInstance().startElement("propertyValue");
65 :
66 : TagLogger::getInstance().attribute("name", pValues[n].Name);
67 :
68 : try
69 : {
70 : sal_Int32 aInt = 0;
71 : pValues[n].Value >>= aInt;
72 : TagLogger::getInstance().attribute("value", aInt);
73 : }
74 : catch (...)
75 : {
76 : }
77 :
78 : if ( pValues[n].Name == "TableColumnSeparators" )
79 : {
80 : lcl_DumpTableColumnSeparators(pValues[n].Value);
81 : }
82 :
83 : TagLogger::getInstance().endElement();
84 : }
85 : TagLogger::getInstance().endElement();
86 : }
87 :
88 : void lcl_DumpPropertyValueSeq(PropertyValueSeq_t & rPropValSeq)
89 : {
90 : TagLogger::getInstance().startElement("PropertyValueSeq");
91 :
92 : beans::PropertyValues * pValues = rPropValSeq.getArray();
93 :
94 : for (sal_Int32 n = 0; n < rPropValSeq.getLength(); ++n)
95 : {
96 : lcl_DumpPropertyValues(pValues[n]);
97 : }
98 :
99 : TagLogger::getInstance().endElement();
100 : }
101 : #endif // DEBUG_WRITERFILTER
102 :
103 : }
104 : }
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|