diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2013-11-18 13:31:39 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2013-11-18 13:35:07 +0100 |
commit | 9c45345a680f7444df251f9403c7d56572380f21 (patch) | |
tree | 23da3ef3944e59f271094cbf32fa3a3ce0bcc9f9 | |
parent | d4fa4c7b386157a7b313bacda0aa0b09ff40f5af (diff) |
datastreams: make toolbar docked, hidden and show it when starting streaming
Change-Id: Icbf1abffc5424e213550c7cf27cdaa59126fa54d
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/datastreams.cxx | 27 |
2 files changed, 28 insertions, 3 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu index 8ef44d37dd70..f5e294b577c8 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu @@ -56,13 +56,13 @@ </node> <node oor:name="private:resource/toolbar/datastreams" oor:op="replace"> <prop oor:name="Docked" oor:type="xs:boolean"> - <value>false</value> + <value>true</value> </prop> <prop oor:name="UIName" oor:type="xs:string"> <value xml:lang="en-US">Data Streams</value> </prop> <prop oor:name="Visible" oor:type="xs:boolean"> - <value>true</value> + <value>false</value> </prop> </node> <node oor:name="private:resource/toolbar/drawobjectbar" oor:op="replace"> diff --git a/sc/source/ui/miscdlgs/datastreams.cxx b/sc/source/ui/miscdlgs/datastreams.cxx index 1639dbc7512f..dd5a8218fd53 100644 --- a/sc/source/ui/miscdlgs/datastreams.cxx +++ b/sc/source/ui/miscdlgs/datastreams.cxx @@ -9,14 +9,18 @@ #include <datastreams.hxx> +#include <com/sun/star/frame/XLayoutManager.hpp> +#include <com/sun/star/ui/XUIElement.hpp> #include <osl/conditn.hxx> #include <rtl/strbuf.hxx> #include <salhelper/thread.hxx> +#include <sfx2/viewfrm.hxx> #include <asciiopt.hxx> +#include <dbfunc.hxx> #include <docsh.hxx> #include <impex.hxx> +#include <tabvwsh.hxx> #include <viewdata.hxx> -#include <dbfunc.hxx> namespace datastreams { @@ -80,6 +84,27 @@ void DataStreams::Start() mpScDocument->EnableUndo(false); mbRunning = true; mxThread->maStart.set(); + css::uno::Reference< css::frame::XFrame > xFrame = + mpScDocShell->GetViewData()->GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(); + if (!xFrame.is()) + return; + + css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY); + if (!xPropSet.is()) + return; + + css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; + xPropSet->getPropertyValue("LayoutManager") >>= xLayoutManager; + if (!xLayoutManager.is()) + return; + + const OUString sResourceURL( "private:resource/toolbar/datastreams" ); + css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL); + if (!xUIElement.is()) + { + xLayoutManager->createElement( sResourceURL ); + xLayoutManager->showElement( sResourceURL ); + } } void DataStreams::Stop() |