[Libreoffice-commits] core.git: filter/source include/filter include/sfx2 sfx2/source sw/inc sw/source writerfilter/inc writerfilter/source

László Németh laszlo.nemeth at collabora.com
Tue Mar 24 00:38:29 PDT 2015


 filter/source/msfilter/msdffimp.cxx                   |   14 +++++++++-----
 include/filter/msfilter/msdffimp.hxx                  |    5 ++++-
 include/sfx2/docfile.hxx                              |    1 +
 sfx2/source/doc/docfile.cxx                           |    6 +++++-
 sw/inc/shellio.hxx                                    |    3 +++
 sw/source/filter/basflt/shellio.cxx                   |    4 +++-
 sw/source/filter/ww8/ww8glsy.cxx                      |    2 +-
 sw/source/filter/ww8/ww8graf.cxx                      |    2 +-
 sw/source/filter/ww8/ww8graf2.cxx                     |    2 +-
 sw/source/filter/ww8/ww8par.cxx                       |    9 +++++----
 sw/source/filter/ww8/ww8par.hxx                       |    5 +++--
 writerfilter/inc/ooxml/OOXMLDocument.hxx              |    4 +++-
 writerfilter/source/filter/WriterFilter.cxx           |    3 ++-
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx       |   11 ++++++-----
 writerfilter/source/ooxml/OOXMLDocumentImpl.hxx       |    4 +++-
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |    5 ++++-
 16 files changed, 54 insertions(+), 26 deletions(-)

New commits:
commit 9b0e09dedc76a3bc4fd7a128a3a115b328727e00
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Mon Mar 23 16:16:28 2015 +0100

    SkipImages option for document import
    
    This option allows images and drawings to be skipped while importing
    DOC and DOCX, for text-only conversion or indexing.
    
    Change-Id: Id4bfbbe48d8a8e970b1cb5922187768bf94dc918
    Reviewed-on: https://gerrit.libreoffice.org/14733
    Reviewed-by: Németh László <nemeth at numbertext.org>
    Tested-by: Németh László <nemeth at numbertext.org>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index a3e880d..e3c35f8 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4278,9 +4278,11 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
 
             if ( bGraphic )
             {
-                pRet = ImportGraphic( rSt, aSet, aObjData );        // SJ: #68396# is no longer true (fixed in ppt2000)
-                ApplyAttributes( rSt, aSet, aObjData );
-                pRet->SetMergedItemSet(aSet);
+                if (!mbSkipImages) {
+                    pRet = ImportGraphic( rSt, aSet, aObjData );        // SJ: #68396# is no longer true (fixed in ppt2000)
+                    ApplyAttributes( rSt, aSet, aObjData );
+                    pRet->SetMergedItemSet(aSet);
+                }
             }
             else if ( aObjData.eShapeType == mso_sptLine && !( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 8 ) )
             {
@@ -5527,7 +5529,8 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
                                  long      nApplicationScale,
                                  ColorData mnDefaultColor_,
                                  sal_uLong     nDefaultFontHeight_,
-                                 SvStream* pStData2_ )
+                                 SvStream* pStData2_,
+                                 bool bSkipImages )
     :DffPropertyReader( *this ),
      pFormModel( NULL ),
      pBLIPInfos( new SvxMSDffBLIPInfos  ),
@@ -5550,7 +5553,8 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
      nSvxMSDffOLEConvFlags( 0 ),
      pSecPropSet( NULL ),
      mnDefaultColor( mnDefaultColor_),
