summaryrefslogtreecommitdiff
path: root/l10ntools/source/xmlparse.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-02-08 22:07:23 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-02-08 22:07:23 +0100
commite960410674fc6761025ca1a63f88352a7049fbb5 (patch)
treee593107b2c9c699d53a2e01c34450829527b48b6 /l10ntools/source/xmlparse.cxx
parentaa11b4c86e4b41be542623b7d98a3fb8e5d30745 (diff)
Various more l10ntools clean up
Diffstat (limited to 'l10ntools/source/xmlparse.cxx')
-rw-r--r--l10ntools/source/xmlparse.cxx53
1 files changed, 10 insertions, 43 deletions
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index d6010960c2ff..c21d9e526132 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -239,51 +239,18 @@ sal_uInt16 XMLFile::GetNodeType()
return XML_NODE_TYPE_FILE;
}
-/*****************************************************************************/
-sal_Bool XMLFile::Write( rtl::OString const &aFilename )
-/*****************************************************************************/
+void XMLFile::Write( rtl::OString const &aFilename )
{
-
- if ( !aFilename.isEmpty()) {
- // retry harder if there is a NFS problem,
- for( int x = 1 ; x < 3 ; x++ ){ // this looks strange...yes!
- ofstream aFStream( aFilename.getStr() , ios::out | ios::trunc );
-
- if( !aFStream ) // From time to time the stream can not be opened the first time on NFS volumes,
- { // I wasn't able to track this down. I think this is an NFS issue .....
- TimeValue aTime;
- aTime.Seconds = 3;
- aTime.Nanosec = 0;
-
- osl::Thread::wait( aTime );
- }
- else
- {
- // write out
- Write( aFStream );
- aFStream.close();
-
- // check!
- DirEntry aTarget( aFilename );
- FileStat aFileStat( aTarget );
-
- if( aFileStat.GetSize() < 1 )
- {
- //retry
- aTarget.Kill();
- }
- else
- {
- //everything ok!
- return true;
- }
- }
- }
- cerr << "ERROR: - helpex - Can't create file " << aFilename.getStr() << "\nPossible reason: Disk full ? Mounted NFS volume broken ? Wrong permissions ?\n";
- exit( -1 );
+ std::ofstream s(
+ aFilename.getStr(), std::ios_base::out | std::ios_base::trunc);
+ if (!s.is_open()) {
+ std::cerr
+ << "Error: helpex cannot create file " << aFilename.getStr()
+ << '\n';
+ std::exit(EXIT_FAILURE);
}
- cerr << "ERROR: - helpex - Empty file name\n";
- exit( -1 );
+ Write(s);
+ s.close();
}
void XMLFile::WriteString( ofstream &rStream, const rtl::OUString &sString )
18db2b5f6f3c'>Remove visual noise from svxAlexander Wilms Change-Id: I56497d953b0500ba0967fddb36ca8bbbe86c62ad Reviewed-on: https://gerrit.libreoffice.org/8321 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2014-02-23Remove unneccessary commentsAlexander Wilms Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb Reviewed-on: https://gerrit.libreoffice.org/8182 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2013-12-06Default OMultiTypeInferfaceContainerHelperVar equalImpl parameterStephan Bergmann ...and assorted OUStringHash clean up Change-Id: I779904e1275e8df88f567beb388d1d11af9e9671