[Libreoffice-commits] core.git: 3 commits - cui/source sc/inc sc/source sc/uiconfig

Eike Rathke erack at redhat.com
Thu Apr 30 17:43:33 PDT 2015


 cui/source/dialogs/about.cxx                      |    2 -
 sc/inc/dbdata.hxx                                 |    2 -
 sc/source/core/tool/dbdata.cxx                    |    6 ++--
 sc/source/ui/dbgui/dbnamdlg.cxx                   |   29 +++++++++++++++++-----
 sc/source/ui/inc/dbnamdlg.hxx                     |    1 
 sc/uiconfig/scalc/ui/definedatabaserangedialog.ui |   28 ++++++++++++++++-----
 6 files changed, 51 insertions(+), 17 deletions(-)

New commits:
commit 5a24b94662414fb9470be9c5d9c8b28c6ad42b5b
Author: Eike Rathke <erack at redhat.com>
Date:   Fri May 1 01:08:13 2015 +0200

    add totals to ScDBData ctor
    
    Change-Id: I798376268b15f8b2f340d48fd2e38d68e53dbc6f

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 2da067a..30c1106 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -79,7 +79,7 @@ public:
     SC_DLLPUBLIC ScDBData(const OUString& rName,
              SCTAB nTab,
              SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-             bool bByR = true, bool bHasH = true);
+             bool bByR = true, bool bHasH = true, bool bTotals = false);
     ScDBData(const ScDBData& rData);
     ScDBData(const OUString& rName, const ScDBData& rData);
     virtual ~ScDBData();
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 64bb384..56b0bc8 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -51,7 +51,7 @@ bool ScDBData::less::operator() (const ScDBData& left, const ScDBData& right) co
 ScDBData::ScDBData( const OUString& rName,
                     SCTAB nTab,
                     SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                    bool bByR, bool bHasH) :
+                    bool bByR, bool bHasH, bool bTotals) :
     mpSortParam(new ScSortParam),
     mpQueryParam(new ScQueryParam),
     mpSubTotal(new ScSubTotalParam),
@@ -65,7 +65,7 @@ ScDBData::ScDBData( const OUString& rName,
     nEndRow     (nRow2),
     bByRow      (bByR),
     bHasHeader  (bHasH),
-    bHasTotals  (false),
+    bHasTotals  (bTotals),
     bDoSize     (false),
     bKeepFmt    (false),
     bStripData  (false),
@@ -783,7 +783,7 @@ ScDBData* ScDBCollection::AnonDBs::getByRange(const ScRange& rRange)
         OUString aName(STR_DB_GLOBAL_NONAME);
         ::std::unique_ptr<ScDBData> pNew(new ScDBData(
             aName, rRange.aStart.Tab(), rRange.aStart.Col(), rRange.aStart.Row(),
-            rRange.aEnd.Col(), rRange.aEnd.Row(), true, false));
+            rRange.aEnd.Col(), rRange.aEnd.Row(), true, false, false));
         pData = pNew.get();
         o3tl::ptr_container::push_back(maDBs, std::move(pNew));
     }
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index ed7d7ad..ca24f23 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -456,8 +456,8 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl)
                     ScDBData* pNewEntry = new ScDBData( aNewName, aStart.Tab(),
                                                         aStart.Col(), aStart.Row(),
                                                         aEnd.Col(), aEnd.Row(),
-                                                        true, m_pBtnHeader->IsChecked() );
-                    pNewEntry->SetTotals( m_pBtnTotals->IsChecked() );
+                                                        true, m_pBtnHeader->IsChecked(),
+                                                        m_pBtnTotals->IsChecked() );
                     pNewEntry->SetDoSize( m_pBtnDoSize->IsChecked() );
                     pNewEntry->SetKeepFmt( m_pBtnKeepFmt->IsChecked() );
                     pNewEntry->SetStripData( m_pBtnStripData->IsChecked() );
commit a1fed7b55e44fd2a2dd525ebf6459f452210b15c
Author: Eike Rathke <erack at redhat.com>
Date:   Fri May 1 00:31:46 2015 +0200

    add "Contains totals row" to database range dialog
    
    Change-Id: Ibdd144158f1484cf0e8c3861b6f3758a03638434

diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 3343c90..ed7d7ad 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 032b8e9..41fb9a5 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 41f3604..0d1a566 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>
commit dd59b3aaf65d326f209a774da7aa612b2247a0fb
Author: Eike Rathke <erack at redhat.com>
Date:   Fri May 1 00:14:07 2015 +0200

    better use application settings
    
    It doesn't really matter, just saves some cycles looking up the system
    locale.
    
    Change-Id: I8895593b445c49f167f26bcbf510c12a3c25e1d4

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index e1a6194..aec33dd 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -281,7 +281,7 @@ OUString AboutDialog::GetVersionString()
 
     OUString sBuildId = GetBuildId();
 
-    OUString aLocaleStr = LanguageTag( LANGUAGE_SYSTEM).getBcp47() + " (" + GetLocaleString() + ")";
+    OUString aLocaleStr = Application::GetSettings().GetLanguageTag().getBcp47() + " (" + GetLocaleString() + ")";
 
     if (!sBuildId.trim().isEmpty())
     {


More information about the Libreoffice-commits mailing list