summaryrefslogtreecommitdiff
path: root/svx/source/toolbars
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-01-27 14:34:19 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-04-01 10:56:17 +0200
commit903902f826129705f1fafc5583a13be645e145b5 (patch)
tree2a4a1878be129d4cf6548cc03d75d4156c868c49 /svx/source/toolbars
parentac8a456d7a6c1bf5b1574eeda8ea2ac41a9b32bc (diff)
Introduce Fontwork context
Change-Id: I61512e4da13514d3e5a199ccb46468ba199b808f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110023 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112274 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'svx/source/toolbars')
-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;