build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / vcl / source / image / ImageArrayData.cxx
blobe1854d2aa55aa5b30db1669b00fe8ead67f1ef6b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/outdev.hxx>
21 #include <vcl/bitmapex.hxx>
22 #include <vcl/alpha.hxx>
23 #include <vcl/window.hxx>
24 #include <vcl/bitmapaccess.hxx>
25 #include <vcl/virdev.hxx>
26 #include <vcl/image.hxx>
27 #include <vcl/settings.hxx>
28 #include <vcl/svapp.hxx>
29 #include <vcl/ImageTree.hxx>
31 #include <image.h>
32 #include <memory>
34 #if OSL_DEBUG_LEVEL > 0
35 #include <rtl/strbuf.hxx>
36 #endif
38 #include "BitmapProcessor.hxx"
40 ImageAryData::ImageAryData( const ImageAryData& rData ) :
41 maName( rData.maName ),
42 mnId( rData.mnId ),
43 maBitmapEx( rData.maBitmapEx )
47 ImageAryData::ImageAryData( const OUString &aName,
48 sal_uInt16 nId, const BitmapEx &aBitmap )
49 : maName( aName ), mnId( nId ), maBitmapEx( aBitmap )
53 ImageAryData::~ImageAryData()
57 ImageAryData& ImageAryData::operator=( const ImageAryData& rData )
59 maName = rData.maName;
60 mnId = rData.mnId;
61 maBitmapEx = rData.maBitmapEx;
63 return *this;
66 void ImageAryData::Load(const OUString &rPrefix)
68 OUString aIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
70 OUString aFileName = rPrefix;
71 aFileName += maName;
73 bool bSuccess = ImageTree::get().loadImage(aFileName, aIconTheme, maBitmapEx, true);
75 if (bSuccess)
77 #if OSL_DEBUG_LEVEL > 0
78 else
80 OStringBuffer aMessage;
81 aMessage.append( "ImageAryData::Load: failed to load image '" );
82 aMessage.append( OUStringToOString( aFileName, RTL_TEXTENCODING_UTF8 ).getStr() );
83 aMessage.append( "'" );
84 aMessage.append( " from icon theme '" );
85 aMessage.append( OUStringToOString( aIconTheme, RTL_TEXTENCODING_UTF8 ).getStr() );
86 aMessage.append( "'" );
87 OSL_FAIL( aMessage.makeStringAndClear().getStr() );
89 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */