summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeena Gupta <heena.h.gupta@ericsson.com>2014-12-24 15:55:37 +0530
committerMichael Stahl <mstahl@redhat.com>2015-02-06 23:57:13 +0000
commitde896f74c805e77706cce10f4d79117af1811ee9 (patch)
tree3bb85924cc3d578a756f9fd0407dda4bbc28f3a9
parente32eff2bb4c12fdc33e476b9f12bb4bb71d22ebc (diff)
fdo#87675-"Edit" Button for next style in edit paragraph style
Change-Id: I1a4888b869df7f242244bed2fef36996450eec23 Reviewed-on: https://gerrit.libreoffice.org/13639 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--include/sfx2/mgetempl.hxx5
-rw-r--r--sfx2/source/dialog/mgetempl.cxx53
-rw-r--r--sfx2/uiconfig/ui/managestylepage.ui15
3 files changed, 72 insertions, 1 deletions
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index 06deead04eae..12fafb48b187 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -43,6 +43,7 @@ class SfxManageStyleSheetPage : public SfxTabPage
FixedText* m_pFollowFt;
ListBox* m_pFollowLb;
+ PushButton* m_pEditStyleBtn;
FixedText* m_pBaseFt;
ListBox* m_pBaseLb;
@@ -69,6 +70,7 @@ friend class SfxStyleDialog;
DECL_LINK( GetFocusHdl, Edit * );
DECL_LINK( LoseFocusHdl, Edit * );
+ DECL_LINK( EditStyleHdl_Impl, void * );
void UpdateName_Impl(ListBox *, const OUString &rNew);
void SetDescriptionText_Impl();
@@ -82,6 +84,9 @@ protected:
virtual bool FillItemSet(SfxItemSet *) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet *) SAL_OVERRIDE;
+ bool Execute_Impl( sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr,
+ sal_uInt16 nFamily, sal_uInt16 nMask = 0,
+ const sal_uInt16* pModifier = NULL );
using TabPage::ActivatePage;
virtual void ActivatePage(const SfxItemSet &) SAL_OVERRIDE;
using TabPage::DeactivatePage;
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index c7a70ca630d9..c9c83704073e 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -34,10 +34,14 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/module.hxx>
+#include <sfx2/templdlg.hxx>
+#include "templdgi.hxx"
#include <sfx2/sfx.hrc>
#include "dialog.hrc"
#include <svl/style.hrc>
+#include <svl/stritem.hxx>
+#include <sfx2/dispatch.hxx>
/* SfxManageStyleSheetPage Constructor
*
@@ -62,6 +66,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
m_pFollowLb->SetStyle(m_pFollowLb->GetStyle() | WB_SORT);
const sal_Int32 nMaxWidth(62);
m_pFollowLb->setMaxWidthChars(nMaxWidth);
+ get(m_pEditStyleBtn, "editstyle");
get(m_pBaseFt, "linkedwithft");
get(m_pBaseLb, "linkedwith");
m_pBaseLb->SetStyle(m_pBaseLb->GetStyle() | WB_SORT);
@@ -223,6 +228,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
// It is a style with auto update? (SW only)
if(SfxItemState::SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
m_pAutoCB->Show();
+ m_pEditStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditStyleHdl_Impl ) );
}
@@ -309,7 +315,53 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
m_pDescFt->SetText( pStyle->GetDescription( eUnit ) );
}
+IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleHdl_Impl )
+{
+
+ OUString aTemplName(m_pFollowLb->GetSelectEntry());
+ if (Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(),(sal_uInt16)pStyle->GetFamily(), 0 ))
+ {
+ }
+ return 0;
+
+}
+
+// Internal: Perform functions through the Dispatcher
+bool SfxManageStyleSheetPage::Execute_Impl(
+ sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily,
+ sal_uInt16 nMask, const sal_uInt16* pModifier)
+{
+
+ SfxDispatcher &rDispatcher = *SfxGetpApp()->GetDispatcher_Impl();
+ SfxStringItem aItem(nId, rStr);
+ SfxUInt16Item aFamily(SID_STYLE_FAMILY, nFamily);
+ SfxUInt16Item aMask( SID_STYLE_MASK, nMask );
+ SfxStringItem aUpdName(SID_STYLE_UPD_BY_EX_NAME, rStr);
+ SfxStringItem aRefName( SID_STYLE_REFERENCE, rRefStr );
+ const SfxPoolItem* pItems[ 6 ];
+ sal_uInt16 nCount = 0;
+ if( !rStr.isEmpty() )
+ pItems[ nCount++ ] = &aItem;
+ pItems[ nCount++ ] = &aFamily;
+ if( nMask )
+ pItems[ nCount++ ] = &aMask;
+ if ( !rRefStr.isEmpty() )
+ pItems[ nCount++ ] = &aRefName;
+
+ pItems[ nCount++ ] = 0;
+
+ sal_uInt16 nModi = pModifier ? *pModifier : 0;
+ const SfxPoolItem* mpItem = rDispatcher.Execute(
+ nId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD | SfxCallMode::MODAL,
+ pItems, nModi );
+
+ if ( !mpItem )
+ return false;
+
+ return true;
+
+}
IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
@@ -325,7 +377,6 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
-
IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
/* [Description]
diff --git a/sfx2/uiconfig/ui/managestylepage.ui b/sfx2/uiconfig/ui/managestylepage.ui
index 99815f2d00c0..396fd3966951 100644
--- a/sfx2/uiconfig/ui/managestylepage.ui
+++ b/sfx2/uiconfig/ui/managestylepage.ui
@@ -99,6 +99,21 @@
</packing>
</child>
<child>
+ <object class="GtkButton" id="editstyle">
+ <property name="label" translatable="yes">Edit Style</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkComboBoxText" id="linkedwith">
<property name="visible">True</property>
<property name="can_focus">False</property>