-     mbTracing( false )
+     mbTracing( false ),
+     mbSkipImages (bSkipImages)
 {
     SetModel( pSdrModel_, nApplicationScale );
 
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index b6b6bd7..a9a9f35 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -526,6 +526,7 @@ public:
     ColorData           mnDefaultColor;
 
     bool                mbTracing;
+    bool                mbSkipImages;
 
     Color MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const;
     Color MSO_CLR_ToColor( sal_uInt32 nColorCode,
@@ -574,6 +575,7 @@ public:
         @param mnDefaultColor_     ???
         @param nDefaultFontHeight_ ???
         @param pStData2_           ???
+        @param bSkipImages         skipping images for text extraction/indexing
     */
     SvxMSDffManager( SvStream& rStCtrl,
                      const OUString& rBaseURL,
@@ -583,7 +585,8 @@ public:
                      long      nApplicationScale    =  0,
                      ColorData mnDefaultColor_      =  COL_DEFAULT,
                      sal_uLong nDefaultFontHeight_  = 24,
-                     SvStream* pStData2_            =  0 );
+                     SvStream* pStData2_            =  0,
+                     bool bSkipImages               =  false );
 
     // in PPT the parameters DGGContainerOffset and PicStream are provided by an
     // init method
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 26e3460..9e6160e 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -192,6 +192,7 @@ public:
     OUString            GetBaseURL( bool bForSaving=false );
     void                SetInCheckIn( bool bInCheckIn );
     bool                IsInCheckIn( );
+    bool                IsSkipImages( );
 
     SAL_DLLPRIVATE bool HasStorage_Impl() const;
 
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 41d8097c..cd5e90c 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -443,7 +443,6 @@ Reference < XContent > SfxMedium::GetContent() const
     return pImp->aContent.get();
 }
 
-
 OUString SfxMedium::GetBaseURL( bool bForSaving )
 {
     OUString aBaseURL;
@@ -476,6 +475,11 @@ OUString SfxMedium::GetBaseURL( bool bForSaving )
     return aBaseURL;
 }
 
+bool SfxMedium::IsSkipImages()
+{
+    const SfxStringItem* pSkipImagesItem = static_cast<const SfxStringItem*>( GetItemSet()->GetItem(SID_FILE_FILTEROPTIONS) );
+    return pSkipImagesItem && pSkipImagesItem->GetValue() == "SkipImages";
+}
 
 SvStream* SfxMedium::GetInStream()
 {
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 980282c..f62df9a 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -154,6 +154,7 @@ class SW_DLLPUBLIC SwReader: public SwDocFac
     SwPaM* pCrsr;
     OUString aFileName;
     OUString sBaseURL;
+    bool mbSkipImages;
 
 public:
 
@@ -179,6 +180,7 @@ public:
 
 protected:
     void                SetBaseURL( const OUString& rURL ) { sBaseURL = rURL; }
+    void                SetSkipImages( bool bSkipImages ) { mbSkipImages = bSkipImages; }
 };
 
 // Special Readers can be both!! (Excel, W4W, .. ).
@@ -209,6 +211,7 @@ protected:
     bool bOrganizerMode : 1;
     bool bHasAskTemplateName : 1;
     bool bIgnoreHTMLComments : 1;
+    bool bSkipImages : 1;
 
     virtual OUString GetTemplateName() const;
 
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index b7438fa..f174d2d 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -69,6 +69,7 @@ sal_uLong SwReader::Read( const Reader& rOptions )
     po->pStg  = pStg;
     po->xStg  = xStg;
     po->bInsertMode = 0 != pCrsr;
