Kaydet (Commit) 4dce632b authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

tdf#92106 sc: Update and new style commands w/o args

Change-Id: I31f7ac6783ab9bb32f2423cc7f80d5ddcf827ba9
üst 18dd07ba
......@@ -28,6 +28,7 @@
#include <sfx2/app.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/newstyle.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
#include <svl/whiter.hxx>
......@@ -250,16 +251,16 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet )
void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
// in case of vertical toolbar
if ( !rReq.GetArgs() )
const SfxItemSet* pArgs = rReq.GetArgs();
const sal_uInt16 nSlotId = rReq.GetSlot();
if ( !pArgs && nSlotId != SID_STYLE_NEW_BY_EXAMPLE && nSlotId != SID_STYLE_UPDATE_BY_EXAMPLE )
{
// in case of vertical toolbar
pViewData->GetDispatcher().Execute( SID_STYLE_DESIGNER, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
return;
}
SfxBindings& rBindings = pViewData->GetBindings();
const SfxItemSet* pArgs = rReq.GetArgs();
const sal_uInt16 nSlotId = rReq.GetSlot();
const SCTAB nCurTab = GetViewData()->GetTabNo();
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScTabViewShell* pTabViewShell= GetViewData()->GetViewShell();
......@@ -430,6 +431,14 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
const SfxPoolItem* pNameItem;
if (pArgs && SfxItemState::SET == pArgs->GetItemState( nSlotId, true, &pNameItem ))
aStyleName = static_cast<const SfxStringItem*>(pNameItem)->GetValue();
else if ( nSlotId == SID_STYLE_NEW_BY_EXAMPLE )
{
ScopedVclPtrInstance<SfxNewStyleDlg> pDlg( nullptr, *pStylePool );
if ( RET_OK != pDlg->Execute() )
return;
aStyleName = pDlg->GetName();
}
pStyleSheet = pStylePool->Find( aStyleName, eFamily );
aOldData.InitFromStyle( pStyleSheet );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment