summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkash Shetye <shetyeakash@gmail.com>2013-06-06 12:19:51 +0530
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-05 14:30:17 -0400
commitcbbaaa71d3023b556d0cd2abfbb85ad752fd16d7 (patch)
tree9b39586f6bf03d2ba71daab2bdf8afa6985f20c9
parente289eb655fb0d750b09c74dfd9811ab27243a207 (diff)
Adds formatting class to hold stylesheet names for alternating rows and cols.
ScDBDataFormatting is added to hold the style sheet names for ScDBData's alternating rows and columns. Change-Id: I3416f8cc56bf0a2afd7fde17039dc17bb6743a55 Reviewed-on: https://gerrit.libreoffice.org/4178 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/inc/dbdataformatting.hxx49
-rw-r--r--sc/source/core/tool/dbdataformatting.cxx89
2 files changed, 138 insertions, 0 deletions
diff --git a/sc/inc/dbdataformatting.hxx b/sc/inc/dbdataformatting.hxx
new file mode 100644
index 000000000000..d1897ad5fdd9
--- /dev/null
+++ b/sc/inc/dbdataformatting.hxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef SC_DBDATAFORMATTING_HXX
+#define SC_DBDATAFORMATTING_HXX
+
+#include "rtl/ustring.hxx"
+
+class ScDBDataFormatting
+{
+ private:
+ OUString maFirstRowStripeStyle;
+ OUString maSecondRowStripeStyle;
+ OUString maFirstColStripeStyle;
+ OUString maSecondColStripeStyle;
+ bool bBandedRows;
+ bool bBandedColumns;
+ public:
+ ScDBDataFormatting(const OUString& rFirstRowStripeStyle, const OUString& rSecondRowStripeStyle, const OUString& rFirstColStripeStyle, const OUString& rSecondColStripeStyle);
+ void SetBandedRows( bool bBRows );
+ bool GetBandedRows();
+ void SetBandedColumns( bool bBCols );
+ bool GetBandedColumns();
+ const OUString& GetFirstRowStripeStyle() const;
+ const OUString& GetSecondRowStripeStyle() const;
+ const OUString& GetFirstColStripeStyle() const;
+ const OUString& GetSecondColStripeStyle() const;
+ void SetFirstRowStripeStyle( const OUString& aStyleName );
+ void SetSecondRowStripeStyle( const OUString& aStyleName );
+ void SetFirstColStripeStyle( const OUString& aStyleName );
+ void SetSecondColStripeStyle( const OUString& aStyleName );
+};
+
+#endif
diff --git a/sc/source/core/tool/dbdataformatting.cxx b/sc/source/core/tool/dbdataformatting.cxx
new file mode 100644
index 000000000000..1a84eb0da80a
--- /dev/null
+++ b/sc/source/core/tool/dbdataformatting.cxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "dbdataformatting.hxx"
+#include "rtl/ustring.hxx"
+
+ScDBDataFormatting::ScDBDataFormatting(const OUString& rFirstRowStripeStyle, const OUString& rSecondRowStripeStyle, const OUString& rFirstColStripeStyle, const OUString& rSecondColStripeStyle) :
+maFirstRowStripeStyle ( rFirstRowStripeStyle),
+maSecondRowStripeStyle ( rSecondRowStripeStyle ),
+maFirstColStripeStyle ( rFirstColStripeStyle ),
+maSecondColStripeStyle ( rSecondColStripeStyle )
+{
+}
+
+void ScDBDataFormatting::SetBandedRows( bool bBRows )
+{
+ bBandedRows = bBRows;
+}
+
+bool ScDBDataFormatting::GetBandedRows()
+{
+ return bBandedRows;
+}
+
+void ScDBDataFormatting::SetBandedColumns( bool bBCols )
+{
+ bBandedColumns = bBCols;
+}
+
+bool ScDBDataFormatting::GetBandedColumns()
+{
+ return bBandedColumns;
+}
+
+const OUString& ScDBDataFormatting::GetFirstRowStripeStyle() const
+{
+ return maFirstRowStripeStyle;
+}
+
+const OUString& ScDBDataFormatting::GetSecondRowStripeStyle() const
+{
+ return maSecondRowStripeStyle;
+}
+
+const OUString& ScDBDataFormatting::GetFirstColStripeStyle() const
+{
+ return maFirstColStripeStyle;
+}
+
+const OUString& ScDBDataFormatting::GetSecondColStripeStyle() const
+{
+ return maSecondColStripeStyle;
+}
+
+void ScDBDataFormatting::SetFirstRowStripeStyle( const OUString& aStyleName )
+{
+ maFirstRowStripeStyle = aStyleName;
+}
+
+void ScDBDataFormatting::SetSecondRowStripeStyle( const OUString& aStyleName )
+{
+ maSecondRowStripeStyle = aStyleName;
+}
+
+void ScDBDataFormatting::SetFirstColStripeStyle( const OUString& aStyleName )
+{
+ maFirstColStripeStyle = aStyleName;
+}
+
+void ScDBDataFormatting::SetSecondColStripeStyle( const OUString& aStyleName )
+{
+ maSecondColStripeStyle = aStyleName;
+}