From a0755ab8772d01797f4945016a978a2bbd8fdf20 Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Thu, 6 Apr 2017 22:22:53 +0200 Subject: Implement RotateAngle API property for Impress table cells Change-Id: I01379c0fc21e8fe294bc882bf824f64502863ff4 --- svx/source/table/cell.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'svx') diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 814e69ce3790..8da2f1555a06 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -90,6 +90,7 @@ static const SvxItemPropertySet* ImplGetSvxCellPropertySet() { OUString("BottomBorder"), SDRATTR_TABLE_BORDER, cppu::UnoType::get(), 0, BOTTOM_BORDER }, { OUString("LeftBorder"), SDRATTR_TABLE_BORDER, cppu::UnoType::get(), 0, LEFT_BORDER }, { OUString("RightBorder"), SDRATTR_TABLE_BORDER, cppu::UnoType::get(), 0, RIGHT_BORDER }, + { OUString("RotateAngle"), SDRATTR_TABLE_TEXT_ROTATION, cppu::UnoType::get(), 0, 0 }, SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_CHAR_PROPERTIES, @@ -285,8 +286,6 @@ namespace sdr OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount); pOutliner->Clear(); - pTemp->SetVertical(pParaObj->IsVertical(), pParaObj->IsTopToBottom()); - mxCell->SetOutlinerParaObject(pTemp); } @@ -1102,6 +1101,18 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& mpProperties->SetObjectItem( XFillBmpTileItem( eMode == BitmapMode_REPEAT ) ); return; } + case SDRATTR_TABLE_TEXT_ROTATION: + { + sal_Int32 nRotVal = 0; + if (!(rValue >>= nRotVal)) + throw IllegalArgumentException(); + + if (nRotVal != 27000 && nRotVal != 9000 && nRotVal != 0) + throw IllegalArgumentException(); + + mpProperties->SetObjectItem(SvxTextRotateItem(nRotVal/10, SDRATTR_TABLE_TEXT_ROTATION)); + return; + } default: { SfxItemSet aSet( GetModel()->GetItemPool(), pMap->nWID, pMap->nWID); @@ -1217,6 +1228,11 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName ) return Any( BitmapMode_NO_REPEAT ); } } + case SDRATTR_TABLE_TEXT_ROTATION: + { + const SvxTextRotateItem& rTextRotate = static_cast(mpProperties->GetItem(SDRATTR_TABLE_TEXT_ROTATION)); + return Any(sal_Int32(rTextRotate.GetValue() * 10)); + } default: { SfxItemSet aSet( GetModel()->GetItemPool(), pMap->nWID, pMap->nWID); -- cgit