[Libreoffice-commits] core.git: sc/source sd/source sw/source
Armin Le Grand
alg at apache.org
Mon Jun 17 01:42:39 PDT 2013
sc/source/ui/drawfunc/drawsh4.cxx | 12 ++++++++---
sc/source/ui/drawfunc/drtxtob2.cxx | 12 ++++++++---
sd/source/ui/view/drviews6.cxx | 11 ++++++++--
sw/source/ui/shells/drawsh.cxx | 34 +++++++++++++++++++-------------
sw/source/ui/shells/drwtxtsh.cxx | 39 +++++++++++++++++++++----------------
5 files changed, 71 insertions(+), 37 deletions(-)
New commits:
commit 0994eb59a1bd1a993c7b6650570454ecad6077b0
Author: Armin Le Grand <alg at apache.org>
Date: Tue Apr 9 11:22:48 2013 +0000
Resolves: #i121538# Disable FontWork dialog entries (slots)...
when CustomShapes are selected to avoid unwanted FontWork editing on these
shapes
(cherry picked from commit c73f0e910fcf3a940c24a639dba9b4ced2057399)
Conflicts:
sw/source/ui/shells/drawsh.cxx
sw/source/ui/shells/drwtxtsh.cxx
Change-Id: I6b702512c48e7b2376874b2e8184563d12d5c6e8
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index b6bea362..ed48933 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -24,7 +24,7 @@
#include <svx/xdef.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
-
+#include <svx/svdoashp.hxx>
#include "drawsh.hxx"
#include "drawview.hxx"
#include "viewdata.hxx"
@@ -49,8 +49,14 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+ const bool bDeactivate(
+ !pObj ||
+ !pTextObj ||
+ !pTextObj->HasText() ||
+ dynamic_cast< const SdrObjCustomShape* >(pObj)); // #121538# no FontWork for CustomShapes
+
+ if(bDeactivate)
{
if ( pDlg )
pDlg->SetActive(false);
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index dcf1b98..cb09ff1 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -33,7 +33,7 @@
#include <sfx2/request.hxx>
#include <sot/formats.hxx>
#include <svl/whiter.hxx>
-
+#include <svx/svdoashp.hxx>
#include "sc.hrc"
#include "drtxtob.hxx"
#include "viewdata.hxx"
@@ -236,8 +236,14 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+ const bool bDeactivate(
+ !pObj ||
+ !pTextObj ||
+ !pTextObj->HasText() ||
+ dynamic_cast< const SdrObjCustomShape* >(pObj)); // #121538# no FontWork for CustomShapes
+
+ if(bDeactivate)
{
if ( pDlg )
pDlg->SetActive(false);
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index a4b0c2e..8b9f5dd 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -54,6 +54,7 @@
#include "DrawDocShell.hxx"
#include "sdabstdlg.hxx"
#include "framework/FrameworkHelper.hxx"
+#include <svx/svdoashp.hxx>
namespace sd {
@@ -122,8 +123,14 @@ void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+ const bool bDeactivate(
+ !pObj ||
+ !pTextObj ||
+ !pTextObj->HasText() ||
+ dynamic_cast< const SdrObjCustomShape* >(pObj)); // #121538# no FontWork for CustomShapes
+
+ if(bDeactivate)
{
// automatic open/close the FontWork-Dialog; first deactivate it
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index a7627c6..4694ec2 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -42,9 +42,9 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp>
+#include <svx/svdoashp.hxx>
#include <svx/xtable.hxx>
#include <sfx2/sidebar/EnumContext.hxx>
-#include <svx/svdoashp.hxx>
#include "swundo.hxx"
#include "wrtsh.hxx"
@@ -442,19 +442,27 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet)
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+ const bool bDeactivate(
+ !pObj ||
+ !pTextObj ||
+ !pTextObj->HasText() ||
+ dynamic_cast< const SdrObjCustomShape* >(pObj)); // #121538# no FontWork for CustomShapes
+
+ if(bDeactivate)
{
-#define XATTR_ANZ 12
- static const sal_uInt16 nXAttr[ XATTR_ANZ ] =
- {
- XATTR_FORMTXTSTYLE, XATTR_FORMTXTADJUST, XATTR_FORMTXTDISTANCE,
- XATTR_FORMTXTSTART, XATTR_FORMTXTMIRROR, XATTR_FORMTXTSTDFORM,
- XATTR_FORMTXTHIDEFORM, XATTR_FORMTXTOUTLINE, XATTR_FORMTXTSHADOW,
- XATTR_FORMTXTSHDWCOLOR, XATTR_FORMTXTSHDWXVAL, XATTR_FORMTXTSHDWYVAL
- };
- for( sal_uInt16 i = 0; i < XATTR_ANZ; )
- rSet.DisableItem( nXAttr[ i++ ] );
+ rSet.DisableItem(XATTR_FORMTXTSTYLE);
+ rSet.DisableItem(XATTR_FORMTXTADJUST);
+ rSet.DisableItem(XATTR_FORMTXTDISTANCE);
+ rSet.DisableItem(XATTR_FORMTXTSTART);
+ rSet.DisableItem(XATTR_FORMTXTMIRROR);
+ rSet.DisableItem(XATTR_FORMTXTSTDFORM);
+ rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
+ rSet.DisableItem(XATTR_FORMTXTOUTLINE);
+ rSet.DisableItem(XATTR_FORMTXTSHADOW);
+ rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
+ rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
+ rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
}
else
{
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 505d787..f0c4046 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -68,13 +68,11 @@
#include <uitool.hxx>
#include <wview.hxx>
#include <swmodule.hxx>
-
-#include <svx/xtable.hxx>
-#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
-
+#include <svx/svdoashp.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/xtable.hxx>
#include <cppuhelper/bootstrap.hxx>
-
#include "swabstdlg.hxx"
#include "misc.hrc"
@@ -267,18 +265,27 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+ const bool bDeactivate(
+ !pObj ||
+ !pTextObj ||
+ !pTextObj->HasText() ||
+ dynamic_cast< const SdrObjCustomShape* >(pObj)); // #121538# no FontWork for CustomShapes
+
+ if (bDeactivate)
{
-#define XATTR_ANZ 12
- static const sal_uInt16 nXAttr[ XATTR_ANZ ] =
- { XATTR_FORMTXTSTYLE, XATTR_FORMTXTADJUST, XATTR_FORMTXTDISTANCE,
- XATTR_FORMTXTSTART, XATTR_FORMTXTMIRROR, XATTR_FORMTXTSTDFORM,
- XATTR_FORMTXTHIDEFORM, XATTR_FORMTXTOUTLINE, XATTR_FORMTXTSHADOW,
- XATTR_FORMTXTSHDWCOLOR, XATTR_FORMTXTSHDWXVAL, XATTR_FORMTXTSHDWYVAL
- };
- for( sal_uInt16 i = 0; i < XATTR_ANZ; )
- rSet.DisableItem( nXAttr[ i++ ] );
+ rSet.DisableItem(XATTR_FORMTXTSTYLE);
+ rSet.DisableItem(XATTR_FORMTXTADJUST);
+ rSet.DisableItem(XATTR_FORMTXTDISTANCE);
+ rSet.DisableItem(XATTR_FORMTXTSTART);
+ rSet.DisableItem(XATTR_FORMTXTMIRROR);
+ rSet.DisableItem(XATTR_FORMTXTSTDFORM);
+ rSet.DisableItem(XATTR_FORMTXTHIDEFORM);
+ rSet.DisableItem(XATTR_FORMTXTOUTLINE);
+ rSet.DisableItem(XATTR_FORMTXTSHADOW);
+ rSet.DisableItem(XATTR_FORMTXTSHDWCOLOR);
+ rSet.DisableItem(XATTR_FORMTXTSHDWXVAL);
+ rSet.DisableItem(XATTR_FORMTXTSHDWYVAL);
}
else
{
More information about the Libreoffice-commits
mailing list