summaryrefslogtreecommitdiff
path: root/vcl/source/helper/canvastools.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-06-11 14:20:45 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-06-11 15:32:10 +0200
commit771c8282aadb45373fc6348cc70f4cd75a43a396 (patch)
tree03baec5cace657f325e0a3ee781564c4a6651651 /vcl/source/helper/canvastools.cxx
parent430fffdd64af4ae09bbc49328c5188fc2dd4e185 (diff)
Simplify Sequences initializations (vcl)
Change-Id: Id93bde17dbc4c71ad93bc094b94408fc9e39ec98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117055 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl/source/helper/canvastools.cxx')
-rw-r--r--vcl/source/helper/canvastools.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index fef5500a8227..c547dace4a14 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -565,15 +565,13 @@ namespace vcl::unotools
uno::Sequence< double > colorToStdColorSpaceSequence( const Color& rColor )
{
- uno::Sequence< double > aRet(4);
- double* pRet = aRet.getArray();
-
- pRet[0] = toDoubleColor(rColor.GetRed());
- pRet[1] = toDoubleColor(rColor.GetGreen());
- pRet[2] = toDoubleColor(rColor.GetBlue());
- pRet[3] = toDoubleColor(rColor.GetAlpha());
-
- return aRet;
+ return
+ {
+ toDoubleColor(rColor.GetRed()),
+ toDoubleColor(rColor.GetGreen()),
+ toDoubleColor(rColor.GetBlue()),
+ toDoubleColor(rColor.GetAlpha())
+ };
}
Color stdColorSpaceSequenceToColor( const uno::Sequence< double >& rColor )
@@ -595,12 +593,15 @@ namespace vcl::unotools
const Color& rColor,
const uno::Reference< rendering::XColorSpace >& xColorSpace )
{
- uno::Sequence<rendering::ARGBColor> aSeq(1);
- aSeq[0] = rendering::ARGBColor(
+ uno::Sequence<rendering::ARGBColor> aSeq
+ {
+ {
toDoubleColor(rColor.GetAlpha()),
toDoubleColor(rColor.GetRed()),
toDoubleColor(rColor.GetGreen()),
- toDoubleColor(rColor.GetBlue()) );
+ toDoubleColor(rColor.GetBlue())
+ }
+ };
return xColorSpace->convertFromARGB(aSeq);
}