sc/qa/unit/data/xls/external-ref.xls |binary sc/qa/unit/subsequent_export-test.cxx | 22 ++++++++++++++++++++++ sc/source/filter/excel/xehelper.cxx | 10 ++++++++++ sw/source/ui/docvw/edtwin.cxx | 2 -- 4 files changed, 32 insertions(+), 2 deletions(-)
New commits: commit 24f95d7e82b0c7896994ed12cac5ab022fc32267 Author: Andras Timar <andras.ti...@collabora.com> Date: Tue Oct 28 12:13:55 2014 +0100 fdo#37960 fix shift+click to select multiple drawings I simply didn't get the logic behind calling GotoNextFly(). It caused not only this bug. For example Ctrl+click on a background text frame did not select the text frame, but an image on the previous page. Change-Id: I85ccbbda2f324de55417d6199b4abe79e59bf295 diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 714734d..4289af4 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -3673,8 +3673,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.IsObjSelectable( aDocPos ) ) && !lcl_urlOverBackground( rSh, aDocPos ) ) { SwMvContext aMvContext( &rSh ); - if( !rSh.IsFrmSelected() ) - rSh.GotoNextFly(); rSh.EnterSelFrmMode(); bCallBase = false; } commit 0a5597d120e561dc8ad72a0416af15f7fb273a67 Author: Andras Timar <andras.ti...@collabora.com> Date: Sat Oct 25 21:47:55 2014 +0200 bnc#893791 XLS export: external sheet references on Linux/OSX The commit solves two problems. 1. Make sure we save absolute paths on Linux/OSX 2. Make sure we don't save invalid XLS (VirtualPath longer than 255 chars) The first problem has always been there, so after a few load/save cycles an XLS with reference to other XLS on a Unix-like file system became invalid, and only LibreOffice could open it, Excel could not. These broken XLS files can be repaired by saving after this patch, however, the original reference will remain broken. (cherry picked from commit 3f5251675eeeeae56ea282fdeb09dbc53ce4aae6) Conflicts: sc/qa/unit/subsequent_export-test.cxx Conflicts: sc/qa/unit/subsequent_export-test.cxx Change-Id: I8f575acb1d560d539c1da61a1afdaac3f0c13977 diff --git a/sc/qa/unit/data/xls/external-ref.xls b/sc/qa/unit/data/xls/external-ref.xls new file mode 100644 index 0000000..21f3338 Binary files /dev/null and b/sc/qa/unit/data/xls/external-ref.xls differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index ad2e2ee..1b88b27 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -74,6 +74,8 @@ public: void testFormulaReferenceXLS(); void testSheetProtectionXLSX(); + void testSupBookVirtualPath(); + CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); #if !defined(MACOSX) && !defined(DRAGONFLY) @@ -93,6 +95,9 @@ public: CPPUNIT_TEST(testFormulaReferenceXLS); CPPUNIT_TEST(testSheetProtectionXLSX); +#if !defined(WNT) + CPPUNIT_TEST(testSupBookVirtualPath); +#endif CPPUNIT_TEST_SUITE_END(); private: @@ -828,6 +833,23 @@ void ScExportTest::tearDown() test::BootstrapFixture::tearDown(); } +void ScExportTest::testSupBookVirtualPath() +{ + ScDocShellRef xShell = loadDoc("external-ref.", XLS); + CPPUNIT_ASSERT(xShell.Is()); + + ScDocShellRef xDocSh = saveAndReload(xShell, XLS); + xShell->DoClose(); + CPPUNIT_ASSERT(xDocSh.Is()); + + ScDocument* pDoc = xDocSh->GetDocument(); + + if (!checkFormula(*pDoc, ScAddress(0,0,0), "'file:///home/timar/Documents/external.xls'#$Sheet1.A1")) + CPPUNIT_FAIL("Wrong SupBook VirtualPath URL"); + + xDocSh->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 98f8b12..d590988 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -913,6 +913,11 @@ OUString lclEncodeDosUrl( aBuf.append(EXC_URL_DOSDRIVE).append(cDrive); aOldUrl = aOldUrl.copy(3); } + else + { + // URL probably points to a document on a Unix-like file system + aBuf.append(EXC_URL_DRIVEROOT); + } // directories sal_Int32 nPos = -1; @@ -954,6 +959,11 @@ OUString lclEncodeDosUrl( if (pTableName) aBuf.append(*pTableName); + // VirtualPath must be shorter than 255 chars ([MS-XLS].pdf 2.5.277) + // It's better to truncate, than generate invalid file that Excel cannot open. + if (aBuf.getLength() > 255) + aBuf.setLength(255); + return aBuf.makeStringAndClear(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits