diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-04-01 15:00:00 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-04-02 14:57:44 +0200 |
commit | 823c77a98ffbc1c819a81687ca7e13d91277bca5 (patch) | |
tree | d01a4325311316bfbc8aaaa77f3001e695a51aa4 /sc/source | |
parent | 68762b3364fed9f0f4df66d9fc65e9b1e1507228 (diff) |
tdf#124329 Add API to make cell anchored graphic resize with cell
Change-Id: Ib2335b1eb26e55fcfcfb964d0f3fe3dd267bdd0d
Reviewed-on: https://gerrit.libreoffice.org/70067
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/unoobj/shapeuno.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index 8c2b504964f1..af0d19eef1d1 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -53,6 +53,7 @@ static const SfxItemPropertyMapEntry* lcl_GetShapeMap() static const SfxItemPropertyMapEntry aShapeMap_Impl[] = { {OUString(SC_UNONAME_ANCHOR), 0, cppu::UnoType<uno::XInterface>::get(), 0, 0 }, + {OUString(SC_UNONAME_RESIZE_WITH_CELL), 0, cppu::UnoType<sal_Bool>::get(), 0, 0 }, {OUString(SC_UNONAME_HORIPOS), 0, cppu::UnoType<sal_Int32>::get(), 0, 0 }, {OUString(SC_UNONAME_IMAGEMAP), 0, cppu::UnoType<container::XIndexContainer>::get(), 0, 0 }, {OUString(SC_UNONAME_VERTPOS), 0, cppu::UnoType<sal_Int32>::get(), 0, 0 }, @@ -417,6 +418,24 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const } } + else if ( aPropertyName == SC_UNONAME_RESIZE_WITH_CELL ) + { + SdrObject* pObj = GetSdrObject(); + if (!pObj) + return; + ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj); + + // Nothing to do if anchored to page + if (aAnchorType == SCA_PAGE) + return; + + ScDrawObjData* pDrawObjData = ScDrawLayer::GetObjData(pObj); + if (!pDrawObjData) + return; + + aValue >>= pDrawObjData->mbResizeWithCell; + ScDrawLayer::SetCellAnchored(*pObj, *pDrawObjData); + } else if ( aPropertyName == SC_UNONAME_IMAGEMAP ) { SdrObject* pObj = GetSdrObject(); @@ -673,6 +692,17 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName ) } } } + else if (aPropertyName == SC_UNONAME_RESIZE_WITH_CELL) + { + bool bIsResizeWithCell = false; + SdrObject* pObj = GetSdrObject(); + if (pObj) + { + ScAnchorType anchorType = ScDrawLayer::GetAnchorType(*pObj); + bIsResizeWithCell = (anchorType == SCA_CELL_RESIZE); + } + aAny <<= bIsResizeWithCell; + } else if ( aPropertyName == SC_UNONAME_IMAGEMAP ) { uno::Reference< uno::XInterface > xImageMap; |