officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu | 4 - sc/source/ui/miscdlgs/datastreams.cxx | 27 +++++++++- 2 files changed, 28 insertions(+), 3 deletions(-)
New commits: commit 9c45345a680f7444df251f9403c7d56572380f21 Author: Matúš Kukan <matus.ku...@collabora.com> Date: Mon Nov 18 13:31:39 2013 +0100 datastreams: make toolbar docked, hidden and show it when starting streaming Change-Id: Icbf1abffc5424e213550c7cf27cdaa59126fa54d diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu index 8ef44d3..f5e294b 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 1639dbc..dd5a821 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()
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits