summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/fontworkbar.hxx2
-rw-r--r--include/vcl/EnumContext.hxx1
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu13
-rw-r--r--svx/source/sidebar/SelectionAnalyzer.cxx9
-rw-r--r--svx/source/toolbars/fontworkbar.cxx26
-rw-r--r--sw/source/uibase/shells/drawsh.cxx11
-rw-r--r--vcl/source/window/EnumContext.cxx1
7 files changed, 53 insertions, 10 deletions
diff --git a/include/svx/fontworkbar.hxx b/include/svx/fontworkbar.hxx
index 1f3a81a9a79c..33c67e8f051b 100644
--- a/include/svx/fontworkbar.hxx
+++ b/include/svx/fontworkbar.hxx
@@ -26,12 +26,14 @@
class SfxViewShell;
class SdrView;
+class SdrObject;
/************************************************************************/
namespace svx
{
bool SVXCORE_DLLPUBLIC checkForSelectedFontWork(SdrView const* pSdrView, sal_uInt32& nCheckStatus);
+bool SVXCORE_DLLPUBLIC checkForFontWork(SdrObject* pObj);
class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FontworkBar final : public SfxShell
{
diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx
index 1c356979d858..639a427a138a 100644
--- a/include/vcl/EnumContext.hxx
+++ b/include/vcl/EnumContext.hxx
@@ -71,6 +71,7 @@ public:
Chart,
ChartElements,
Draw,
+ DrawFontwork,
DrawLine,
DrawPage,
DrawText,
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 2c37dec8fe65..5c38580ce00a 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -376,6 +376,7 @@
Calc, EditCell, visible ;
Calc, Pivot, visible, .uno:CellTextDlg ;
DrawImpress, Draw, hidden ;
+ DrawImpress, DrawFontwork, hidden ;
DrawImpress, DrawText, visible ;
DrawImpress, DrawLine, hidden ;
DrawImpress, Graphic, hidden ;
@@ -587,13 +588,16 @@
<prop oor:name="ContextList">
<value oor:separator=";">
Calc, Draw, visible ;
+ Calc, DrawFontwork, visible ;
Calc, OLE, hidden ;
DrawImpress, 3DObject, visible ;
DrawImpress, Draw, visible ;
+ DrawImpress, DrawFontwork, visible ;
DrawImpress, Graphic, hidden ;
DrawImpress, TextObject, hidden ;
DrawImpress, OLE, hidden ;
WriterVariants, Draw, visible ;
+ WriterVariants, DrawFontwork, visible ;
Writer, Graphic, hidden ;
Writer, OLE, hidden ;
Writer, Frame, visible ;
@@ -655,9 +659,11 @@
<prop oor:name="ContextList">
<value oor:separator=";">
Calc, Draw, visible ;
+ Calc, DrawFontwork, visible ;
Calc, OLE, hidden ;
DrawImpress, 3DObject, visible ;
DrawImpress, Draw, hidden ;
+ DrawImpress, DrawFontwork, hidden ;
DrawImpress, Graphic, hidden ;
DrawImpress, TextObject, hidden ;
DrawImpress, OLE, hidden ;
@@ -690,16 +696,19 @@
<prop oor:name="ContextList">
<value oor:separator=";">
Calc, Draw, visible ;
+ Calc, DrawFontwork, visible ;
Calc, DrawLine, visible ;
Calc, Graphic, visible ;
Calc, OLE, hidden ;
DrawImpress, 3DObject, visible ;
DrawImpress, Draw, visible ;
+ DrawImpress, DrawFontwork, visible ;
DrawImpress, DrawLine, visible ;
DrawImpress, Graphic, visible ;
DrawImpress, TextObject, hidden ;
DrawImpress, OLE, hidden ;
WriterVariants, Draw, visible ;
+ WriterVariants, DrawFontwork, visible ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
@@ -759,6 +768,7 @@
<value oor:separator=";">
Calc, Chart, visible ;
Calc, Draw, hidden ;
+ Calc, DrawFontwork, hidden ;
Calc, DrawLine, visible ;
Calc, Form, visible ;
Calc, Graphic, hidden ;
@@ -767,6 +777,7 @@
Calc, OLE, visible ;
DrawImpress, 3DObject, visible ;
DrawImpress, Draw, visible ;
+ DrawImpress, DrawFontwork, visible ;
DrawImpress, DrawLine, visible ;
DrawImpress, Form, visible ;
DrawImpress, Graphic, hidden ;
@@ -775,6 +786,7 @@
DrawImpress, OLE, visible ;
DrawImpress, TextObject, hidden ;
WriterVariants, Draw, hidden ;
+ WriterVariants, DrawFontwork, hidden ;
WriterVariants, Form, visible ;
WriterVariants, Graphic, visible, .uno:GraphicDialog ;
WriterVariants, Media, visible ;
@@ -1235,6 +1247,7 @@
DrawImpress, DrawLine, hidden ;
DrawImpress, 3DObject, hidden ;
DrawImpress, Draw, hidden ;
+ DrawImpress, DrawFontwork, hidden ;
DrawImpress, DrawText, visible ;
DrawImpress, Graphic, hidden ;
DrawImpress, Table, visible ;
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;
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 7589507511a9..3cf059b05929 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -32,6 +32,7 @@
#include <textboxhelper.hxx>
#include <wview.hxx>
#include <swmodule.hxx>
+#include <svx/fontworkbar.hxx>
#include <svx/svdoashp.hxx>
#include <svx/xfillit0.hxx>
@@ -531,7 +532,15 @@ SwDrawShell::SwDrawShell(SwView &_rView) :
{
SetName("Draw");
- SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Draw));
+ vcl::EnumContext::Context eContext = vcl::EnumContext::Context::Draw;
+
+ SwWrtShell &rSh = GetShell();
+ SdrView* pDrView = rSh.GetDrawView();
+ sal_uInt32 nCheckStatus = 0;
+ if (pDrView && svx::checkForSelectedFontWork(pDrView, nCheckStatus))
+ eContext = vcl::EnumContext::Context::DrawFontwork;
+
+ SfxShell::SetContextName(vcl::EnumContext::GetContextName(eContext));
}
// Edit SfxRequests for FontWork
diff --git a/vcl/source/window/EnumContext.cxx b/vcl/source/window/EnumContext.cxx
index 7d3d704180f4..b407a8069bc7 100644
--- a/vcl/source/window/EnumContext.cxx
+++ b/vcl/source/window/EnumContext.cxx
@@ -159,6 +159,7 @@ void EnumContext::ProvideContextContainers()
AddEntry("Chart", Context::Chart);
AddEntry("ChartElements", Context::ChartElements);
AddEntry("Draw", Context::Draw);
+ AddEntry("DrawFontwork", Context::DrawFontwork);
AddEntry("DrawLine", Context::DrawLine);
AddEntry("DrawPage", Context::DrawPage);
AddEntry("DrawText", Context::DrawText);