libreofficekit/qa/data/join/README                   |    4 ++
 libreofficekit/qa/data/join/calc-100-textjitter.xlsx |binary
 libreofficekit/qa/tilebench/tilebench.cxx            |   37 ++++++++++---------
 sc/source/ui/view/gridwin4.cxx                       |    2 -
 4 files changed, 26 insertions(+), 17 deletions(-)

New commits:
commit 706afd3e765e98489a2b43934a259626f9f0be01
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Fri Oct 25 19:55:37 2019 +0100
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Fri Oct 25 22:21:32 2019 +0200

    lok: disable page break view for tiled rendering mode.
    
    Why ? dotted lines fail to join giving differences in the grid depending
    on render position, vcl's LineInfo has no offset to compensate (yet).
    
    Restore when vcl's LineInfo is better.
    
    Change-Id: I45803ee80c8fcefd17a37dc3fd93fbafd94fffd4
    Reviewed-on: https://gerrit.libreoffice.org/81530
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index aed7f1447d39..76041fdc5b7a 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -560,7 +560,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const 
ScTableInfo& rTableI
     bool bGrid = rOpts.GetOption( VOPT_GRID ) && pViewData->GetShowGrid();
     bool bGridFirst = !rOpts.GetOption( VOPT_GRID_ONTOP );
 
-    bool bPage = rOpts.GetOption( VOPT_PAGEBREAKS );
+    bool bPage = rOpts.GetOption( VOPT_PAGEBREAKS ) && !bIsTiledRendering;
     // tdf#124983, if option LibreOfficeDev Calc/View/Visual Aids/Page breaks
     // is enabled, breaks should be visible. If the document is opened the 
first
     // time, the breaks are not calculated yet, so this initialization is
commit 439f595e6e74d34b66f8745e0a6013ec738f23df
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Fri Oct 25 19:58:35 2019 +0100
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Fri Oct 25 22:21:20 2019 +0200

    lok: improve tilebench and add an unpleasant text rendering test case.
    
    Change-Id: I9e769cff6db794389bcef821c08ca1cd60173ab9
    Reviewed-on: https://gerrit.libreoffice.org/81531
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/libreofficekit/qa/data/join/README 
b/libreofficekit/qa/data/join/README
new file mode 100644
index 000000000000..35762e1f0525
--- /dev/null
+++ b/libreofficekit/qa/data/join/README
@@ -0,0 +1,4 @@
+Files to run through tilebench --join to detect problems.
+
+bin/run tilebench instdir/program libreofficekit/qa/join/<filename> --join
+
diff --git a/libreofficekit/qa/data/join/calc-100-textjitter.xlsx 
b/libreofficekit/qa/data/join/calc-100-textjitter.xlsx
new file mode 100644
index 000000000000..94a3e5254d9a
Binary files /dev/null and 
b/libreofficekit/qa/data/join/calc-100-textjitter.xlsx differ
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx 
b/libreofficekit/qa/tilebench/tilebench.cxx
index a1d415fe56bb..fef5271bdf27 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -72,19 +72,21 @@ static void dumpTile(const char *pNameStem,
         nTotalWidth = nWidth;
 
     auto pBuffer = reinterpret_cast<const char *>(pBufferU);
+    static int counter = 0;
     std::string aName = "/tmp/dump_tile";
     aName += pNameStem;
+    aName += "_" + std::to_string(counter);
     aName += ".ppm";
 #ifndef IOS
     std::ofstream ofs(aName);
 #else
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 
NSUserDomainMask, YES);
     NSString *documentsDirectory = [paths objectAtIndex:0];
-    static int counter = 0;
-    NSString *path = [NSString stringWithFormat:@"%@/dump_tile_%d.ppm", 
documentsDirectory, counter++];
+    NSString *path = [NSString stringWithFormat:@"%@/dump_tile_%d.ppm", 
documentsDirectory, counter];
     std::ofstream ofs([path UTF8String]);
     std::cerr << "---> Dumping tile\n";
 #endif
+    counter++;
     ofs << "P6\n"
         << nWidth << " "
         << nHeight << "\n"
@@ -356,7 +358,7 @@ static bool testJoinsAt( Document *pDocument, long nX, long 
nY,
 }
 
 // Check that our tiles join nicely ...
-static void testJoin( Document *pDocument)
+static int testJoin( Document *pDocument)
 {
     // Ignore parts - just the first for now ...
     long nWidth = 0, nHeight = 0;
@@ -366,20 +368,23 @@ static void testJoin( Document *pDocument)
     // Use realistic dimensions, similar to the Online client.
     long const nTilePixelSize = 256;
     long const nTileTwipSize = 1852;
+    long nFails = 0;
 
     for( long y = 0; y < 5; ++y )
     {
         for( long x = 0; x < 5; ++x )
         {
             if ( !testJoinsAt( pDocument, x, y, nTilePixelSize, nTileTwipSize 
) )
-            {
-                fprintf( stderr, "failed\n" );
-                return;
-            }
+                nFails++;
         }
     }
 
-    fprintf( stderr, "All joins compared correctly\n" );
+    if (nFails > 0)
+        fprintf( stderr, "Failed %ld joins\n", nFails );
+    else
+        fprintf( stderr, "All joins compared correctly\n" );
+
+    return nFails;
 }
 
 static std::atomic<bool> bDialogRendered(false);
@@ -512,7 +517,7 @@ int main( int argc, char* argv[] )
 
     aTimes.emplace_back("initialization");
     // coverity[tainted_string] - build time test tool
-    Office *pOffice = lok_cpp_init(install_path, user_profile);
+    std::unique_ptr<Office> pOffice( lok_cpp_init(install_path, user_profile) 
);
     if (pOffice == nullptr)
     {
         fprintf(stderr, "Failed to initialize Office from %s\n", argv[1]);
@@ -521,13 +526,13 @@ int main( int argc, char* argv[] )
     aTimes.emplace_back();
     pOffice->registerCallback(ignoreCallback, nullptr);
 
-    Document *pDocument = nullptr;
+    std::unique_ptr<Document> pDocument;
 
     pOffice->setOptionalFeatures(LOK_FEATURE_NO_TILED_ANNOTATIONS);
 
     aTimes.emplace_back("load document");
     if (doc_url != nullptr)
-        pDocument = pOffice->documentLoad(doc_url);
+        pDocument.reset(pOffice->documentLoad(doc_url));
     aTimes.emplace_back();
 
     if (pDocument)
@@ -540,11 +545,11 @@ int main( int argc, char* argv[] )
             int max_tiles = (argc > arg ? atoi(argv[arg++]) : -1);
             const bool dump = true;
 
-            testTile (pDocument, max_parts, max_tiles, dump);
+            testTile (pDocument.get(), max_parts, max_tiles, dump);
         }
         else if (!strcmp(mode, "--join"))
         {
-            testJoin (pDocument);
+            return testJoin (pDocument.get());
         }
         else if (!strcmp (mode, "--dialog"))
         {
@@ -563,16 +568,16 @@ int main( int argc, char* argv[] )
                     return help("missing argument to --dialog and no default");
                 }
             }
-            testDialog (pDocument, uno_cmd);
+            testDialog (pDocument.get(), uno_cmd);
         } else
             return help ("unknown parameter");
     }
 
     aTimes.emplace_back("destroy document");
-    delete pDocument;
+    pDocument.reset();
     aTimes.emplace_back();
 
-    delete pOffice;
+    pOffice.reset();
 
     double nTotal = 0.0;
     fprintf (stderr, "profile run:\n");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to