summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 13:20:57 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-28 22:14:27 +0100
commita36802f6b9e16e0f1d3c33ed03d19a6c7b61c705 (patch)
treed9329da8eb17039d93baaf0734d4e79d42a0dd56
parent5fc964fa337ebfb331997d894556f847d17fa2bc (diff)
flatten scope and fix plenking
Change-Id: I813fc97d48c6df92638cdedfca26f1a06d4df836
-rw-r--r--sw/source/core/unocore/unotbl.cxx121
1 files changed, 60 insertions, 61 deletions
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 448dc1b9015c..90fca8849a59 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1043,74 +1043,73 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- if(IsValid())
+ if(!IsValid())
+ return;
+ // Hack to support hidden property to transfer textDirection
+ if(rPropertyName == "FRMDirection")
+ {
+ SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
+ sal_Int16 nNum = 0;
+ aValue >>= nNum;
+ SAL_INFO("sw.uno", "FRMDirection val " << nNum);
+ switch (nNum)
+ {
+ case 0:
+ eDir = FRMDIR_HORI_LEFT_TOP;
+ break;
+ case 1:
+ eDir = FRMDIR_HORI_RIGHT_TOP;
+ break;
+ case 2:
+ eDir = FRMDIR_VERT_TOP_RIGHT;
+ break;
+ default:
+ OSL_FAIL("unknown direction code, maybe it's a bitfield");
+ }
+ SvxFrameDirectionItem aItem(eDir, RES_FRAMEDIR);
+ pBox->GetFrmFmt()->SetFmtAttr(aItem);
+ }
+ else if(rPropertyName == "TableRedlineParams")
+ {
+ // Get the table row properties
+ uno::Sequence<beans::PropertyValue> tableCellProperties;
+ tableCellProperties = aValue.get< uno::Sequence< beans::PropertyValue > >();
+ comphelper::SequenceAsHashMap aPropMap(tableCellProperties);
+ OUString sRedlineType;
+ uno::Any sRedlineTypeValue;
+ sRedlineTypeValue = aPropMap.getUnpackedValueOrDefault("RedlineType", sRedlineTypeValue);
+ if(sRedlineTypeValue >>= sRedlineType)
+ {
+ // Create a 'Table Cell Redline' object
+ SwUnoCursorHelper::makeTableCellRedline(*pBox, sRedlineType, tableCellProperties);
+ }
+ else
+ {
+ throw beans::UnknownPropertyException("No redline type property: ", static_cast < cppu::OWeakObject * > ( this ) );
+ }
+ }
+ else
{
- // Hack to support hidden property to transfer textDirection
- if ( rPropertyName == "FRMDirection" )
+ const SfxItemPropertySimpleEntry* pEntry =
+ m_pPropSet->getPropertyMap().getByName(rPropertyName);
+ if(!pEntry)
{
- SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
- sal_Int16 nNum = 0;
- aValue >>= nNum;
- SAL_INFO("sw.uno", "FRMDirection val " << nNum);
- switch (nNum)
- {
- case 0:
- eDir = FRMDIR_HORI_LEFT_TOP;
- break;
- case 1:
- eDir = FRMDIR_HORI_RIGHT_TOP;
- break;
- case 2:
- eDir = FRMDIR_VERT_TOP_RIGHT;
- break;
- default:
- OSL_FAIL( "unknown direction code, maybe it's a bitfield");
- }
- SvxFrameDirectionItem aItem( eDir, RES_FRAMEDIR);
- pBox->GetFrmFmt()->SetFmtAttr(aItem);
+ beans::UnknownPropertyException aEx;
+ aEx.Message = rPropertyName;
+ throw(aEx);
}
- else if ( rPropertyName == "TableRedlineParams" )
+ if(pEntry->nWID == FN_UNO_CELL_ROW_SPAN)
{
- // Get the table row properties
- uno::Sequence< beans::PropertyValue > tableCellProperties;
- tableCellProperties = aValue.get< uno::Sequence< beans::PropertyValue > >();
- comphelper::SequenceAsHashMap aPropMap( tableCellProperties );
- OUString sRedlineType;
- uno::Any sRedlineTypeValue;
- sRedlineTypeValue = aPropMap.getUnpackedValueOrDefault("RedlineType", sRedlineTypeValue);
- if( sRedlineTypeValue >>= sRedlineType )
- {
- // Create a 'Table Cell Redline' object
- SwUnoCursorHelper::makeTableCellRedline( *pBox, sRedlineType, tableCellProperties);
- }
- else
- {
- throw beans::UnknownPropertyException("No redline type property: ", static_cast < cppu::OWeakObject * > ( this ) );
- }
+ sal_Int32 nRowSpan = 0;
+ if(aValue >>= nRowSpan)
+ pBox->setRowSpan(nRowSpan);
}
else
{
- const SfxItemPropertySimpleEntry* pEntry =
- m_pPropSet->getPropertyMap().getByName(rPropertyName);
- if( !pEntry )
- {
- beans::UnknownPropertyException aEx;
- aEx.Message = rPropertyName;
- throw( aEx );
- }
- if( pEntry->nWID == FN_UNO_CELL_ROW_SPAN )
- {
- sal_Int32 nRowSpan = 0;
- if( aValue >>= nRowSpan )
- pBox->setRowSpan( nRowSpan );
- }
- else
- {
- SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
- SwAttrSet aSet(pBoxFmt->GetAttrSet());
- m_pPropSet->setPropertyValue(rPropertyName, aValue, aSet);
- pBoxFmt->GetDoc()->SetAttr(aSet, *pBoxFmt);
- }
+ SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
+ SwAttrSet aSet(pBoxFmt->GetAttrSet());
+ m_pPropSet->setPropertyValue(rPropertyName, aValue, aSet);
+ pBoxFmt->GetDoc()->SetAttr(aSet, *pBoxFmt);
}
}
}