From fdb50cd32e98f5e6128eb411ed910684b1fb41f0 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 25 Jun 2014 10:42:35 +0200 Subject: [PATCH] SwTextBoxHelper::syncProperty: handle RES_TEXT_VERT_ADJUST So that vertical text adjustment of the shape is reflected in the textbox layout. Change-Id: I887d51928fe4d37db08864374e0cea54f80953b5 --- .../uiwriter/data/shape-textbox-vertadjust.odt | Bin 0 -> 12076 bytes sw/qa/extras/uiwriter/uiwriter.cxx | 12 ++++++++++++ sw/source/core/doc/textboxhelper.cxx | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/uiwriter/data/shape-textbox-vertadjust.odt diff --git a/sw/qa/extras/uiwriter/data/shape-textbox-vertadjust.odt b/sw/qa/extras/uiwriter/data/shape-textbox-vertadjust.odt new file mode 100644 index 0000000000000000000000000000000000000000..dfb26bfa39127c907c204182234800c3f5b4fa46 GIT binary patch literal 12076 zcmeHtWmp~AvNplp32wn9Sa5d_?oM#GjRXzBJ-EATaCd^cI|O&z8&7}>=iIrOnKN_m zIe)%i-^rjU z_Hy7nD^oFdw)tRdXkqQd2>9)k!QR#^L_tmh2_6sr`4%K8Nl~Te&pt4)S75N<&u3-= z8Q5T8@S9SiLMm=)C#zCUm^Zln7a6)_5wBgoZGszNTW!-~bov`W?Bu7(C=md`za!m# zPy8OM56%&ap~^*`7)M5sN(%!+`wDl6J;}e9*_0K!%GklP zj;F^iKbUK`;e@vyH>YjSM~P~w^^`FSu69)UbV9A!>3WBq72WHw>(;j&rlTnc*bKFG zbtmf`&scA_Wk}?4+8sGvZ9yU8b-UQ?1#sKYHBhYkJb8JjzKK@&`P7A=ZLM^=7in`= zP*8AsdTPzy;;_|cHD7@RACRc;y~qyQ-p=E*yYf8mf+>{GBzguRp>C6-iHAoE-_u1u zaVEF(;jFs;$XAQTXx2<{~IeQa_Go@Ey&6Z4h$a z>WiqTs2CfQLl`iP;`0V>hwxQ)8O4r(SF>0zpD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@!IKBiDv*AZP6re{AIfbljQr9(8VZ$)F~vj%=Jtxcumf0`;a z&k@}rk)E2m`4llf_$ub-8Y81zgEe@iX{svoeO;e$@=XwEVU^NqSZ^}h^n;wSj>`m& z>QqxuN^yIGINgxVW-w9*7>I_7iW3b(2Io3xn_mGJA4*qb&4{DNAni~P@k)$gi44i} zj=;qxJj5Zm~BN0aJMN z+cPlP%CH?MH+Fii{6R_fg5L-2`BZU6=q|QU7CgaUwjJRokS4+Nw&RCUItp63*Q zbP>Nv{vEIV8jMxl6g`VHD<=^Xh;mcph{0lw5*z@1j zGW!==ezEDls|A7jUv2Y?UH_@&x5fAJ1iw+_^WeXO&|hfz8@B!TUt7{&DE&Rx{{17q zubVt literal 0 HcmV?d00001 diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 9ec5a76d8022..b279e7c9365a 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -44,6 +44,7 @@ public: void testShapeTextboxSelect(); void testShapeTextboxDelete(); void testCp1000071(); + void testShapeTextboxVertadjust(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -58,6 +59,7 @@ public: CPPUNIT_TEST(testShapeTextboxSelect); CPPUNIT_TEST(testShapeTextboxDelete); CPPUNIT_TEST(testCp1000071); + CPPUNIT_TEST(testShapeTextboxVertadjust); CPPUNIT_TEST_SUITE_END(); private: @@ -360,6 +362,16 @@ void SwUiWriterTest::testCp1000071() CPPUNIT_ASSERT_EQUAL( redlineEnd1Index, rTbl[ 1 ]->End()->nContent.GetIndex()); } +void SwUiWriterTest::testShapeTextboxVertadjust() +{ + SwDoc* pDoc = createDoc("shape-textbox-vertadjust.odt"); + SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); + SdrObject* pObject = pPage->GetObj(1); + SwFrmFmt* pFmt = static_cast(pObject->GetUserCall())->GetFmt(); + // This was SDRTEXTVERTADJUST_TOP. + CPPUNIT_ASSERT_EQUAL(SDRTEXTVERTADJUST_CENTER, pFmt->GetTextVertAdjust().GetValue()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 90d2b5446beb..5e1b502dcc37 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -279,7 +279,7 @@ Rectangle SwTextBoxHelper::getTextRectangle(SwFrmFmt* pShape, bool bAbsolute) return aRet; } -void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, const OUString& rPropertyName, const css::uno::Any& /*rValue*/) +void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, const OUString& rPropertyName, const css::uno::Any& rValue) { if (rPropertyName == "CustomShapeGeometry") { @@ -294,6 +294,8 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, const OUString& rPropertyNa syncProperty(pShape, RES_VERT_ORIENT, MID_VERTORIENT_POSITION, uno::makeAny(static_cast(convertTwipToMm100(aRectangle.Top())))); } } + else if (rPropertyName == UNO_NAME_TEXT_VERT_ADJUST) + syncProperty(pShape, RES_TEXT_VERT_ADJUST, 0, rValue); } void SwTextBoxHelper::getProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 nMemberId, css::uno::Any& rValue) @@ -412,6 +414,9 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 break; } break; + case RES_TEXT_VERT_ADJUST: + aPropertyName = UNO_NAME_TEXT_VERT_ADJUST; + break; } if (!aPropertyName.isEmpty())