Kaydet (Commit) 9c45345a authored tarafından Matúš Kukan's avatar Matúš Kukan

datastreams: make toolbar docked, hidden and show it when starting streaming

Change-Id: Icbf1abffc5424e213550c7cf27cdaa59126fa54d
üst d4fa4c7b
......@@ -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">
......
......@@ -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()
......
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