summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ww8export/data/tdf77964.docbin0 -> 248320 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export4.cxx7
-rw-r--r--sw/source/filter/ww8/ww8par.cxx8
3 files changed, 14 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf77964.doc b/sw/qa/extras/ww8export/data/tdf77964.doc
new file mode 100644
index 000000000000..6ef50ab15834
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf77964.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx
index 91b9477a996f..bc0d51ff529e 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -13,6 +13,7 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <comphelper/sequenceashashmap.hxx>
@@ -48,6 +49,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148360)
assertXPath(pLayout, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text");
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf77964)
+{
+ loadAndReload("tdf77964.doc");
+ // both images were loading as AT_PARA instead of AS_CHAR. Image2 visually had text wrapping.
+ CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty<text::TextContentAnchorType>(getShapeByName(u"Image2"), "AnchorType"));
+}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d7e2d418d47b..f9d5a4e76b54 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3727,7 +3727,13 @@ bool SwWW8ImplReader::ReadChar(tools::Long nPosCp, tools::Long nCpOfs)
if (m_bObj)
pResult = ImportOle();
else if (m_bSpec)
- pResult = ImportGraf();
+ {
+ SwFrameFormat* pAsCharFlyFormat = m_rDoc.GetDfltFrameFormat();
+ SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR);
+ pAsCharFlyFormat->SetFormatAttr(aAnchor);
+ pResult = ImportGraf(nullptr, pAsCharFlyFormat);
+ }
+
// If we have a bad 0x1 insert a space instead.
if (!pResult)