[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - sw/qa sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 20 17:52:12 UTC 2020


 sw/qa/extras/ooxmlexport/data/ooo39250-1-min.rtf |   42 +++++++++++++++++++++++
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx       |   16 ++++++++
 sw/source/core/access/accframebase.cxx           |    8 ++++
 sw/source/core/access/accmap.cxx                 |   17 ++++++++-
 sw/source/core/layout/trvlfrm.cxx                |   16 +++++++-
 sw/source/filter/ww8/docxsdrexport.cxx           |   14 +++----
 6 files changed, 100 insertions(+), 13 deletions(-)

New commits:
commit 53b9c0a13ce71a0fc04533d701a8d6e49a170380
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Jul 18 18:27:18 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Feb 20 18:51:55 2020 +0100

    (related: tdf#110442) sw: fix a11y/UI selection of at-char flys
    
    SwAccessibleFrameBase::GetSelectedState() and SwAccessibleMap ignored
    FLY_AT_CHAR flys for no apparent reason.
    
    SwRootFrame::CalcFrameRects() is the function that determines the
    selection overlay painted in the view.
    
    (cherry picked from commit be55b1915fd0374f8f25c2c1be2b39744666d052)
    
    Conflicts:
            sw/source/core/access/accmap.cxx
            sw/source/core/layout/trvlfrm.cxx
    
    Change-Id: I60aae2e401d2e811ed1aa8eb95cfd093c65c1de4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89096
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index f53edaa4ea3b..c08e255a6725 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -38,6 +38,7 @@
 #include <txtfrm.hxx>
 #include <notxtfrm.hxx>
 #include <ndtxt.hxx>
+#include <undobj.hxx>
 #include <dcontact.hxx>
 #include <fmtanchr.hxx>
 
@@ -343,6 +344,13 @@ bool SwAccessibleFrameBase::GetSelectedState( )
                                 && (nHere < nEndIndex ) )
                                 return true;
                         }
+                        else if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR)
+                        {
+                            if (IsDestroyFrameAnchoredAtChar(*pPos, *pStart, *pEnd))
+                            {
+                                return true;
+                            }
+                        }
                         break;
                     }
                     // else: this PaM doesn't point to this paragraph
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index bd77f85b5edb..5b42a664f0c2 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -73,6 +73,7 @@
 #include <dflyobj.hxx>
 #include <prevwpage.hxx>
 #include <calbck.hxx>
+#include <undobj.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
@@ -1196,7 +1197,6 @@ void SwAccessibleMap::InvalidateShapeInParaSelection()
                                 sal_uLong nEndIndex = pEnd->nNode.GetIndex();
                                 if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex))
                                 {
-                                    // FIXME: what about missing FLY_AT_CHAR?
                                     if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR )
                                     {
                                         if( ( ((nHere == nStartIndex) && (nIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) )
@@ -1230,6 +1230,21 @@ void SwAccessibleMap::InvalidateShapeInParaSelection()
                                                 static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->ResetState( AccessibleStateType::SELECTED );
                                         }
                                     }
+                                    else if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR)
+                                    {
+                                        uno::Reference<XAccessible> const xAcc((*aIter).second);
+                                        if (xAcc.is())
+                                        {
+                                            if (IsDestroyFrameAnchoredAtChar(*pPos, *pStart, *pEnd))
+                                            {
+                                                static_cast<::accessibility::AccessibleShape*>(xAcc.get())->SetState( AccessibleStateType::SELECTED );
+                                            }
+                                            else
+                                            {
+                                                static_cast<::accessibility::AccessibleShape*>(xAcc.get())->ResetState( AccessibleStateType::SELECTED );
+                                            }
+                                        }
+                                    }
                                 }
                             }
                         }
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 343b2c01b788..5c466862c816 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -47,6 +47,7 @@
 #include <fldbas.hxx>
 #include <frmatr.hxx>
 #include <frmtool.hxx>
+#include <undobj.hxx>
 
 #include <cfloat>
 #include <swselectionlist.hxx>
@@ -2575,9 +2576,18 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor)
                 const SwFlyFrame* pFly = static_cast<const SwFlyFrame*>(pAnchoredObj);
                 const SwVirtFlyDrawObj* pObj = pFly->GetVirtDrawObj();
                 const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround();
