we don't need to update the style icons anymore

once this was a dialog but now its a panel and the case of a the document under
the dialog changing type isn't an issue anymore

Change-Id: I4680cf238675161c533852d843508a19c74a9073
This commit is contained in:
Caolán McNamara
2016-10-25 14:06:09 +01:00
parent f144d592fb
commit e83d0d9b3b
3 changed files with 3 additions and 37 deletions

View File

@@ -37,7 +37,6 @@ public:
virtual ~SfxTemplatePanelControl() override;
virtual void dispose() override;
virtual void DataChanged( const DataChangedEvent& _rDCEvt ) override;
virtual void Resize() override;
virtual void StateChanged( StateChangedType nStateChange ) override;

View File

@@ -349,7 +349,7 @@ SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Wi
{
OSL_ASSERT(mpBindings!=nullptr);
pImpl->updateNonFamilyImages();
pImpl->setNonFamilyImages();
SetStyle(GetStyle() & ~WB_DOCKABLE);
}
@@ -365,18 +365,6 @@ void SfxTemplatePanelControl::dispose()
Window::dispose();
}
void SfxTemplatePanelControl::DataChanged( const DataChangedEvent& _rDCEvt )
{
if ( ( DataChangedEventType::SETTINGS == _rDCEvt.GetType() ) &&
( AllSettingsFlags::STYLE & _rDCEvt.GetFlags() ) )
{
pImpl->updateFamilyImages();
pImpl->updateNonFamilyImages();
}
Window::DataChanged( _rDCEvt );
}
void SfxTemplatePanelControl::Resize()
{
if(pImpl)
@@ -2310,26 +2298,7 @@ void SfxTemplateDialog_Impl::ReplaceUpdateButtonByMenu()
ToolBoxItemBits::DROPDOWNONLY|m_aActionTbR->GetItemBits( SID_STYLE_NEW_BY_EXAMPLE ));
}
void SfxTemplateDialog_Impl::updateFamilyImages()
{
if ( !m_pStyleFamiliesId )
// we do not have a resource id to load the new images from
return;
// let the families collection update the images
pStyleFamilies->updateImages( *m_pStyleFamiliesId );
// and set the new images on our toolbox
size_t nLoop = pStyleFamilies->size();
for( ; nLoop--; )
{
const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nLoop );
sal_uInt16 nId = SfxTemplate::SfxFamilyIdToNId( pItem->GetFamily() );
m_aActionTbL->SetItemImage( nId, pItem->GetImage() );
}
}
void SfxTemplateDialog_Impl::updateNonFamilyImages()
void SfxTemplateDialog_Impl::setNonFamilyImages()
{
m_aActionTbR->SetImageList(ImageList(SfxResId(RID_STYLE_DESIGNER_IMAGELIST)));
}
@@ -2362,7 +2331,6 @@ SfxTemplateDialog_Impl::~SfxTemplateDialog_Impl()
void SfxTemplateDialog_Impl::LoadedFamilies()
{
updateFamilyImages();
Resize();
}

View File

@@ -369,8 +369,7 @@ protected:
void Resize();
Size GetMinOutputSizePixel();
void updateFamilyImages();
void updateNonFamilyImages();
void setNonFamilyImages();
public:
friend class SfxTemplateDialog;