[Libreoffice-commits] core.git: 2 commits - cppu/source libreofficekit/source
Michael Meeks
michael.meeks at collabora.com
Fri Jun 27 00:55:38 PDT 2014
cppu/source/typelib/typelib.cxx | 4 +++-
libreofficekit/source/gtk/lokdocview.c | 22 +++++++++++++++-------
2 files changed, 18 insertions(+), 8 deletions(-)
New commits:
commit ab0b8a95ef9ede3d41289593b8fbf68800ff9278
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Tue Jun 24 16:12:08 2014 +0100
fix comment and tiny optimisation for shutdown.
Change-Id: I94e0f55f7fc38529a9ab165786efaf7ac649a9d3
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index 583b737..8533578 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -270,7 +270,9 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl()
if( pWeakMap )
{
std::vector< typelib_TypeDescriptionReference * > ppTDR;
- // save al weak references
+ ppTDR.reserve( pWeakMap->size() );
+
+ // save all weak references
WeakMap_Impl::const_iterator aIt = pWeakMap->begin();
while( aIt != pWeakMap->end() )
{
commit 3c440aad56cdaf3e0c05af6c7967a3d15b183034
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Jun 26 11:14:50 2014 +0100
LOK DocView: handle document load failure without crashing.
Change-Id: Icd668b3a7ec3ac58322a6af3f1da6008837d0b6b
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c
index 49aaf2e..f813e68 100644
--- a/libreofficekit/source/gtk/lokdocview.c
+++ b/libreofficekit/source/gtk/lokdocview.c
@@ -22,8 +22,9 @@ static void lok_docview_init( LOKDocView* pDocView );
void lcl_onDestroy( LOKDocView* pDocView, gpointer pData )
{
(void) pData;
- pDocView->pDocument->pClass->destroy( pDocView->pDocument );
- pDocView->pDocument = 0;
+ if ( pDocView->pDocument )
+ pDocView->pDocument->pClass->destroy( pDocView->pDocument );
+ pDocView->pDocument = NULL;
}
SAL_DLLPUBLIC_EXPORT guint lok_docview_get_type()
@@ -139,15 +140,22 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_docview_open_document( LOKDocView* pDocView, c
if ( pDocView->pDocument )
{
pDocView->pDocument->pClass->destroy( pDocView->pDocument );
- pDocView->pDocument = 0;
+ pDocView->pDocument = NULL;
}
pDocView->pDocument = pDocView->pOffice->pClass->documentLoad( pDocView->pOffice,
- pPath );
-
- renderDocument( pDocView );
+ pPath );
+ if ( !pDocView->pDocument )
+ {
+ // FIXME: should have a GError parameter and populate it.
+ char *pError = pDocView->pOffice->pClass->getError( pDocView->pOffice );
+ fprintf( stderr, "Error opening document '%s'\n", pError );
+ return FALSE;
+ }
+ else
+ renderDocument( pDocView );
- return FALSE;
+ return TRUE;
}
SAL_DLLPUBLIC_EXPORT void lok_docview_set_zoom ( LOKDocView* pDocView, float fZoom )
More information about the Libreoffice-commits
mailing list