Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi all,

I built the libreoffice-4-0 branch from git on Ubuntu 10.04 today, which has g++ 4.4.3 as compiler. The build fails in linguistic/source/lngsvcmgr.cxx and the attached patch is necessary to make the build continue. Apart from this issue, the build is completed just fine.

I don't know why exactly the patch is necessary, perhaps it is a compiler bug.



regards,

-kris.
From 18704de3403a69bbbc897ecd6ad653acfa89ce72 Mon Sep 17 00:00:00 2001
From: Kristian Rietveld <kris@lanedo.com>
Date: Sat, 23 Feb 2013 21:34:46 +0100
Subject: [PATCH] Introduce temporary variables to stop compiler from complaining

Without this change, g++ 4.4.3 on Ubuntu 10.04 gives an error message
saying that the parameter cannot be a variably modified type.

Change-Id: I4de54179583df731cb1ec559bfcb087ce4553968
---
 linguistic/source/lngsvcmgr.cxx |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 93697e6..e153db9 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -744,7 +744,8 @@ void LngSvcMgr::UpdateAll()
         const OUString *pNodeName = aNodeNames.getConstArray();
         for (i = 0;  i < nNodeNames;  ++i)
         {
-            Locale aLocale( LanguageTag( pNodeName[i]).getLocale() );
+            const OUString &tmp(pNodeName[i]);
+            Locale aLocale( LanguageTag( tmp ).getLocale() );
             Sequence< OUString > aCfgSvcs( getConfiguredServices( aService, aLocale ));
             Sequence< OUString > aAvailSvcs( getAvailableServices( aService, aLocale ));
 
@@ -763,7 +764,8 @@ void LngSvcMgr::UpdateAll()
         const Locale *pAvailLocale = aAvailLocales.getConstArray();
         for (i = 0;  i < nAvailLocales;  ++i)
         {
-            OUString aCfgLocaleStr( LanguageTag( pAvailLocale[i] ).getBcp47() );
+            const Locale &tmp(pAvailLocale[i]);
+            OUString aCfgLocaleStr( LanguageTag( tmp ).getBcp47() );
 
             Sequence< OUString > aAvailSvcs( getAvailableServices( aService, pAvailLocale[i] ));
 
@@ -1840,7 +1842,8 @@ sal_Bool LngSvcMgr::SaveCfgSvcs( const String &rServiceName )
             aCfgAny <<= aSvcImplNames;
             DBG_ASSERT( aCfgAny.hasValue(), "missing value for 'Any' type" );
 
-            OUString aCfgLocaleStr( LanguageTag( pLocale[i] ).getBcp47() );
+            const lang::Locale &tmp(pLocale[i]);
+            OUString aCfgLocaleStr( LanguageTag( tmp ).getBcp47() );
             pValue->Value = aCfgAny;
             pValue->Name  = aNodeName;
             pValue->Name += OUString::valueOf( (sal_Unicode) '/' );
-- 
1.7.0.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.