sc/source/ui/app/inputhdl.cxx                             |    8 +
 sc/source/ui/inc/inputhdl.hxx                             |    3 
 sc/source/ui/view/tabvwsh4.cxx                            |    3 
 sw/qa/extras/rtfimport/data/rhbz1065629.rtf               |   81 ++++++++++++++
 sw/qa/extras/rtfimport/rtfimport.cxx                      |   21 +++
 swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java |    4 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx            |   14 ++
 writerfilter/source/rtftok/rtfdocumentimpl.hxx            |    1 
 8 files changed, 132 insertions(+), 3 deletions(-)

New commits:
commit d98ae159392c0cd4373f40d3da31ecb0f8516938
Author: Julien Nabet <serval2...@yahoo.fr>
Date:   Wed Feb 19 22:23:58 2014 +0100

    Resolves: fdo#69925 Wiki Publisher Extension is not working
    
    Regression from 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=b80d8c695e6b6ded231e67ed9a80bcd1f1250c03
    "compareTo" has been replaced by "==", so we compared the equality ot the 
pointers on the objects instead of the content of the strings
    To make it simple and since we compare String objects, let's simply use 
"equals" method
    
    Change-Id: I65bc1a87751297411fdbe722d3f49bce5e291638
    (cherry picked from commit 9e2d1d21f9a58e320444f6eaea2f006530bbd2cb)
    Signed-off-by: Michael Stahl <mst...@redhat.com>

diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java 
b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
index ff9f85a..4cad2f6 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
@@ -134,7 +134,7 @@ public final class WikiEditorImpl extends WeakBase
     {
         final com.sun.star.util.URL myURL = aURL;
         //logger.log( Level.INFO, "received dispatch request for: 
"+aURL.Complete );
-        if ( aURL.Protocol == protocolName )
+        if ( aURL.Protocol.equals(protocolName) )
         {
             /*
             synchronized( this )
@@ -146,7 +146,7 @@ public final class WikiEditorImpl extends WeakBase
 
             try
             {
-                if ( myURL.Path == "send" )
+                if ( myURL.Path.equals("send") )
                 {
                     sendArticle();
                 }
commit 9eb6e9516bed2d966717a473354a930b894b5bdb
Author: Kohei Yoshida <kohei.yosh...@collabora.com>
Date:   Fri Feb 14 12:28:03 2014 -0500

    fdo#73773: Check if the *document* is closing, not the *app*.
    
    Otherwise it would crash if the app has multiple document instances open
    and only one of them is being closed.
    
    (cherry picked from commit 76bdf523981d2bd983dac4e01bc5cc934118a73f)
    
    Conflicts:
        sc/source/ui/app/inputhdl.cxx
    
    Change-Id: Ib6e370037ab6097c9c6eff8035249663944b3a6c
    Reviewed-on: https://gerrit.libreoffice.org/8055
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index b31489c..a45ac8f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -298,6 +298,11 @@ handle_r1c1:
     }
 }
 
+void ScInputHandler::SetDocumentDisposing( bool b )
+{
+    mbDocumentDisposing = b;
+}
+
 static void lcl_Replace( EditView* pView, const String& rNewStr, const 
ESelection& rOldSel )
 {
     if ( pView )
@@ -519,6 +524,7 @@ ScInputHandler::ScInputHandler()
         bProtected( false ),
         bCellHasPercentFormat( false ),
         bLastIsSymbol( false ),
+        mbDocumentDisposing(false),
         nValidation( 0 ),
         eAttrAdjust( SVX_HOR_JUSTIFY_STANDARD ),
         aScaleX( 1,1 ),
@@ -542,7 +548,7 @@ ScInputHandler::~ScInputHandler()
     //  Wenn dies der Applikations-InputHandler ist, wird der dtor erst nach 
SfxApplication::Main
     //  gerufen, darf sich also auf keine Sfx-Funktionen mehr verlassen
 
-    if ( !SFX_APP()->IsDowning() )          // inplace
+    if (!mbDocumentDisposing)          // inplace
         EnterHandler();                     // Eingabe noch abschliessen
 
     if (SC_MOD()->GetRefInputHdl()==this)
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 8d0d44f..0bb4fda 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -100,6 +100,7 @@ private:
     bool                    bProtected:1;
     bool                    bCellHasPercentFormat:1;
     bool                    bLastIsSymbol:1;
+    bool                    mbDocumentDisposing:1;
     sal_uLong                   nValidation;
     SvxCellHorJustify       eAttrAdjust;
 
@@ -256,6 +257,8 @@ public:
                     // actually private, public for SID_INPUT_SUM
     void            InitRangeFinder( const String& rFormula );
 
+    void SetDocumentDisposing( bool b );
+
     static void     SetAutoComplete(bool bSet)  { bAutoComplete = bSet; }
 };
 
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 377546f..cb920d4 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1740,6 +1740,9 @@ ScTabViewShell::~ScTabViewShell()
     //  alles auf NULL, falls aus dem TabView-dtor noch darauf zugegriffen wird
     //! (soll eigentlich nicht !??!?!)
 
+    if (pInputHandler)
+        pInputHandler->SetDocumentDisposing(true);
+
     DELETEZ(pFontworkBarShell);
     DELETEZ(pExtrusionBarShell);
     DELETEZ(pCellShell);
commit cace9588c86a32beecbf65fae4988af6a32c6769
Author: Michael Stahl <mst...@redhat.com>
Date:   Tue Feb 18 11:22:52 2014 +0100

    rhbz#1065629: RTF import: don't drop nested cells if not enough \cellx
    
    In this document written by "XMLmind XSL-FO Converter" there are less
    \cellx than \cell and thus when reading \nestrow/\row a whole buffered
    nested table \cell is lost and then subsequently the rest of the nested
    table too.  Try to fix that by counting both \cell and \cellx and
    replaying until the maximum of those.
    
    Cannot count \intbl since we synthesize that in various places.
    
    (regression in LO 3.5)
    
    (cherry picked from commit 07ef4cf096015f0e427ffd17cd26bb6837e75481)
    Conflicts:
        sw/qa/extras/rtfimport/rtfimport.cxx
    
    Reviewed-on: https://gerrit.libreoffice.org/8101
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Miklos Vajna <vmik...@collabora.co.uk>
    
    Conflicts:
        sw/qa/extras/rtfimport/rtfimport.cxx
    
    Change-Id: I3b64ad94af842e076611418589a0c83bd18841c6

diff --git a/sw/qa/extras/rtfimport/data/rhbz1065629.rtf 
b/sw/qa/extras/rtfimport/data/rhbz1065629.rtf
new file mode 100644
index 0000000..b22ec50
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/rhbz1065629.rtf
@@ -0,0 +1,81 @@
+{\rtf1\ansi\ansicpg1252\deff0
+{\fonttbl
+\f0\froman\fcharset0 Times New Roman;
+\f1\fswiss\fcharset0 Arial;
+\f2\fmodern\fcharset0 Courier New;
+\f3\ftech\fcharset2 Symbol;
+\f4\fswiss\fcharset0 Helvetica;
+}
+{\info
+{\*\userprops
+{\propname creator}\proptype30
+{\staticval XMLmind XSL-FO Converter Professional Edition 4.6.1}
+}
+}
+\facingp\fet0\ftnbj
+\sectd
+\pghsxn16114\pgwsxn12514
+\margtsxn720\margbsxn907\marglsxn907\margrsxn1080
+\headery720
+\footery547
+\pgncont\pgndec
+
+\par
+\trowd\trleft10
+\clvertalt
+\clcbpat17
+\clbrdrt\brdrs\brdrw20\brdrcf2\clbrdrb\brdrs\brdrw20\brdrcf2\clbrdrl\brdrs\brdrw20\brdrcf2\clbrdrr\brdrs\brdrw20\brdrcf2\cellx10262
+\pard\intbl
+{\plain\f4\fs19\b\cf15\ulc2
+Informations client
+}
+\cell
+\row
+\trowd\trleft10
+\clvertalt
+\clbrdrl\brdrs\brdrw10\brdrcf2\cellx5136
+\clvertalt
+\clbrdrl\brdrs\brdrw10\brdrcf2\clbrdrr\brdrs\brdrw10\brdrcf2\cellx10262
+\pard\intbl\itap2
+{\plain\f4\fs18\cf2\ulc2
+E-mail:
+}
+\nestcell
+{\*\nesttableprops
+\trowd\trleft0
+\clvertalt
+\cellx5400
+\nestrow}
+\pard\intbl
+\cell
+\pard\intbl\itap2
+{\plain\f4\fs18\b\cf2\ulc2
+Responsable Commercial:
+}
+\nestcell
+{\*\nesttableprops
+\trowd\trleft0
+\clvertalt
+\cellx5400
+\nestrow}
+\pard\intbl\itap2
+{\plain\f4\fs18\cf2\ulc2
+\~
+}
+\par
+\pard\intbl\itap2
+{\plain\f4\fs18\cf2\ulc2
+Nom: John Doe
+}
+\nestcell
+{\*\nesttableprops
+\trowd\trleft0
+\clvertalt
+\cellx5400
+\nestrow}
+\pard\intbl
+\cell
+\row
+
+\pard\sect
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index df118b0..828ddcc 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -165,6 +165,7 @@ public:
     void testFdo65090();
     void testN823675();
     void testCp1000018();
+    void testNestedTable();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -313,6 +314,7 @@ void Test::run()
         {"fdo65090.rtf", &Test::testFdo65090},
         {"n823675.rtf", &Test::testN823675},
         {"cp1000018.rtf", &Test::testCp1000018},
+        {"rhbz1065629.rtf", &Test::testNestedTable},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1535,6 +1537,25 @@ void Test::testFdo65090()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< 
uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), 
"TableColumnSeparators").getLength());
 }
 
+void Test::testNestedTable()
+{
+    // nested table in second cell was missing
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> 
xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    uno::Reference<text::XTextTable> xTable(xTables->getByIndex(1), 
uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), 
uno::UNO_QUERY);
+    uno::Reference<container::XEnumerationAccess> 
xParaEnumAccess(xCell->getText(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xParaEnum = 
xParaEnumAccess->createEnumeration();
+    uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), 
uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("Responsable Commercial:"), 
xPara->getString());
+    xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY);
+    xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY);
+    xParaEnum = xParaEnumAccess->createEnumeration();
+    xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY);
+    xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("Nom: John Doe"), xPara->getString());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 #if !defined(MACOSX) && !defined(WNT)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2097b05..86ab26d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1812,6 +1812,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
                 RTFValue::Pointer_t pValue;
                 m_aTableBuffer.push_back(make_pair(BUFFER_CELLEND, pValue));
                 m_bNeedPap = true;
+                m_aStates.top().nCellEnds++;
             }
             break;
         case RTF_ROW:
@@ -1844,6 +1845,17 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
                     m_aStates.top().aTableCellsAttributes.pop_front();
                     replayBuffer(m_aTableBuffer);
                 }
+                for (int i = 0; i < m_aStates.top().nCellEnds - 
m_aStates.top().nCells; ++i)
+                {
+                    replayBuffer(m_aTableBuffer);
+                }
+                for (size_t i = 0; i < m_aTableBuffer.size(); ++i)
+                {
+                    SAL_WARN_IF(BUFFER_CELLEND == m_aTableBuffer[i].first,
+                        "writerfilter.rtf", "dropping table cell!");
+                }
+                assert(0 == m_aStates.top().aTableCellsSprms.size());
+                assert(0 == m_aStates.top().aTableCellsAttributes.size());
                 m_aStates.top().aTableCellSprms = 
m_aDefaultState.aTableCellSprms;
                 m_aStates.top().aTableCellAttributes = 
m_aDefaultState.aTableCellAttributes;
 
@@ -1896,6 +1908,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
                 m_bNeedFinalPar = true;
                 m_aTableBuffer.clear();
                 m_aStates.top().nCells = 0;
+                m_aStates.top().nCellEnds = 0;
                 m_aStates.top().aTableCellsSprms.clear();
                 m_aStates.top().aTableCellsAttributes.clear();
             }
@@ -4773,6 +4786,7 @@ RTFParserState::RTFParserState(RTFDocumentImpl 
*pDocumentImpl)
     nCellX(0),
     nCells(0),
     nInheritingCells(0),
+    nCellEnds(0),
     bIsCjk(false),
     nYear(0),
     nMonth(0),
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index b16a3a5..51abf48 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -377,6 +377,7 @@ namespace writerfilter {
                 int nCellX;
                 int nCells;
                 int nInheritingCells;
+                int nCellEnds;
 
                 /// CJK or CTL?
                 bool bIsCjk;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to