[Libreoffice-commits] core.git: crashrep/source cui/source

2014-12-08 Thread Michael Weghorn
 crashrep/source/win32/soreport.cxx|2 +-
 cui/source/customize/cfg.cxx  |   20 
 cui/source/customize/macropg.cxx  |4 ++--
 cui/source/dialogs/SpellDialog.cxx|3 +--
 cui/source/dialogs/cuigaldlg.cxx  |6 ++
 cui/source/dialogs/hangulhanjadlg.cxx |3 +--
 cui/source/dialogs/insdlg.cxx |3 +--
 cui/source/factory/dlgfact.cxx|3 +--
 cui/source/options/optchart.cxx   |6 ++
 cui/source/options/optlingu.cxx   |   10 --
 cui/source/tabpages/chardlg.cxx   |3 +--
 cui/source/tabpages/tpbitmap.cxx  |3 +--
 cui/source/tabpages/tpcolor.cxx   |3 +--
 cui/source/tabpages/tpgradnt.cxx  |3 +--
 cui/source/tabpages/tphatch.cxx   |3 +--
 cui/source/tabpages/tpline.cxx|3 +--
 cui/source/tabpages/tplnedef.cxx  |3 +--
 cui/source/tabpages/tpshadow.cxx  |3 ++-
 18 files changed, 32 insertions(+), 52 deletions(-)

New commits:
commit 5f6af01f13460909e7c3819e14edb2eb04788156
Author: Michael Weghorn m.wegh...@posteo.de
Date:   Mon Dec 8 20:46:05 2014 +0100

fdo#39440 reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: I19d0070c5dc54c605a7924b750eee1538bed16b3
Reviewed-on: https://gerrit.libreoffice.org/13384
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/crashrep/source/win32/soreport.cxx 
b/crashrep/source/win32/soreport.cxx
index 4a4d2bf..ee8b7d0 100644
--- a/crashrep/source/win32/soreport.cxx
+++ b/crashrep/source/win32/soreport.cxx
@@ -564,11 +564,11 @@ static string xml_encode( const string rString )
 
 static size_t fcopy( FILE *fpin, FILE *fpout )
 {
-char buffer[1024];
 size_t nBytesWritten = 0;
 
 if ( fpin  fpout )
 {
+char buffer[1024];
 size_t nBytes;
 while ( 0 != (nBytes = fread( buffer, 1, sizeof(buffer), fpin )) )
 {
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index b015f08..77d3afc 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -275,10 +275,9 @@ generateCustomName(
 // now check is there is an already existing entry with this name
 SvxEntries::const_iterator iter = entries-begin();
 
-SvxConfigEntry* pEntry;
 while ( iter != entries-end() )
 {
-pEntry = *iter;
+SvxConfigEntry* pEntry = *iter;
 
 if ( name.equals( pEntry-GetName() ) )
 {
@@ -314,10 +313,9 @@ generateCustomURL(
 // now check is there is an already existing entry with this url
 SvxEntries::const_iterator iter = entries-begin();
 
-SvxConfigEntry* pEntry;
 while ( iter != entries-end() )
 {
-pEntry = *iter;
+SvxConfigEntry* pEntry = *iter;
 
 if ( url.equals( pEntry-GetCommand() ) )
 {
@@ -1082,7 +1080,6 @@ bool MenuSaveInData::LoadSubMenus(
 uno::Reference container::XIndexAccessxSubMenu;
 OUStringaCommandURL;
 OUStringaLabel;
-boolbIsUserDefined = true;
 
 sal_uInt16 nType( css::ui::ItemType::DEFAULT );
 
@@ -1091,6 +1088,7 @@ bool MenuSaveInData::LoadSubMenus(
 
 if ( bItem )
 {
+bool bIsUserDefined = true;
 if ( nType == css::ui::ItemType::DEFAULT )
 {
 uno::Any a;
@@ -2594,16 +2592,13 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog(
 // Copy the entries list passed in
 if ( entries != NULL )
 {
-SvxConfigEntry* pEntry;
-SvTreeListEntry* pLBEntry;
-
 mpEntries = new SvxEntries();
 SvxEntries::const_iterator iter = entries-begin();
 
 while ( iter != entries-end() )
 {
-pEntry = *iter;
-pLBEntry =
+SvxConfigEntry* pEntry = *iter;
+SvTreeListEntry* pLBEntry =
 m_pMenuListBox-InsertEntry( stripHotKey( pEntry-GetName() ) 
);
 pLBEntry-SetUserData( pEntry );
 mpEntries-push_back( pEntry );
@@ -4176,7 +4171,6 @@ bool ToolbarSaveInData::LoadToolbar(
 uno::Reference container::XIndexAccessxSubMenu;
 OUStringaCommandURL;
 OUStringaLabel;
-boolbIsUserDefined = true;
 boolbIsVisible;
 sal_Int32   nStyle;
 
@@ -4187,6 +4181,7 @@ bool ToolbarSaveInData::LoadToolbar(
 
 if ( bItem )
 {
+bool bIsUserDefined = true;
 if ( nType == css::ui::ItemType::DEFAULT )
 {
 uno::Any a;
@@ -5238,7 +5233,6 @@ bool SvxIconSelectorDialog::ImportGraphic( const 
OUString aURL )
 
 uno::Reference graphic::XGraphic  xGraphic;
 com::sun::star::awt::Size aSize;
-bool bOK = true;
 aMediaProps[0].Value = aURL;
 try
 

[Libreoffice-commits] core.git: crashrep/source

2014-11-03 Thread Norbert Thiebaud
 crashrep/source/unx/main.cxx |  258 +--
 1 file changed, 154 insertions(+), 104 deletions(-)

New commits:
commit bbdd3da43d37ea4fdbcc2dc3ad8b4800020e71e8
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Sat Nov 1 09:52:30 2014 -0500

crashrep: get rid of tmpnam()

Change-Id: If84d623719058e4b14f224a433253fac4fd47f85
Reviewed-on: https://gerrit.libreoffice.org/12066
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index 65d70e2..d70bb0e 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -71,9 +71,7 @@ static string g_strPStackFileName;
 static string g_strChecksumFileName;
 static string g_strProgramDir;
 
-static char g_szStackFile[L_tmpnam] = ;
-static char g_szDescriptionFile[2048] = ;
-static char g_szReportFile[2048] = ;
+//static char g_szStackFile[L_tmpnam] = ;
 
 #define REPORT_SERVER   (g_strReportServer.c_str())
 #define REPORT_PORT g_uReportPort
@@ -163,87 +161,124 @@ static size_t fcopy( FILE *fpout, FILE *fpin )
from which it can be reviewed and sent
 */
 
-bool write_report( const boost::unordered_map string, string  rSettings )
+char* write_report( const boost::unordered_map string, string  rSettings )
 {
-FILE*fp = fopen( tmpnam( g_szReportFile ), w );
-const char *pszUserType = getenv( STAROFFICE_USERTYPE );
+char * report_filename;
 
-fprintf( fp,
-   ?xml version=\1.0\ encoding=\UTF-8\?\n
-   !DOCTYPE errormail:errormail PUBLIC \-//OpenOffice.org//DTD 
ErrorMail 1.0//EN\ \errormail.dtd\\n
-   errormail:errormail 
xmlns:errormail=\http://openoffice.org/2002/errormail\; usertype=\%s\\n
-   reportmail:mail 
xmlns:reportmail=\http://openoffice.org/2002/reportmail\; version=\1.1\ 
feedback=\%s\ email=\%s\\n
-   reportmail:title%s/reportmail:title\n
-   reportmail:attachment name=\description.txt\ 
media-type=\text/plain\ class=\UserComment\/\n
-   reportmail:attachment name=\stack.txt\ media-type=\text/plain\ 
class=\pstack output\/\n
-   /reportmail:mail\n
-   officeinfo:officeinfo 
xmlns:officeinfo=\http://openoffice.org/2002/officeinfo\; build=\%s\ 
platform=\%s\ language=\%s\ exceptiontype=\%d\ product=\%s\ 
procpath=\%s\/\n
-   ,
-   pszUserType ? xml_encode( pszUserType ).c_str() : ,
-   xml_encode(rSettings.find( CONTACT )-second).c_str(),
-   xml_encode(rSettings.find( EMAIL )-second).c_str(),
-   xml_encode(rSettings.find( TITLE )-second).c_str(),
-   g_buildid.length() ? xml_encode( g_buildid ).c_str() : unknown,
-   _INPATH,
-   g_strDefaultLanguage.c_str(),
-   g_signal,
-   g_strProductKey.length() ? xml_encode(g_strProductKey).c_str() : 
unknown,
-   xml_encode(getprogramdir()).c_str()
-   );
-
-struct utsname  info;
-
-memset( info, 0, sizeof(info) );
-uname( info );
+report_filename = (char*)calloc(1, 2048);
 
-fprintf( fp,
-   systeminfo:systeminfo 
xmlns:systeminfo=\http://openoffice.org/2002/systeminfo\;\n
-   systeminfo:System name=\%s\ version=\%s\ build=\%s\ 
locale=\%s\/\n
-   ,
-   xml_encode( info.sysname ).c_str(),
-   xml_encode( info.version ).c_str(),
-   xml_encode( info.release ).c_str(),
-   xml_encode( getlocale() ).c_str()
-   );
-fprintf( fp, systeminfo:CPU type=\%s\/\n, xml_encode( info.machine 
).c_str() );
-fprintf( fp, /systeminfo:systeminfo\n );
-
-FILE *fpxml = fopen( g_strXMLFileName.c_str(), r );
-if ( fpxml )
+if(!report_filename)
 {
-fcopy( fp, fpxml );
-fclose( fpxml );
+return NULL;
 }
+strncpy( report_filename, P_tmpdir, 2047 );
+strncat( report_filename, /crashreport.XX, 2047 - 
strlen(report_filename));
 
-FILE *fpchk = fopen( g_strChecksumFileName.c_str(), r );
-if ( fpchk )
+int fd = mkstemp(report_filename);
+if(fd == -1)
 {
-fcopy( fp, fpchk );
-fclose( fpchk );
+free(report_filename);
+return NULL;
 }
+else
+{
+FILE* fp = fdopen(fd, w);
+
+const char* pszUserType = getenv( STAROFFICE_USERTYPE );
+
+fprintf( fp,
+ ?xml version=\1.0\ encoding=\UTF-8\?\n
+ !DOCTYPE errormail:errormail PUBLIC 
\-//OpenOffice.org//DTD ErrorMail 1.0//EN\ \errormail.dtd\\n
+ errormail:errormail 
xmlns:errormail=\http://openoffice.org/2002/errormail\; usertype=\%s\\n
+ reportmail:mail 
xmlns:reportmail=\http://openoffice.org/2002/reportmail\; version=\1.1\ 
feedback=\%s\ email=\%s\\n
+ reportmail:title%s/reportmail:title\n
+ reportmail:attachment name=\description.txt\ 
media-type=\text/plain\ class=\UserComment\/\n
+ reportmail:attachment name=\stack.txt\ 
media-type=\text/plain\ class=\pstack output\/\n
+ 

[Libreoffice-commits] core.git: crashrep/source

2014-02-25 Thread Alexander Wilms
 crashrep/source/unx/main.cxx |4 -
 crashrep/source/win32/rcheader.txt   |4 -
 crashrep/source/win32/rctemplate.txt |   22 
 crashrep/source/win32/resource.h |4 -
 crashrep/source/win32/soreport.cxx   |   90 +--
 5 files changed, 62 insertions(+), 62 deletions(-)

New commits:
commit 86709d62ab7d97a8337304ffa34ebca71e52cfb5
Author: Alexander Wilms f.alexander.wi...@gmail.com
Date:   Tue Feb 25 18:03:30 2014 +0100

Remove visual noise from crashrep

Change-Id: I9e13aa176cf6ca1d97e52d059423fc59018671f5
Reviewed-on: https://gerrit.libreoffice.org/8249
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index 6dc8e19..07ee976 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -579,7 +579,7 @@ static void setup_program_dir( const char* progname )
 }
 }
 
-//*
+
 
 static long setup_commandline_arguments( int argc, char** argv, int *pSignal )
 {
@@ -650,7 +650,7 @@ static long setup_commandline_arguments( int argc, char** 
argv, int *pSignal )
 return pid;
 }
 
-//*
+
 
 static bool read_line( FILE *fp, string rLine )
 {
diff --git a/crashrep/source/win32/rcheader.txt 
b/crashrep/source/win32/rcheader.txt
index 3091b4f..a94e4be 100644
--- a/crashrep/source/win32/rcheader.txt
+++ b/crashrep/source/win32/rcheader.txt
@@ -33,9 +33,9 @@
 #define LANG_JAPANESE 81
 #define PLACEHOLDER LANGUAGE
 
-// ---
+
 // version information
-// ---
+
 
 VS_VERSION_INFO versioninfo
fileversionVERSION, SUBVERSION, MICROVERSION, VERVARIANT
diff --git a/crashrep/source/win32/rctemplate.txt 
b/crashrep/source/win32/rctemplate.txt
index 448ce8a..9c71356 100644
--- a/crashrep/source/win32/rctemplate.txt
+++ b/crashrep/source/win32/rctemplate.txt
@@ -1,12 +1,12 @@
-//
+
 // This file is part of the LibreOffice project.
-//
+
 // 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/.
-//
+
 // This file incorporates work covered by the following license notice:
-//
+
 //   Licensed to the Apache Software Foundation (ASF) under one or more
 //   contributor license agreements. See the NOTICE file distributed
 //   with this work for additional information regarding copyright
@@ -14,7 +14,7 @@
 //   License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
-//
+
 
 #ifdef FONTSIZE
 #undef FONTSIZE
@@ -29,10 +29,10 @@
 
 #define FONTSIZE 9
 
-/
-//
+
+
 // Dialog
-//
+
 
 IDD_WELCOME_PAGE DIALOGEX 0, 41, 327, 195
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD
@@ -145,10 +145,10 @@ BEGIN
 LTEXT   3,IDC_SENDING_REPORT_STATUS,7,7,202,34
 END
 
-/
-//
+
+
 // String Table
-//
+
 
 STRINGTABLE 
 BEGIN
diff --git a/crashrep/source/win32/resource.h b/crashrep/source/win32/resource.h
index 7b7c56c..83e4e3f 100644
--- a/crashrep/source/win32/resource.h
+++ b/crashrep/source/win32/resource.h
@@ -20,7 +20,7 @@
 //{{NO_DEPENDENCIES}}
 // Microsoft Visual C++ generated include file.
 // Used by soreport.rc
-//
+
 #define IDD_DIALOG_FRAME101
 #define IDS_WELCOME_CAPTION 102
 #define IDS_WELCOME_HEADER  103
@@ -101,7 +101,7 @@
 #define IDC_PROXY_DESCRIPTION   1033
 #define IDC_SENDING_REPORT_STATUS   1034
 // Next default values for new objects
-//
+
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NO_MFC 1
diff --git a/crashrep/source/win32/soreport.cxx 
b/crashrep/source/win32/soreport.cxx
index a48db07..0f7f760 100644
--- a/crashrep/source/win32/soreport.cxx
+++ b/crashrep/source/win32/soreport.cxx
@@ -116,7 +116,7 @@ boolg_bLoadReport = false;
 #define REPORT_PORT g_uReportPort
 
 
-//***
+
 // tmpfile from msvcrt creates the temporary file in the root of the current
 // volume and can fail.
 
@@ -157,7 +157,7 @@ static FILE *_tmpfile(void)
 
 return fp;
 }
-//***
+
 
 static BOOL GetCrashDataPath( LPTSTR szBuffer )
 {
@@ -203,7 +203,7 @@ static FILE *_open_reportfile( LPCTSTR lpExt, LPCTSTR 
lpMode )
 return 

[Libreoffice-commits] core.git: crashrep/source

2013-03-27 Thread Julien Nabet
 crashrep/source/unx/main.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 51fedc00adaf244afd6e1ac81e568c93314cfab1
Author: Julien Nabet serval2...@yahoo.fr
Date:   Wed Mar 27 20:23:08 2013 +0100

Remove unused macro PMAP_CMD

Change-Id: I00812388e7abf17e8388f19143f78843f7946405

diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index 7041f8c..5bef30d 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -75,12 +75,6 @@ static char g_szStackFile[L_tmpnam] = ;
 static char g_szDescriptionFile[2048] = ;
 static char g_szReportFile[2048] = ;
 
-#ifdef LINUX
-#define PMAP_CMDcat /proc/%d/maps
-#else
-#define PMAP_CMDpmap %d
-#endif
-
 #define REPORT_SERVER   (g_strReportServer.c_str())
 #define REPORT_PORT g_uReportPort
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: crashrep/source crashrep/WinResTarget_crashrep.mk desktop/util desktop/win32 desktop/WinResTarget_sbase.mk desktop/WinResTarget_scalc.mk desktop/WinResTarget_sdraw.mk d

2013-02-28 Thread Andras Timar
 crashrep/WinResTarget_crashrep.mk|5 -
 crashrep/source/win32/rcheader.txt   |   15 ---
 desktop/WinResTarget_sbase.mk|1 +
 desktop/WinResTarget_scalc.mk|1 +
 desktop/WinResTarget_sdraw.mk|1 +
 desktop/WinResTarget_simpress.mk |1 +
 desktop/WinResTarget_smath.mk|1 +
 desktop/WinResTarget_soffice.mk  |1 +
 desktop/WinResTarget_sofficebin.mk   |1 +
 desktop/WinResTarget_sweb.mk |1 +
 desktop/WinResTarget_swriter.mk  |1 +
 desktop/util/officeloader.rc |2 +-
 desktop/win32/source/applauncher/launcher.rc |2 +-
 scp2/source/base/file_base.scp   |5 -
 scp2/source/calc/file_calc.scp   |5 -
 scp2/source/crashrep/file_crashrep.scp   |5 -
 scp2/source/draw/file_draw.scp   |5 -
 scp2/source/impress/file_impress.scp |5 -
 scp2/source/math/file_math.scp   |5 -
 scp2/source/ooo/common_brand.scp |8 
 scp2/source/writer/file_writer.scp   |8 +---
 21 files changed, 24 insertions(+), 55 deletions(-)

New commits:
commit 6851c5fd4337af38884d16c05695da7e4e059dcc
Author: Andras Timar ati...@suse.com
Date:   Thu Feb 28 13:17:39 2013 +0100

bin PATCH_SO_NAME crack

In VersionInfo of Windows executables the FileDescription property 
originally contained
80 times 'x' character. These executables were marked as PATCH_SO_NAME and 
later the
installer maker perl program replaced the xxx to the actual file 
description
which was defined in scp2. WHy was it good, I have no idea. The problem was 
that it
happened after postprocess, where we signed the binaries, thus diigital 
signature became
corrupted. It is better to give file descriptions via makefiles.

Change-Id: Id5ad4470bb7a6313b33fbba09d72d9a009163a89

diff --git a/crashrep/WinResTarget_crashrep.mk 
b/crashrep/WinResTarget_crashrep.mk
index 6206dc7..6036157 100644
--- a/crashrep/WinResTarget_crashrep.mk
+++ b/crashrep/WinResTarget_crashrep.mk
@@ -14,7 +14,10 @@ $(eval $(call gb_WinResTarget_use_custom_headers,crashrep,\
 ))
 
 $(eval $(call gb_WinResTarget_add_defs,crashrep,\
-   -DVERVARIANT=$(BUILD) \
+-DRES_APP_NAME=crashrep \
+-DRES_APP_FILEDESC=$(PRODUCTNAME) Crashreporter \
+-DVERVARIANT=$(BUILD) \
+-DRES_APP_VENDOR=$(OOO_VENDOR) \
 ))
 
 $(eval $(call 
gb_WinResTarget_set_rcfile,crashrep,crashrep/source/win32/crashrep))
diff --git a/crashrep/source/win32/rcheader.txt 
b/crashrep/source/win32/rcheader.txt
index be3c060..bace84b 100644
--- a/crashrep/source/win32/rcheader.txt
+++ b/crashrep/source/win32/rcheader.txt
@@ -58,13 +58,14 @@ VS_VERSION_INFO versioninfo
block 040904E4
{
// International StringTable
-   value CompanyName,The Document 
Foundation\0
-   value FileDescription,
\0
-   value FileVersion,PPS(VER_LEVEL) 
\0
-   value ProductVersion, PPS(VER_LEVEL) 
\0
-   value OriginalFilename,   SOREPORT.EXE\0
-   value InternalName,   CrashReport\0
-   value LegalCopyright, S_CRIGHT  
LibreOffice contributors and/or their affiliates. All rights reserved.\0
+VALUE CompanyName,  PPS(RES_APP_VENDOR) \0
+VALUE FileDescription,  PPS(RES_APP_FILEDESC) \0
+VALUE FileVersion,  PPS(VER_LEVEL) \0
+VALUE ProductVersion,   PPS(VER_LEVEL) \0
+VALUE ProductName,  LibreOffice\0
+VALUE OriginalFilename, PPS(RES_APP_NAME) .exe\0
+VALUE InternalName, PPS(RES_APP_NAME) \0
+VALUE LegalCopyright,   S_CRIGHT  LibreOffice contributors 
and/or their affiliates. All rights reserved.\0
}
}
 
diff --git a/desktop/WinResTarget_sbase.mk b/desktop/WinResTarget_sbase.mk
index 008e436..f4f49d4 100644
--- a/desktop/WinResTarget_sbase.mk
+++ b/desktop/WinResTarget_sbase.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_WinResTarget_set_include,sbase/src,\
 
 $(eval $(call gb_WinResTarget_add_defs,sbase/src,\
 -DRES_APP_NAME=sbase \
+-DRES_APP_FILEDESC=$(PRODUCTNAME) Base \
 -DRES_APP_ICON=icons/base_app.ico \
 -DVERVARIANT=$(BUILD) \
 -DRES_APP_VENDOR=$(OOO_VENDOR) \
diff --git a/desktop/WinResTarget_scalc.mk b/desktop/WinResTarget_scalc.mk
index 89a2d2d..8781d0d 100644
--- a/desktop/WinResTarget_scalc.mk
+++ b/desktop/WinResTarget_scalc.mk
@@ -34,6 +34,7 @@ $(eval $(call