[Libreoffice-commits] .: 2 commits - config/config_version.h.in configure.ac vcl/inc vcl/source vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jan 10 09:39:32 PST 2013
config/config_version.h.in | 14 ++++++++++++++
configure.ac | 18 ++++++++++++++++++
vcl/inc/svdata.hxx | 5 +++++
vcl/source/app/svapp.cxx | 4 ++++
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 4 ++++
vcl/unx/gtk/window/gtkframe.cxx | 6 +-----
6 files changed, 46 insertions(+), 5 deletions(-)
New commits:
commit 0260f0b256c3675bb6d836c0a2babb7626577b7a
Author: Michael Meeks <michael.meeks at suse.com>
Date: Thu Jan 10 17:38:18 2013 +0000
export cleaned up dotted version in environment and GtkWindow user-data.
Change-Id: If865127a9a5560f4b3636fb870699e2f3bac0e83
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index ff87f29..515bcbc 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -45,6 +45,11 @@
#include <boost/unordered_map.hpp>
+#include <config_version.h>
+
+#define LIBO_VERSION_DOTTED (LIBO_VERSION_MAJOR "." LIBO_VERSION_MINOR "." \
+ LIBO_VERSION_MICRO "." LIBO_VERSION_PATCH)
+
struct ImplTimerData;
struct ImplConfigData;
class ImplDirectFontSubstitution;
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 1a79987..c6c6c5a 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -205,6 +205,10 @@ Application* GetpApp()
Application::Application()
{
+ // useful for themes at least, perhaps extensions too
+ rtl::OUString aVar("LIBO_VERSION"), aValue(LIBO_VERSION_DOTTED);
+ osl_setEnvironment(aVar.pData, aValue.pData);
+
if( ! ImplGetSVData() )
ImplInitSVData();
ImplGetSVData()->mpApp = this;
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 46a4c01..736834a 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_version.h>
#include "vcl/svapp.hxx"
@@ -4173,6 +4174,9 @@ static void NWAddWidgetToCacheWindow( GtkWidget* widget, SalX11Screen nScreen )
if ( !rData.gCacheWindow )
{
rData.gCacheWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ g_object_set_data( G_OBJECT( rData.gCacheWindow ), "libo-version",
+ (gpointer)LIBO_VERSION_DOTTED );
+
GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(),
nScreen.getXScreen() );
if( pScreen )
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 6bba141..398ece4 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1071,11 +1071,7 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType,
"visible", FALSE, NULL );
g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this );
-
- static char pVersion[16] = "";
- if( pVersion[0] == '\0' )
- g_sprintf( pVersion, "%d", SUPD );
- g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", pVersion );
+ g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", (gpointer)LIBO_VERSION_DOTTED);
// force wm class hint
m_nExtStyle = ~0;
commit 364cce0a511d3e7a3bbc51e09895999fbdf0dbe1
Author: Michael Meeks <michael.meeks at suse.com>
Date: Thu Jan 10 17:15:37 2013 +0000
add LIBO_VERSION_* macros and a config header for them to live in.
Change-Id: Ia6735e3e7f3231722231e9d7a4c9839f08038b96
diff --git a/config/config_version.h.in b/config/config_version.h.in
new file mode 100644
index 0000000..caaa9c4
--- /dev/null
+++ b/config/config_version.h.in
@@ -0,0 +1,14 @@
+/*
+Version settings
+ version 4.0.0.1 is Major.Minor.Micro.Patch
+*/
+
+#ifndef CONFIG_VERSION_H
+#define CONFIG_VERSION_H
+
+#undef LIBO_VERSION_MAJOR
+#undef LIBO_VERSION_MINOR
+#undef LIBO_VERSION_MICRO
+#undef LIBO_VERSION_PATCH
+
+#endif
diff --git a/configure.ac b/configure.ac
index 2ef61b1..3b4fb48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4320,6 +4320,23 @@ AC_SUBST(UPD)
AC_SUBST(SOURCEVERSION)
dnl ===================================================================
+dnl Grim-ness to export version number of LibreOffice to code
+dnl this needs to be turned around and to be driven by configure
+dnl ===================================================================
+LIBO_VERSION_MAJOR="`$GREP VERSIONMAJOR solenv/inc/minor.mk | sed "s/^.*=//"`"
+LIBO_VERSION_MINOR="`$GREP VERSIONMINOR solenv/inc/minor.mk | sed "s/^.*=//"`"
+LIBO_VERSION_MICRO="`$GREP VERSIONMICRO solenv/inc/minor.mk | sed "s/^.*=//"`"
+LIBO_VERSION_PATCH="`$GREP BUILD solenv/inc/minor.mk | sed "s/^.*=//"`"
+AC_SUBST(LIBO_VERSION_MAJOR)
+AC_SUBST(LIBO_VERSION_MINOR)
+AC_SUBST(LIBO_VERSION_MICRO)
+AC_SUBST(LIBO_VERSION_PATCH)
+AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,"$LIBO_VERSION_MAJOR")
+AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,"$LIBO_VERSION_MINOR")
+AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,"$LIBO_VERSION_MICRO")
+AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,"$LIBO_VERSION_PATCH")
+
+dnl ===================================================================
dnl Check for syslog header
dnl ===================================================================
AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
@@ -12429,6 +12446,7 @@ AC_CONFIG_HEADERS([config/config_global.h])
AC_CONFIG_HEADERS([config/config_graphite.h])
AC_CONFIG_HEADERS([config/config_telepathy.h])
AC_CONFIG_HEADERS([config/config_vclplug.h])
+AC_CONFIG_HEADERS([config/config_version.h])
AC_OUTPUT
# touch the config timestamp file
More information about the Libreoffice-commits
mailing list