[Libreoffice-commits] .: sw/source
Noel Power
noelp at kemper.freedesktop.org
Fri Nov 26 07:46:32 PST 2010
sw/source/core/unocore/unotbl.cxx | 60 +++++++++++++++++++++++++++-----------
1 file changed, 44 insertions(+), 16 deletions(-)
New commits:
commit 7a57f3bbd95b4d5f20f3610dab746a14b016c49e
Author: Noel Power <noel.power at novell.com>
Date: Fri Nov 26 15:32:34 2010 +0000
tentative fix for fdo#30474#
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 4792cf1..4d1ba5f 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -101,6 +101,7 @@
#include <unochart.hxx>
#include <sortopt.hxx>
#include <rtl/math.hxx>
+#include <editeng/frmdiritem.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -1044,26 +1045,53 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
SolarMutexGuard aGuard;
if(IsValid())
{
- const SfxItemPropertySimpleEntry* pEntry =
- m_pPropSet->getPropertyMap()->getByName(rPropertyName);
- if( !pEntry )
+ // Hack to support hidden property to transfer textDirection
+ if ( rPropertyName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FRMDirection") ) ) )
{
- 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 );
+ SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
+ sal_Int16 nNum = 0;
+ aValue >>= nNum;
+ OSL_TRACE("FRMDirection val %d", 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_ENSURE( false, "unknown direction code, maybe its a bitfield");
+ }
+ SvxFrameDirectionItem aItem( eDir, RES_FRAMEDIR);
+ pBox->GetFrmFmt()->SetFmtAttr(aItem);
}
else
{
- SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
- SwAttrSet aSet(pBoxFmt->GetAttrSet());
- m_pPropSet->setPropertyValue(rPropertyName, aValue, aSet);
- pBoxFmt->GetDoc()->SetAttr(aSet, *pBoxFmt);
+ 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);
+ }
}
}
}
More information about the Libreoffice-commits
mailing list