Tools.cxx (b9e67834) Tools.cxx (95a18594)
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

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

24#include "Tools.hxx"
25
26#include "sfx2/sidebar/Theme.hxx"
27
28#include "sfx2/imagemgr.hxx"
29#include <comphelper/processfactory.hxx>
30#include <comphelper/componentcontext.hxx>
31#include <comphelper/namedvaluecollection.hxx>
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

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

24#include "Tools.hxx"
25
26#include "sfx2/sidebar/Theme.hxx"
27
28#include "sfx2/imagemgr.hxx"
29#include <comphelper/processfactory.hxx>
30#include <comphelper/componentcontext.hxx>
31#include <comphelper/namedvaluecollection.hxx>
32#include <vcl/gradient.hxx>
32
33
34#include <com/sun/star/graphic/XGraphicProvider.hpp>
33
35
36#include <cstring>
37
34using namespace css;
35using namespace cssu;
36
37
38namespace sfx2 { namespace sidebar {
39
40Image Tools::GetImage (
41 const ::rtl::OUString& rsImageURL,

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

94 return Image(xGraphic);
95 }
96 }
97 }
98 return Image();
99}
100
101
38using namespace css;
39using namespace cssu;
40
41
42namespace sfx2 { namespace sidebar {
43
44Image Tools::GetImage (
45 const ::rtl::OUString& rsImageURL,

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

98 return Image(xGraphic);
99 }
100 }
101 }
102 return Image();
103}
104
105
106
107
108css::awt::Gradient Tools::VclToAwtGradient (const Gradient aVclGradient)
109{
110 css::awt::Gradient aAwtGradient (
111 awt::GradientStyle(aVclGradient.GetStyle()),
112 aVclGradient.GetStartColor().GetRGBColor(),
113 aVclGradient.GetEndColor().GetRGBColor(),
114 aVclGradient.GetAngle(),
115 aVclGradient.GetBorder(),
116 aVclGradient.GetOfsX(),
117 aVclGradient.GetOfsY(),
118 aVclGradient.GetStartIntensity(),
119 aVclGradient.GetEndIntensity(),
120 aVclGradient.GetSteps());
121 return aAwtGradient;
122}
123
124
125
126
127Gradient Tools::AwtToVclGradient (const css::awt::Gradient aAwtGradient)
128{
129 Gradient aVclGradient (
130 GradientStyle(aAwtGradient.Style),
131 aAwtGradient.StartColor,
132 aAwtGradient.EndColor);
133 aVclGradient.SetAngle(aAwtGradient.Angle);
134 aVclGradient.SetBorder(aAwtGradient.Border);
135 aVclGradient.SetOfsX(aAwtGradient.XOffset);
136 aVclGradient.SetOfsY(aAwtGradient.YOffset);
137 aVclGradient.SetStartIntensity(aAwtGradient.StartIntensity);
138 aVclGradient.SetEndIntensity(aAwtGradient.EndIntensity);
139 aVclGradient.SetSteps(aAwtGradient.StepCount);
140
141 return aVclGradient;
142}
143
144
145
146
147SvBorder Tools::RectangleToSvBorder (const Rectangle aBox)
148{
149 return SvBorder(
150 aBox.Left(),
151 aBox.Top(),
152 aBox.Right(),
153 aBox.Bottom());
154}
155
102} } // end of namespace sfx2::sidebar
156} } // end of namespace sfx2::sidebar