summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-10-11 12:24:51 +0100
committerMichael Meeks <michael.meeks@novell.com>2010-10-11 15:19:42 +0100
commit2bbb62509b1752b7c5d77b236c343fc9a34905f0 (patch)
tree8f504a6d759ad60bdbf0a760e6b6a03e20a5c636
parent22b20b4b7cdc91453fe26deee22bf69d8723bf83 (diff)
push branded image finding down into vcl
-rw-r--r--desktop/source/splash/splash.cxx7
-rw-r--r--sfx2/source/appl/brand.cxx79
-rw-r--r--sfx2/source/appl/makefile.mk1
-rw-r--r--sfx2/source/dialog/about.cxx3
4 files changed, 5 insertions, 85 deletions
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index d8061fda509f..59019502e0c9 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -36,7 +36,6 @@
#include <tools/urlobj.hxx>
#include <tools/stream.hxx>
#include <sfx2/sfx.hrc>
-#include <sfx2/app.hxx>
#include <vcl/svapp.hxx>
#include <vcl/salnativewidgets.hxx>
@@ -422,15 +421,15 @@ void SplashScreen::SetScreenBitmap(BitmapEx &rBitmap)
aResBuf.append( OString::valueOf( nHeight ));
aStrBuf.append( aResBuf.getStr() );
- if (SfxApplication::LoadBrandBitmap (aStrBuf.makeStringAndClear(), rBitmap))
+ if (Application::LoadBrandBitmap (aStrBuf.makeStringAndClear(), rBitmap))
return;
aStrBuf.append( "intro_" );
aStrBuf.append( aResBuf.getStr() );
- if (SfxApplication::LoadBrandBitmap (aResBuf.makeStringAndClear(), rBitmap))
+ if (Application::LoadBrandBitmap (aResBuf.makeStringAndClear(), rBitmap))
return;
- SfxApplication::LoadBrandBitmap ("intro", rBitmap);
+ Application::LoadBrandBitmap ("intro", rBitmap);
}
void SplashScreen::determineProgressRatioValues(
diff --git a/sfx2/source/appl/brand.cxx b/sfx2/source/appl/brand.cxx
deleted file mode 100644
index df8d70412b83..000000000000
--- a/sfx2/source/appl/brand.cxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Version: MPL 1.1 / GPLv3+ / LGPLv3+
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Initial Developer of the Original Code is
- * Novell, Inc.
- * Portions created by the Initial Developer are Copyright (C) 2010 the
- * Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Michael Meeks <michael.meeks@novell.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-
-#include <rtl/ustring.hxx>
-#include <rtl/bootstrap.hxx>
-#include <rtl/locale.hxx>
-#include <osl/process.h>
-#include <tools/urlobj.hxx>
-#include <tools/stream.hxx>
-#include <vcl/pngread.hxx>
-#include <sfx2/app.hxx>
-
-namespace {
- static bool loadPng(const char *pPath, const rtl::OUString &rName, BitmapEx &rBitmap)
- {
- rtl::OUString uri = rtl::OUString::createFromAscii( pPath ) + rName;
- rtl::Bootstrap::expandMacros( uri );
- INetURLObject aObj( uri );
- SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
- if ( !aStrm.GetError() ) {
- vcl::PNGReader aReader( aStrm );
- rBitmap = aReader.Read();
- return !rBitmap.IsEmpty();
- }
- else
- return false;
- }
-}
-
-bool SfxApplication::LoadBrandBitmap (const char* pName, BitmapEx &rBitmap)
-{
- // TODO - if we want more flexibility we could add a branding path
- // in an rc file perhaps fallback to "about.bmp"
- rtl::OUString aBaseName = ( rtl::OUString::createFromAscii( "/" ) +
- rtl::OUString::createFromAscii( pName ) );
- rtl::OUString aPng( RTL_CONSTASCII_USTRINGPARAM(".png") );
-
- rtl_Locale *pLoc = NULL;
- osl_getProcessLocale (&pLoc);
- rtl::OLocale aLoc( pLoc );
-
- rtl::OUString aName = aBaseName + aPng;
- rtl::OUString aLocaleName = ( aBaseName + rtl::OUString::createFromAscii ("-") +
- aLoc.getLanguage() +
- rtl::OUString::createFromAscii ("_") +
- aLoc.getCountry() + aPng );
-
- return ( loadPng ("$BRAND_BASE_DIR/program/edition", aLocaleName, rBitmap) ||
- loadPng ("$BRAND_BASE_DIR/program", aLocaleName, rBitmap) ||
- loadPng ("$BRAND_BASE_DIR/program/edition", aName, rBitmap) ||
- loadPng ("$BRAND_BASE_DIR/program", aName, rBitmap) );
-}
diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk
index 3c7c3f463859..72ac94a9b38e 100644
--- a/sfx2/source/appl/makefile.mk
+++ b/sfx2/source/appl/makefile.mk
@@ -88,7 +88,6 @@ SFX_OBJECTS = \
$(SLO)$/appserv.obj \
$(SLO)$/appuno.obj \
$(SLO)$/appbaslib.obj \
- $(SLO)$/brand.obj \
$(SLO)$/childwin.obj \
$(SLO)$/fileobj.obj \
$(SLO)$/helpdispatch.obj \
diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx
index 4fe48d28deab..580f3c42257d 100644
--- a/sfx2/source/dialog/about.cxx
+++ b/sfx2/source/dialog/about.cxx
@@ -41,6 +41,7 @@
#include <unotools/bootstrap.hxx>
#include <com/sun/star/uno/Any.h>
#include <unotools/configmgr.hxx>
+#include <vcl/svapp.hxx>
#include <vcl/graph.hxx>
#include <svtools/filter.hxx>
@@ -64,7 +65,7 @@
Image SfxApplication::GetApplicationLogo()
{
BitmapEx aBitmap;
- LoadBrandBitmap ("about", aBitmap);
+ Application::LoadBrandBitmap ("about", aBitmap);
return Image( aBitmap );
}