[Libreoffice-commits] core.git: 2 commits - package/source sal/inc ucb/source
Stephan Bergmann
sbergman at redhat.com
Fri Mar 15 10:54:59 PDT 2013
package/source/manifest/ManifestReader.cxx | 9 ++++++---
package/source/zipapi/XUnbufferedStream.cxx | 3 ++-
package/source/zippackage/ZipPackage.cxx | 21 ++++++++++++++-------
sal/inc/sal/log-areas.dox | 2 ++
ucb/source/ucp/gio/gio_content.cxx | 7 +++----
5 files changed, 27 insertions(+), 15 deletions(-)
New commits:
commit df3cbe026f2d5b432283625fa30cc910c484abdc
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Mar 15 18:54:19 2013 +0100
fprintf -> SAL_WARN
Change-Id: Ifab1415fafa93551d8bed1e77c38f04bec8d2eba
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index da9bff0..9cf9855 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -202,6 +202,7 @@ certain functionality.
@li @c cmisucp
@li @c ucb.ucp
+ at li @c ucb.ucp.gio
@li @c ucb.ucp.webdav
@section unotools
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index 6584bc5..e7a3450 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -490,13 +490,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo *
{
xRow->appendObject( rProp, uno::makeAny( queryCreatableContentsInfo( xEnv ) ) );
}
-#ifdef DEBUG
else
{
- fprintf(stderr, "Looking for unsupported property %s\n",
- rtl::OUStringToOString(rProp.Name, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN(
+ "ucb.ucp.gio",
+ "Looking for unsupported property " << rProp.Name);
}
-#endif
}
return uno::Reference< sdbc::XRow >( xRow.get() );
commit 27d02a348b987de0f1a9c2142724a46a03730cf5
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Mar 15 18:51:07 2013 +0100
Improve debug messages
Some of those SAL_WARNs might actually better be SAL_INFOs; please change if
they hit too often.
Change-Id: I2a3b9bd485586b7878194f84bc734b54ce69bc06
diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx
index bba764a..feac40c 100644
--- a/package/source/manifest/ManifestReader.cxx
+++ b/package/source/manifest/ManifestReader.cxx
@@ -67,14 +67,17 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ManifestReader::readManifestSeque
while( aIter != aEnd )
*pSequence++ = (*aIter++);
}
- catch (SAXParseException& )
+ catch (SAXParseException& e)
{
+ SAL_WARN("package", "ignoring SAXParseException " + e.Message);
}
- catch (SAXException& )
+ catch (SAXException& e)
{
+ SAL_WARN("package", "ignoring SAXException " + e.Message);
}
- catch (IOException& )
+ catch (IOException& e)
{
+ SAL_WARN("package", "ignoring IOException " + e.Message);
}
xParser->setDocumentHandler ( Reference < XDocumentHandler > () );
return aManifestSequence;
diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx
index 37599c3..cb4b812 100644
--- a/package/source/zipapi/XUnbufferedStream.cxx
+++ b/package/source/zipapi/XUnbufferedStream.cxx
@@ -140,9 +140,10 @@ XUnbufferedStream::XUnbufferedStream(
try {
if ( mxZipSeek.is() )
mnZipSize = mxZipSeek->getLength();
- } catch( Exception& )
+ } catch( Exception& e )
{
// in case of problem the size will stay set to 0
+ SAL_WARN("package", "ignoring Exception " + e.Message);
}
mnZipEnd = mnZipCurrent + mnZipSize;
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index c3561ab..8c714a3 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -397,7 +397,10 @@ void ZipPackage::parseManifest()
// the mimetype stream should contain the information from manifest.xml
if ( !m_pRootFolder->GetMediaType().equals( aPackageMediatype ) )
throw ZipIOException(
- OSL_LOG_PREFIX "mimetype conflicts with manifest.xml\n",
+ (OSL_LOG_PREFIX
+ "mimetype conflicts with manifest.xml, \""
+ + m_pRootFolder->GetMediaType() + "\" vs. \""
+ + aPackageMediatype + "\""),
uno::Reference< uno::XInterface >() );
}
@@ -580,7 +583,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
throw( Exception, RuntimeException )
{
RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::initialize" );
- sal_Bool bBadZipFile = sal_False, bHaveZipFile = sal_True;
+ sal_Bool bHaveZipFile = sal_True;
uno::Reference< XProgressHandler > xProgressHandler;
beans::NamedValue aNamedValue;
@@ -750,18 +753,22 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
}
if ( bHaveZipFile )
{
+ bool bBadZipFile = false;
+ OUString message;
try
{
m_pZipFile = new ZipFile ( m_xContentStream, m_xContext, sal_True, m_bForceRecovery, xProgressHandler );
getZipFileContents();
}
- catch ( IOException & )
+ catch ( IOException & e )
{
- bBadZipFile = sal_True;
+ bBadZipFile = true;
+ message = "IOException: " + e.Message;
}
- catch ( ZipException & )
+ catch ( ZipException & e )
{
- bBadZipFile = sal_True;
+ bBadZipFile = true;
+ message = "ZipException: " + e.Message;
}
catch ( Exception & )
{
@@ -775,7 +782,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
if( m_pZipFile ) { delete m_pZipFile; m_pZipFile = NULL; }
throw com::sun::star::packages::zip::ZipIOException (
- OSL_LOG_PREFIX "Bad Zip File.",
+ OSL_LOG_PREFIX "Bad Zip File, " + message,
static_cast < ::cppu::OWeakObject * > ( this ) );
}
}
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index eca0a75..da9bff0 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -293,6 +293,7 @@ certain functionality.
@li @c helpcompiler
@li @c linguistic
@li @c oox
+ at li @c package
@li @c rsc
@li @c sax
@li @c shell
More information about the Libreoffice-commits
mailing list