diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-07 13:50:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-07 16:17:53 +0000 |
commit | ca100d7bacf63b595723698af58f165eb8e79887 (patch) | |
tree | 7d9ad3caa92d6307de387eec00134a3148e1db44 /sw | |
parent | 6b3686e54520b5cf02d6ce03aa421c755a33b140 (diff) |
adapt code to bullets and numbering dialog .ui
Change-Id: I219f851d570dcfb54a6162d2a881dff70ae10e79
Diffstat (limited to 'sw')
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/source/ui/inc/num.hxx | 6 | ||||
-rw-r--r-- | sw/source/ui/misc/num.cxx | 117 | ||||
-rw-r--r-- | sw/source/ui/misc/num.hrc | 19 | ||||
-rw-r--r-- | sw/source/ui/misc/num.src | 80 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/bulletsandnumbering.ui | 46 |
6 files changed, 82 insertions, 187 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index a57daca763eb..f5545492e86f 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -141,7 +141,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/misc/docfnote.src \ sw/source/ui/misc/glosbib.src \ sw/source/ui/misc/glossary.src \ - sw/source/ui/misc/num.src \ sw/source/ui/misc/numberingtypelistbox.src \ sw/source/ui/misc/outline.src \ sw/source/ui/misc/pgfnote.src \ diff --git a/sw/source/ui/inc/num.hxx b/sw/source/ui/inc/num.hxx index 379cc230bb88..2af7c5f6e357 100644 --- a/sw/source/ui/inc/num.hxx +++ b/sw/source/ui/inc/num.hxx @@ -147,8 +147,10 @@ public: class SwSvxNumBulletTabDialog : public SfxTabDialog { SwWrtShell& rWrtSh; - - String sRemoveText; + sal_uInt16 m_nSingleNumPageId; + sal_uInt16 m_nBulletPageId; + sal_uInt16 m_nOptionsPageId; + sal_uInt16 m_nPositionPageId; protected: virtual short Ok(); diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index bd74e07bce39..c3bbaa60a01b 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -45,7 +45,6 @@ #include <misc.hrc> #include <frmui.hrc> -#include <num.hrc> #include <globals.hrc> #include <helpid.h> #include <SwStyleNameMapper.hxx> @@ -916,24 +915,20 @@ void SwNumPositionTabPage::SetModified(sal_Bool bRepaint) #endif SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(Window* pParent, - const SfxItemSet* pSwItemSet, SwWrtShell & rSh) : - SfxTabDialog(pParent, SW_RES(DLG_SVXTEST_NUM_BULLET), pSwItemSet, sal_False, &aEmptyStr), - rWrtSh(rSh), - sRemoveText(SW_RES(ST_RESET)) + const SfxItemSet* pSwItemSet, SwWrtShell & rSh) + : SfxTabDialog(pParent, "BulletsAndNumberingDialog", + "modules/swriter/ui/bulletsandnumbering.ui", + pSwItemSet, sal_False) + , rWrtSh(rSh) { - FreeResource(); - GetUserButton()->SetText(sRemoveText); - GetUserButton()->SetHelpId(HID_NUM_RESET); GetUserButton()->SetClickHdl(LINK(this, SwSvxNumBulletTabDialog, RemoveNumberingHdl)); - if(!rWrtSh.GetCurNumRule()) - GetUserButton()->Enable(sal_False); - AddTabPage( RID_SVXPAGE_PICK_SINGLE_NUM ); - AddTabPage( RID_SVXPAGE_PICK_BULLET ); - AddTabPage( RID_SVXPAGE_PICK_NUM ); - AddTabPage( RID_SVXPAGE_PICK_BMP ); - AddTabPage( RID_SVXPAGE_NUM_OPTIONS ); - AddTabPage( RID_SVXPAGE_NUM_POSITION ); - + GetUserButton()->Enable(rWrtSh.GetCurNumRule() != NULL); + m_nSingleNumPageId = AddTabPage("singlenum", RID_SVXPAGE_PICK_SINGLE_NUM ); + m_nBulletPageId = AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET ); + AddTabPage("outlinenum", RID_SVXPAGE_PICK_NUM ); + AddTabPage("graphics", RID_SVXPAGE_PICK_BMP ); + m_nOptionsPageId = AddTabPage("options", RID_SVXPAGE_NUM_OPTIONS ); + m_nPositionPageId = AddTabPage("position", RID_SVXPAGE_NUM_POSITION ); } SwSvxNumBulletTabDialog::~SwSvxNumBulletTabDialog() @@ -947,56 +942,48 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt ); SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt ); - switch ( nPageId ) + if (nPageId == m_nSingleNumPageId) { - case RID_SVXPAGE_PICK_NUM: - { - SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); - aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); - rPage.PageCreated(aSet); - } - break; - case RID_SVXPAGE_PICK_BULLET : - { - SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); - rPage.PageCreated(aSet); - } - break; + SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); + aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); + aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); + rPage.PageCreated(aSet); + } + else if (nPageId == m_nBulletPageId) + { + SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); + aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); + rPage.PageCreated(aSet); + } + else if (nPageId == m_nOptionsPageId) + { + SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); + aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); + aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); + // collect char styles + ListBox rCharFmtLB(this); + rCharFmtLB.Clear(); + rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone ); + SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell(); + ::FillCharStyleListBox(rCharFmtLB, pDocShell); - case RID_SVXPAGE_NUM_OPTIONS: - { - SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); - aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); - // collect char styles - ListBox rCharFmtLB(this); - rCharFmtLB.Clear(); - rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone ); - SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell(); - ::FillCharStyleListBox(rCharFmtLB, pDocShell); - - std::vector<String> aList; - for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++) - aList.push_back( String(rCharFmtLB.GetEntry(j))); - - aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ; - - FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell)); - aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric) ) ); - rPage.PageCreated(aSet); - } - break; - case RID_SVXPAGE_NUM_POSITION: - { - SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell(); - FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell)); - SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)) ); - rPage.PageCreated(aSet); - } - break; + std::vector<String> aList; + for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++) + aList.push_back( String(rCharFmtLB.GetEntry(j))); + + aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ; + + FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell)); + aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric) ) ); + rPage.PageCreated(aSet); + } + else if (nPageId == m_nPositionPageId) + { + SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell(); + FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell)); + SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); + aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)) ); + rPage.PageCreated(aSet); } } diff --git a/sw/source/ui/misc/num.hrc b/sw/source/ui/misc/num.hrc deleted file mode 100644 index c2c9c4a1abb2..000000000000 --- a/sw/source/ui/misc/num.hrc +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 . - */ - -#define ST_RESET 1 diff --git a/sw/source/ui/misc/num.src b/sw/source/ui/misc/num.src deleted file mode 100644 index f6efa09b2425..000000000000 --- a/sw/source/ui/misc/num.src +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 . - */ -/* StarView resource file */ - - -#include "globals.hrc" -#include "misc.hrc" -#include "num.hrc" -#include "cmdid.h" -#include "helpid.h" -#include "svx/dialogs.hrc" - -/**************************************************************************/ -/* */ -/* dialog for Svx-implementation's test */ -/* */ -/**************************************************************************/ -TabDialog DLG_SVXTEST_NUM_BULLET -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "Bullets and Numbering"; - Moveable = TRUE ; - TabControl 1 - { - SVLook = TRUE ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_PICK_BULLET ; - Text [ en-US ] = "Bullets" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_PICK_SINGLE_NUM ; - Text [ en-US ] = "Numbering type" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_PICK_NUM ; - Text [ en-US ] = "Outline" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_PICK_BMP ; - Text [ en-US ] = "Graphics" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_NUM_POSITION ; - Text [ en-US ] = "Position" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_NUM_OPTIONS ; - Text [ en-US ] = "Options" ; - }; - }; - }; - String ST_RESET - { - Text [ en-US ] = "~Remove" ; - }; -}; diff --git a/sw/uiconfig/swriter/ui/bulletsandnumbering.ui b/sw/uiconfig/swriter/ui/bulletsandnumbering.ui index 5bea0aa52c45..eeb90ffb557b 100644 --- a/sw/uiconfig/swriter/ui/bulletsandnumbering.ui +++ b/sw/uiconfig/swriter/ui/bulletsandnumbering.ui @@ -1,9 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.0 --> - <object class="GtkDialog" id="Bullets And Numbering "> + <object class="GtkDialog" id="BulletsAndNumberingDialog"> <property name="can_focus">False</property> <property name="border_width">5</property> + <property name="title" translatable="yes">Bullets and Numbering</property> <property name="window_position">mouse</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> @@ -16,10 +17,12 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="button2"> + <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> @@ -30,11 +33,12 @@ </packing> </child> <child> - <object class="GtkButton" id="button3"> - <property name="label" translatable="yes">Remove</property> + <object class="GtkButton" id="user"> + <property name="label" translatable="yes">_Remove</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> @@ -43,7 +47,7 @@ </packing> </child> <child> - <object class="GtkButton" id="button4"> + <object class="GtkButton" id="cancel"> <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -57,7 +61,7 @@ </packing> </child> <child> - <object class="GtkButton" id="button5"> + <object class="GtkButton" id="help"> <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -71,7 +75,7 @@ </packing> </child> <child> - <object class="GtkButton" id="button6"> + <object class="GtkButton" id="reset"> <property name="label" translatable="yes">Reset</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -92,14 +96,16 @@ </packing> </child> <child> - <object class="GtkNotebook" id="notebook1"> + <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="label24"> + <object class="GtkLabel" id="bullets"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Bullets</property> @@ -112,7 +118,7 @@ <placeholder/> </child> <child type="tab"> - <object class="GtkLabel" id="label22"> + <object class="GtkLabel" id="singlenum"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0.49000000953674316</property> @@ -127,7 +133,7 @@ <placeholder/> </child> <child type="tab"> - <object class="GtkLabel" id="label20"> + <object class="GtkLabel" id="outlinenum"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Outline</property> @@ -141,7 +147,7 @@ <placeholder/> </child> <child type="tab"> - <object class="GtkLabel" id="label18"> + <object class="GtkLabel" id="graphics"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Graphics</property> @@ -155,7 +161,7 @@ <placeholder/> </child> <child type="tab"> - <object class="GtkLabel" id="label10"> + <object class="GtkLabel" id="position"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Position</property> @@ -169,7 +175,7 @@ <placeholder/> </child> <child type="tab"> - <object class="GtkLabel" id="label3"> + <object class="GtkLabel" id="options"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Options</property> @@ -181,7 +187,7 @@ </child> </object> <packing> - <property name="expand">False</property> + <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> @@ -189,11 +195,11 @@ </object> </child> <action-widgets> - <action-widget response="0">button2</action-widget> - <action-widget response="0">button3</action-widget> - <action-widget response="0">button4</action-widget> - <action-widget response="0">button5</action-widget> - <action-widget response="0">button6</action-widget> + <action-widget response="0">ok</action-widget> + <action-widget response="0">user</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + <action-widget response="0">reset</action-widget> </action-widgets> </object> </interface> |