summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2015-08-31 22:03:07 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2015-08-31 22:11:06 +0300
commit4dce632b3930d0826dae69d494b5a73ac794d28c (patch)
treec827aedc8b971b148be81f5e7f171666f4c91b74
parent18dd07ba4fd9ede98ce576e6024831658bbd5401 (diff)
tdf#92106 sc: Update and new style commands w/o args
Change-Id: I31f7ac6783ab9bb32f2423cc7f80d5ddcf827ba9
-rw-r--r--sc/source/ui/view/formatsh.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 315afb3c7637..3fdbf69520d8 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -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 );