+    po->bSkipImages = mbSkipImages;
 
     // if a Medium is selected, get its Stream
     if( 0 != (po->pMedium = pMedium ) &&
@@ -400,6 +401,7 @@ SwReader::SwReader(SfxMedium& rMedium, const OUString& rFileName, SwDoc *pDocume
     aFileName(rFileName)
 {
     SetBaseURL( rMedium.GetBaseURL() );
+    SetSkipImages( rMedium.IsSkipImages() );
 }
 
 
@@ -430,7 +432,7 @@ Reader::Reader()
     aChkDateTime( DateTime::EMPTY ),
     pStrm(0), pMedium(0), bInsertMode(false),
     bTmplBrowseMode(false), bReadUTF8(false), bBlockMode(false), bOrganizerMode(false),
-    bHasAskTemplateName(false), bIgnoreHTMLComments(false)
+    bHasAskTemplateName(false), bIgnoreHTMLComments(false), bSkipImages(false)
 {
 }
 
diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx
index 680d262..e77e9fa 100644
--- a/sw/source/filter/ww8/ww8glsy.cxx
+++ b/sw/source/filter/ww8/ww8glsy.cxx
@@ -211,7 +211,7 @@ bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile )
             {
                 SwDoc *pD =  static_cast<SwDocShell*>((&xDocSh))->GetDoc();
                 SwWW8ImplReader* pRdr = new SwWW8ImplReader(pGlossary->nVersion,
-                    xStg, &rStrm, *pD, rBlocks.GetBaseURL(), true);
+                    xStg, &rStrm, *pD, rBlocks.GetBaseURL(), true, false);
 
                 SwNodeIndex aIdx(
                     *pD->GetNodes().GetEndOfContent().StartOfSectionNode(), 1);
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index c1f39df..3fbb880 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -3040,7 +3040,7 @@ void SwWW8ImplReader::GrafikCtor()  // Fuer SVDraw und VCControls und Escher
         OSL_ENSURE(pDrawModel, "Kann DrawModel nicht anlegen");
         pDrawPg = pDrawModel->GetPage(0);
 
-        pMSDffManager = new SwMSDffManager(*this);
+        pMSDffManager = new SwMSDffManager(*this, mbSkipImages);
         pMSDffManager->SetModel(pDrawModel, 1440);
         /*
          Now the dff manager always needs a controls // converter as well, but a
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 490dfb5..4752969 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -515,7 +515,7 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
 
             WW8PicDesc aPD( aPic );
             if (!pMSDffManager)
-                pMSDffManager = new SwMSDffManager(*this);
+                pMSDffManager = new SwMSDffManager(*this, mbSkipImages);
             /*
             ##835##
             Disable use of main stream as fallback stream for inline direct
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 051c866..c49cba5 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -525,9 +525,9 @@ Sttb::getStringAtIndex( sal_uInt32 index )
 
 }
 
-SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr )
+SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr, bool bSkipImages )
     : SvxMSDffManager(*rRdr.pTableStream, rRdr.GetBaseURL(), rRdr.pWwFib->fcDggInfo,
-        rRdr.pDataStream, 0, 0, COL_WHITE, 12, rRdr.pStrm),
+        rRdr.pDataStream, 0, 0, COL_WHITE, 12, rRdr.pStrm, bSkipImages),
     rReader(rRdr), pFallbackStream(0)
 {
     SetSvxMSDffSettings( GetSvxMSDffSettings() );
@@ -4107,7 +4107,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
 }
 
 SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage,
-    SvStream* pSt, SwDoc& rD, const OUString& rBaseURL, bool bNewDoc)
+    SvStream* pSt, SwDoc& rD, const OUString& rBaseURL, bool bNewDoc, bool bSkipImages)
     : mpDocShell(rD.GetDocShell())
     , pStg(pStorage)
     , pStrm(pSt)
@@ -4190,6 +4190,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage,
     , nPgChpDelim(0)
     , nPgChpLevel(0)
     , mbNewDoc(bNewDoc)
+    , mbSkipImages(bSkipImages)
     , bReadNoTbl(false)
     , bPgSecBreak(false)
     , bSpec(false)
@@ -6091,7 +6092,7 @@ sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, co
             Reader::ResetFrmFmts( rDoc );
         }
         SwWW8ImplReader* pRdr = new SwWW8ImplReader(nVersion, pStg, pIn, rDoc,
-            rBaseURL, bNew);
+            rBaseURL, bNew, bSkipImages);
         try
         {
             nRet = pRdr->LoadDoc( rPam );
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 7d537f0..a7fdff5 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -778,7 +778,7 @@ public:
     static sal_uInt32 GetFilterFlags();
     static sal_Int32 GetEscherLineMatch(MSO_LineStyle eStyle, MSO_SPT eShapeType,
         sal_Int32 &rThick);
-    SwMSDffManager( SwWW8ImplReader& rRdr );
+    SwMSDffManager( SwWW8ImplReader& rRdr, bool bSkipImages );
     void DisableFallbackStream();
     void EnableFallbackStream();
 protected:
@@ -1302,6 +1302,7 @@ private:
     sal_uInt8 nPgChpLevel;           // ChapterLevel of Heading from PageNum
 
     bool mbNewDoc;          // Neues Dokument ?
+    bool mbSkipImages;      // skip images for text extraction/indexing
     bool bReadNoTbl;        // Keine Tabellen
     bool bPgSecBreak;       // Page- oder Sectionbreak ist noch einzufuegen
     bool bSpec;             // Special-Char im Text folgt
@@ -1892,7 +1893,7 @@ public:     // eigentlich private, geht aber leider nur public
     static ColorData GetCol(sal_uInt8 nIco);
 
     SwWW8ImplReader( sal_uInt8 nVersionPara, SvStorage* pStorage, SvStream* pSt,
-        SwDoc& rD, const OUString& rBaseURL, bool bNewDoc );
+        SwDoc& rD, const OUString& rBaseURL, bool bNewDoc, bool bSkipImages );
 
     const OUString& GetBaseURL() const { return sBaseURL; }
     // Laden eines kompletten DocFiles
diff --git a/writerfilter/inc/ooxml/OOXMLDocument.hxx b/writerfilter/inc/ooxml/OOXMLDocument.hxx
index c533e35..d9b76e2 100644
--- a/writerfilter/inc/ooxml/OOXMLDocument.hxx
+++ b/writerfilter/inc/ooxml/OOXMLDocument.hxx
@@ -260,7 +260,9 @@ public:
     createStream(OOXMLStream::Pointer_t pStream, const OUString & rId);
 
     static OOXMLDocument *
-    createDocument(OOXMLStream::Pointer_t pStream, const css::uno::Reference<css::task::XStatusIndicator>& xStatusIndicator);
+    createDocument(OOXMLStream::Pointer_t pStream,
+                 const css::uno::Reference<css::task::XStatusIndicator>& xStatusIndicator,
+                 bool bSkipImage);
 
 };
 
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index 1a968d9..327477b 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -154,6 +154,7 @@ sal_Bool WriterFilter::filter(const uno::Sequence< beans::PropertyValue >& aDesc
     {
         utl::MediaDescriptor aMediaDesc(aDescriptor);
         bool bRepairStorage = aMediaDesc.getUnpackedValueOrDefault("RepairPackage", false);
+        bool bSkipImages = aMediaDesc.getUnpackedValueOrDefault("FilterOptions", OUString("")) == "SkipImages";
 
         uno::Reference< io::XInputStream > xInputStream;
         try
@@ -175,7 +176,7 @@ sal_Bool WriterFilter::filter(const uno::Sequence< beans::PropertyValue >& aDesc
         //create the tokenizer and domain mapper
         writerfilter::ooxml::OOXMLStream::Pointer_t pDocStream = writerfilter::ooxml::OOXMLDocumentFactory::createStream(m_xContext, xInputStream, bRepairStorage);
         uno::Reference<task::XStatusIndicator> xStatusIndicator = aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), uno::Reference<task::XStatusIndicator>());
-        writerfilter::ooxml::OOXMLDocument::Pointer_t pDocument(writerfilter::ooxml::OOXMLDocumentFactory::createDocument(pDocStream, xStatusIndicator));
+        writerfilter::ooxml::OOXMLDocument::Pointer_t pDocument(writerfilter::ooxml::OOXMLDocumentFactory::createDocument(pDocStream, xStatusIndicator, bSkipImages));
 
         uno::Reference<frame::XModel> xModel(m_xDstDoc, uno::UNO_QUERY_THROW);
         pDocument->setModel(xModel);
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 097bdfe..d15d59e 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -48,13 +48,14 @@ namespace writerfilter {
 namespace ooxml
 {
 
-OOXMLDocumentImpl::OOXMLDocumentImpl(OOXMLStream::Pointer_t pStream, const uno::Reference<task::XStatusIndicator>& xStatusIndicator)
+OOXMLDocumentImpl::OOXMLDocumentImpl(OOXMLStream::Pointer_t pStream, const uno::Reference<task::XStatusIndicator>& xStatusIndicator, bool bSkipImages)
     : mpStream(pStream)
     , mxStatusIndicator(xStatusIndicator)
     , mnXNoteId(0)
     , mXNoteType(0)
     , mxThemeDom(nullptr)
     , mbIsSubstream(false)
+    , mbSkipImages(bSkipImages)
     , mnPercentSize(0)
     , mnProgressLastPos(0)
     , mnProgressCurrentPos(0)
@@ -268,7 +269,7 @@ OOXMLDocumentImpl::getSubStream(const OUString & rId)
 
     OOXMLDocumentImpl * pTemp;
     // Do not pass status indicator to sub-streams: they are typically marginal in size, so we just track the main document for now.
-    writerfilter::Reference<Stream>::Pointer_t pRet( pTemp = new OOXMLDocumentImpl(pStream, uno::Reference<task::XStatusIndicator>()) );
+    writerfilter::Reference<Stream>::Pointer_t pRet( pTemp = new OOXMLDocumentImpl(pStream, uno::Reference<task::XStatusIndicator>(), mbSkipImages ));
     pTemp->setModel(mxModel);
     pTemp->setDrawPage(mxDrawPage);
     pTemp->setIsSubstream( true );
@@ -282,7 +283,7 @@ OOXMLDocumentImpl::getXNoteStream(OOXMLStream::StreamType_t nType, const Id & rT
     OOXMLStream::Pointer_t pStream =
         (OOXMLDocumentFactory::createStream(mpStream, nType));
     // See above, no status indicator for the note stream, either.
-    OOXMLDocumentImpl * pDocument = new OOXMLDocumentImpl(pStream, uno::Reference<task::XStatusIndicator>());
+    OOXMLDocumentImpl * pDocument = new OOXMLDocumentImpl(pStream, uno::Reference<task::XStatusIndicator>(), mbSkipImages);
     pDocument->setXNoteId(nId);
     pDocument->setXNoteType(rType);
 
@@ -950,9 +951,9 @@ uno::Sequence<beans::PropertyValue > OOXMLDocumentImpl::getEmbeddingsList( )
 
 OOXMLDocument *
 OOXMLDocumentFactory::createDocument
-(OOXMLStream::Pointer_t pStream, const uno::Reference<task::XStatusIndicator>& xStatusIndicator)
+(OOXMLStream::Pointer_t pStream, const uno::Reference<task::XStatusIndicator>& xStatusIndicator, bool mbSkipImages)
 {
-    return new OOXMLDocumentImpl(pStream, xStatusIndicator);
+    return new OOXMLDocumentImpl(pStream, xStatusIndicator, mbSkipImages);
 }
 
 }}
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
index 8f9cb2a..507a3ad 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
@@ -55,6 +55,7 @@ class OOXMLDocumentImpl : public OOXMLDocument
     css::uno::Sequence < css::beans::PropertyValue > mxEmbeddingsList;
     std::vector<css::beans::PropertyValue> mxEmbeddingsListTemp;
     bool mbIsSubstream;
+    bool mbSkipImages;
     /// How many paragraphs equal to 1 percent?
     sal_Int32 mnPercentSize;
     /// Position progress when it was last updated, possibly not after every paragraph in case of large documents.
@@ -90,7 +91,7 @@ protected:
     void resolveGlossaryStream(Stream & rStream);
     void resolveEmbeddingsStream(OOXMLStream::Pointer_t pStream);
 public:
-    OOXMLDocumentImpl(OOXMLStream::Pointer_t pStream, const css::uno::Reference<css::task::XStatusIndicator>& xStatusIndicator);
+    OOXMLDocumentImpl(OOXMLStream::Pointer_t pStream, const css::uno::Reference<css::task::XStatusIndicator>& xStatusIndicator, bool bSkipImages);
     virtual ~OOXMLDocumentImpl();
 
     virtual void resolve(Stream & rStream) SAL_OVERRIDE;
@@ -140,6 +141,7 @@ public:
     virtual css::uno::Sequence<css::beans::PropertyValue >  getEmbeddingsList() SAL_OVERRIDE;
 
     void incrementProgress();
+    bool IsSkipImages() { return mbSkipImages; };
 };
 }}
 #endif // OOXML_DOCUMENT_IMPL_HXX
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 3a47a8a..9a9c841 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1826,9 +1826,12 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
     // filter out a single token. Just hardwire the wrap token here till we
     // need a more generic solution.
     bool bIsWrap = Element == static_cast<sal_Int32>(NMSP_vmlWord | XML_wrap);
+    bool bSkipImages = getDocument()->IsSkipImages() && oox::getNamespace(Element) == static_cast<sal_Int32>(NMSP_dml) &&
+        !((oox::getBaseToken(Element) == XML_linkedTxbx) || (oox::getBaseToken(Element) == XML_txbx));
+
     if ( bInNamespaces && (!bIsWrap || static_cast<OOXMLFastContextHandlerShape*>(mpParent)->isShapeSent()) )
         xResult.set(OOXMLFactory::getInstance()->createFastChildContextFromStart(this, Element));
-    else if (mxContext.is())
+    else if (mxContext.is()  && !bSkipImages)
     {
         OOXMLFastContextHandlerWrapper * pWrapper =
             new OOXMLFastContextHandlerWrapper


More information about the Libreoffice-commits mailing list