l10ntools/Executable_renewpo.mk | 19 +++++--------- l10ntools/inc/po.hxx | 31 ++++-------------------- l10ntools/source/po.cxx | 51 ++++++++++++---------------------------- l10ntools/source/renewpo.cxx | 31 ++++-------------------- 4 files changed, 35 insertions(+), 97 deletions(-)
New commits: commit 61eadf2df432ed4f048006b1409046505d9a4e8c Author: Zolnai Tamás <[email protected]> Date: Thu Aug 30 12:41:18 2012 +0200 More cleanup aka clean up cleanup Use integers consistently Change headers Make variable initialization uniform Change-Id: I91937704a80c0d5997ad81591ce79076794a4e32 Reviewed-on: https://gerrit.libreoffice.org/517 Reviewed-by: Andras Timar <[email protected]> Tested-by: Andras Timar <[email protected]> diff --git a/l10ntools/Executable_renewpo.mk b/l10ntools/Executable_renewpo.mk index 33e38b2..4872e8a 100644 --- a/l10ntools/Executable_renewpo.mk +++ b/l10ntools/Executable_renewpo.mk @@ -1,18 +1,13 @@ -# for the specific language governing rights and limitations under the -# License. +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # -# Major Contributor(s): -# Copyright (C) 2012 David Ostrovsky <[email protected]> (initial developer) +# This file is part of the LibreOffice project. # -# All Rights Reserved. +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. # -# For minor contributions see the git repository. +# convert old po to new po # -# 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. $(eval $(call gb_Executable_Executable,renewpo)) @@ -33,4 +28,4 @@ $(eval $(call gb_Executable_add_exception_objects,renewpo,\ l10ntools/source/renewpo \ )) -# vim:set shiftwidth=4 softtabstop=4 expandtab: +# vim: set noet sw=4 ts=4: diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx index 3330afb..c03baf8 100644 --- a/l10ntools/inc/po.hxx +++ b/l10ntools/inc/po.hxx @@ -1,30 +1,11 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #ifndef _PO_INCLUDED #define _PO_INCLUDED diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 472e876..6848d7e 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -1,30 +1,11 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #include "po.hxx" #include <ctime> @@ -60,9 +41,9 @@ OString ImplEscapeText(const OString& rText, if(rEscaped.getLength()!=2*rUnEscaped.getLength()) throw; OString sResult = rText; int nCount = 0; - for(int nIndex=0; nIndex<rText.getLength(); ++nIndex) + for(sal_Int32 nIndex=0; nIndex<rText.getLength(); ++nIndex) { - int nActChar = rUnEscaped.indexOf(rText[nIndex]); + sal_Int32 nActChar = rUnEscaped.indexOf(rText[nIndex]); if(nActChar!=-1) sResult = sResult.replaceAt((nIndex)+(nCount++),1, rEscaped.copy(2*nActChar,2)); @@ -78,9 +59,9 @@ OString ImplUnEscapeText(const OString& rText, if(rEscaped.getLength()!=2*rUnEscaped.getLength()) throw; OString sResult = rText; int nCount = 0; - for(int nIndex=0; nIndex<rText.getLength()-1; ++nIndex) + for(sal_Int32 nIndex=0; nIndex<rText.getLength()-1; ++nIndex) { - int nActChar = rEscaped.indexOf(rText.copy(nIndex,2)); + sal_Int32 nActChar = rEscaped.indexOf(rText.copy(nIndex,2)); if(nActChar % 2 == 0) sResult = sResult.replaceAt((nIndex++)-(nCount++),2, rUnEscaped.copy(nActChar/2,1)); @@ -95,7 +76,7 @@ OString ImplGenMsgString(const OString& rSource) return "\"\""; OString sResult = "\"" + rSource + "\""; - int nIndex = 0; + sal_Int32 nIndex = 0; while((nIndex=sResult.indexOf("\\n",nIndex))!=-1) { if( sResult.copy(nIndex-1,3) != "\\\\n" ) @@ -160,12 +141,12 @@ void GenPoEntry::writeToFile(std::ofstream& io_rOFStream) //Class PoEntry //Split string at the delimiter char -void ImplSplitAt(const OString& rSource, const char nDelimiter, +void ImplSplitAt(const OString& rSource, const sal_Char nDelimiter, std::vector<OString>& o_vParts) { o_vParts.resize( 0 ); - int nActIndex( 0 ); - int nLastSplit( 0 ); + sal_Int32 nActIndex = 0; + sal_Int32 nLastSplit = 0; while( nActIndex < rSource.getLength() ) { if ( rSource[nActIndex] == nDelimiter ) @@ -257,8 +238,8 @@ void PoEntry::setTransStr(const OString& rTransStr) //Get actual time in "YEAR-MO-DA HO:MI+ZONE" form OString ImplGetTime() { - time_t aNow(time(NULL)); - struct tm* pNow(localtime(&aNow)); + time_t aNow = time(NULL); + struct tm* pNow = localtime(&aNow); char pBuff[50]; strftime( pBuff, sizeof pBuff, "%Y-%m-%d %H:%M%z", pNow ); return pBuff; diff --git a/l10ntools/source/renewpo.cxx b/l10ntools/source/renewpo.cxx index 20738b1..a6e1273 100644 --- a/l10ntools/source/renewpo.cxx +++ b/l10ntools/source/renewpo.cxx @@ -1,30 +1,11 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #include <iostream> #include <fstream>
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
