diff options
Diffstat (limited to 'sw/source')
-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 |
4 files changed, 56 insertions, 166 deletions
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" ; - }; -}; |