[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/qa writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 30 00:19:47 UTC 2018


 sw/qa/extras/rtfexport/data/fdo69384-paste.rtf  |    4 ++--
 sw/qa/extras/rtfexport/rtfexport2.cxx           |   13 ++++++++++---
 writerfilter/source/dmapper/StyleSheetTable.cxx |    7 -------
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 634527cf866adf5cc7fb501b09e36bb3f7be89e5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Aug 23 17:19:07 2018 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Thu Aug 30 02:19:25 2018 +0200

    Resolves: tdf#118382 crash on paste of rtf
    
    into an existing document since....
    
    commit deaa16bd24fba4a3a6b072ab2b94542a7dbd41c6
    Author: Serge Krot <Serge.Krot at cib.de>
    Date:   Mon Jan 29 12:17:06 2018 +0100
    
        tdf#72942 Do not overwrite styles from the inserted doc
    
        During inserting of the text from the external document
        we should not change original default styles in
        currently opened document.
    
    because missing styles aren't created, so there's exceptons
    thrown on their use.
    
    I see that the m_bIsNewDoc flag is already checked for since...
    
    commit 5ebe826caf75e8d00656b3333385bf0bbc05cb27
    Author: Miklos Vajna <vmiklos at collabora.co.uk>
    Date:   Fri Oct 4 11:02:59 2013 +0200
    
        fdo#69384 fix impress -> writer copy&paste
    
        Regression from 2ade07126971b79c92f729fae5709f2e2e2b495c (fdo#62044 RTF
        import: don't overwrite existing styles when pasting, 2013-06-04),
        during paste, if existing style was found, then the intention was to
        skip that style, but instead we tried to create one.
    
    in the body of the following loop, which should mean that existing
    styles are left alone and only missing styles created if we remove
    this hunk of the tdf#72942 commit
    
    Change-Id: Ia4aedb5e309c991490656061aa20d11ff24f4f9e
    Reviewed-on: https://gerrit.libreoffice.org/59519
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 1f1e349bbee1b2bff01a850d9a7fe4d6a77c4f29)
    Reviewed-on: https://gerrit.libreoffice.org/59636
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf b/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf
index cbdca5be6e9c..e0a9733c7475 100644
--- a/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf
+++ b/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf
@@ -8,10 +8,10 @@
 {\s4\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext4 Object without fill;}
 {\s5\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext5 Object with no fill and no line;}
 {\s6\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext6 Text;}
-{\s7\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs32\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext7 Text body;}
+{\s7\fi0\li0\ri0\sb0\sa0\sl200\slmult0\cf0\f3\fs132\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs136\fs136\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext7 Text Body;}
 {\s8\fi0\li0\ri0\sb0\sa0\sl200\slmult0\ql\cf0\f3\fs36\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs36\fs36\b0\b0\i0\i0\accnone\olnone\sbasedon1\snext8 Text body justified;}}
 {\*\EditEnginePoolDefaults\ltrpar\fi0\li0\ri0\fi0\li0\ri0\sb0\sa0\sl0\slmult0\ql\cf0\f0\fs48\b0\ulnone\strike0\i0\outl0\shad0\kerning0\expndtw0\f1\f2\fs48\fs48\b0\b0\i0\i0\accnone\olnone}
 \deftab709
 {
-\s27\fi0\li0\ri0\qc\cf0\f3\fs64\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs64\fs64\b0\b0\i0\i0\accnone\olnone {\f3\fs64\b0\i0 sss}\par\pard\plain
+\s7\fi0\li0\ri0\qc\cf0\f3\fs64\b0\ulnone\strike0\i0\outl0\shad0\kerning1\f4\f2\fs64\fs64\b0\b0\i0\i0\accnone\olnone {\f3\fs64\b0\i0 sss}\par\pard\plain
 }}
diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx
index 64de79280e25..e5b2fd4f958b 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -655,8 +655,12 @@ DECLARE_RTFEXPORT_TEST(testFdo63428, "hello.rtf")
 
 DECLARE_RTFEXPORT_TEST(testFdo69384, "fdo69384-paste.rtf")
 {
-    // Check if the style is loaded
+    // Ensure non-default style is loaded
     getStyles("ParagraphStyles")->getByName("Text body justified");
+    // Ensure default styles were modified, vs testFdo69384Inserted where it is not
+    uno::Reference<beans::XPropertySet> xPropertySet(
+        getStyles("ParagraphStyles")->getByName("Text Body"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(68.f, getProperty<float>(xPropertySet, "CharHeight"));
 }
 
 DECLARE_RTFEXPORT_TEST(testFdo69384Inserted, "hello.rtf")
@@ -666,8 +670,11 @@ DECLARE_RTFEXPORT_TEST(testFdo69384Inserted, "hello.rtf")
     uno::Reference<text::XTextRange> xEnd = xText->getEnd();
     paste("rtfexport/data/fdo69384-paste.rtf", xEnd);
 
-    // During insert of the RTF document we do not insert new styles
-    CPPUNIT_ASSERT(!getStyles("ParagraphStyles")->hasByName("Text body justified"));
+    // During insert of the RTF document we do not change pre-existing styles
+    // vs testFdo69384 where it is
+    uno::Reference<beans::XPropertySet> xPropertySet(
+        getStyles("ParagraphStyles")->getByName("Text Body"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(xPropertySet, "CharHeight"));
 }
 
 DECLARE_RTFEXPORT_TEST(testFdo61193, "hello.rtf")
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 2aa8bd4d5caa..d01e39044f5a 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -882,13 +882,6 @@ uno::Sequence< OUString > PropValVector::getNames()
 
 void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
 {
-    if (!m_pImpl->m_bIsNewDoc)
-    {
-        // tdf#72942: do not import styles from document being inserted,
-        // while they corrupts original styles in master document
-        return;
-    }
-
     try
     {
         uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( m_pImpl->m_xTextDocument, uno::UNO_QUERY_THROW );


More information about the Libreoffice-commits mailing list