diff options
author | Justin Luth <justin_luth@sil.org> | 2017-08-24 15:48:29 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-09-12 14:23:39 +0200 |
commit | 267b46d4c6052152f2e7023e26bb21670869743c (patch) | |
tree | d951f0a30c058ddeb45942a134c1a7b39a883896 | |
parent | 181d107b41b1b1ab9c03dc43fea7513e894ce404 (diff) |
tdf#111891 unostyle: use default handler for non-page style
LO 5.1 commit 664197d95becd516c3dac25a50439078ba61e051
introduced a handler for RES_TEXT_VERT_ADJUST to handle
page styles, but that meant that the default handler
was no longer called for frames (the only other item
currently using RES_TEXT_VERT_ADJUST).
Change-Id: I33827160fe64dc4cc2107afc26f7ac2e698007e1
Reviewed-on: https://gerrit.libreoffice.org/41538
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
(cherry picked from commit 10dc371d31f003ac3ed9b89ca1db95d36603603f)
Reviewed-on: https://gerrit.libreoffice.org/41910
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 461aa995d75f031209711feda9d785d915c42dd2)
Reviewed-on: https://gerrit.libreoffice.org/42082
(cherry picked from commit db7a015c86248bd2a3d090240f9360f84b3bec8c)
-rw-r--r-- | sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt | bin | 0 -> 8814 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 7 |
3 files changed, 12 insertions, 1 deletions
diff --git a/sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt b/sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt Binary files differnew file mode 100644 index 000000000000..8fcf98a6272b --- /dev/null +++ b/sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index a5f456f4807f..b4c728b3302d 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -758,6 +758,12 @@ DECLARE_ODFEXPORT_TEST(testTextFrameVertAdjust, "textframe-vertadjust.odt") CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust")); } +DECLARE_ODFEXPORT_TEST(testTdf111891_frameVertStyle, "tdf111891_frameVertStyle.odt") +{ + uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust")); +} + DECLARE_ODFEXPORT_TEST(testShapeRelsize, "shape-relsize.odt") { uno::Reference<drawing::XShape> xShape = getShape(1); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index ad6dd78b687e..db6fc57152c3 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1803,8 +1803,13 @@ void SwXStyle::SetPropertyValue<RES_PAGEDESC>(const SfxItemPropertySimpleEntry& } } template<> -void SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +void SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) { + if(m_rEntry.m_eFamily != SfxStyleFamily::Page) + { + SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase); + return; + } if(!m_pDoc || !rValue.has<drawing::TextVerticalAdjust>() || !o_rStyleBase.GetOldPageDesc()) return; SwPageDesc* pPageDesc = m_pDoc->FindPageDesc(o_rStyleBase.GetOldPageDesc()->GetName()); |