libodsstream
Library for mass spectrometry
Loading...
Searching...
No Matches
odstablesettings.cpp
Go to the documentation of this file.
1/**
2 * \file odsstream/writer/options/odstablesettings.cpp
3 * \date 23/04/2018
4 * \author Olivier Langella
5 * \brief store table settings
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2013 Olivier Langella <Olivier.Langella@u-psud.fr>.
10 *
11 * This file is part of the libodsstream library.
12 *
13 * libodsstream is a library to read and write ODS documents as streams
14 * Copyright (C) 2013 Olivier Langella <Olivier.Langella@u-psud.fr>
15 *
16 * This program is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License as published
18 *by the Free Software Foundation, either version 3 of the License, or (at your
19 *option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public License
27 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 *
29 * Contributors:
30 * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
31 *implementation
32 ******************************************************************************/
33
34#include "odstablesettings.h"
35#include <QDebug>
36
50{
51 if(this == &other)
52 return *this;
53 _sheetname = other._sheetname;
55 return *this;
56}
57void
58OdsTableSettings::setSheetName(const QString &sheetname)
59{
60 _sheetname = sheetname;
61}
62const QString &
64{
65 return _sheetname;
66}
67const QString
68OdsTableSettings::getValue(const QString &property) const
69{
70 auto it = _map_properties.find(property);
71 if(it != _map_properties.end())
72 {
73 return it->second;
74 }
75 else
76 {
77 return "0";
78 }
79}
80void
82{
83 qDebug() << __FILE__ << " " << __FUNCTION__ << " " << position;
84 if(position == 0)
85 {
86 _map_properties[QString("VerticalSplitMode")] = QString("0");
87 }
88 else
89 {
90 _map_properties[QString("VerticalSplitMode")] = QString("2");
91 }
92 _map_properties[QString("VerticalSplitPosition")] =
93 QString("%1").arg(position);
94 qDebug() << __FILE__ << " " << __FUNCTION__ << " "
95 << getValue("VerticalSplitPosition");
96}
97
98void
100{
101 if(position == 0)
102 {
103 _map_properties[QString("HorizontalSplitMode")] = QString("0");
104 }
105 else
106 {
107 _map_properties[QString("HorizontalSplitMode")] = QString("2");
108 }
109 _map_properties[QString("HorizontalSplitPosition")] =
110 QString("%1").arg(position);
111}
const QString getValue(const QString &property) const
void setVerticalSplit(unsigned int position)
void setSheetName(const QString &sheetname)
std::map< QString, QString > _map_properties
const QString & getSheetName() const
void setHorizontalSplit(unsigned int position)
OdsTableSettings & operator=(OdsTableSettings const &other)
store table settings