diff options
-rw-r--r-- | sw/CppunitTest_sw_ww8export2.mk | 1 | ||||
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf70838.odt | bin | 0 -> 9257 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 10 |
4 files changed, 22 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_ww8export2.mk b/sw/CppunitTest_sw_ww8export2.mk index 840d586c3679..8ca4ba478cb6 100644 --- a/sw/CppunitTest_sw_ww8export2.mk +++ b/sw/CppunitTest_sw_ww8export2.mk @@ -25,6 +25,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8export2, \ test \ unotest \ utl \ + svxcore \ sw \ tl \ $(gb_UWINAPI) \ diff --git a/sw/qa/extras/ww8export/data/tdf70838.odt b/sw/qa/extras/ww8export/data/tdf70838.odt Binary files differnew file mode 100644 index 000000000000..65d20ecb65f5 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf70838.odt diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index f86982239640..ec8b89e8ff56 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -21,6 +21,8 @@ #include <com/sun/star/text/VertOrientation.hpp> #include <pagedesc.hxx> +#include <svx/svdpage.hxx> +#include <drawdoc.hxx> #include <editeng/unoprnms.hxx> class Test : public SwModelTestBase @@ -133,6 +135,15 @@ DECLARE_WW8EXPORT_TEST(testTdf111480, "tdf111480.doc") CPPUNIT_ASSERT(xText->getSize().Width > 11000); } +DECLARE_WW8EXPORT_TEST(testTdf70838, "tdf70838.odt") +{ + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); + tools::Rectangle aRect = pPage->GetObj(0)->GetSnapRect(); + CPPUNIT_ASSERT( aRect.GetHeight() > aRect.GetWidth() ); +} + DECLARE_WW8EXPORT_TEST( testActiveXCheckbox, "checkbox_control.odt" ) { // First check box anchored as a floating object diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 1789bd42d02a..091f5300faae 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -691,6 +691,16 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const if (pObj) { aRect = pObj->GetLogicRect(); + + // rotating to vertical means swapping height and width as seen in SvxMSDffManager::ImportShape + const long nAngle = NormAngle360( pObj->GetRotateAngle() ); + if ( ( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 ) ) + { + const long nWidth = aRect.getWidth(); + const long nHeight = aRect.getHeight(); + aRect.setWidth( nHeight ); + aRect.setHeight( nWidth ); + } } } |