diff options
-rw-r--r-- | sc/AllLangResTarget_sc.mk | 1 | ||||
-rw-r--r-- | sc/UIConfig_scalc.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 2 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 19 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/subtdlg.cxx | 25 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsubt.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/subtdlg.hrc | 37 | ||||
-rw-r--r-- | sc/source/ui/inc/subtdlg.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/src/subtdlg.src | 69 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 6 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/subtotaldialog.ui | 176 |
13 files changed, 199 insertions, 149 deletions
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk index abeb023c6708..e2ddb93690ad 100644 --- a/sc/AllLangResTarget_sc.mk +++ b/sc/AllLangResTarget_sc.mk @@ -43,7 +43,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ sc/source/ui/src/textdlgs.src \ sc/source/ui/src/sc.src \ sc/source/ui/src/pseudo.src \ - sc/source/ui/src/subtdlg.src \ sc/source/ui/src/hdrcont.src \ sc/source/ui/src/scerrors.src \ sc/source/ui/src/simpref.src \ diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index fb8b69658217..8e1cb1386a6b 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -132,6 +132,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/sortkey \ sc/uiconfig/scalc/ui/sortoptionspage \ sc/uiconfig/scalc/ui/sortwarning \ + sc/uiconfig/scalc/ui/subtotaldialog \ sc/uiconfig/scalc/ui/subtotaloptionspage \ sc/uiconfig/scalc/ui/subtotalgrppage \ sc/uiconfig/scalc/ui/statisticsinfopage \ diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index a1de7167949f..dafcf69268f2 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1004,7 +1004,7 @@ #define RID_SCDLG_NAMES (SC_DIALOGS_START + 22) #define RID_SCDLG_DBNAMES (SC_DIALOGS_START + 23) #define RID_SCDLG_SOLVER (SC_DIALOGS_START + 26) -#define RID_SCDLG_SUBTOTALS (SC_DIALOGS_START + 27) + #define RID_SCPAGE_SUBT_OPTIONS (SC_DIALOGS_START + 29) #define RID_SCPAGE_USERLISTS (SC_DIALOGS_START + 31) #define RID_SCDLG_PIVOTFILTER (SC_DIALOGS_START + 33) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index cdd08eb4cef7..84146181b299 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -492,8 +492,7 @@ public: int nId) = 0; virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent, - const SfxItemSet* pArgSet, - int nId) = 0; + const SfxItemSet* pArgSet ) = 0; virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell, int nId ) = 0; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index c77952655ff6..cf31147be055 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -1157,23 +1157,10 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( Window* return 0; } -SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg( Window* pParent, - const SfxItemSet* pArgSet, - int nId) +SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet) { - SfxTabDialog* pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_SUBTOTALS : - pDlg = new ScSubTotalDlg( pParent, pArgSet ); - break; - default: - break; - } - - if ( pDlg ) - return new ScAbstractTabDialog_Impl( pDlg ); - return 0; + SfxTabDialog* pDlg = new ScSubTotalDlg( pParent, pArgSet ); + return new ScAbstractTabDialog_Impl( pDlg ); } SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 07cc57788d81..55b8ab45de0b 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -560,8 +560,7 @@ public: int nId); virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window* pParent, - const SfxItemSet* pArgSet, - int nId); + const SfxItemSet* pArgSet ); virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell, int nId ); diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx index 6be149efe12a..fd6545136a76 100644 --- a/sc/source/ui/dbgui/subtdlg.cxx +++ b/sc/source/ui/dbgui/subtdlg.cxx @@ -25,31 +25,28 @@ #include "tpsubt.hxx" #include "scresid.hxx" #include "subtdlg.hxx" -#include "subtdlg.hrc" //================================================================== -ScSubTotalDlg::ScSubTotalDlg( Window* pParent, - const SfxItemSet* pArgSet ) : - SfxTabDialog( pParent, - ScResId( RID_SCDLG_SUBTOTALS ), - pArgSet ), - aBtnRemove ( m_pActionArea, ScResId( BTN_REMOVE ) ) +ScSubTotalDlg::ScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet) + : SfxTabDialog(pParent, "SubTotalDialog", + "modules/scalc/ui/subtotaldialog.ui", pArgSet) { - AddTabPage( PAGE_GROUP1, ScTpSubTotalGroup1::Create, 0 ); - AddTabPage( PAGE_GROUP2, ScTpSubTotalGroup2::Create, 0 ); - AddTabPage( PAGE_GROUP3, ScTpSubTotalGroup3::Create, 0 ); - AddTabPage( PAGE_OPTIONS, ScTpSubTotalOptions::Create, 0 ); - aBtnRemove.SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) ); - FreeResource(); + get(m_pBtnRemove, "remove"); + + AddTabPage("1stgroup", ScTpSubTotalGroup1::Create, 0); + AddTabPage("2ndgroup", ScTpSubTotalGroup2::Create, 0); + AddTabPage("3rdgroup", ScTpSubTotalGroup3::Create, 0); + AddTabPage("options", ScTpSubTotalOptions::Create, 0); + m_pBtnRemove->SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) ); } //------------------------------------------------------------------------ IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn ) { - if ( pBtn == &aBtnRemove ) + if (pBtn == m_pBtnRemove) { EndDialog( SCRET_REMOVE ); } diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 28fb52a35bcc..7f777a920b87 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -29,7 +29,6 @@ #include "sc.hrc" #include "subtdlg.hxx" -#include "subtdlg.hrc" #include "tpsubt.hxx" //======================================================================== diff --git a/sc/source/ui/inc/subtdlg.hrc b/sc/source/ui/inc/subtdlg.hrc deleted file mode 100644 index a5736cc67d61..000000000000 --- a/sc/source/ui/inc/subtdlg.hrc +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- 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" - -// TabDialog -#define BTN_REMOVE 1 -#define PAGE_GROUP1 2 -#define PAGE_GROUP2 3 -#define PAGE_GROUP3 4 -#define PAGE_OPTIONS 5 - -// Groups TabPages -#define FT_GROUP 10 -#define LB_GROUP 11 -#define FT_COLUMNS 12 -#define WND_COLUMNS 13 -#define LB_FUNCTIONS 14 -#define FT_FUNCTIONS 15 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/subtdlg.hxx b/sc/source/ui/inc/subtdlg.hxx index 1124197bc7af..1a387c8b960c 100644 --- a/sc/source/ui/inc/subtdlg.hxx +++ b/sc/source/ui/inc/subtdlg.hxx @@ -29,10 +29,9 @@ class ScSubTotalDlg : public SfxTabDialog { public: - ScSubTotalDlg( Window* pParent, - const SfxItemSet* pArgSet ); + ScSubTotalDlg(Window* pParent, const SfxItemSet* pArgSet); private: - PushButton aBtnRemove; + PushButton* m_pBtnRemove; DECL_LINK( RemoveHdl, PushButton * ); }; diff --git a/sc/source/ui/src/subtdlg.src b/sc/source/ui/src/subtdlg.src deleted file mode 100644 index 227690889c68..000000000000 --- a/sc/source/ui/src/subtdlg.src +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- 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 "subtdlg.hrc" - -TabDialog RID_SCDLG_SUBTOTALS -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 294 , 176 ) ; - Text [ en-US ] = "Subtotals" ; - Moveable = TRUE ; - Closeable = FALSE ; - TabControl 1 - { - OutputSize = TRUE ; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 240 , 150 ) ; - PageList = - { - PageItem - { - Identifier = PAGE_GROUP1 ; - Text [ en-US ] = "1st Group" ; - }; - PageItem - { - Identifier = PAGE_GROUP2 ; - Text [ en-US ] = "2nd Group" ; - }; - PageItem - { - Identifier = PAGE_GROUP3 ; - Text [ en-US ] = "3rd Group" ; - }; - PageItem - { - Identifier = PAGE_OPTIONS ; - Text [ en-US ] = "Options" ; - }; - }; - }; - PushButton BTN_REMOVE - { - Pos = MAP_APPFONT ( 143 , 160 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Text [ en-US ] = "~Delete" ; - TabStop = TRUE ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 659307c850dd..2f64ea6fc519 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2729,10 +2729,10 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, GetViewData(), &aSubTotalParam ) ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); + assert(pFact); //"ScAbstractFactory create fail - pDlg = pFact->CreateScSubTotalDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SUBTOTALS ); - OSL_ENSURE(pDlg, "Dialog create fail!"); + pDlg = pFact->CreateScSubTotalDlg(pTabViewShell->GetDialogParent(), &aArgSet); + assert(pDlg); // "Dialog create fail pDlg->SetCurPageId(1); short bResult = pDlg->Execute(); diff --git a/sc/uiconfig/scalc/ui/subtotaldialog.ui b/sc/uiconfig/scalc/ui/subtotaldialog.ui new file mode 100644 index 000000000000..c878a405d53a --- /dev/null +++ b/sc/uiconfig/scalc/ui/subtotaldialog.ui @@ -0,0 +1,176 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="SubTotalDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Subtotals</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 internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="remove"> + <property name="label">gtk-remove</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkNotebook" id="tabcontrol"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="1stgroup"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">1st Group</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="2ndgroup"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">2nd Group</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="3rdgroup"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">3rd Group</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child type="tab"> + <object class="GtkLabel" id="options"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Options</property> + </object> + <packing> + <property name="position">3</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + <action-widget response="0">reset</action-widget> + <action-widget response="0">remove</action-widget> + </action-widgets> + </object> +</interface> |