summaryrefslogtreecommitdiff
path: root/svx/source/toolbars/fontworkbar.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/toolbars/fontworkbar.cxx')
-rw-r--r--svx/source/toolbars/fontworkbar.cxx26
1 files changed, 17 insertions, 9 deletions
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;