Kaydet (Commit) b9ec2b7d authored tarafından Rishabh Kumar's avatar Rishabh Kumar Kaydeden (comit) Andras Timar

tdf#73071: Styles tab addition to the sidebar for writer

Addition of .uno:StyleApply , .uno:StyleUpdateByExample and .uno:StyleNewByExample uno commands to the sidebar

Change-Id: Iab6f1fb465066fce523fd376038a059189f1b842
Reviewed-on: https://gerrit.libreoffice.org/16279Reviewed-by: 's avatarYousuf Philips <philipz85@hotmail.com>
Tested-by: 's avatarYousuf Philips <philipz85@hotmail.com>
(cherry picked from commit e436f311)
Reviewed-on: https://gerrit.libreoffice.org/16306Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 5cd5424f
......@@ -231,6 +231,33 @@
</node>
<node oor:name="PanelList">
<node oor:name="StylesPropertyPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Styles</value>
</prop>
<prop oor:name="Id" oor:type="xs:string">
<value>StylesPropertyPanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
<value>PropertyDeck</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
WriterVariants, Annotation, visible ;
WriterVariants, DrawText, visible ;
WriterVariants, Table, visible ;
WriterVariants, Text, visible ;
WriterVariants, default, visible ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
<value>private:resource/toolpanel/SvxPanelFactory/StylesPropertyPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
<value>100</value>
</prop>
</node>
<node oor:name="TextPropertyPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Character</value>
......@@ -270,7 +297,7 @@
<value>private:resource/toolpanel/SvxPanelFactory/TextPropertyPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
<value>100</value>
<value>120</value>
</prop>
</node>
......
......@@ -182,6 +182,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/text/TextUnderlineControl \
svx/source/sidebar/text/TextUnderlinePopup \
svx/source/sidebar/text/TextPropertyPanel \
svx/source/sidebar/styles/StylesPropertyPanel \
svx/source/sidebar/paragraph/ParaLineSpacingControl \
svx/source/sidebar/paragraph/ParaLineSpacingPopup \
svx/source/sidebar/paragraph/ParaPropertyPanel \
......
......@@ -64,6 +64,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/sidebarline \
svx/uiconfig/ui/sidebarparagraph \
svx/uiconfig/ui/sidebarpossize \
svx/uiconfig/ui/sidebarstylespanel \
svx/uiconfig/ui/sidebartextpanel \
svx/uiconfig/ui/textcontrolchardialog \
svx/uiconfig/ui/textcontrolparadialog \
......
......@@ -18,6 +18,7 @@
*/
#include "text/TextPropertyPanel.hxx"
#include "styles/StylesPropertyPanel.hxx"
#include "paragraph/ParaPropertyPanel.hxx"
#include "area/AreaPropertyPanel.hxx"
#include "graphic/GraphicPropertyPanel.hxx"
......@@ -144,6 +145,10 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
{
pControl = TextPropertyPanel::Create(pParentWindow, xFrame, pBindings, aContext);
}
else if (rsResourceURL.endsWith("/StylesPropertyPanel"))
{
pControl = StylesPropertyPanel::Create(pParentWindow, xFrame, pBindings);
}
else if (rsResourceURL.endsWith("/ParaPropertyPanel"))
{
pControl = ParaPropertyPanel::Create(pParentWindow, xFrame, pBindings, xSidebar);
......
#include "StylesPropertyPanel.hxx"
#include <boost/bind.hpp>
using namespace css;
using namespace css::uno;
namespace svx { namespace sidebar {
VclPtr<vcl::Window> StylesPropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
{
if (pParent == NULL)
throw lang::IllegalArgumentException("no parent Window given to StylesPropertyPanel::Create", NULL, 0);
if ( ! rxFrame.is())
throw lang::IllegalArgumentException("no XFrame given to StylesPropertyPanel::Create", NULL, 1);
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to StylesPropertyPanel::Create", NULL, 2);
return VclPtr<StylesPropertyPanel>::Create(pParent,rxFrame,pBindings);
}
StylesPropertyPanel::StylesPropertyPanel ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings )
: PanelLayout(pParent, "SidebarStylesPanel", "svx/ui/sidebarstylespanel.ui", rxFrame),
mpBindings(pBindings)
{
}
StylesPropertyPanel::~StylesPropertyPanel()
{
disposeOnce();
}
void StylesPropertyPanel::dispose()
{
PanelLayout::dispose();
}
void StylesPropertyPanel::DataChanged( const DataChangedEvent& /*rEvent*/)
{
}
void StylesPropertyPanel::NotifyItemUpdate (
const sal_uInt16 /*nSId*/,
const SfxItemState /*eState*/,
const SfxPoolItem* /*pState*/,
const bool /*bIsEnabled*/)
{
}
}}
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <sfx2/sidebar/EnumContext.hxx>
#include <svtools/ctrlbox.hxx>
#include <editeng/fhgtitem.hxx>
#include <boost/scoped_ptr.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/ui/XSidebar.hpp>
#include <com/sun/star/frame/XToolbarController.hpp>
#include <svx/sidebar/PanelLayout.hxx>
namespace svx { namespace sidebar{
class StylesPropertyPanel:
public PanelLayout
{
public:
virtual ~StylesPropertyPanel();
virtual void dispose() SAL_OVERRIDE;
static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
virtual void DataChanged( const DataChangedEvent& rEvent ) SAL_OVERRIDE;
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
const SfxPoolItem* pState,
const bool bIsEnabled); //SAL_OVERRIDE;
StylesPropertyPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
SfxBindings* GetBindings() { return mpBindings; }
private:
SfxBindings* mpBindings;
//more controls will be added later
};
} } //end of namespace svx::sidebar
#endif
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkGrid" id="SidebarStylesPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="sfxlo-SidebarToolBox" id="fontstyletoolbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkToolButton" id="fontstyle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="is_important">True</property>
<property name="action_name">.uno:StyleApply</property>
</object>
<packing>
<property name="expand">True</property>
<property name="homogenous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_right">6</property>
<child>
<object class="sfxlo-SidebarToolBox" id="styleupdate">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkToolButton" id="styleupdateexample">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="is_important">True</property>
<property name="action_name">.uno:StyleUpdateByExample</property>
</object>
<packing>
<property name="expand">True</property>
<property name="homogenous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="sfxlo-SidebarToolBox" id="stylenew">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkToolButton" id="stylenewexample">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="is_important">True</property>
<property name="action_name">.uno:StyleNewByExample</property>
</object>
<packing>
<property name="expand">True</property>
<property name="homogenous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
</interface>
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