Tools.cxx (f35c6d02) Tools.cxx (d46a1e42)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 20 unchanged lines hidden (view full) ---

29#include <comphelper/processfactory.hxx>
30#include <comphelper/componentcontext.hxx>
31#include <comphelper/namedvaluecollection.hxx>
32#include <vcl/gradient.hxx>
33
34#include <com/sun/star/frame/XDispatchProvider.hpp>
35#include <com/sun/star/graphic/XGraphicProvider.hpp>
36#include <com/sun/star/util/XURLTransformer.hpp>
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 20 unchanged lines hidden (view full) ---

29#include <comphelper/processfactory.hxx>
30#include <comphelper/componentcontext.hxx>
31#include <comphelper/namedvaluecollection.hxx>
32#include <vcl/gradient.hxx>
33
34#include <com/sun/star/frame/XDispatchProvider.hpp>
35#include <com/sun/star/graphic/XGraphicProvider.hpp>
36#include <com/sun/star/util/XURLTransformer.hpp>
37#include <com/sun/star/frame/XModuleManager.hpp>
37
38#include <cstring>
39
40using namespace css;
41using namespace cssu;
42
43
44namespace sfx2 { namespace sidebar {

--- 135 unchanged lines hidden (view full) ---

180 const util::URL& rURL)
181{
182 Reference<frame::XDispatchProvider> xProvider (rxFrame, UNO_QUERY_THROW);
183 Reference<frame::XDispatch> xDispatch (xProvider->queryDispatch(rURL, ::rtl::OUString(), 0));
184 return xDispatch;
185}
186
187
38
39#include <cstring>
40
41using namespace css;
42using namespace cssu;
43
44
45namespace sfx2 { namespace sidebar {

--- 135 unchanged lines hidden (view full) ---

181 const util::URL& rURL)
182{
183 Reference<frame::XDispatchProvider> xProvider (rxFrame, UNO_QUERY_THROW);
184 Reference<frame::XDispatch> xDispatch (xProvider->queryDispatch(rURL, ::rtl::OUString(), 0));
185 return xDispatch;
186}
187
188
189
190
191::rtl::OUString Tools::GetModuleName (
192 const cssu::Reference<css::frame::XFrame>& rxFrame)
193{
194 if ( ! rxFrame.is() || ! rxFrame->getController().is())
195 return ::rtl::OUString();
196
197 try
198 {
199 const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
200 const Reference<frame::XModuleManager> xModuleManager (
201 aContext.createComponent("com.sun.star.frame.ModuleManager"),
202 UNO_QUERY_THROW);
203 return xModuleManager->identify(rxFrame);
204 }
205 catch (const Exception&)
206 {
207 // Ignored.
208 }
209 return ::rtl::OUString();
210}
211
212
188} } // end of namespace sfx2::sidebar
213} } // end of namespace sfx2::sidebar