-                const SwPosition* anchoredAt = pAnchoredObj->GetFrameFormat().GetAnchor().GetContentAnchor();
-                bool inSelection = ( anchoredAt != nullptr && *pStartPos <= *anchoredAt && *anchoredAt < *pEndPos );
-                if( anchoredAt != nullptr && *anchoredAt == *pEndPos )
+                SwFormatAnchor const& rAnchor(pAnchoredObj->GetFrameFormat().GetAnchor());
+                const SwPosition* anchoredAt = rAnchor.GetContentAnchor();
+                bool inSelection = (
+                            anchoredAt != nullptr
+                        && (   (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR
+                                && IsDestroyFrameAnchoredAtChar(*anchoredAt, *pStartPos, *pEndPos))
+                            || (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA
+                                && *pStartPos <= *anchoredAt
+                                && *anchoredAt < *pEndPos)));
+                if (anchoredAt != nullptr
+                    && rAnchor.GetAnchorId() != RndStdIds::FLY_AT_CHAR
+                    && *anchoredAt == *pEndPos)
                 {
                     const SwNodes& nodes = anchoredAt->GetDoc()->GetNodes();
                     if( *pEndPos == SwPosition( nodes.GetEndOfContent()))
commit 05f6fec700ac7c109e151d4dd6ba758545fa518a
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Aug 14 12:35:51 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Feb 20 18:51:38 2020 +0100

    sw: fix assert on export of ooo39250-1.rtf to DOCX
    
    The problem is that a fly anchored at-char inside a text frame is being
    exported; in DocxSdrExport::startDMLAnchorInline() the
    m_bFlyFrameGraphic is true so an "inline" element is written but then
    DocxSdrExport::writeDMLTextFrame() sets the flag to true then false,
    so in endDMLAnchorInline() it's false and "anchor" results.
    
    Remove the pointless information hiding between DocxSdrExport and its
    own pImpl class so that the previous flag can be restored.
    
    (regression from commit 28b77c89dfcafae82cf2a6d85731b643ff9290e5
     which changed things somehow so that the anchor is inside the text
     frame instead of the body as it was before; Word has it also in the
     text frame so we can consider it an improvement)
    
    (cherry picked from commit eceace1f688ef2a50dc298cb4149c5a84fcaa34e)
    
    Conflicts:
            sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
            sw/source/filter/ww8/docxsdrexport.cxx
    
    Change-Id: I2df20b5cc336251f1c20cf81b6d68153c0c6ff46
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89095
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/data/ooo39250-1-min.rtf b/sw/qa/extras/ooxmlexport/data/ooo39250-1-min.rtf
new file mode 100644
index 000000000000..df1467e4fe47
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/ooo39250-1-min.rtf
@@ -0,0 +1,42 @@
+{\rtf1\ansi\ansicpg1250\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1060\deflangfe1060{\fonttbl{\f0\froman\fcharset238\fprq2{\*\panose 02020603050405020304}Times New Roman;}
+{\f1\fswiss\fcharset238\fprq2{\*\panose 020b0604020202020204}Arial;}{\f40\froman\fcharset0\fprq2 Times New Roman;}{\f39\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f41\froman\fcharset161\fprq2 Times New Roman Greek;}
+{\f42\froman\fcharset162\fprq2 Times New Roman Tur;}{\f43\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f44\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f45\froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\f46\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f50\fswiss\fcharset0\fprq2 Arial;}{\f49\fswiss\fcharset204\fprq2 Arial Cyr;}{\f51\fswiss\fcharset161\fprq2 Arial Greek;}{\f52\fswiss\fcharset162\fprq2 Arial Tur;}
+{\f53\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f54\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f55\fswiss\fcharset186\fprq2 Arial Baltic;}{\f56\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
+\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
+\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 \snext0 Normal;}{\*\cs10 \additive 
+\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv 
+\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid3551688\rsid4459474}
+{\*\generator Microsoft Word 11.0.6359;}{\info{\author robi01}{\doccomm Produced by: PsQRFilters V2.11 for QuickReport (www.pragnaan.com)}{\operator robi01}{\creatim\yr2004\mo12\dy16\hr12\min51}{\revtim\yr2004\mo12\dy16\hr12\min51}{\version2}{\edmins1}
+{\nofpages1}{\nofwords256}{\nofchars1465}{\nofcharsws1718}{\vern24703}}\paperw11906\paperh16838\margl567\margr567\margt283\margb283 \widowctrl\ftnbj\aenddoc\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120
+\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot3551688 \fet0\sectd \linex0\headery0\footery0\colsx708\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}
+{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
+{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9
+\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 {\lang1024\langfe1024\noproof\insrsid3551688 
+}
+{\f1\insrsid3551688 \par }
+
+\pard \ql \li0\ri0\nowidctlpar\pvpg\phpg\posx702\posy11927\absw1095\faauto\rin0\lin0\itap0 {\f1\fs16\cf1\insrsid3551688 
+\par }
+\pard \ql \li0\ri0\nowidctlpar\pvpg\phpg\posx1782\posy11927\absw1695\faauto\rin0\lin0\itap0 {\lang1024\langfe1024\noproof\insrsid3551688 
+}
+
+\pard \qr \li0\ri0\nowidctlpar\pvpg\phpg\posx7347\posy11492\absw1785\faauto\rin0\lin0\itap0 {\b\f1\fs16\cf1\insrsid3551688 Za pla\'e8ilo: }
+
+{\lang1024\langfe1024\noproof\insrsid3551688 
+{\shp{\*\shpinst\shpleft687\shptop12452\shpright11248\shpbottom13593\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz7\shplid1033{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}
+{\sp{\sn lTxid}{\sv 65536}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fShadow}{\sv 0}}
+{\sp{\sn posrelh}{\sv 1}}{\sp{\sn posrelv}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 0}}{\sp{\sn fBehindDocument}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 0}}{\shptxt \pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 
+\fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 {\b\f1\fs16\expnd-1\expndtw-6\insrsid3551688 
+\par 
+\par Pla\'e8ilo izvr\'9aite na transakcijski ra\'e8un NLB in se sklicujte na \'9atevilko predra\'e8una
+\par Do popolnega pla\'e8ila ostaja predmet pogodbe last podjetja TI, d.o.o. }{\f1\fs16\expnd-1\expndtw-6\insrsid3551688 
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs16\expnd-1\expndtw-6\insrsid3551688 
+\par }{\f1\insrsid3551688 _}}}{\shprslt{\*\do\dobxpage\dobypage\dodhgt7\dptxbx\dptxlrtb{\dptxbxtext\pard\plain \qc \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1060\langfe1060\cgrid\langnp1060\langfenp1060 {\b\f1\fs16\expnd-1\expndtw-6\insrsid3551688 
+\par 
+\par Pla\'e8ilo izvr\'9aite na transakcijski ra\'e8un NLB in se sklicujte na \'9atevilko predra\'e8una
+\par Do popolnega pla\'e8ila ostaja predmet pogodbe last podjetja TI, d.o.o. }{\f1\fs16\expnd-1\expndtw-6\insrsid3551688 
+\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs16\expnd-1\expndtw-6\insrsid3551688 
+\par }{\f1\insrsid3551688 _}}\dpx687\dpy12452\dpxsize10561\dpysize1141\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr255\dpfillbgcg255\dpfillbgcb255\dpfillpat0\dplinehollow}}}}
+
+}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 06dc369d14bb..f5fd6bc70b80 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -14,6 +14,7 @@
 #include <com/sun/star/text/XDocumentIndex.hpp>
 #include <com/sun/star/text/XTextFrame.hpp>
 #include <com/sun/star/text/XTextFramesSupplier.hpp>
+#include <com/sun/star/text/XTextFrame.hpp>
 #include <com/sun/star/drawing/XControlShape.hpp>
 #include <com/sun/star/style/LineSpacing.hpp>
 #include <com/sun/star/style/LineSpacingMode.hpp>
@@ -43,10 +44,23 @@ protected:
      */
     bool mustTestImportOf(const char* filename) const override {
         // If the testcase is stored in some other format, it's pointless to test.
-        return OString(filename).endsWith(".docx");
+        return OString(filename).endsWith(".docx") || OString(filename) == "ooo39250-1-min.rtf";
     }
 };
 
