summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/Tools.cxx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-05-03 13:01:13 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:28 +0100
commit1571b476038c46777edd3df610c83dc761f22cf9 (patch)
tree55070a75e4c33217a8033541b54f9085d1df0a15 /sfx2/source/sidebar/Tools.cxx
parentc6f163600e308ae7c4f5ea3f6962a23cb067185f (diff)
Resolves: #i122218# Add new sidebar panel...
for inserting shapes into Draw documents (cherry picked from commit 5e09229d726cbc288719c7466b277a4eb5bb244b) Conflicts: sd/source/ui/view/drviewsa.cxx sfx2/Package_inc.mk svx/inc/svx/dialogs.hrc Related: #i122218# Added missing files to sfx2/inc/sfx2/sidebar (cherry picked from commit 99572ff12af758a256703884811c7915c79f27ec) Conflicts: sfx2/inc/sfx2/sidebar/ResourceDefinitions.hrc Related: #i122218# Added more missing files (cherry picked from commit cdc8cb702630938c673255638aecbd2dd5c53ed7) fix up to build Change-Id: I098976d787e6a91d36aac98a5917f48b50872087 9c6f4d957924e177922e26606173d1b238b8006e ceb9b720c08fb1db5b418c618e280b9b68eda2cf 01712631eacbd3e58e2cd04d1903bbcb0ecb9301
Diffstat (limited to 'sfx2/source/sidebar/Tools.cxx')
-rw-r--r--sfx2/source/sidebar/Tools.cxx34
1 files changed, 33 insertions, 1 deletions
diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx
index 27956cd6670d..881545864ae9 100644
--- a/sfx2/source/sidebar/Tools.cxx
+++ b/sfx2/source/sidebar/Tools.cxx
@@ -16,7 +16,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Tools.hxx"
+#include "sfx2/sidebar/Tools.hxx"
#include "sfx2/sidebar/Theme.hxx"
@@ -26,7 +26,9 @@
#include <comphelper/namedvaluecollection.hxx>
#include <vcl/gradient.hxx>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
#include <cstring>
@@ -147,4 +149,34 @@ SvBorder Tools::RectangleToSvBorder (const Rectangle aBox)
aBox.Bottom());
}
+
+
+
+util::URL Tools::GetURL (const ::rtl::OUString& rsCommand)
+{
+ util::URL aURL;
+ aURL.Complete = rsCommand;
+
+ const ::comphelper::ComponentContext aComponentContext (::comphelper::getProcessServiceFactory());
+ const Reference<util::XURLTransformer> xParser (
+ aComponentContext.createComponent("com.sun.star.util.URLTransformer"),
+ UNO_QUERY_THROW);
+ xParser->parseStrict(aURL);
+
+ return aURL;
+}
+
+
+
+
+Reference<frame::XDispatch> Tools::GetDispatch (
+ const cssu::Reference<css::frame::XFrame>& rxFrame,
+ const util::URL& rURL)
+{
+ Reference<frame::XDispatchProvider> xProvider (rxFrame, UNO_QUERY_THROW);
+ Reference<frame::XDispatch> xDispatch (xProvider->queryDispatch(rURL, ::rtl::OUString(), 0));
+ return xDispatch;
+}
+
+
} } // end of namespace sfx2::sidebar