diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-05-27 09:04:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-05-27 09:32:43 +0200 |
commit | f1ada85a95268f1276608ff25c761f2aee77dcb6 (patch) | |
tree | 3b52eab7a304679e6033240206ae556cb877255d /sw | |
parent | 9a7e617eb30c8a475ccfc1af8bf3bee741a74fbf (diff) |
SwXShape: new bool TextBox property
Change-Id: Iae588c817ea17b6b2c2d3f2818ee5f94ed6f4e96
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/cmdid.h | 1 | ||||
-rw-r--r-- | sw/inc/textboxhelper.hxx | 2 | ||||
-rw-r--r-- | sw/inc/unoprnms.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 1 |
6 files changed, 22 insertions, 4 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index a7674e1377ed..c27ceb9cd48c 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -813,6 +813,7 @@ #define FN_SHAPE_STARTPOSITION_IN_HORI_L2R (FN_PARAM2+25) #define FN_SHAPE_ENDPOSITION_IN_HORI_L2R (FN_PARAM2+26) #define FN_PARAM_PAM (FN_PARAM2+27) /* Point and Mark */ +#define FN_TEXT_BOX (FN_PARAM2+28) /* TextBox Property*/ // Status: not more than 19! #define FN_STAT_PAGE (FN_STAT + 1) diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx index 65ba9cf2cba4..93a459deec41 100644 --- a/sw/inc/textboxhelper.hxx +++ b/sw/inc/textboxhelper.hxx @@ -30,6 +30,8 @@ public: static css::uno::Any getXTextAppend(SwFrmFmt* pShape, const css::uno::Type& rType); /// Sync property of TextBox with the one of the shape. static void syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, const OUString& rPropertyName, const css::uno::Any& rValue); + /// If we have an associated TextFrame, then return that. + static SwFrmFmt* findTextBox(SwFrmFmt* pShape); }; #endif // INCLUDED_SW_INC_TEXTBOXHELPER_HXX diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 63dfe4abaa32..bed1254b4a5e 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -65,6 +65,7 @@ #define UNO_NAME_FOOTER_LEFT_MARGIN "FooterLeftMargin" #define UNO_NAME_FOOTER_RIGHT_MARGIN "FooterRightMargin" #define UNO_NAME_TEXT_RANGE "TextRange" +#define UNO_NAME_TEXT_BOX "TextBox" #define UNO_NAME_NAME "Name" #define UNO_NAME_NUMBERING_ALIGNMENT "NumberingAlignment" #define UNO_NAME_BULLET_FONT_NAME "BulletFontName" diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index d7702f7ce9a0..ec27548cbb70 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -65,8 +65,7 @@ void SwTextBoxHelper::create(SwFrmFmt* pShape) } } -// If we have an associated TextFrame, then return that. -SwFrmFmt* lcl_findTextBox(SwFrmFmt* pShape) +SwFrmFmt* SwTextBoxHelper::findTextBox(SwFrmFmt* pShape) { SwFrmFmt* pRet = 0; @@ -94,7 +93,7 @@ uno::Any SwTextBoxHelper::getXTextAppend(SwFrmFmt* pShape, const uno::Type& rTyp if (rType == cppu::UnoType<css::text::XTextAppend>::get()) { - if (SwFrmFmt* pFmt = lcl_findTextBox(pShape)) + if (SwFrmFmt* pFmt = findTextBox(pShape)) { uno::Reference<text::XTextAppend> xTextAppend(static_cast<cppu::OWeakObject*>(SwXFrames::GetObject(*pFmt, FLYCNTTYPE_FRM)), uno::UNO_QUERY); aRet <<= xTextAppend; @@ -109,7 +108,7 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 uno::Any aValue(rValue); nMemberId &= ~CONVERT_TWIPS; - if (SwFrmFmt* pFmt = lcl_findTextBox(pShape)) + if (SwFrmFmt* pFmt = findTextBox(pShape)) { bool bSync = false; bool bAdjustX = false; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 20a14cfdc602..1c03330c0b3a 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1178,6 +1178,15 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a delete pInternalPam; } } + else if (pEntry->nWID == FN_TEXT_BOX) + { + bool bValue; + aValue >>= bValue; + // If TextBox is to be enabled. + if (bValue) + SwTextBoxHelper::create(pFmt); + + } // #i28749# else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pEntry->nWID ) { @@ -1500,6 +1509,11 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) } } } + else if (pEntry->nWID == FN_TEXT_BOX) + { + bool bValue = SwTextBoxHelper::findTextBox(pFmt); + aRet <<= bValue; + } // #i28749# else if ( FN_SHAPE_TRANSFORMATION_IN_HORI_L2R == pEntry->nWID ) { diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index b2fb90775001..5a9cb5a762eb 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -1394,6 +1394,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { OUString(UNO_NAME_RELATIVE_HEIGHT_RELATION), RES_FRM_SIZE, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_FRMSIZE_REL_HEIGHT_RELATION }, { OUString(UNO_NAME_RELATIVE_WIDTH), RES_FRM_SIZE, cppu::UnoType<sal_Int16>::get() , PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH }, { OUString(UNO_NAME_RELATIVE_WIDTH_RELATION), RES_FRM_SIZE, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH_RELATION }, + { OUString(UNO_NAME_TEXT_BOX), FN_TEXT_BOX, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, { OUString(), 0, css::uno::Type(), 0, 0 } }; aMapEntriesArr[nPropertyId] = aShapeMap_Impl; |