diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/SelectionAnalyzer.cxx | 9 | ||||
-rw-r--r-- | svx/source/toolbars/fontworkbar.cxx | 26 |
2 files changed, 26 insertions, 9 deletions
diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx index 7cc20c5dd0a0..7d0cb4d16967 100644 --- a/svx/source/sidebar/SelectionAnalyzer.cxx +++ b/svx/source/sidebar/SelectionAnalyzer.cxx @@ -22,6 +22,7 @@ #include <svx/svdobj.hxx> #include <svx/svdotext.hxx> #include <svx/svdpage.hxx> +#include <svx/fontworkbar.hxx> using vcl::EnumContext; @@ -46,6 +47,10 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC(const SdrMarkL { eContext = EnumContext::Context::DrawText; } + else if (svx::checkForFontWork(pObj)) + { + eContext = EnumContext::Context::DrawFontwork; + } else { const SdrInventor nInv = pObj->GetObjInventor(); @@ -133,6 +138,10 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD(const SdrMarkL else eContext = EnumContext::Context::DrawText; } + else if (svx::checkForFontWork(pObj)) + { + eContext = EnumContext::Context::DrawFontwork; + } else { const SdrInventor nInv = pObj->GetObjInventor(); diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index 8f7029204006..0fc4da30e1bf 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -205,26 +205,34 @@ FontworkBar::~FontworkBar() } namespace svx { +bool checkForFontWork( SdrObject* pObj ) +{ + static constexpr OUStringLiteral sTextPath = u"TextPath"; + bool bFound = false; + + if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr ) + { + const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + const Any* pAny = aGeometryItem.GetPropertyValueByName( sTextPath, sTextPath ); + if( pAny ) + *pAny >>= bFound; + } + + return bFound; +} + bool checkForSelectedFontWork( SdrView const * pSdrView, sal_uInt32& nCheckStatus ) { if ( nCheckStatus & 2 ) return ( nCheckStatus & 1 ) != 0; - static constexpr OUStringLiteral sTextPath = u"TextPath"; - const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); bool bFound = false; for(size_t i=0; (i<nCount) && !bFound ; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); - if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr ) - { - const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); - const Any* pAny = aGeometryItem.GetPropertyValueByName( sTextPath, sTextPath ); - if( pAny ) - *pAny >>= bFound; - } + bFound = checkForFontWork(pObj); } if ( bFound ) nCheckStatus |= 1; |