/src/libstaroffice/src/lib/STOFFTable.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */ |
2 | | |
3 | | /* libstaroffice |
4 | | * Version: MPL 2.0 / LGPLv2+ |
5 | | * |
6 | | * The contents of this file are subject to the Mozilla Public License Version |
7 | | * 2.0 (the "License"); you may not use this file except in compliance with |
8 | | * the License or as specified alternatively below. You may obtain a copy of |
9 | | * the License at http://www.mozilla.org/MPL/ |
10 | | * |
11 | | * Software distributed under the License is distributed on an "AS IS" basis, |
12 | | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
13 | | * for the specific language governing rights and limitations under the |
14 | | * License. |
15 | | * |
16 | | * Major Contributor(s): |
17 | | * Copyright (C) 2002 William Lachance (wrlach@gmail.com) |
18 | | * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net) |
19 | | * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch) |
20 | | * Copyright (C) 2006, 2007 Andrew Ziem |
21 | | * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr) |
22 | | * |
23 | | * |
24 | | * All Rights Reserved. |
25 | | * |
26 | | * For minor contributions see the git repository. |
27 | | * |
28 | | * Alternatively, the contents of this file may be used under the terms of |
29 | | * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), |
30 | | * in which case the provisions of the LGPLv2+ are applicable |
31 | | * instead of those above. |
32 | | */ |
33 | | |
34 | | /* |
35 | | * Structure to store and construct a table from an unstructured list |
36 | | * of cell |
37 | | * |
38 | | */ |
39 | | |
40 | | #include <iomanip> |
41 | | #include <iostream> |
42 | | #include <map> |
43 | | #include <set> |
44 | | #include <sstream> |
45 | | |
46 | | #include <librevenge/librevenge.h> |
47 | | |
48 | | #include "STOFFCell.hxx" |
49 | | #include "STOFFListener.hxx" |
50 | | #include "STOFFPosition.hxx" |
51 | | |
52 | | #include "STOFFTable.hxx" |
53 | | |
54 | | /** Internal: the structures of a STOFFTable */ |
55 | | namespace STOFFTableInternal |
56 | | { |
57 | | } |
58 | | |
59 | | //////////////////////////////////////////////////////////// |
60 | | // STOFFTable |
61 | | //////////////////////////////////////////////////////////// |
62 | | |
63 | | // destructor, ... |
64 | | STOFFTable::~STOFFTable() |
65 | 21.0k | { |
66 | 21.0k | } |
67 | | |
68 | | void STOFFTable::addTablePropertiesTo(librevenge::RVNGPropertyList &pList) const |
69 | 6.04k | { |
70 | 6.04k | if (!m_propertyList["table:border-model"]) |
71 | 6.04k | pList.insert("table:border-model","collapsing"); |
72 | 6.04k | librevenge::RVNGPropertyList::Iter i(m_propertyList); |
73 | 46.5k | for (i.rewind(); i.next();) { |
74 | 40.5k | if (i.child()) { |
75 | 6.04k | pList.insert(i.key(), *i.child()); |
76 | 6.04k | continue; |
77 | 6.04k | } |
78 | 34.5k | pList.insert(i.key(), i()->clone()); |
79 | 34.5k | } |
80 | | #if 0 |
81 | | switch (m_alignment) { |
82 | | case Paragraph: |
83 | | break; |
84 | | case Left: |
85 | | propList.insert("table:align", "left"); |
86 | | propList.insert("fo:margin-left", double(m_leftMargin), librevenge::RVNG_POINT); |
87 | | break; |
88 | | case Center: |
89 | | propList.insert("table:align", "center"); |
90 | | break; |
91 | | case Right: |
92 | | propList.insert("table:align", "right"); |
93 | | propList.insert("fo:margin-right", double(m_rightMargin), librevenge::RVNG_POINT); |
94 | | break; |
95 | | default: |
96 | | break; |
97 | | } |
98 | | #endif |
99 | 6.04k | } |
100 | | |