summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-05-01 00:31:46 +0200
committerEike Rathke <erack@redhat.com>2015-05-01 02:42:43 +0200
commita1fed7b55e44fd2a2dd525ebf6459f452210b15c (patch)
treef2e0a0e7de9e68b822ef804750eadd0e5d64b740
parentdd59b3aaf65d326f209a774da7aa612b2247a0fb (diff)
add "Contains totals row" to database range dialog
Change-Id: Ibdd144158f1484cf0e8c3861b6f3758a03638434
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx27
-rw-r--r--sc/source/ui/inc/dbnamdlg.hxx1
-rw-r--r--sc/uiconfig/scalc/ui/definedatabaserangedialog.ui28
3 files changed, 45 insertions, 11 deletions
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 3343c90181c5..ed7d7ad72b05 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -50,15 +50,17 @@ static DBSaveData* pSaveObj = NULL;
class DBSaveData
{
public:
- DBSaveData( Edit& rEd, CheckBox& rHdr, CheckBox& rSize, CheckBox& rFmt,
+ DBSaveData( Edit& rEd, CheckBox& rHdr, CheckBox& rTot, CheckBox& rSize, CheckBox& rFmt,
CheckBox& rStrip, ScRange& rArea )
: rEdAssign(rEd)
, rBtnHeader(rHdr)
+ , rBtnTotals(rTot)
, rBtnSize(rSize)
, rBtnFormat(rFmt)
, rBtnStrip(rStrip)
, rCurArea(rArea)
, bHeader(false)
+ , bTotals(false)
, bSize(false)
, bFormat(false)
, bStrip(false)
@@ -71,6 +73,7 @@ public:
private:
Edit& rEdAssign;
CheckBox& rBtnHeader;
+ CheckBox& rBtnTotals;
CheckBox& rBtnSize;
CheckBox& rBtnFormat;
CheckBox& rBtnStrip;
@@ -78,6 +81,7 @@ private:
OUString aStr;
ScRange aArea;
bool bHeader:1;
+ bool bTotals:1;
bool bSize:1;
bool bFormat:1;
bool bStrip:1;
@@ -89,6 +93,7 @@ void DBSaveData::Save()
aArea = rCurArea;
aStr = rEdAssign.GetText();
bHeader = rBtnHeader.IsChecked();
+ bTotals = rBtnTotals.IsChecked();
bSize = rBtnSize.IsChecked();
bFormat = rBtnFormat.IsChecked();
bStrip = rBtnStrip.IsChecked();
@@ -102,6 +107,7 @@ void DBSaveData::Restore()
rCurArea = aArea;
rEdAssign.SetText( aStr );
rBtnHeader.Check ( bHeader );
+ rBtnTotals.Check ( bTotals );
rBtnSize.Check ( bSize );
rBtnFormat.Check ( bFormat );
rBtnStrip.Check ( bStrip );
@@ -131,6 +137,7 @@ ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPar
m_pRbAssign->SetReferences(this, m_pEdAssign);
get(m_pOptions, "Options");
get(m_pBtnHeader, "ContainsColumnLabels");
+ get(m_pBtnTotals, "ContainsTotalsRow");
get(m_pBtnDoSize, "InsertOrDeleteCells");
get(m_pBtnKeepFmt, "KeepFormatting");
get(m_pBtnStripData, "DontSaveImportedData");
@@ -151,7 +158,7 @@ ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPar
aStrSource = m_pFTSource->GetText();
aStrOperations = m_pFTOperations->GetText();
- pSaveObj = new DBSaveData( *m_pEdAssign, *m_pBtnHeader,
+ pSaveObj = new DBSaveData( *m_pEdAssign, *m_pBtnHeader, *m_pBtnTotals,
*m_pBtnDoSize, *m_pBtnKeepFmt, *m_pBtnStripData, theCurArea );
Init();
}
@@ -170,6 +177,7 @@ void ScDbNameDlg::dispose()
m_pRbAssign.clear();
m_pOptions.clear();
m_pBtnHeader.clear();
+ m_pBtnTotals.clear();
m_pBtnDoSize.clear();
m_pBtnKeepFmt.clear();
m_pBtnStripData.clear();
@@ -184,7 +192,8 @@ void ScDbNameDlg::dispose()
void ScDbNameDlg::Init()
{
- m_pBtnHeader->Check( true ); // Default: mit Spaltenkoepfen
+ m_pBtnHeader->Check( true ); // Default: with column headers
+ m_pBtnTotals->Check( false ); // Default: without totals row
m_pBtnDoSize->Check( true );
m_pBtnKeepFmt->Check( true );
@@ -243,6 +252,7 @@ void ScDbNameDlg::Init()
m_pEdName->SetText(aDBName);
m_pBtnHeader->Check( pDBData->HasHeader() );
+ m_pBtnTotals->Check( pDBData->HasTotals() );
m_pBtnDoSize->Check( pDBData->IsDoSize() );
m_pBtnKeepFmt->Check( pDBData->IsKeepFmt() );
m_pBtnStripData->Check( pDBData->IsStripData() );
@@ -364,6 +374,7 @@ void ScDbNameDlg::UpdateDBData( const OUString& rStrName )
m_pEdAssign->SetText( theArea );
m_pBtnAdd->SetText( aStrModify );
m_pBtnHeader->Check( pData->HasHeader() );
+ m_pBtnTotals->Check( pData->HasTotals() );
m_pBtnDoSize->Check( pData->IsDoSize() );
m_pBtnKeepFmt->Check( pData->IsKeepFmt() );
m_pBtnStripData->Check( pData->IsStripData() );
@@ -433,6 +444,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl)
aEnd.Col(), aEnd.Row() );
pOldEntry->SetByRow( true );
pOldEntry->SetHeader( m_pBtnHeader->IsChecked() );
+ pOldEntry->SetTotals( m_pBtnTotals->IsChecked() );
pOldEntry->SetDoSize( m_pBtnDoSize->IsChecked() );
pOldEntry->SetKeepFmt( m_pBtnKeepFmt->IsChecked() );
pOldEntry->SetStripData( m_pBtnStripData->IsChecked() );
@@ -445,6 +457,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl)
aStart.Col(), aStart.Row(),
aEnd.Col(), aEnd.Row(),
true, m_pBtnHeader->IsChecked() );
+ pNewEntry->SetTotals( m_pBtnTotals->IsChecked() );
pNewEntry->SetDoSize( m_pBtnDoSize->IsChecked() );
pNewEntry->SetKeepFmt( m_pBtnKeepFmt->IsChecked() );
pNewEntry->SetStripData( m_pBtnStripData->IsChecked() );
@@ -461,7 +474,8 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl)
m_pBtnAdd->Disable();
m_pBtnRemove->Disable();
m_pEdAssign->SetText( EMPTY_OUSTRING );
- m_pBtnHeader->Check( true ); // Default: mit Spaltenkoepfen
+ m_pBtnHeader->Check( true ); // Default: with column headers
+ m_pBtnTotals->Check( false ); // Default: without totals row
m_pBtnDoSize->Check( false );
m_pBtnKeepFmt->Check( false );
m_pBtnStripData->Check( false );
@@ -541,7 +555,8 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl)
m_pBtnRemove->Disable();
m_pEdAssign->SetText( EMPTY_OUSTRING );
theCurArea = ScRange();
- m_pBtnHeader->Check( true ); // Default: mit Spaltenkoepfen
+ m_pBtnHeader->Check( true ); // Default: with column headers
+ m_pBtnTotals->Check( false ); // Default: without totals row
m_pBtnDoSize->Check( false );
m_pBtnKeepFmt->Check( false );
m_pBtnStripData->Check( false );
@@ -631,6 +646,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AssModifyHdl)
{
m_pBtnAdd->Enable();
m_pBtnHeader->Enable();
+ m_pBtnTotals->Enable();
m_pBtnDoSize->Enable();
m_pBtnKeepFmt->Enable();
m_pBtnStripData->Enable();
@@ -641,6 +657,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AssModifyHdl)
{
m_pBtnAdd->Disable();
m_pBtnHeader->Disable();
+ m_pBtnTotals->Disable();
m_pBtnDoSize->Disable();
m_pBtnKeepFmt->Disable();
m_pBtnStripData->Disable();
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index 032b8e9df704..41fb9a5f91b4 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -55,6 +55,7 @@ private:
VclPtr<VclContainer> m_pOptions;
VclPtr<CheckBox> m_pBtnHeader;
+ VclPtr<CheckBox> m_pBtnTotals;
VclPtr<CheckBox> m_pBtnDoSize;
VclPtr<CheckBox> m_pBtnKeepFmt;
VclPtr<CheckBox> m_pBtnStripData;
diff --git a/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui b/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
index 41f3604279cd..0d1a5666d3f5 100644
--- a/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
+++ b/sc/uiconfig/scalc/ui/definedatabaserangedialog.ui
@@ -225,6 +225,22 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="ContainsTotalsRow">
+ <property name="label" translatable="yes">Contains _totals row</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton" id="InsertOrDeleteCells">
<property name="label" translatable="yes">Insert or delete _cells</property>
<property name="visible">True</property>
@@ -237,7 +253,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -253,7 +269,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -269,7 +285,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -282,7 +298,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
@@ -295,7 +311,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
<child>
@@ -308,7 +324,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">6</property>
+ <property name="position">7</property>
</packing>
</child>
</object>