include/LibreOfficeKit/LibreOfficeKit.h |    4 ----
 libreofficekit/source/gtk/lokdocview.c  |   22 +++++++++++++++-------
 sc/source/ui/view/gridwin4.cxx          |   24 ++++++++++++++++++++++--
 3 files changed, 37 insertions(+), 13 deletions(-)

New commits:
commit 07aae44547c4494509986ed7dcbca6787a6ced27
Author: Andrzej Hunt <andrzej.h...@collabora.com>
Date:   Fri Jun 27 09:28:17 2014 +0200

    Kill saveAsWithOptions again. (merge error/oversight)
    
    The declaration sneaked in again when merging the libreofficekit
    tiled rendering changes, there's no actual implementation or use
    of this anywhere though.
    (cherry picked from commit 822cf7cb24eaa11ed3aa8d243370fba5bf6af889)

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index 77a8d0f..ba4319f 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -72,10 +72,6 @@ struct _LibreOfficeKitDocumentClass
                      const char *pUrl,
                      const char *pFormat,
                      const char *pFilterOptions);
-  int (*saveAsWithOptions) (LibreOfficeKitDocument* pThis,
-                            const char *pUrl,
-                            const char *pFormat,
-                            const char *pFilterOptions);
 #ifdef LOK_USE_UNSTABLE_API
   LibreOfficeKitDocumentType (*getDocumentType) (LibreOfficeKitDocument* 
pThis);
 
commit 85ef5e243d7bece45cd62a742ad07d3db3d33777
Author: Michael Meeks <michael.me...@collabora.com>
Date:   Thu Jun 26 11:14:50 2014 +0100

    LOK DocView: handle document load failure without crashing.
    
    Change-Id: Icd668b3a7ec3ac58322a6af3f1da6008837d0b6b
    (cherry picked from commit 3c440aad56cdaf3e0c05af6c7967a3d15b183034)

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 )
commit 952900510397d7bd64ee85edf245465b3d73d5a2
Author: Andrzej Hunt <andrzej.h...@collabora.com>
Date:   Thu Jun 26 17:06:58 2014 +0100

    Ensure we actually render all cells in the selected area.
    
    Only cells within maVisibleRange are rendered, even if we request
    a larger area (and maVisibleRange is otherwise not updated for tiled
    rendering). Hence we should explicitly set it here.
    
    Change-Id: I399be9df1f266a2b3d32a95483960b21f561c6b3

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 08fc100..06838f6 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -383,6 +383,10 @@ void ScGridWindow::Paint( const Rectangle& rRect, 
OutputDevice* pOutDev )
         nScrY += pOutDev->LogicToPixel( Point( 0, pDoc->GetRowHeight( nY2, 
nTab ) ) ).getY();
     }
 
+    // We specifically need to set the visible range here -- by default it is
+    // set in UpdateVisibleRange which however uses the viewdata, which is
+    // completely irrelevant for tiled rendering.
+    maVisibleRange.set( nX1, nY1, nX2, nY2 );
     Draw( nX1,nY1,nX2,nY2, SC_UPDATE_MARKS, pOutDev );           // nicht 
weiterzeichnen
     bIsInPaint = false;
 }
commit aec7317d368d0dcfeaccc19878bcb179de5075f5
Author: Andrzej Hunt <andrzej.h...@collabora.com>
Date:   Thu Jun 26 14:30:08 2014 +0100

    Take into account drawing layer for data area size.
    
    The drawing layer could potentially have items that are outwith
    the data area, but we probably want to have them included for
    tiled rendering.
    
    Change-Id: I958c4fa29491cdb0fd80392dfcfa033306f2b76c

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a34b95e..08fc100 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -29,6 +29,7 @@
 #include <sfx2/printer.hxx>
 #include <vcl/settings.hxx>
 
+#include <svx/svdpage.hxx>
 #include <svx/svdview.hxx>
 #include "tabvwsh.hxx"
 
@@ -394,17 +395,32 @@ Size ScGridWindow::GetDataAreaSize()
 
     SCTAB nTab = pViewData->GetTabNo();
 
+    // Actual data area
     pDoc->ShrinkToDataArea( nTab,
                             nStartCol, nStartRow, nEndCol, nEndRow );
 
+    // Drawing layer area -- is completely independent of the data area.
+    ScTabViewShell* pTabViewShell = pViewData->GetViewShell();
+    SdrView* pDrawView = pTabViewShell->GetSdrView();
+    SdrPageView* pPageView = pDrawView->GetSdrPageView();
+    SdrPage* pPage = pPageView->GetPage();
+    Rectangle aDrawDataArea = pPage->GetAllObjBoundRect();
+    // Draw layer works in 100th mm, whereas we're working with TWIPs.
+    aDrawDataArea.SetPos( aDrawDataArea.TopLeft() * 1440 / 2540 );
+    aDrawDataArea.SetSize( Size( aDrawDataArea.GetSize().Width() * 1440 / 2540,
+                                 aDrawDataArea.GetSize().Height() * 1440 / 
2540 ) );
+
+    // We specifically keep iterating until we have covered both the
+    // data area AND the drawing layer area. We also make sure that
+    // we return an area corresponding to a whole number of cells.
     long nX = 0;
-    for ( SCCOL i = 0; i <= nEndCol; i++ )
+    for ( SCCOL i = 0; i <= nEndCol || nX < aDrawDataArea.Right(); i++ )
     {
         nX += pDoc->GetColWidth( i, nTab );
     }
 
     long nY = 0;
-    for ( SCROW i = 0; i <= nEndRow; i++ )
+    for ( SCROW i = 0; i <= nEndRow || nY < aDrawDataArea.Bottom(); i++ )
     {
         nY += pDoc->GetRowHeight( i, nTab );
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to