RTF import: anchor drawing objects at-character by default
Change-Id: I292ab1a6f12a9372b1cfdd4e8e59fbae57c6ceca
This commit is contained in:
4
sw/qa/extras/rtfimport/data/dprect-anchor.rtf
Normal file
4
sw/qa/extras/rtfimport/data/dprect-anchor.rtf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{\rtf1
|
||||||
|
{\colortbl\red255\green255\blue255; \red0\green0\blue0; }
|
||||||
|
{\*\do\dobxpage\dobypara\dodhgt8192\dprect\dproundr\dpx9807\dpy3968\dpxsize1644\dpysize566\dplinecor255\dplinecog255\dplinecob255\dpfillbgcr0\dpfillbgcg0\dpfillbgcb0\dpfillpat1\dplinehollow0}
|
||||||
|
}
|
@@ -1534,6 +1534,12 @@ DECLARE_RTFIMPORT_TEST(testDptxbxRelation, "dptxbx-relation.rtf")
|
|||||||
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(getShape(1), "HoriOrientRelation"));
|
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(getShape(1), "HoriOrientRelation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECLARE_RTFIMPORT_TEST(testDprectAnchor, "dprect-anchor.rtf")
|
||||||
|
{
|
||||||
|
// This was at-page, which is not something Word supports, so clearly an import error.
|
||||||
|
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
|
||||||
|
}
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include <com/sun/star/text/VertOrientation.hpp>
|
#include <com/sun/star/text/VertOrientation.hpp>
|
||||||
#include <com/sun/star/text/RelOrientation.hpp>
|
#include <com/sun/star/text/RelOrientation.hpp>
|
||||||
#include <com/sun/star/text/WrapTextMode.hpp>
|
#include <com/sun/star/text/WrapTextMode.hpp>
|
||||||
|
#include <com/sun/star/text/TextContentAnchorType.hpp>
|
||||||
#include <rtl/tencinfo.h>
|
#include <rtl/tencinfo.h>
|
||||||
#include <svl/lngmisc.hxx>
|
#include <svl/lngmisc.hxx>
|
||||||
#include <unotools/ucbstreamhelper.hxx>
|
#include <unotools/ucbstreamhelper.hxx>
|
||||||
@@ -4611,6 +4612,9 @@ int RTFDocumentImpl::popState()
|
|||||||
uno::Reference<lang::XServiceInfo> xServiceInfo(xShape, uno::UNO_QUERY);
|
uno::Reference<lang::XServiceInfo> xServiceInfo(xShape, uno::UNO_QUERY);
|
||||||
bool bTextFrame = xServiceInfo->supportsService("com.sun.star.text.TextFrame");
|
bool bTextFrame = xServiceInfo->supportsService("com.sun.star.text.TextFrame");
|
||||||
|
|
||||||
|
// The default is certainly not inline, but then what Word supports is just at-character.
|
||||||
|
xPropertySet->setPropertyValue("AnchorType", uno::makeAny(text::TextContentAnchorType_AT_CHARACTER));
|
||||||
|
|
||||||
if (bTextFrame)
|
if (bTextFrame)
|
||||||
{
|
{
|
||||||
xPropertySet->setPropertyValue("HoriOrientPosition", uno::makeAny((sal_Int32)rDrawing.nLeft));
|
xPropertySet->setPropertyValue("HoriOrientPosition", uno::makeAny((sal_Int32)rDrawing.nLeft));
|
||||||
|
Reference in New Issue
Block a user