summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/test76734_2K7.docxbin0 -> 10446 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx8
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx13
3 files changed, 18 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx b/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx
new file mode 100644
index 000000000000..5e0e114a5dc1
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 1e1fd6dac6a3..68ef7ebbe7bd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3041,6 +3041,14 @@ DECLARE_OOXMLEXPORT_TEST(testFDO76586, "fdo76586.docx")
assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[2]", "w", "7843");
}
+DECLARE_OOXMLEXPORT_TEST(test76734_2K7, "test76734_2K7.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]", "Requires", "wps");
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4ba7f2b79384..04f5d3780fb0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4179,10 +4179,17 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
{
// The frame output is postponed to the end of the anchor paragraph
bool bDuplicate = false;
- for( unsigned nIndex = 0; nIndex < m_aFramesOfParagraph.size(); ++nIndex )
+ const OUString& rName = rFrame.GetFrmFmt().GetName();
+ unsigned nSize = m_aFramesOfParagraph.size();
+ for( unsigned nIndex = 0; nIndex < nSize; ++nIndex )
{
- if( rFrame.GetFrmFmt().GetName() == m_aFramesOfParagraph[nIndex].GetFrmFmt().GetName() )
- bDuplicate = true;
+ const OUString& rNameExisting = m_aFramesOfParagraph[nIndex].GetFrmFmt().GetName();
+
+ if (!rName.isEmpty() && !rNameExisting.isEmpty())
+ {
+ if (rName == rNameExisting)
+ bDuplicate = true;
+ }
}
if( !bDuplicate )