summaryrefslogtreecommitdiff
authorMiklos Vajna <vmiklos@suse.cz>2013-06-16 09:57:57 (GMT)
committer Miklos Vajna <vmiklos@suse.cz>2013-06-16 10:11:03 (GMT)
commitaa0f3ca1cd285e8ffbc10de5510d447a72de980a (patch) (side-by-side diff)
treeb021c1b8e221518e1b0e37d1bb720d2b50d790d8
parentf1967d9bd4a0cb1558b495b564202a9bde2ab323 (diff)
downloadcore-aa0f3ca1cd285e8ffbc10de5510d447a72de980a.zip
core-aa0f3ca1cd285e8ffbc10de5510d447a72de980a.tar.gz
RTF import of fFitShapeToText shape property
Change-Id: I1d0cd0d34284e6ecabd0b4dc9bf25bc31b7ff4c1
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx1
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx10
2 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 19f956e..624b2b7 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1283,6 +1283,7 @@ void Test::testPoshPosv()
uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(xDraws->getByIndex(0), "HoriOrient"));
CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty<sal_Int16>(xDraws->getByIndex(0), "VertOrient"));
+ CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xDraws->getByIndex(0), "FrameIsAutomaticHeight"));
}
void Test::testTextframeTable()
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index d0178ff..08516d1 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -120,6 +120,7 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> xShape, OUStrin
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
sal_Int16 nHoriOrient = 0;
sal_Int16 nVertOrient = 0;
+ boost::optional<bool> obFitShapeToText;
if (aKey == "posh")
{
switch (aValue.toInt32())
@@ -160,10 +161,17 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> xShape, OUStrin
break;
}
}
+ else if (aKey == "fFitShapeToText")
+ obFitShapeToText.reset(aValue.toInt32() == 1);
if (nHoriOrient != 0)
xPropertySet->setPropertyValue("HoriOrient", uno::makeAny(nHoriOrient));
if (nVertOrient != 0)
xPropertySet->setPropertyValue("VertOrient", uno::makeAny(nVertOrient));
+ if (obFitShapeToText)
+ {
+ xPropertySet->setPropertyValue("SizeType", uno::makeAny(*obFitShapeToText ? text::SizeType::MIN : text::SizeType::FIX));
+ xPropertySet->setPropertyValue("FrameIsAutomaticHeight", uno::makeAny(*obFitShapeToText));
+ }
}
void RTFSdrImport::resolve(RTFShape& rShape, bool bClose)
@@ -444,7 +452,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose)
else if (i->first == "shadowOffsetX")
// EMUs to points
aShadowModel.moOffset.set(OUString::number(i->second.toDouble() / 12700) + "pt");
- else if (i->first == "posh" || i->first == "posv")
+ else if (i->first == "posh" || i->first == "posv" || i->first == "fFitShapeToText")
applyProperty(xShape, i->first, i->second);
else if (i->first == "posrelh")
{