summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/templdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/dialog/templdlg.cxx')
-rw-r--r--sfx2/source/dialog/templdlg.cxx41
1 files changed, 21 insertions, 20 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 58d903adde4c..6fcc9de53ff1 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -150,18 +150,11 @@ SfxTemplateDialog::SfxTemplateDialog
pImpl->updateNonFamilyImages();
}
-
-
SfxTemplateDialog::~SfxTemplateDialog()
{
delete pImpl;
}
-ISfxTemplateCommon* SfxTemplateDialog::GetISfxTemplateCommon()
-{
- return pImpl->GetISfxTemplateCommon();
-}
-
void SfxTemplateDialog::SetParagraphFamily()
{
// first select the paragraph family
@@ -170,8 +163,6 @@ void SfxTemplateDialog::SetParagraphFamily()
pImpl->SetAutomaticFilter();
}
-
-
void SfxTemplateDialog::DataChanged( const DataChangedEvent& _rDCEvt )
{
if ( ( DATACHANGED_SETTINGS == _rDCEvt.GetType() ) &&
@@ -253,8 +244,8 @@ sal_Int8 DropListBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt )
{
// special case: page styles are allowed to create new styles by example
// but not allowed to be created by drag and drop
- if( pDialog->nActFamily == SfxCommonTemplateDialog_Impl::SfxFamilyIdToNId( SFX_STYLE_FAMILY_PAGE ) ||
- pDialog->bNewByExampleDisabled )
+ if (pDialog->GetActualFamily() == SFX_STYLE_FAMILY_PAGE ||
+ pDialog->bNewByExampleDisabled)
return DND_ACTION_NONE;
else
return DND_ACTION_COPY;
@@ -780,7 +771,6 @@ SvTreeListEntry* FillBox_Impl(SvTreeListBox *pBox,
SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Window* pW, bool ) :
mbIgnoreSelect( false ),
- aISfxTemplateCommon ( this ),
pBindings ( pB ),
pWindow ( pW ),
pModule ( NULL ),
@@ -833,7 +823,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Win
sal_uInt16 SfxCommonTemplateDialog_Impl::StyleNrToInfoOffset(sal_uInt16 nId)
{
const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nId );
- return SfxFamilyIdToNId(pItem->GetFamily())-1;
+ return SfxTemplateDialog::SfxFamilyIdToNId(pItem->GetFamily())-1;
}
void SfxTemplateDialog_Impl::EnableEdit(bool bEnable)
@@ -928,7 +918,7 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
for( ; nCount--; )
{
const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nCount );
- sal_uInt16 nId = SfxFamilyIdToNId( pItem->GetFamily() );
+ sal_uInt16 nId = SfxTemplateDialog::SfxFamilyIdToNId( pItem->GetFamily() );
InsertFamilyItem( nId, pItem );
}
@@ -1017,9 +1007,7 @@ SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
m_pDeletionWatcher->signal();
}
-
-
-sal_uInt16 SfxCommonTemplateDialog_Impl::SfxFamilyIdToNId( SfxStyleFamily nFamily )
+sal_uInt16 SfxTemplateDialog::SfxFamilyIdToNId(SfxStyleFamily nFamily)
{
switch ( nFamily )
{
@@ -1032,6 +1020,19 @@ sal_uInt16 SfxCommonTemplateDialog_Impl::SfxFamilyIdToNId( SfxStyleFamily nFamil
}
}
+SfxStyleFamily SfxTemplateDialog::NIdToSfxFamilyId(sal_uInt16 nId)
+{
+ switch (nId)
+ {
+ case 1: return SFX_STYLE_FAMILY_CHAR;
+ case 2: return SFX_STYLE_FAMILY_PARA;
+ case 3: return SFX_STYLE_FAMILY_FRAME;
+ case 4: return SFX_STYLE_FAMILY_PAGE;
+ case 5: return SFX_STYLE_FAMILY_PSEUDO;
+ default: return SFX_STYLE_FAMILY_ALL;
+ }
+}
+
void SfxCommonTemplateDialog_Impl::SetAutomaticFilter()
{
sal_uInt16 nCount = aFilterLb.GetEntryCount();
@@ -1057,7 +1058,7 @@ const SfxStyleFamilyItem *SfxCommonTemplateDialog_Impl::GetFamilyItem_Impl() con
for(size_t i = 0; i < nCount; ++i)
{
const SfxStyleFamilyItem *pItem = pStyleFamilies->at( i );
- sal_uInt16 nId = SfxFamilyIdToNId(pItem->GetFamily());
+ sal_uInt16 nId = SfxTemplateDialog::SfxFamilyIdToNId(pItem->GetFamily());
if(nId == nActFamily)
return pItem;
}
@@ -2482,7 +2483,7 @@ void SfxTemplateDialog_Impl::updateFamilyImages()
for( ; nLoop--; )
{
const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nLoop );
- sal_uInt16 nId = SfxFamilyIdToNId( pItem->GetFamily() );
+ sal_uInt16 nId = SfxTemplateDialog::SfxFamilyIdToNId( pItem->GetFamily() );
m_aActionTbL.SetItemImage( nId, pItem->GetImage() );
}
}
@@ -2880,7 +2881,7 @@ sal_Int8 DropToolBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt )
}
// special case: page styles are allowed to create new styles by example
// but not allowed to be created by drag and drop
- if ( nItemId != SfxCommonTemplateDialog_Impl::SfxFamilyIdToNId( SFX_STYLE_FAMILY_PAGE )&&
+ if ( nItemId != SfxTemplateDialog::SfxFamilyIdToNId( SFX_STYLE_FAMILY_PAGE )&&
IsDropFormatSupported( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) &&
!rParent.bNewByExampleDisabled )
{