summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSusobhan Ghosh <susobhang70@gmail.com>2016-06-10 16:33:42 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-06-16 08:09:27 +0000
commitb0a9ba98ba83154680f8aea0fd0e58b85e2cfb04 (patch)
tree165763a46727b2303bcbd1a367813313534a2926
parentd2106d8c8c1af64924f5423223388dbbe99af352 (diff)
tdf#86759 and tdf#89466: Enable Page Background Panel for Draw
Rename Slide Background Panel to Slide in Impress. Reorder Properties Deck Change-Id: Ib2039c41c56a0182887f19aa362d633dcabfe9dd Reviewed-on: https://gerrit.libreoffice.org/26159 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu38
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx35
-rw-r--r--sd/source/ui/sidebar/SlideBackground.hxx8
3 files changed, 59 insertions, 22 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 6b2f53a4a837..f579ba16d4d9 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -693,62 +693,62 @@
</prop>
</node>
- <node oor:name="SdLayoutsPanel" oor:op="replace">
+ <node oor:name="SlideBackgroundPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
- <value xml:lang="en-US">Layouts</value>
+ <value xml:lang="en-US">Slide</value>
</prop>
<prop oor:name="TitleBarIsOptional" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="Id" oor:type="xs:string">
- <value>SdLayoutsPanel</value>
+ <value>SlideBackgroundPanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
<value>PropertyDeck</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
- Impress, DrawPage, visible ;
- Impress, default, visible ;
- Impress, HandoutPage, visible ;
- Impress, NotesPage, visible ;
- Impress, SlidesorterPage, visible ;
+ DrawImpress, DrawPage, visible, .uno:PageSetup ;
+ DrawImpress, default, visible, .uno:PageSetup ;
+ DrawImpress, HandoutPage, visible, .uno:PageSetup ;
+ DrawImpress, NotesPage, visible, .uno:PageSetup ;
+ DrawImpress, SlidesorterPage, visible, .uno:PageSetup ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
- <value>private:resource/toolpanel/SdPanelFactory/Layouts</value>
+ <value>private:resource/toolpanel/SdPanelFactory/SlideBackgroundPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
<value>100</value>
</prop>
</node>
- <node oor:name="SlideBackgroundPanel" oor:op="replace">
+ <node oor:name="SdLayoutsPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
- <value xml:lang="en-US">Slide Background</value>
+ <value xml:lang="en-US">Layouts</value>
</prop>
<prop oor:name="TitleBarIsOptional" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="Id" oor:type="xs:string">
- <value>SlideBackgroundPanel</value>
+ <value>SdLayoutsPanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
<value>PropertyDeck</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
- Impress, DrawPage, visible, .uno:PageSetup ;
- Impress, default, visible, .uno:PageSetup ;
- Impress, HandoutPage, visible, .uno:PageSetup ;
- Impress, NotesPage, visible, .uno:PageSetup ;
- Impress, SlidesorterPage, visible, .uno:PageSetup ;
+ Impress, DrawPage, visible ;
+ Impress, default, visible ;
+ Impress, HandoutPage, visible ;
+ Impress, NotesPage, visible ;
+ Impress, SlidesorterPage, visible ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
- <value>private:resource/toolpanel/SdPanelFactory/SlideBackgroundPanel</value>
+ <value>private:resource/toolpanel/SdPanelFactory/Layouts</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>100</value>
+ <value>200</value>
</prop>
</node>
<node oor:name="SdUsedMasterPagesPanel" oor:op="replace">
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 279d8e4471ac..4cd012fa5cd7 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -63,6 +63,7 @@
#include <svx/dlgutil.hxx>
#include <algorithm>
#include "EventMultiplexer.hxx"
+#include "glob.hrc"
using namespace ::com::sun::star;
@@ -94,6 +95,8 @@ SlideBackground::SlideBackground(
mpHatchItem(),
mpBitmapItem(),
mxFrame(rxFrame),
+ maContext(),
+ mbTitle(false),
mpBindings(pBindings)
{
get(mpPaperSizeBox,"paperformat");
@@ -155,6 +158,14 @@ void SlideBackground::Initialize()
Update();
}
+void SlideBackground::HandleContextChange(
+ const ::sfx2::sidebar::EnumContext& rContext)
+{
+ if (maContext == rContext)
+ return;
+ maContext = rContext;
+}
+
void SlideBackground::Update()
{
const drawing::FillStyle eXFS = (drawing::FillStyle)mpFillStyle->GetSelectEntryPos();
@@ -290,7 +301,8 @@ void SlideBackground::addListener()
aLink,
tools::EventMultiplexerEvent::EID_CURRENT_PAGE |
tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED |
- tools::EventMultiplexerEvent::EID_SHAPE_CHANGED );
+ tools::EventMultiplexerEvent::EID_SHAPE_CHANGED |
+ tools::EventMultiplexerEvent::EID_VIEW_ADDED);
}
void SlideBackground::removeListener()
@@ -338,6 +350,27 @@ IMPL_LINK_TYPED(SlideBackground, EventMultiplexerListener,
GetBindings()->Invalidate( SidArray );
}
break;
+ case tools::EventMultiplexerEvent::EID_VIEW_ADDED:
+ {
+ if(!mbTitle)
+ {
+ sfx2::sidebar::EnumContext rDrawContext(sfx2::sidebar::EnumContext::Application_Draw,
+ sfx2::sidebar::EnumContext::Context_DrawPage);
+ sfx2::sidebar::EnumContext rImpressContext(sfx2::sidebar::EnumContext::Application_Impress,
+ sfx2::sidebar::EnumContext::Context_DrawPage);
+ if(maContext == rDrawContext)
+ {
+ SetPanelTitle(SD_RESSTR(STR_PAGE_NAME));
+ mbTitle = true;
+ }
+ else if(maContext == rImpressContext)
+ {
+ SetPanelTitle(SD_RESSTR(STR_SLIDE_NAME));
+ mbTitle = true;
+ }
+ }
+ }
+ break;
default:
break;
}
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index b5b892ea9ea6..65d908045be2 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -43,12 +43,13 @@
#include <svx/xbtmpit.hxx>
#include <svx/xflhtit.hxx>
#include "EventMultiplexer.hxx"
-
+#include <sfx2/sidebar/IContextChangeReceiver.hxx>
namespace sd { namespace sidebar {
class SlideBackground :
public PanelLayout,
+ public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
@@ -67,6 +68,8 @@ public:
const SfxItemState eState,
const SfxPoolItem* pState,
const bool bIsEnabled) override;
+ virtual void HandleContextChange(
+ const ::sfx2::sidebar::EnumContext& rContext) override;
private:
@@ -100,6 +103,8 @@ private:
std::unique_ptr< XFillBitmapItem > mpBitmapItem;
css::uno::Reference<css::frame::XFrame> mxFrame;
+ ::sfx2::sidebar::EnumContext maContext;
+ bool mbTitle;
SfxBindings* mpBindings;
SfxMapUnit meUnit;
@@ -115,7 +120,6 @@ private:
void Initialize();
void Update();
- //DO NOT REMOVE, will be used in follow-up commits
void SetPanelTitle(const OUString& rTitle);
Color GetColorSetOrDefault();