assemble SfxStyleFamilies from more generic resource components
Change-Id: I25aa0d8bca1f16f5fc27d3b299709479a1635ea3
This commit is contained in:
parent
88ec5de1c9
commit
c14b9d036a
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
typedef std::vector<SfxFilterTupel> SfxStyleFilter;
|
||||
|
||||
// CLASS -----------------------------------------------------------------
|
||||
|
||||
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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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; }
|
||||
|
@ -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: */
|
||||
|
@ -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" ;
|
||||
};
|
||||
};
|
||||
|
||||
// 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
|
||||
{
|
||||
Prefix = "sf";
|
||||
IdList = { 1; 2; };
|
||||
< "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
|
||||
< "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
|
||||
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
|
||||
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
|
||||
};
|
||||
};
|
||||
|
||||
StringArray RID_PAGESTYLEFAMILY
|
||||
{
|
||||
ItemList [ en-US ] =
|
||||
{
|
||||
< "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: */
|
||||
|
@ -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;
|
||||
|
@ -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 ] =
|
||||
{
|
||||
Prefix = "sf";
|
||||
STYLE_IMAGE_LISTEF
|
||||
< "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
|
||||
< "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
|
||||
};
|
||||
#undef STYLE_IMAGE_LISTEF
|
||||
};
|
||||
|
||||
ImageList RID_STYLEFAMILY_IMAGELIST
|
||||
{
|
||||
Prefix = "sf";
|
||||
IdList =
|
||||
{
|
||||
1; 2;
|
||||
};
|
||||
IdCount = 2;
|
||||
};
|
||||
|
||||
Bitmap BMP_PRESOBJ_GRAPHIC
|
||||
|
@ -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: */
|
||||
|
@ -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";
|
||||
|
@ -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: */
|
||||
|
@ -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!
|
||||
|
@ -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: */
|
||||
|
@ -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() &&
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -67,103 +67,120 @@ ImageList RID_DEFAULTIMAGELIST_LC
|
||||
IMAGELIST_AND_COUNT
|
||||
};
|
||||
|
||||
SfxStyleFamilies DLG_STYLE_DESIGNER
|
||||
String STR_PARAGRAPHSTYLEFAMILY
|
||||
{
|
||||
StyleFamilyList =
|
||||
{
|
||||
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 ; > ;
|
||||
};
|
||||
};
|
||||
};
|
||||
Text [ en-US ] = "Paragraph Styles" ;
|
||||
};
|
||||
|
||||
ImageList 1 // == BMP_COLOR_NORMAL + 1
|
||||
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 ] =
|
||||
{
|
||||
Prefix = "sf";
|
||||
IdList =
|
||||
{
|
||||
1; 2; 3; 4; 5; 6;
|
||||
};
|
||||
IdCount = 6;
|
||||
< "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 ; > ;
|
||||
};
|
||||
};
|
||||
|
||||
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 =
|
||||
{
|
||||
1; 2; 3; 4; 5; 6;
|
||||
};
|
||||
IdCount = 6;
|
||||
};
|
||||
|
||||
// Bitmap for the NumberingTemplates in the Organizer
|
||||
Bitmap BMP_STYLES_FAMILY_NUM { File = "styfamnu.bmp" ; };
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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: */
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user