[Libreoffice-commits] core.git: 2 commits - writerfilter/source

Miklos Vajna vmiklos at suse.cz
Sun Jun 16 03:47:59 PDT 2013


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   32 +------------------------
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    5 ---
 writerfilter/source/rtftok/rtfsdrimport.cxx    |    1 
 3 files changed, 2 insertions(+), 36 deletions(-)

New commits:
commit be53bec4fa8e6d08ceac0496585bbf64f69b4a19
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Sun Jun 16 12:44:04 2013 +0200

    RTFDocumentImpl::getShapetextBuffer can go as well
    
    Hopefully this was the last trace of buffered shape import in the RTF
    filter.
    
    Change-Id: I42a531954ef5832473c43c121d569635f144a4d1

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 45ebd43..a2bf11e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -239,7 +239,6 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
     m_xStorage(),
     m_aTableBuffer(),
     m_aSuperBuffer(),
-    m_aShapetextBuffer(),
     m_bHasFootnote(false),
     m_pSuperstream(0),
     m_nHeaderFooterPositions(),
@@ -599,11 +598,6 @@ RTFParserState& RTFDocumentImpl::getDefaultState()
         return m_pSuperstream->getDefaultState();
 }
 
-RTFBuffer_t RTFDocumentImpl::getShapetextBuffer()
-{
-    return m_aShapetextBuffer;
-}
-
 oox::GraphicHelper& RTFDocumentImpl::getGraphicHelper()
 {
     return *m_pGraphicHelper;
@@ -1161,7 +1155,6 @@ void RTFDocumentImpl::text(OUString& rString)
 
 void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer)
 {
-    bool bShapeText = !m_aShapetextBuffer.empty();
     while (rBuffer.size())
     {
         std::pair<RTFBufferTypes, RTFValue::Pointer_t> aPair = rBuffer.front();
@@ -1199,13 +1192,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer)
         else if (aPair.first == BUFFER_ENDRUN)
             Mapper().endCharacterGroup();
         else if (aPair.first == BUFFER_PAR)
-        {
-            if (!rBuffer.empty() || !bShapeText)
-                // RTF may have a fake paragraph at the end of the shape text,
-                // that would cause an additional empty paragraph at the end of
-                // the shape text.
-                parBreak();
-        }
+            parBreak();
         else
             SAL_WARN("writerfilter", "should not happen");
     }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index a12000a..7ca1c24 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -465,8 +465,6 @@ namespace writerfilter {
                 rtl_TextEncoding getEncoding(sal_uInt32 nFontIndex);
                 /// Get the default parser state.
                 RTFParserState& getDefaultState();
-                /// Get the shape text buffer;
-                RTFBuffer_t getShapetextBuffer();
                 oox::GraphicHelper& getGraphicHelper();
 
             private:
@@ -541,8 +539,6 @@ namespace writerfilter {
                 RTFBuffer_t m_aTableBuffer;
                 /// Buffered superscript, till footnote is reached (or not).
                 RTFBuffer_t m_aSuperBuffer;
-                /// Buffered shape text.
-                RTFBuffer_t m_aShapetextBuffer;
 
                 bool m_bHasFootnote;
                 /// Superstream of this substream.
commit 769266a9b9f5464847ed7d240e15c1bb16ac3d80
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Sun Jun 16 12:39:11 2013 +0200

    RTFDocumentImpl::replayShapetext is no longer needed
    
    Change-Id: I3dce867e01049d815b61b5292ec7afacffa5b2e8

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e1bba04..45ebd43 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2237,8 +2237,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
                 // Reset everything.
                 m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms;
                 m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes;
-                if (m_aStates.top().pCurrentBuffer != &m_aShapetextBuffer)
-                    m_aStates.top().pCurrentBuffer = 0;
+                m_aStates.top().pCurrentBuffer = 0;
             }
             else
             {
@@ -4147,7 +4146,6 @@ int RTFDocumentImpl::popState()
                 if (!m_aStates.top().aDrawingObject.bHadShapeText)
                 {
                     Mapper().startShape(xShape);
-                    replayShapetext();
                 }
                 Mapper().endShape();
             }
@@ -4649,19 +4647,6 @@ void RTFDocumentImpl::setDestinationText(OUString& rString)
     m_aStates.top().aDestinationText.append(rString);
 }
 
-void RTFDocumentImpl::replayShapetext()
-{
-    Mapper().startParagraphGroup();
-    if (!m_aShapetextBuffer.empty())
-    {
-        replayBuffer(m_aShapetextBuffer);
-        Mapper().startCharacterGroup();
-        runBreak();
-        Mapper().endCharacterGroup();
-    }
-    Mapper().endParagraphGroup();
-}
-
 bool RTFDocumentImpl::getSkipUnknown()
 {
     return m_bSkipUnknown;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index e59fac2..a12000a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -440,7 +440,6 @@ namespace writerfilter {
                 void setDestinationText(OUString& rString);
                 /// Resolve a picture: If not inline, then anchored.
                 int resolvePict(bool bInline);
-                void replayShapetext();
                 bool getSkipUnknown();
                 void setSkipUnknown(bool bSkipUnknown);
 
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 08516d1..36c4cb1 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -604,7 +604,6 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose)
     m_rImport.Mapper().startShape(xShape);
     if (bClose)
     {
-        m_rImport.replayShapetext();
         m_rImport.Mapper().endShape();
     }
     m_xShape = xShape;


More information about the Libreoffice-commits mailing list