summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-25 16:35:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-26 12:02:40 +0100
commitc14b9d036ac8549feb588764b3596c0eb42cf97c (patch)
tree695b0e480549c55df4da70720b3669825b8b8228
parentexpand SvMetaType::ReadNamesSvIdl (diff)
downloadcore-c14b9d036ac8549feb588764b3596c0eb42cf97c.tar.gz
core-c14b9d036ac8549feb588764b3596c0eb42cf97c.zip
assemble SfxStyleFamilies from more generic resource components
Change-Id: I25aa0d8bca1f16f5fc27d3b299709479a1635ea3
-rw-r--r--include/sfx2/mgetempl.hxx2
-rw-r--r--include/sfx2/module.hxx4
-rw-r--r--include/sfx2/sfx.hrc2
-rw-r--r--include/sfx2/styfitem.hxx47
-rw-r--r--sc/inc/sc.hrc4
-rw-r--r--sc/inc/scmod.hxx1
-rw-r--r--sc/source/ui/app/scmod.cxx20
-rw-r--r--sc/source/ui/styleui/scstyles.src52
-rw-r--r--sd/inc/sdmod.hxx1
-rw-r--r--sd/source/ui/app/res_bmp.src58
-rw-r--r--sd/source/ui/app/sdmod2.cxx21
-rw-r--r--sd/source/ui/app/strings.src4
-rw-r--r--sd/source/ui/inc/res_bmp.hrc7
-rw-r--r--sd/source/ui/inc/strings.hrc35
-rw-r--r--sfx2/source/appl/module.cxx14
-rw-r--r--sfx2/source/dialog/mgetempl.cxx18
-rw-r--r--sfx2/source/dialog/styfitem.cxx148
-rw-r--r--sfx2/source/dialog/templdlg.cxx50
-rw-r--r--sfx2/source/inc/templdgi.hxx6
-rw-r--r--sw/inc/swmodule.hxx1
-rw-r--r--sw/source/ui/app/app.src195
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx30
-rw-r--r--sw/source/uibase/app/swmodule.cxx39
-rw-r--r--sw/source/uibase/inc/app.hrc16
24 files changed, 349 insertions, 426 deletions
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index 637f928d867e..f60f4bf74e1f 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -23,6 +23,7 @@
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/vclmedit.hxx>
+#include <sfx2/styfitem.hxx>
#include <sfx2/tabdlg.hxx>
/* expected:
@@ -30,7 +31,6 @@
SID_TEMPLATE_FAMILY : In: Family of Template
*/
-class SfxStyleFamilies;
class SfxStyleFamilyItem;
class SfxStyleSheetBase;
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index 4a20b1c5f27a..9a01f82a94f3 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -23,6 +23,7 @@
#include <sfx2/app.hxx>
#include <sfx2/dllapi.h>
#include <sfx2/shell.hxx>
+#include <sfx2/styfitem.hxx>
#include <svtools/imgdef.hxx>
#include <sal/types.h>
#include <tools/fldunit.hxx>
@@ -37,7 +38,6 @@ class SfxObjectFactory;
class SfxModule;
class SfxModule_Impl;
class SfxSlotPool;
-class SfxStyleFamilies;
struct SfxChildWinContextFactory;
struct SfxChildWinFactory;
struct SfxStbCtrlFactory;
@@ -85,7 +85,7 @@ public:
const SfxItemSet& rSet );
virtual void Invalidate(sal_uInt16 nId = 0) override;
- SfxStyleFamilies* CreateStyleFamilies();
+ virtual SfxStyleFamilies* CreateStyleFamilies() { return nullptr; }
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=nullptr );
static FieldUnit GetCurrentFieldUnit();
diff --git a/include/sfx2/sfx.hrc b/include/sfx2/sfx.hrc
index 5d6faa5b1b3b..251dd229285b 100644
--- a/include/sfx2/sfx.hrc
+++ b/include/sfx2/sfx.hrc
@@ -111,8 +111,6 @@
#define RID_DEFAULTABOUT (RID_SFX_START+0)
-#define DLG_STYLE_DESIGNER (RID_SFX_START+8)
-
#define STR_STYLE_FILTER_AUTO (RID_SFX_START+9)
#define STR_STYLE_FILTER_USED (RID_SFX_START+10)
#define STR_STYLE_FILTER_USERDEF (RID_SFX_START+11)
diff --git a/include/sfx2/styfitem.hxx b/include/sfx2/styfitem.hxx
index 1fd10168c693..b1dd71bedae9 100644
--- a/include/sfx2/styfitem.hxx
+++ b/include/sfx2/styfitem.hxx
@@ -25,64 +25,35 @@
#include <vcl/bitmap.hxx>
#include <vcl/image.hxx>
#include <tools/rc.hxx>
+#include <tools/resary.hxx>
#include <rsc/rscsfx.hxx>
#include <vector>
-struct SfxFilterTupel {
+struct SFX2_DLLPUBLIC SfxFilterTupel
+{
OUString aName;
sal_uInt16 nFlags;
};
-typedef ::std::vector< SfxFilterTupel* > SfxStyleFilter;
-
-// CLASS -----------------------------------------------------------------
+typedef std::vector<SfxFilterTupel> SfxStyleFilter;
-class SfxStyleFamilyItem: public Resource
+class SFX2_DLLPUBLIC SfxStyleFamilyItem
{
- Image aImage;
- Bitmap aBitmap;
- OUString aText;
- OUString aHelpText;
SfxStyleFamily nFamily;
+ OUString aText;
+ Image aImage;
SfxStyleFilter aFilterList;
public:
- SfxStyleFamilyItem( const ResId &rId );
- ~SfxStyleFamilyItem();
+ SfxStyleFamilyItem(SfxStyleFamily nFamily, const OUString &rName, const Image& rImage, const ResId &rStringArray);
const OUString& GetText() const { return aText; }
SfxStyleFamily GetFamily() const { return nFamily; }
const SfxStyleFilter& GetFilterList() const { return aFilterList; }
const Image& GetImage() const { return aImage; }
-
-
- class GrantAccess { friend class SfxStyleFamilies; };
void SetImage( const Image& _rImg ) { aImage = _rImg; }
};
-class SFX2_DLLPUBLIC SfxStyleFamilies: public Resource
-{
- ::std::vector< SfxStyleFamilyItem* > aEntryList;
-
-public:
- SfxStyleFamilies( const ResId &);
- SfxStyleFamilies( ) {};
- ~SfxStyleFamilies();
-
- size_t size() const
- { return aEntryList.size(); }
-
- const SfxStyleFamilyItem* at(size_t nIdx) const
- { return aEntryList.empty() ? nullptr : aEntryList[nIdx]; }
-
- /** updates the images of all single SfxStyleFamilyItems with new images from the given resource
-
- <p>The resource must contain a local image lists, with the id being the integer equivalent for the
- requested bitmap mode, incremented by 1.</p>
-
- <p>Usually, you will use the same resource which originally constructed the object.</p>
- */
- void updateImages( const ResId& _rId );
-};
+using SfxStyleFamilies = std::vector<SfxStyleFamilyItem>;
#endif
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index f4906545f7fa..26bd9e97885e 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1091,6 +1091,10 @@
#define RID_SCDLG_DPDATEGROUP (SC_DIALOGS_START + 136)
#define RID_SCDLG_DPSHOWDETAIL (SC_DIALOGS_START + 137)
+#define RID_CELLSTYLEFAMILY (SC_DIALOGS_START + 138)
+#define RID_PAGESTYLEFAMILY (SC_DIALOGS_START + 139)
+#define RID_STYLEFAMILY_IMAGELIST (SC_DIALOGS_START + 140)
+
#define RID_POPUP_FILTER (SC_DIALOGS_START + 153)
#define RID_SCDLG_COND_FORMAT_MANAGER (SC_DIALOGS_START + 159)
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index d7affbb57101..1715819a7344 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -238,6 +238,7 @@ public:
virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) override;
+ virtual SfxStyleFamilies* CreateStyleFamilies() override;
void SetInSharedDocLoading( bool bNew ) { mbIsInSharedDocLoading = bNew; }
bool IsInSharedDocLoading() const { return mbIsInSharedDocLoading; }
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index af9fa54498b1..bfbe59d72710 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -86,6 +86,7 @@
#include "docsh.hxx"
#include "drwlayer.hxx"
#include "uiitems.hxx"
+#include "globstr.hrc"
#include "sc.hrc"
#include "cfgids.hxx"
#include "inputhdl.hxx"
@@ -2268,4 +2269,23 @@ bool ScModule::HasThesaurusLanguage( sal_uInt16 nLang )
return bHasLang;
}
+SfxStyleFamilies* ScModule::CreateStyleFamilies()
+{
+ SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
+
+ ImageList aEntryImages(ScResId(RID_STYLEFAMILY_IMAGELIST));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
+ ScGlobal::GetRscString(STR_STYLE_FAMILY_CELL),
+ aEntryImages.GetImage(1),
+ ScResId(RID_CELLSTYLEFAMILY)));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Page,
+ ScGlobal::GetRscString(STR_STYLE_FAMILY_PAGE),
+ aEntryImages.GetImage(2),
+ ScResId(RID_PAGESTYLEFAMILY)));
+
+ return pStyleFamilies;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/styleui/scstyles.src b/sc/source/ui/styleui/scstyles.src
index d07b0fb1015b..2502ceef27c2 100644
--- a/sc/source/ui/styleui/scstyles.src
+++ b/sc/source/ui/styleui/scstyles.src
@@ -20,43 +20,33 @@
#include "sc.hrc"
#include <svl/style.hrc>
-SfxStyleFamilies DLG_STYLE_DESIGNER
+StringArray RID_CELLSTYLEFAMILY
{
- StyleFamilyList =
+ ItemList [ en-US ] =
{
- SfxStyleFamilyItem
- {
- StyleFamily = SfxStyleFamily::Para ;
- FilterList [ en-US ] =
- {
- < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- Text [ en-US ] = "Cell Styles" ;
- };
-
- SfxStyleFamilyItem
- {
- StyleFamily = SfxStyleFamily::Page ;
- FilterList [ en-US ] =
- {
- < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- Text [ en-US ] = "Page Styles" ;
- };
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
+};
- // style family images are now taken from an ImageList
- // (for each family, there's one entry in the IdList)
- ImageList 1 // == BMP_COLOR_NORMAL + 1
+StringArray RID_PAGESTYLEFAMILY
+{
+ ItemList [ en-US ] =
{
- Prefix = "sf";
- IdList = { 1; 2; };
+ < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
};
+// style family images are now taken from an ImageList
+// (for each family, there's one entry in the IdList)
+ImageList RID_STYLEFAMILY_IMAGELIST
+{
+ Prefix = "sf";
+ IdList = { 1; 2; };
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index 9b04cf0d78dc..6a8f7351010c 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -125,6 +125,7 @@ public:
virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) override;
+ virtual SfxStyleFamilies* CreateStyleFamilies() override;
SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache;
diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src
index 0719ce166e18..dab95cbfb89e 100644
--- a/sd/source/ui/app/res_bmp.src
+++ b/sd/source/ui/app/res_bmp.src
@@ -280,46 +280,34 @@ String STR_STYLE_FILTER_ALL
Text [ en-US ] = "All Styles" ;
};
-SfxStyleFamilies DLG_STYLE_DESIGNER
+StringArray RID_GRAPHICSTYLEFAMILY
{
- StyleFamilyList =
+ ItemList [ en-US ] =
{
- SfxStyleFamilyItem RID_GRAPHICSTYLEFAMILY
- {
- Text [ en-US ] = "Graphic Styles" ;
- StyleFamily = SfxStyleFamily::Para ;
- FilterList [ en-US ] =
- {
- < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- };
- SfxStyleFamilyItem RID_PRESENTATIONSTYLEFAMILY
- {
- Text [ en-US ] = "Presentation Styles" ;
- StyleFamily = SfxStyleFamily::Pseudo ;
- FilterList [ en-US ] =
- {
- < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- };
- };
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
- #define STYLE_IMAGE_LISTEF \
- IdList = \
- { \
- 1; 2; \
- }; \
- IdCount = 2;
-
- ImageList 1 // == BMP_COLOR_NORMAL + 1
+};
+
+StringArray RID_PRESENTATIONSTYLEFAMILY
+{
+ ItemList [ en-US ] =
+ {
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ };
+};
+
+ImageList RID_STYLEFAMILY_IMAGELIST
+{
+ Prefix = "sf";
+ IdList =
{
- Prefix = "sf";
- STYLE_IMAGE_LISTEF
+ 1; 2;
};
- #undef STYLE_IMAGE_LISTEF
+ IdCount = 2;
};
Bitmap BMP_PRESOBJ_GRAPHIC
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 13d5bedfa50d..79af5b81f845 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -20,6 +20,7 @@
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
#include <sfx2/printer.hxx>
+#include <sfx2/styfitem.hxx>
#include <svl/inethist.hxx>
#include <svl/poolitem.hxx>
#include <svl/flagitem.hxx>
@@ -799,4 +800,24 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent
return pRet;
}
+SfxStyleFamilies* SdModule::CreateStyleFamilies()
+{
+ SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
+
+ ImageList aEntryImages(SdResId(RID_STYLEFAMILY_IMAGELIST));
+
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
+ SD_RESSTR(STR_GRAPHICS_STYLE_FAMILY),
+ aEntryImages.GetImage(1),
+ SdResId(RID_GRAPHICSTYLEFAMILY)));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Pseudo,
+ SD_RESSTR(STR_PRESENTATIONS_STYLE_FAMILY),
+ aEntryImages.GetImage(2),
+ SdResId(RID_PRESENTATIONSTYLEFAMILY)));
+
+ return pStyleFamilies;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index e8081f4031b8..2194407c29a1 100644
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -1159,6 +1159,10 @@ String STR_GRAPHICS_STYLE_FAMILY
{
Text [ en-US ] = "Graphic Styles";
};
+String STR_PRESENTATIONS_STYLE_FAMILY
+{
+ Text [ en-US ] = "Presentation Styles";
+};
String STR_CELL_STYLE_FAMILY
{
Text [ en-US ] = "Cell Styles";
diff --git a/sd/source/ui/inc/res_bmp.hrc b/sd/source/ui/inc/res_bmp.hrc
index 955abfded17a..733035fda567 100644
--- a/sd/source/ui/inc/res_bmp.hrc
+++ b/sd/source/ui/inc/res_bmp.hrc
@@ -208,9 +208,10 @@
#define RID_GRAPHICSTYLEFAMILY RID_APP_START+395
#define RID_PRESENTATIONSTYLEFAMILY RID_APP_START+396
+#define RID_STYLEFAMILY_IMAGELIST RID_APP_START+397
-#define IMG_EMBEDDED RID_APP_START+397
-#define IMG_LINK RID_APP_START+398
-#define IMG_HYPERLINK RID_APP_START+399
+#define IMG_EMBEDDED RID_APP_START+398
+#define IMG_LINK RID_APP_START+399
+#define IMG_HYPERLINK RID_APP_START+400
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/strings.hrc b/sd/source/ui/inc/strings.hrc
index 769e18845370..c99591b4cb4b 100644
--- a/sd/source/ui/inc/strings.hrc
+++ b/sd/source/ui/inc/strings.hrc
@@ -392,29 +392,30 @@
#define STR_TASKPANEL_PREPARING_PREVIEW_SUBSTITUTION (RID_APP_START+712)
#define STR_TASKPANEL_LAYOUT_MENU_TITLE (RID_APP_START+713)
#define STR_GRAPHICS_STYLE_FAMILY (RID_APP_START+715)
-#define STR_OBJECTS_TREE (RID_APP_START+716)
-#define STR_CELL_STYLE_FAMILY (RID_APP_START+717)
+#define STR_PRESENTATIONS_STYLE_FAMILY (RID_APP_START+716)
+#define STR_OBJECTS_TREE (RID_APP_START+717)
+#define STR_CELL_STYLE_FAMILY (RID_APP_START+718)
-#define STR_NAVIGATOR_SHOW_NAMED_SHAPES (RID_APP_START+718)
-#define STR_NAVIGATOR_SHOW_ALL_SHAPES (RID_APP_START+719)
-#define STR_NAVIGATOR_SHAPE_BASE_NAME (RID_APP_START+720)
+#define STR_NAVIGATOR_SHOW_NAMED_SHAPES (RID_APP_START+719)
+#define STR_NAVIGATOR_SHOW_ALL_SHAPES (RID_APP_START+720)
+#define STR_NAVIGATOR_SHAPE_BASE_NAME (RID_APP_START+721)
-#define STR_RESET_LAYOUT (RID_APP_START+721)
-#define STR_INSERT_TABLE (RID_APP_START+722)
-#define STR_INSERT_CHART (RID_APP_START+723)
-#define STR_INSERT_PICTURE (RID_APP_START+724)
-#define STR_INSERT_MOVIE (RID_APP_START+725)
+#define STR_RESET_LAYOUT (RID_APP_START+722)
+#define STR_INSERT_TABLE (RID_APP_START+723)
+#define STR_INSERT_CHART (RID_APP_START+724)
+#define STR_INSERT_PICTURE (RID_APP_START+725)
+#define STR_INSERT_MOVIE (RID_APP_START+726)
-#define STRING_DRAG_AND_DROP_PAGES (RID_APP_START+726)
-#define STRING_DRAG_AND_DROP_SLIDES (RID_APP_START+727)
+#define STRING_DRAG_AND_DROP_PAGES (RID_APP_START+727)
+#define STRING_DRAG_AND_DROP_SLIDES (RID_APP_START+728)
-#define STR_ACC_DIALOG_DESC (RID_APP_START+728)
+#define STR_ACC_DIALOG_DESC (RID_APP_START+729)
-#define STR_PHOTO_ALBUM_EMPTY_WARNING (RID_APP_START+729)
-#define STR_PHOTO_ALBUM_TEXTBOX (RID_APP_START+730)
+#define STR_PHOTO_ALBUM_EMPTY_WARNING (RID_APP_START+730)
+#define STR_PHOTO_ALBUM_TEXTBOX (RID_APP_START+731)
-#define STR_INSERT_3D_MODEL_TITLE (RID_APP_START+731)
-#define STR_INSERT_3D_MODEL_ALL_SUPPORTED_FORMATS (RID_APP_START+732)
+#define STR_INSERT_3D_MODEL_TITLE (RID_APP_START+732)
+#define STR_INSERT_3D_MODEL_ALL_SUPPORTED_FORMATS (RID_APP_START+733)
/******************************************************************************
* The ids in glob.hrc start at RID_APP_START+750!
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 0b64e6f3158e..72d447b6ec26 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -292,18 +292,4 @@ FieldUnit SfxModule::GetFieldUnit() const
return eUnit;
}
-SfxStyleFamilies* SfxModule::CreateStyleFamilies()
-{
- SfxStyleFamilies *pStyleFamilies = nullptr;
- ResMgr* pMgr = GetResMgr();
- if (pMgr)
- {
- ResId aFamId(DLG_STYLE_DESIGNER, *pMgr);
- aFamId.SetRT(RSC_SFX_STYLE_FAMILIES);
- if (pMgr->IsAvailable(aFamId))
- pStyleFamilies = new SfxStyleFamilies(aFamId);
- }
- return pStyleFamilies;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 8a5e89e18b56..523a47648aa1 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -179,7 +179,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
size_t i;
for ( i = 0; i < nCount; ++i )
{
- pItem = pFamilies->at( i );
+ pItem = &(pFamilies->at(i));
if ( pItem->GetFamily() == pStyle->GetFamily() )
break;
@@ -199,17 +199,17 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
for ( i = 0; i < nCount; ++i )
{
- SfxFilterTupel* pTupel = rList[ i ];
+ const SfxFilterTupel& rTupel = rList[ i ];
- if ( pTupel->nFlags != SFXSTYLEBIT_AUTO &&
- pTupel->nFlags != SFXSTYLEBIT_USED &&
- pTupel->nFlags != SFXSTYLEBIT_ALL_VISIBLE &&
- pTupel->nFlags != SFXSTYLEBIT_ALL )
+ if ( rTupel.nFlags != SFXSTYLEBIT_AUTO &&
+ rTupel.nFlags != SFXSTYLEBIT_USED &&
+ rTupel.nFlags != SFXSTYLEBIT_ALL_VISIBLE &&
+ rTupel.nFlags != SFXSTYLEBIT_ALL )
{
- m_pFilterLb->InsertEntry( pTupel->aName, nIdx );
+ m_pFilterLb->InsertEntry( rTupel.aName, nIdx );
m_pFilterLb->SetEntryData(nIdx, reinterpret_cast<void*>(i));
- if ( ( pTupel->nFlags & nMask ) == nMask )
+ if ( ( rTupel.nFlags & nMask ) == nMask )
nStyleFilterIdx = nIdx;
++nIdx;
}
@@ -469,7 +469,7 @@ bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet* rSet )
bModified = true;
OSL_ENSURE( pItem, "No Item" );
// is only possibly for user templates
- sal_uInt16 nMask = pItem->GetFilterList()[ reinterpret_cast<size_t>(m_pFilterLb->GetEntryData( nFilterIdx )) ]->nFlags | SFXSTYLEBIT_USERDEF;
+ sal_uInt16 nMask = pItem->GetFilterList()[ reinterpret_cast<size_t>(m_pFilterLb->GetEntryData( nFilterIdx )) ].nFlags | SFXSTYLEBIT_USERDEF;
pStyle->SetMask( nMask );
}
if(m_pAutoCB->IsVisible() &&
diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx
index 5ae6a03a5e02..5821500bd928 100644
--- a/sfx2/source/dialog/styfitem.cxx
+++ b/sfx2/source/dialog/styfitem.cxx
@@ -23,147 +23,17 @@
#include <tools/rcid.h>
#include <tools/debug.hxx>
-// Implementierung des Resource-Konstruktors
-
-SfxStyleFamilyItem::SfxStyleFamilyItem( const ResId &rResId ) :
-
- Resource( rResId.SetRT( RSC_SFX_STYLE_FAMILY_ITEM ) )
-
+SfxStyleFamilyItem::SfxStyleFamilyItem(SfxStyleFamily nFamily_, const OUString &rName, const Image& rImage, const ResId &rStringArrayId)
+ : nFamily(nFamily_)
+ , aText(rName)
+ , aImage(rImage)
{
- const sal_Int32 nMask = ReadLongRes();
-
- if(nMask & (sal_uInt32)SfxStyleItem::List)
+ ResStringArray aResList(rStringArrayId);
+ aFilterList.resize(aResList.Count());
+ for (sal_uInt32 i = 0; i < aResList.Count(); ++i)
{
- const sal_Int32 nCount = ReadLongRes();
- for( sal_Int32 i = 0; i < nCount; ++i )
- {
- SfxFilterTupel *pTupel = new SfxFilterTupel;
- pTupel->aName = ReadStringRes();
- pTupel->nFlags = static_cast<sal_uInt16>(ReadLongRes());
- aFilterList.push_back( pTupel );
- }
- }
- if(nMask & (sal_uInt32)SfxStyleItem::Bitmap)
- {
- aBitmap = Bitmap(ResId(static_cast<RSHEADER_TYPE *>(GetClassRes()),*rResId.GetResMgr()));
- IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
- }
- if(nMask & (sal_uInt32)SfxStyleItem::Text)
- {
- aText = ReadStringRes();
- }
- if(nMask & (sal_uInt32)SfxStyleItem::HelpText)
- {
- aHelpText = ReadStringRes();
- }
- if(nMask & (sal_uInt32)SfxStyleItem::StyleFamily)
- {
- nFamily = static_cast<SfxStyleFamily>(ReadLongRes());
- }
- else
- nFamily = SfxStyleFamily::Para;
-
- if(nMask & (sal_uInt32)SfxStyleItem::Image)
- {
- aImage = Image(ResId(static_cast<RSHEADER_TYPE *>(GetClassRes()),*rResId.GetResMgr()));
- IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
- }
- else
- aImage = Image(aBitmap);
-}
-
-
-// Destructor; releases the internal data
-
-SfxStyleFamilyItem::~SfxStyleFamilyItem()
-{
- for (SfxFilterTupel* p : aFilterList)
- delete p;
- aFilterList.clear();
-}
-
-
-// Implementation of the resource constructor
-
-SfxStyleFamilies::SfxStyleFamilies( const ResId& rResId ) :
- Resource( rResId.SetRT( RSC_SFX_STYLE_FAMILIES ).SetAutoRelease( false ) )
-{
- const sal_Int32 nCount = ReadLongRes();
- for( sal_Int32 i = 0; i < nCount; ++i )
- {
- const ResId aResId(static_cast<RSHEADER_TYPE *>(GetClassRes()), *rResId.GetResMgr());
- SfxStyleFamilyItem *pItem = new SfxStyleFamilyItem(aResId);
- IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
- aEntryList.push_back( pItem );
- }
-
- FreeResource();
-
- updateImages( rResId );
-}
-
-
-// Destructor; releases the internal data
-
-SfxStyleFamilies::~SfxStyleFamilies()
-{
- for (SfxStyleFamilyItem* p : aEntryList)
- delete p;
- aEntryList.clear();
-}
-
-namespace
-{
- class OLocalResourceAccess : public Resource
- {
- protected:
- ResMgr* m_pManager;
-
- public:
- OLocalResourceAccess( const ResId& _rId )
- :Resource( _rId.SetAutoRelease( false ) )
- ,m_pManager( _rId.GetResMgr() )
- {
- }
-
- ~OLocalResourceAccess()
- {
- if ( m_pManager )
- m_pManager->Increment( m_pManager->GetRemainSize() );
- FreeResource();
- }
-
- bool IsAvailableRes( const ResId& _rId ) const
- {
- return Resource::IsAvailableRes( _rId );
- }
- };
-}
-
-void SfxStyleFamilies::updateImages( const ResId& _rId )
-{
- OLocalResourceAccess aLocalRes( _rId );
-
- // check if the image list is present
- ResId aImageListId( (sal_uInt16) 1, *_rId.GetResMgr() );
- aImageListId.SetRT( RSC_IMAGELIST );
-
- if ( aLocalRes.IsAvailableRes( aImageListId ) )
- { // there is such a list
- ImageList aImages( aImageListId );
-
- // number of styles items/images
- sal_uInt16 nCount = aImages.GetImageCount( );
- DBG_ASSERT( aEntryList.size() == nCount, "SfxStyleFamilies::updateImages: found the image list, but missing some bitmaps!" );
- if ( nCount > aEntryList.size() )
- nCount = aEntryList.size();
-
- // set the images on the items
- for ( size_t i = 0; i < nCount; ++i )
- {
- SfxStyleFamilyItem* pItem = aEntryList[ i ];
- pItem->SetImage( aImages.GetImage( aImages.GetImageId( i ) ) );
- }
+ aFilterList[i].aName = aResList.GetString(i);
+ aFilterList[i].nFlags = aResList.GetValue(i);
}
}
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index cb21669e2f8d..025e5e00d9a3 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -716,8 +716,8 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, vcl
sal_uInt16 SfxCommonTemplateDialog_Impl::StyleNrToInfoOffset(sal_uInt16 nId)
{
- const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nId );
- return SfxTemplate::SfxFamilyIdToNId(pItem->GetFamily())-1;
+ const SfxStyleFamilyItem& rItem = pStyleFamilies->at( nId );
+ return SfxTemplate::SfxFamilyIdToNId(rItem.GetFamily())-1;
}
void SfxTemplateDialog_Impl::EnableEdit(bool bEnable)
@@ -755,7 +755,7 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
for (i = 0; i < nCount; ++i)
{
sal_uInt16 nSlot = 0;
- switch( pStyleFamilies->at( i )->GetFamily() )
+ switch (pStyleFamilies->at(i).GetFamily())
{
case SfxStyleFamily::Char:
nSlot = SID_STYLE_FAMILY1; break;
@@ -812,9 +812,9 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
for( ; nCount--; )
{
- const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nCount );
- sal_uInt16 nId = SfxTemplate::SfxFamilyIdToNId( pItem->GetFamily() );
- InsertFamilyItem( nId, pItem );
+ const SfxStyleFamilyItem &rItem = pStyleFamilies->at( nCount );
+ sal_uInt16 nId = SfxTemplate::SfxFamilyIdToNId( rItem.GetFamily() );
+ InsertFamilyItem(nId, rItem);
}
LoadedFamilies();
@@ -904,10 +904,10 @@ const SfxStyleFamilyItem *SfxCommonTemplateDialog_Impl::GetFamilyItem_Impl() con
const size_t nCount = pStyleFamilies->size();
for(size_t i = 0; i < nCount; ++i)
{
- const SfxStyleFamilyItem *pItem = pStyleFamilies->at( i );
- sal_uInt16 nId = SfxTemplate::SfxFamilyIdToNId(pItem->GetFamily());
+ const SfxStyleFamilyItem &rItem = pStyleFamilies->at( i );
+ sal_uInt16 nId = SfxTemplate::SfxFamilyIdToNId(rItem.GetFamily());
if(nId == nActFamily)
- return pItem;
+ return &rItem;
}
return nullptr;
}
@@ -1133,8 +1133,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags)
const SfxStyleFamily eFam = pItem->GetFamily();
- SfxFilterTupel* pT = ( nActFilter < pItem->GetFilterList().size() ? pItem->GetFilterList()[nActFilter] : nullptr );
- sal_uInt16 nFilter = pT ? pT->nFlags : 0;
+ sal_uInt16 nFilter (nActFilter < pItem->GetFilterList().size() ? pItem->GetFilterList()[nActFilter].nFlags : 0);
if(!nFilter) // automatic
nFilter = nAppFilter;
@@ -1152,10 +1151,10 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags)
sal_Int32 nPos = aFilterLb->InsertEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString(), 0);
aFilterLb->SetEntryData( nPos, reinterpret_cast<void*>(SFXSTYLEBIT_ALL) );
const SfxStyleFilter& rFilter = pItem->GetFilterList();
- for(const SfxFilterTupel* i : rFilter)
+ for(const SfxFilterTupel& i : rFilter)
{
- sal_uIntPtr nFilterFlags = i->nFlags;
- nPos = aFilterLb->InsertEntry( i->aName );
+ sal_uIntPtr nFilterFlags = i.nFlags;
+ nPos = aFilterLb->InsertEntry( i.aName );
aFilterLb->SetEntryData( nPos, reinterpret_cast<void*>(nFilterFlags) );
}
if(nActFilter < aFilterLb->GetEntryCount() - 1)
@@ -1164,8 +1163,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(StyleFlags nFlags)
{
nActFilter = 0;
aFilterLb->SelectEntryPos(1);
- SfxFilterTupel* pActT = ( nActFilter < rFilter.size() ) ? rFilter[ nActFilter ] : nullptr;
- sal_uInt16 nFilterFlags = pActT ? pActT->nFlags : 0;
+ sal_uInt16 nFilterFlags = (nActFilter < rFilter.size()) ? rFilter[nActFilter].nFlags : 0;
pStyleSheetPool->SetSearchMask(eFam, nFilterFlags);
}
@@ -1395,7 +1393,7 @@ void SfxCommonTemplateDialog_Impl::Update_Impl()
// other filters for automatic
CheckItem( nActFamily );
const SfxStyleFamilyItem *pStyleItem = GetFamilyItem_Impl();
- if ( pStyleItem && 0 == pStyleItem->GetFilterList()[ nActFilter ]->nFlags
+ if ( pStyleItem && 0 == pStyleItem->GetFilterList()[nActFilter].nFlags
&& nAppFilter != pItem->GetValue())
{
nAppFilter = pItem->GetValue();
@@ -1605,9 +1603,9 @@ bool SfxCommonTemplateDialog_Impl::Execute_Impl(
for ( size_t i = 0; i < nFilterCount; ++i )
{
- const SfxFilterTupel *pTupel = pFamilyItem->GetFilterList()[ i ];
+ const SfxFilterTupel &rTupel = pFamilyItem->GetFilterList()[ i ];
- if ( ( pTupel->nFlags & nFilterFlags ) == nFilterFlags && pIdx )
+ if ( ( rTupel.nFlags & nFilterFlags ) == nFilterFlags && pIdx )
*pIdx = i;
}
}
@@ -1730,7 +1728,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry)
sal_uInt16 nFilter;
if( pItem && nActFilter != SFXSTYLEBIT_ALL )
{
- nFilter = pItem->GetFilterList()[ nActFilter ]->nFlags;
+ nFilter = pItem->GetFilterList()[nActFilter].nFlags;
if(!nFilter) // automatisch
nFilter = nAppFilter;
}
@@ -1848,7 +1846,7 @@ void SfxCommonTemplateDialog_Impl::NewHdl()
sal_uInt16 nMask;
if( nActFilter != SFXSTYLEBIT_ALL )
{
- nMask = pItem->GetFilterList()[ nActFilter ]->nFlags;
+ nMask = pItem->GetFilterList()[nActFilter].nFlags;
if(!nMask) // automatic
nMask = nAppFilter;
}
@@ -1997,8 +1995,8 @@ void SfxCommonTemplateDialog_Impl::EnableDelete()
const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
const SfxStyleFamily eFam = pItem->GetFamily();
sal_uInt16 nFilter = 0;
- if(pItem->GetFilterList().size() > nActFilter)
- nFilter = pItem->GetFilterList()[ nActFilter ]->nFlags;
+ if (pItem->GetFilterList().size() > nActFilter)
+ nFilter = pItem->GetFilterList()[nActFilter].nFlags;
if(!nFilter) // automatic
nFilter = nAppFilter;
const SfxStyleSheetBase *pStyle =
@@ -2263,10 +2261,10 @@ void SfxTemplateDialog_Impl::EnableFamilyItem( sal_uInt16 nId, bool bEnable )
}
// Insert element into dropdown filter "Frame Styles", "List Styles", etc.
-void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 nId,const SfxStyleFamilyItem *pItem)
+void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 nId,const SfxStyleFamilyItem &rItem)
{
OString sHelpId;
- switch( pItem->GetFamily() )
+ switch( rItem.GetFamily() )
{
case SfxStyleFamily::Char: sHelpId = ".uno:CharStyle"; break;
case SfxStyleFamily::Para: sHelpId = ".uno:ParaStyle"; break;
@@ -2276,7 +2274,7 @@ void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 nId,const SfxStyleFamil
case SfxStyleFamily::Table: sHelpId = ".uno:TableStyle"; break;
default: OSL_FAIL("unknown StyleFamily"); break;
}
- m_aActionTbL->InsertItem( nId, pItem->GetImage(), pItem->GetText(), ToolBoxItemBits::NONE, 0);
+ m_aActionTbL->InsertItem( nId, rItem.GetImage(), rItem.GetText(), ToolBoxItemBits::NONE, 0);
m_aActionTbL->SetHelpId( nId, sHelpId );
}
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 0eafffe09154..d49cf8cd37b7 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -35,9 +35,9 @@ class SfxTemplateControllerItem;
#include <rsc/rscsfx.hxx>
#include <sfx2/childwin.hxx>
+#include <sfx2/styfitem.hxx>
#include <sfx2/templdlg.hxx>
-class SfxStyleFamilies;
class SfxStyleFamilyItem;
class SfxTemplateItem;
class SfxBindings;
@@ -228,7 +228,7 @@ protected:
{}
void InvalidateBindings();
- virtual void InsertFamilyItem( sal_uInt16 nId, const SfxStyleFamilyItem* pItem ) = 0;
+ virtual void InsertFamilyItem( sal_uInt16 nId, const SfxStyleFamilyItem& rItem ) = 0;
virtual void EnableFamilyItem( sal_uInt16 nId, bool bEnabled ) = 0;
virtual void ClearFamilyList() = 0;
virtual void ReplaceUpdateButtonByMenu();
@@ -360,7 +360,7 @@ protected:
virtual void CheckItem( sal_uInt16 nMesId, bool bCheck = true ) override;
virtual bool IsCheckedItem( sal_uInt16 nMesId ) override;
virtual void LoadedFamilies() override;
- virtual void InsertFamilyItem( sal_uInt16 nId, const SfxStyleFamilyItem* pIten ) override;
+ virtual void InsertFamilyItem( sal_uInt16 nId, const SfxStyleFamilyItem& rItem ) override;
virtual void EnableFamilyItem( sal_uInt16 nId, bool bEnabled ) override;
virtual void ClearFamilyList() override;
virtual void ReplaceUpdateButtonByMenu() override;
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 6abfe6106b39..427732c8d08b 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -220,6 +220,7 @@ public:
virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) override;
+ virtual SfxStyleFamilies* CreateStyleFamilies() override;
// Pool is created here and set at SfxShell.
void InitAttrPool();
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index f3ec0f65b4d4..2796e9c32e16 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -67,101 +67,118 @@ ImageList RID_DEFAULTIMAGELIST_LC
IMAGELIST_AND_COUNT
};
-SfxStyleFamilies DLG_STYLE_DESIGNER
+String STR_PARAGRAPHSTYLEFAMILY
{
- StyleFamilyList =
+ Text [ en-US ] = "Paragraph Styles" ;
+};
+
+String STR_CHARACTERSTYLEFAMILY
+{
+ Text [ en-US ] = "Character Styles" ;
+};
+
+String STR_FRAMESTYLEFAMILY
+{
+ Text [ en-US ] = "Frame Styles" ;
+};
+
+String STR_PAGESTYLEFAMILY
+{
+ Text [ en-US ] = "Page Styles" ;
+};
+
+String STR_LISTSTYLEFAMILY
+{
+ Text [ en-US ] = "List Styles" ;
+};
+
+String STR_TABLESTYLEFAMILY
+{
+ Text [ en-US ] = "Table Styles" ;
+};
+
+StringArray RID_PARAGRAPHSTYLEFAMILY
+{
+ ItemList [ en-US ] =
{
- SfxStyleFamilyItem
- {
- Text [ en-US ] = "Paragraph Styles" ;
- StyleFamily = SfxStyleFamily::Para ;
- FilterList [ en-US ] =
- {
- < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- < "Automatic" ; SFXSTYLEBIT_AUTO ; > ;
- < "Text Styles" ; SWSTYLEBIT_TEXT ; > ;
- < "Chapter Styles" ; SWSTYLEBIT_CHAPTER ; > ;
- < "List Styles" ; SWSTYLEBIT_LIST ; > ;
- < "Index Styles" ; SWSTYLEBIT_IDX ; > ;
- < "Special Styles" ; SWSTYLEBIT_EXTRA ; > ;
- < "HTML Styles" ; SWSTYLEBIT_HTML ; > ;
- < "Conditional Styles" ; SWSTYLEBIT_CONDCOLL ; > ;
- };
- };
- SfxStyleFamilyItem
- {
- Text [ en-US ] = "Character Styles" ;
- StyleFamily = SfxStyleFamily::Char ;
- FilterList [ en-US ] =
- {
- < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- };
- SfxStyleFamilyItem
- {
- Text [ en-US ] = "Frame Styles" ;
- StyleFamily = SfxStyleFamily::Frame ;
- FilterList [ en-US ] =
- {
- < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- };
- SfxStyleFamilyItem
- {
- Text [ en-US ] = "Page Styles" ;
- StyleFamily = SfxStyleFamily::Page ;
- FilterList [ en-US ] =
- {
- < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- };
- SfxStyleFamilyItem
- {
- StyleFamily = SfxStyleFamily::Pseudo ;
- FilterList [ en-US ] =
- {
- < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- Text [ en-US ] = "List Styles" ;
- };
- SfxStyleFamilyItem
- {
- Text [ en-US ] = "Table Styles" ;
- StyleFamily = SfxStyleFamily::Table ;
- FilterList [ en-US ] =
- {
- < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
- < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
- < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
- < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
- };
- };
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ < "Automatic" ; SFXSTYLEBIT_AUTO ; > ;
+ < "Text Styles" ; SWSTYLEBIT_TEXT ; > ;
+ < "Chapter Styles" ; SWSTYLEBIT_CHAPTER ; > ;
+ < "List Styles" ; SWSTYLEBIT_LIST ; > ;
+ < "Index Styles" ; SWSTYLEBIT_IDX ; > ;
+ < "Special Styles" ; SWSTYLEBIT_EXTRA ; > ;
+ < "HTML Styles" ; SWSTYLEBIT_HTML ; > ;
+ < "Conditional Styles" ; SWSTYLEBIT_CONDCOLL ; > ;
};
+};
- ImageList 1 // == BMP_COLOR_NORMAL + 1
+StringArray RID_CHARACTERSTYLEFAMILY
+{
+ ItemList [ en-US ] =
+ {
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ };
+};
+
+StringArray RID_FRAMESTYLEFAMILY
+{
+ ItemList [ en-US ] =
+ {
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ };
+};
+
+StringArray RID_PAGESTYLEFAMILY
+{
+ ItemList [ en-US ] =
+ {
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ };
+};
+
+StringArray RID_LISTSTYLEFAMILY
+{
+ ItemList [ en-US ] =
+ {
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ };
+};
+
+StringArray RID_TABLESTYLEFAMILY
+{
+ ItemList [ en-US ] =
+ {
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
+ < "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
+ < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
+ };
+};
+
+ImageList RID_STYLEFAMILY_IMAGELIST
+{
+ Prefix = "sf";
+ IdList =
{
- Prefix = "sf";
- IdList =
- {
- 1; 2; 3; 4; 5; 6;
- };
- IdCount = 6;
+ 1; 2; 3; 4; 5; 6;
};
+ IdCount = 6;
};
// Bitmap for the NumberingTemplates in the Organizer
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index e102554aa435..df1b7d04a0b2 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -96,26 +96,24 @@ SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet)
m_pTbLinks->Resize(); // OS: Hack for the right selection
m_pTbLinks->SetSpaceBetweenEntries( 0 );
- SfxStyleFamilies aFamilies(SW_RES(DLG_STYLE_DESIGNER));
- const SfxStyleFamilyItem* pFamilyItem = nullptr;
-
- size_t nCount = aFamilies.size();
- for( size_t i = 0; i < nCount; ++i )
+ std::unique_ptr<SfxStyleFamilies> xFamilies(SW_MOD()->CreateStyleFamilies());
+ size_t nCount = xFamilies->size();
+ for (size_t j = 0; j < nCount; ++j)
{
- if(SfxStyleFamily::Para == (pFamilyItem = aFamilies.at( i ))->GetFamily())
- break;
- }
-
- if (pFamilyItem)
- {
- const SfxStyleFilter& rFilterList = pFamilyItem->GetFilterList();
- for( size_t i = 0; i < rFilterList.size(); ++i )
+ const SfxStyleFamilyItem &rFamilyItem = xFamilies->at(j);
+ if (SfxStyleFamily::Para == rFamilyItem.GetFamily())
{
- m_pFilterLB->InsertEntry( rFilterList[ i ]->aName);
- sal_uInt16* pFilter = new sal_uInt16(rFilterList[i]->nFlags);
- m_pFilterLB->SetEntryData(i, pFilter);
+ const SfxStyleFilter& rFilterList = rFamilyItem.GetFilterList();
+ for (size_t i = 0; i < rFilterList.size(); ++i)
+ {
+ m_pFilterLB->InsertEntry(rFilterList[i].aName);
+ sal_uInt16* pFilter = new sal_uInt16(rFilterList[i].nFlags);
+ m_pFilterLB->SetEntryData(i, pFilter);
+ }
+ break;
}
}
+
m_pFilterLB->SelectEntryPos(1);
m_pTbLinks->Show();
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 9d2818bce00d..19bc121b731e 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -398,4 +398,43 @@ void SwModule::RemoveAttrPool()
SfxItemPool::Free(m_pAttrPool);
}
+SfxStyleFamilies* SwModule::CreateStyleFamilies()
+{
+ SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
+
+ ImageList aEntryImages(SW_RES(RID_STYLEFAMILY_IMAGELIST));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
+ SW_RESSTR(STR_PARAGRAPHSTYLEFAMILY),
+ aEntryImages.GetImage(1),
+ SW_RES(RID_PARAGRAPHSTYLEFAMILY)));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Char,
+ SW_RESSTR(STR_CHARACTERSTYLEFAMILY),
+ aEntryImages.GetImage(2),
+ SW_RES(RID_CHARACTERSTYLEFAMILY)));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Frame,
+ SW_RESSTR(STR_FRAMESTYLEFAMILY),
+ aEntryImages.GetImage(3),
+ SW_RES(RID_FRAMESTYLEFAMILY)));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Page,
+ SW_RESSTR(STR_PAGESTYLEFAMILY),
+ aEntryImages.GetImage(4),
+ SW_RES(RID_PAGESTYLEFAMILY)));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Pseudo,
+ SW_RESSTR(STR_LISTSTYLEFAMILY),
+ aEntryImages.GetImage(5),
+ SW_RES(RID_LISTSTYLEFAMILY)));
+
+ pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Table,
+ SW_RESSTR(STR_TABLESTYLEFAMILY),
+ aEntryImages.GetImage(6),
+ SW_RES(RID_TABLESTYLEFAMILY)));
+
+ return pStyleFamilies;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/app.hrc b/sw/source/uibase/inc/app.hrc
index 1dca48890527..d39e4d53df71 100644
--- a/sw/source/uibase/inc/app.hrc
+++ b/sw/source/uibase/inc/app.hrc
@@ -92,7 +92,21 @@
#define STR_WRONG_TABLENAME (RC_APP_BEGIN + 138)
#define STR_SRTERR (RC_APP_BEGIN + 139)
-#define APP_ACT_END STR_SRTERR
+#define STR_PARAGRAPHSTYLEFAMILY (RC_APP_BEGIN + 140)
+#define STR_CHARACTERSTYLEFAMILY (RC_APP_BEGIN + 141)
+#define STR_FRAMESTYLEFAMILY (RC_APP_BEGIN + 142)
+#define STR_PAGESTYLEFAMILY (RC_APP_BEGIN + 143)
+#define STR_LISTSTYLEFAMILY (RC_APP_BEGIN + 144)
+#define STR_TABLESTYLEFAMILY (RC_APP_BEGIN + 145)
+#define RID_PARAGRAPHSTYLEFAMILY (RC_APP_BEGIN + 146)
+#define RID_CHARACTERSTYLEFAMILY (RC_APP_BEGIN + 147)
+#define RID_FRAMESTYLEFAMILY (RC_APP_BEGIN + 148)
+#define RID_PAGESTYLEFAMILY (RC_APP_BEGIN + 149)
+#define RID_LISTSTYLEFAMILY (RC_APP_BEGIN + 150)
+#define RID_TABLESTYLEFAMILY (RC_APP_BEGIN + 151)
+#define RID_STYLEFAMILY_IMAGELIST (RC_APP_BEGIN + 152)
+
+#define APP_ACT_END RID_STYLEFAMILY_IMAGELIST
#if APP_ACT_END > RC_APP_END
#error Resource-Id Ueberlauf in #file, #line