[Libreoffice-commits] core.git: Branch 'feature/gsoc-calc-enhanced-db-range' - 4 commits - sc/Library_sc.mk sc/source sc/uiconfig sc/UIConfig_scalc.mk sw/Module_sw.mk
Akash Shetye
shetyeakash at gmail.com
Sun Sep 22 13:28:42 PDT 2013
sc/Library_sc.mk | 1
sc/UIConfig_scalc.mk | 1
sc/source/filter/excel/xedbdata.cxx | 4 -
sc/source/filter/excel/xestyle.cxx | 18 ++---
sc/source/ui/dbgui/dbformattingdlg.cxx | 60 ++++++++++++++++++
sc/source/ui/dbgui/dbnamdlg.cxx | 14 ++++
sc/source/ui/inc/dbformattingdlg.hrc | 30 +++++++++
sc/source/ui/inc/dbformattingdlg.hxx | 37 +++++++++++
sc/source/ui/inc/dbnamdlg.hrc | 1
sc/source/ui/inc/dbnamdlg.hxx | 3
sc/uiconfig/scalc/ui/dbdataformatting.ui | 70 ++++++++++++++++++++++
sc/uiconfig/scalc/ui/definedatabaserangedialog.ui | 13 ++++
sw/Module_sw.mk | 1
13 files changed, 240 insertions(+), 13 deletions(-)
New commits:
commit 759a4b29e4c45a31cc07a2116615d5ed3456c9ba
Author: Akash Shetye <shetyeakash at gmail.com>
Date: Mon Sep 23 01:24:38 2013 +0530
Trying to add a simple mode less dialog for db formatting;
I am missing something and the program crashes as soon as the dialog is initialized.
Change-Id: If778ccded4c3d1a066483dc4272f764aed630891
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 5b24e6b..73858ab 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -376,6 +376,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/dbgui/csvsplits \
sc/source/ui/dbgui/csvtablebox \
sc/source/ui/dbgui/dbnamdlg \
+ sc/source/ui/dbgui/dbformattingdlg \
sc/source/ui/dbgui/expftext \
$(if $(filter TRUE,$(MPL_SUBSET)),, \
sc/source/ui/dbgui/fieldwnd) \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 43dee84..dcdf2df 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -126,6 +126,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/ungroupdialog \
sc/uiconfig/scalc/ui/validationhelptabpage \
sc/uiconfig/scalc/ui/movecopysheet \
+ sc/uiconfig/scalc/ui/dbdataformatting \
))
# vim: set noet sw=4 ts=4:
diff --git a/sc/source/ui/dbgui/dbformattingdlg.cxx b/sc/source/ui/dbgui/dbformattingdlg.cxx
new file mode 100644
index 0000000..dbcea9422
--- /dev/null
+++ b/sc/source/ui/dbgui/dbformattingdlg.cxx
@@ -0,0 +1,60 @@
+/* -*- 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 <comphelper/string.hxx>
+#include <vcl/msgbox.hxx>
+#include <comphelper/string.hxx>
+#include <vcl/msgbox.hxx>
+#include "reffact.hxx"
+#include "document.hxx"
+#include "scresid.hxx"
+#include "globstr.hrc"
+#include "dbnamdlg.hrc"
+#include "rangenam.hxx" // IsNameValid
+#include "globalnames.hxx"
+#include "dbformattingdlg.hxx"
+
+ScDbFormattingDlg::ScDbFormattingDlg( Window* pParent )
+ : ModalDialog( pParent, "DbDataFormatting", "modules/scalc/ui/dbdataformatting.ui" )
+{
+}
+
+ScDbFormattingDlg::~ScDbFormattingDlg()
+{
+}
+
+void ScDbFormattingDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
+{
+}
+
+sal_Bool ScDbFormattingDlg::Close()
+{
+ return true;
+}
+
+void ScDbFormattingDlg::SetActive()
+{
+ //aEdAssign.GrabFocus();
+ //RefInputDone();
+}
+
+sal_Bool ScDbFormattingDlg::IsRefInputMode() const
+{
+ return false;
+}
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 69447ad..c675aba 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -26,6 +26,7 @@
#include "globstr.hrc"
#include "rangenam.hxx" // IsNameValid
#include "globalnames.hxx"
+#include "dbformattingdlg.hxx"
#include "dbnamdlg.hxx"
@@ -119,7 +120,7 @@ ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
: ScAnyRefDlg(pB, pCW, pParent,
"DefineDatabaseRangeDialog",
"modules/scalc/ui/definedatabaserangedialog.ui")
- , pViewData(ptrViewData)
+ , pViewData( ptrViewData )
, pDoc(ptrViewData->GetDocument())
, bRefInputMode(false)
, aAddrDetails(pDoc->GetAddressConvention(), 0, 0)
@@ -501,6 +502,8 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl)
IMPL_LINK_NOARG(ScDbNameDlg, FormattingBtnHdl)
{
//Invoke the db formatting dialog here
+ //ScDbFormattingDlg* pDbDataFormattingDlg = new ScDbFormattingDlg( mpB, mpCW, GetParent(), pViewData );
+ return 0;
}
namespace {
diff --git a/sc/source/ui/inc/dbformattingdlg.hrc b/sc/source/ui/inc/dbformattingdlg.hrc
new file mode 100644
index 0000000..a32d521
--- /dev/null
+++ b/sc/source/ui/inc/dbformattingdlg.hrc
@@ -0,0 +1,30 @@
+/* -*- 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 "sc.hrc"
+
+#define LB_FIRSTROWSTRIPE 1
+#define LB_SECONDROWSTRIPE 2
+#define LB_FIRSTCOLSTRIPE 3
+#define LB_SECONDROWSTRIPE 4
+#define CB_BANDEDROWS 5
+#define CB_BANDEDCOLUMNS 10
+#define BTN_OK 11
+#define BTN_CANCEL 12
+
diff --git a/sc/source/ui/inc/dbformattingdlg.hxx b/sc/source/ui/inc/dbformattingdlg.hxx
new file mode 100644
index 0000000..ff3ef26
--- /dev/null
+++ b/sc/source/ui/inc/dbformattingdlg.hxx
@@ -0,0 +1,37 @@
+/* -*- 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_DBFORMATTINGDLG_HXX
+#define SC_DBFORMATTINGDLG_HXX
+
+#include "anyrefdg.hxx"
+#include "dbdata.hxx"
+
+class ScDbFormattingDlg : public ModalDialog
+{
+public:
+ ScDbFormattingDlg( Window* pParent );
+ ~ScDbFormattingDlg();
+ virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
+ virtual sal_Bool IsRefInputMode() const;
+ virtual void SetActive();
+ virtual sal_Bool Close();
+};
+
+
+#endif
diff --git a/sc/uiconfig/scalc/ui/dbdataformatting.ui b/sc/uiconfig/scalc/ui/dbdataformatting.ui
new file mode 100644
index 0000000..e24bce0
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/dbdataformatting.ui
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkDialog" id="DbDataFormatting">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Database Range Formatting</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="NameFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkComboBox" id="firstrowstripe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 202c67c..d8ca65e 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -48,7 +48,6 @@ $(eval $(call gb_Module_add_check_targets,sw,\
$(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_htmlexport \
CppunitTest_sw_macros_test \
- CppunitTest_sw_ooxmlexport \
CppunitTest_sw_ooxmlimport \
CppunitTest_sw_ww8export \
CppunitTest_sw_ww8import \
commit 139c74934abe25f2622c0b5b111ade072fad84bd
Author: Akash Shetye <shetyeakash at gmail.com>
Date: Sun Sep 22 15:39:55 2013 +0530
Added the Formatting button to the dbnamedlg
Change-Id: Ie204ce8fcbff39932c889f3b1bc652177b939f42
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index e46ffc4..69447ad 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -142,6 +142,7 @@ ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
get(m_pBtnOk, "ok");
get(m_pBtnCancel, "cancel");
get(m_pBtnAdd, "add");
+ get(m_pBtnFormatting, "formatting");
aStrAdd = m_pBtnAdd->GetText();
aStrModify = get<Window>("modify")->GetText();
get(m_pBtnRemove, "delete");
@@ -178,6 +179,7 @@ void ScDbNameDlg::Init()
m_pBtnCancel->SetClickHdl ( LINK( this, ScDbNameDlg, CancelBtnHdl ) );
m_pBtnAdd->SetClickHdl ( LINK( this, ScDbNameDlg, AddBtnHdl ) );
m_pBtnRemove->SetClickHdl ( LINK( this, ScDbNameDlg, RemoveBtnHdl ) );
+ m_pBtnFormatting->SetClickHdl( LINK( this, ScDbNameDlg, FormattingBtnHdl ) );
m_pEdName->SetModifyHdl ( LINK( this, ScDbNameDlg, NameModifyHdl ) );
m_pEdAssign->SetModifyHdl ( LINK( this, ScDbNameDlg, AssModifyHdl ) );
UpdateNames();
@@ -494,6 +496,13 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl)
return 0;
}
+// ---------------------------------------------------------------------
+
+IMPL_LINK_NOARG(ScDbNameDlg, FormattingBtnHdl)
+{
+ //Invoke the db formatting dialog here
+}
+
namespace {
class FindByName : public ::std::unary_function<ScDBData, bool>
diff --git a/sc/source/ui/inc/dbnamdlg.hrc b/sc/source/ui/inc/dbnamdlg.hrc
index e10abb1..ff99c92 100644
--- a/sc/source/ui/inc/dbnamdlg.hrc
+++ b/sc/source/ui/inc/dbnamdlg.hrc
@@ -40,5 +40,6 @@
#define STR_MODIFY 31
#define STR_DB_INVALID 32
#define BTN_MORE 33
+#define BTN_FORMATTING 34
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index e36b622..ec6ac5f 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -68,6 +68,7 @@ private:
CancelButton* m_pBtnCancel;
PushButton* m_pBtnAdd;
PushButton* m_pBtnRemove;
+ PushButton* m_pBtnFormatting;
sal_Bool bSaved;
@@ -99,6 +100,8 @@ private:
DECL_LINK( RemoveBtnHdl, void * );
DECL_LINK( NameModifyHdl, void * );
DECL_LINK( AssModifyHdl, void * );
+ DECL_LINK( FormattingBtnHdl, void * );
+
};
diff --git a/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui b/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
index 4305eae..83522a5 100644
--- a/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
+++ b/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
@@ -321,6 +321,19 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="formatting">
+ <property name="label">Formatting</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="recieves_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
commit 97a19389c398dc0aab5d520c61d7d4e9aba2cd11
Author: Akash Shetye <shetyeakash at gmail.com>
Date: Wed Sep 18 23:54:58 2013 +0530
Corrected the [Content_type].xml data
Change-Id: I0745088c52c9626de0b131c58126b7cd57c06976
diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx
index 502ea15..0e2c102 100644
--- a/sc/source/filter/excel/xedbdata.cxx
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -142,8 +142,8 @@ void XclExpXmlDBDataTables::SaveXml( XclExpXmlStream& rStrm )
OUString( "xl/tables/table" )+ OUString::number( i ) + OUString(".xml" ),
OUString( "table" ) + OUString::number( i ) + OUString( ".xml" ),
rStrm.GetCurrentStream()->getOutputStream(),
- "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
- "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" );// Last two parameters are a mystery
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" );// imp for xlsx import
rStrm.PushStream( aDBDataTable );
//Now the table#.xml file is created, need to pass the stream to that table
itr->SaveXml( rStrm );
commit 1bf44abe54c2c2f7d0deeb08ad6280021893fb65
Author: Akash Shetye <shetyeakash at gmail.com>
Date: Fri Aug 30 19:49:20 2013 +0530
Table (DB Range) style export now considers stripe size
Change-Id: Ifed63e1c3534ec880a4bcc5acb0ee4ea7809a26f
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index c52ff30..d1615b6 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -3164,31 +3164,31 @@ XclExpTableStyle::XclExpTableStyle( const XclExpRoot& rRoot, ScDBDataFormatting&
//Keep adding table style elements
OUString aStyleString;
OUString aElementType;
- int aiDxfId;
+ sal_Int32 nDxfId;
if( !(aStyleString = maTableStyle.GetFirstRowStripeStyle()).isEmpty() )
{
//Resolve this string style sheet name to a dxf id
- aiDxfId = rDxfs.GetDxfId( aStyleString );
+ nDxfId = rDxfs.GetDxfId( aStyleString );
aElementType = "firstRowStripe";
- maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, 1, aiDxfId ) );
+ maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, maTableStyle.GetFirstRowStripeSize(), nDxfId ) );
}
if( !(aStyleString = maTableStyle.GetSecondRowStripeStyle()).isEmpty() )
{
- aiDxfId = rDxfs.GetDxfId( aStyleString );
+ nDxfId = rDxfs.GetDxfId( aStyleString );
aElementType = "secondRowStripe";
- maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, 1, aiDxfId ) );
+ maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, maTableStyle.GetSecondRowStripeSize(), nDxfId ) );
}
if( !(aStyleString = maTableStyle.GetFirstColStripeStyle()).isEmpty() )
{
- aiDxfId = rDxfs.GetDxfId( aStyleString );
+ nDxfId = rDxfs.GetDxfId( aStyleString );
aElementType = "firstColumnStripe";
- maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, 1, aiDxfId ) );
+ maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, maTableStyle.GetFirstColStripeSize(), nDxfId ) );
}
if( !(aStyleString = maTableStyle.GetSecondColStripeStyle()).isEmpty() )
{
- aiDxfId = rDxfs.GetDxfId( aStyleString );
+ nDxfId = rDxfs.GetDxfId( aStyleString );
aElementType = "secondColumnStripe";
- maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, 1, aiDxfId ) );
+ maStyleElementContainer.push_back( new XclExpTableStyleElement( rRoot, aElementType, maTableStyle.GetSecondColStripeSize(), nDxfId ) );
}
miCount = maStyleElementContainer.size();
}
More information about the Libreoffice-commits
mailing list