+// TODO: the re-import doesn't work just yet, but that isn't a regression...
+DECLARE_SW_EXPORT_TEST(testFlyInFly, "ooo39250-1-min.rtf", nullptr, Test)
+{
+    // check that anchor of text frame is in other text frame
+    uno::Reference<text::XTextContent> const xAnchored(getShape(3), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xAnchored.is());
+    CPPUNIT_ASSERT_EQUAL(OUString(""), uno::Reference<container::XNamed>(xAnchored, uno::UNO_QUERY_THROW)->getName());
+    uno::Reference<text::XText> const xAnchorText(xAnchored->getAnchor()->getText());
+    uno::Reference<text::XTextFrame> const xAnchorFrame(xAnchorText, uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xAnchorFrame.is());
+    CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), uno::Reference<container::XNamed>(xAnchorFrame, uno::UNO_QUERY_THROW)->getName());
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF, "tdf121374_sectionHF.odt")
 {
     uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 61da8449791f..a7afc59d3c7b 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -36,6 +36,7 @@
 #include "docxexportfilter.hxx"
 #include <comphelper/processfactory.hxx>
 #include <comphelper/seqstream.hxx>
+#include <comphelper/flagguard.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/sequenceashashmap.hxx>
 #include <o3tl/make_unique.hxx>
@@ -153,7 +154,6 @@ struct DocxSdrExport::Impl
     bool m_bDrawingOpen;
     bool m_bParagraphSdtOpen;
     bool m_bParagraphHasDrawing; ///Flag for checking drawing in a paragraph.
-    bool m_bFlyFrameGraphic;
     rtl::Reference<sax_fastparser::FastAttributeList> m_pFlyFillAttrList;
     sax_fastparser::FastAttributeList* m_pFlyWrapAttrList;
     sax_fastparser::FastAttributeList* m_pBodyPrAttrList;
@@ -163,6 +163,8 @@ struct DocxSdrExport::Impl
     /// Preserved rotation for TextFrames.
     sal_Int32 m_nDMLandVMLTextFrameRotation;
 
+    bool m_bFlyFrameGraphic = false;
+
     Impl(DocxSdrExport& rSdrExport, DocxExport& rExport, sax_fastparser::FSHelperPtr pSerializer,
          oox::drawingml::DrawingML* pDrawingML)
         : m_rSdrExport(rSdrExport)
@@ -175,7 +177,6 @@ struct DocxSdrExport::Impl
         , m_bDrawingOpen(false)
         , m_bParagraphSdtOpen(false)
         , m_bParagraphHasDrawing(false)
-        , m_bFlyFrameGraphic(false)
         , m_pFlyWrapAttrList(nullptr)
         , m_pBodyPrAttrList(nullptr)
         , m_bDMLAndVMLDrawingOpen(false)
@@ -1079,9 +1080,8 @@ void DocxSdrExport::writeOnlyTextOfFrame(ww8::Frame const* pParentFrame)
     ExportDataSaveRestore aDataGuard(m_pImpl->m_rExport, nStt, nEnd, pParentFrame);
 
     m_pImpl->m_pBodyPrAttrList = sax_fastparser::FastSerializerHelper::createAttrList();
-    m_pImpl->m_bFlyFrameGraphic = true;
+    ::comphelper::FlagRestorationGuard const g(m_pImpl->m_bFlyFrameGraphic, true);
     m_pImpl->m_rExport.WriteText();
-    m_pImpl->m_bFlyFrameGraphic = false;
 }
 
 void DocxSdrExport::writeBoxItemLine(const SvxBoxItem& rBox)
@@ -1349,14 +1349,13 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho
         else if (rDirection.GetValue() == SvxFrameDirection::Vertical_LR_BT)
             m_pImpl->m_pBodyPrAttrList->add(XML_vert, "vert270");
 
-        m_pImpl->m_bFlyFrameGraphic = true;
+        ::comphelper::FlagRestorationGuard const g(m_pImpl->m_bFlyFrameGraphic, true);
         m_pImpl->m_rExport.WriteText();
         if (m_pImpl->m_bParagraphSdtOpen)
         {
             m_pImpl->m_rExport.DocxAttrOutput().EndParaSdtBlock();
             m_pImpl->m_bParagraphSdtOpen = false;
         }
-        m_pImpl->m_bFlyFrameGraphic = false;
 
         pFS->endElementNS(XML_w, XML_txbxContent);
         pFS->endElementNS(XML_wps, XML_txbx);
@@ -1496,14 +1495,13 @@ void DocxSdrExport::writeVMLTextFrame(ww8::Frame const* pParentFrame, bool bText
         pFS->startElementNS(XML_v, XML_textbox, xTextboxAttrList);
     }
     pFS->startElementNS(XML_w, XML_txbxContent, FSEND);
-    m_pImpl->m_bFlyFrameGraphic = true;
+    ::comphelper::FlagRestorationGuard const g(m_pImpl->m_bFlyFrameGraphic, true);
     m_pImpl->m_rExport.WriteText();
     if (m_pImpl->m_bParagraphSdtOpen)
     {
         m_pImpl->m_rExport.DocxAttrOutput().EndParaSdtBlock();
         m_pImpl->m_bParagraphSdtOpen = false;
     }
-    m_pImpl->m_bFlyFrameGraphic = false;
     pFS->endElementNS(XML_w, XML_txbxContent);
     if (!bTextBoxOnly)
     {


More information about the Libreoffice-commits mailing list