[Libreoffice-commits] core.git: 2 commits - framework/source sc/source sd/sdi sd/source sfx2/sdi svx/sdi sw/inc sw/source
Maxim Monastirsky
momonasmon at gmail.com
Tue Jul 21 07:36:53 PDT 2015
framework/source/uielement/subtoolbarcontroller.cxx | 53 ++++--
sc/source/ui/inc/tabvwsh.hxx | 3
sc/source/ui/view/tabvwsh2.cxx | 6
sd/sdi/sdraw.sdi | 22 +-
sd/source/ui/func/fuconcs.cxx | 5
sd/source/ui/inc/DrawViewShell.hxx | 1
sd/source/ui/inc/fuconcs.hxx | 1
sd/source/ui/table/tablefunction.cxx | 1
sd/source/ui/view/drviews2.cxx | 17 --
sd/source/ui/view/drviews7.cxx | 47 ++----
sd/source/ui/view/drviewsc.cxx | 155 --------------------
sd/source/ui/view/drviewse.cxx | 9 -
sfx2/sdi/sfx.sdi | 2
svx/sdi/svx.sdi | 12 -
sw/inc/view.hxx | 5
sw/source/uibase/uiview/viewdraw.cxx | 1
sw/source/uibase/uiview/viewstat.cxx | 5
17 files changed, 76 insertions(+), 269 deletions(-)
New commits:
commit 74cc3fbc17235f5c0010c363342a9a9adaf85c4e
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Tue Jul 21 10:58:39 2015 +0300
tdf#36796 Status updates for custom shapes buttons
We're dealing here with 2 bugs:
1. Single shape buttons (like rectangle, ellipse etc.) don't get
the pressed state when active. The cause is that all commands of
the same kind (Basic Shapes, Symbol Shapes etc.) are handled as
one internally, allowing only one type of status updates. It used
to transport the current active shape, but it was changed to a
boolean value in the fix for i#41753, and since then used for
the pressed state of the group buttons.
2. The pressed state of a group button shows always, even when a
user activates a shape from a place other than the drop-down
of that button. But in this case the image of the group button
doesn't update with the current shape, thus confusing the user on
what is currently active. The cause here is that we use (since
i#41753) the XSubToolbarController interface to update the last
selected function (instead of the old-style status based update),
and ToolBarManager notifies a controller about a new selection
only if it was made from a particular toolbar that the controller
claimed to use in the getSubToolbarName method.
Since 7352a7c17875e5adcc4226c45f4a03e11c44ff49 there is a similar
regression for other group buttons in sd (like lines, 3D Objects
and other), with the same cause. This is also fixed now.
Change-Id: Ida074a001ff78bf5bd5bcb8151516daa6e27cbce
diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx
index 63a0984..3a06a10 100644
--- a/framework/source/uielement/subtoolbarcontroller.cxx
+++ b/framework/source/uielement/subtoolbarcontroller.cxx
@@ -102,6 +102,8 @@ SubToolBarController::SubToolBarController( const css::uno::Sequence< css::uno::
break;
}
}
+ if ( !m_aLastCommand.isEmpty() )
+ addStatusListener( m_aLastCommand );
}
SubToolBarController::~SubToolBarController()
@@ -131,32 +133,41 @@ void SubToolBarController::statusChanged( const css::frame::FeatureStateEvent& E
sal_uInt16 nId = 0;
if ( getToolboxId( nId, &pToolBox ) )
{
- pToolBox->EnableItem( nId, Event.IsEnabled );
ToolBoxItemBits nItemBits = pToolBox->GetItemBits( nId );
nItemBits &= ~ToolBoxItemBits::CHECKABLE;
TriState eTri = TRISTATE_FALSE;
- bool bValue;
- css::frame::status::ItemStatus aItemState;
- css::frame::status::Visibility aItemVisibility;
-
- if ( Event.State >>= bValue )
- {
- // Boolean, treat it as checked/unchecked
- pToolBox->SetItemBits( nId, nItemBits );
- pToolBox->CheckItem( nId, bValue );
- if ( bValue )
- eTri = TRISTATE_TRUE;
- nItemBits |= ToolBoxItemBits::CHECKABLE;
- }
- else if ( Event.State >>= aItemState )
+ if ( Event.FeatureURL.Complete == m_aCommandURL )
{
- eTri = TRISTATE_INDET;
- nItemBits |= ToolBoxItemBits::CHECKABLE;
+ pToolBox->EnableItem( nId, Event.IsEnabled );
+
+ OUString aStrValue;
+ css::frame::status::Visibility aItemVisibility;
+ if ( Event.State >>= aStrValue )
+ {
+ // Enum command, such as the current custom shape,
+ // toggle checked state.
+ if ( m_aLastCommand == OUString( m_aCommandURL + "." + aStrValue ) )
+ {
+ eTri = TRISTATE_TRUE;
+ nItemBits |= ToolBoxItemBits::CHECKABLE;
+ }
+ }
+ else if ( Event.State >>= aItemVisibility )
+ {
+ pToolBox->ShowItem( nId, aItemVisibility.bVisible );
+ }
}
- else if ( Event.State >>= aItemVisibility )
+ else
{
- pToolBox->ShowItem( nId, aItemVisibility.bVisible );
+ bool bValue;
+ if ( Event.State >>= bValue )
+ {
+ // Boolean, treat it as checked/unchecked
+ if ( bValue )
+ eTri = TRISTATE_TRUE;
+ nItemBits |= ToolBoxItemBits::CHECKABLE;
+ }
}
pToolBox->SetItemState( nId, eTri );
@@ -261,9 +272,11 @@ OUString SubToolBarController::getSubToolbarName()
void SubToolBarController::functionSelected( const OUString& rCommand )
throw ( css::uno::RuntimeException, std::exception )
{
- if ( !m_aLastCommand.isEmpty() )
+ if ( !m_aLastCommand.isEmpty() && m_aLastCommand != rCommand )
{
+ removeStatusListener( m_aLastCommand );
m_aLastCommand = rCommand;
+ addStatusListener( m_aLastCommand );
updateImage();
}
}
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index 6bf6439..6e22952 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -440,7 +440,7 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet)
case SID_DRAWTBX_CS_FLOWCHART:
case SID_DRAWTBX_CS_CALLOUT:
case SID_DRAWTBX_CS_STAR:
- rSet.Put( SfxBoolItem( nWhich, nDrawSfxId == nWhich ) );
+ rSet.Put( SfxStringItem( nWhich, nDrawSfxId == nWhich ? sDrawCustom : OUString() ) );
break;
}
nWhich = aIter.NextWhich();
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index 4a02435..d91e21b 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -16,7 +16,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-SfxBoolItem AdvancedMode SID_OBJECT_CHOOSE_MODE
+SfxVoidItem AdvancedMode SID_OBJECT_CHOOSE_MODE
[
/* flags: */
@@ -196,7 +196,7 @@ SfxUInt16Item AnimatorState SID_ANIMATOR_STATE
GroupId = GID_OPTIONS;
]
-SfxBoolItem ArrowsToolbox SID_DRAWTBX_ARROWS
+SfxVoidItem ArrowsToolbox SID_DRAWTBX_ARROWS
[
/* flags: */
@@ -250,7 +250,7 @@ SfxVoidItem BeforeObject SID_BEFORE_OBJ
()
[
/* flags: */
- AutoUpdate = FALSE,
+ AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
@@ -274,7 +274,7 @@ SfxVoidItem BehindObject SID_BEHIND_OBJ
()
[
/* flags: */
- AutoUpdate = FALSE,
+ AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
@@ -1292,7 +1292,7 @@ SfxBoolItem ConnectorLinesCircleStart SID_CONNECTOR_LINES_CIRCLE_START
GroupId = GID_CONNECTOR;
]
-SfxBoolItem ConnectorToolbox SID_DRAWTBX_CONNECTORS
+SfxVoidItem ConnectorToolbox SID_DRAWTBX_CONNECTORS
[
/* flags: */
@@ -2157,7 +2157,7 @@ SfxBoolItem CustomAnimationSchemes SID_CUSTOM_ANIMATION_SCHEMES_PANEL
GroupId = GID_OPTIONS;
]
-SfxBoolItem EllipseToolbox SID_DRAWTBX_ELLIPSES
+SfxVoidItem EllipseToolbox SID_DRAWTBX_ELLIPSES
[
/* flags: */
@@ -3889,7 +3889,7 @@ SfxVoidItem LineTo SID_LINETO
GroupId = GID_DRAWING;
]
-SfxBoolItem LineToolbox SID_DRAWTBX_LINES
+SfxVoidItem LineToolbox SID_DRAWTBX_LINES
[
/* flags: */
@@ -4516,7 +4516,7 @@ SfxBoolItem NotesMode SID_NOTESMODE
GroupId = GID_VIEW;
]
-SfxBoolItem ObjectPosition SID_POSITION
+SfxVoidItem ObjectPosition SID_POSITION
[
/* flags: */
@@ -4542,7 +4542,7 @@ SfxBoolItem ObjectPosition SID_POSITION
GroupId = GID_MODIFY;
]
-SfxBoolItem Objects3DToolbox SID_DRAWTBX_3D_OBJECTS
+SfxVoidItem Objects3DToolbox SID_DRAWTBX_3D_OBJECTS
[
/* flags: */
@@ -5195,7 +5195,7 @@ SfxBoolItem QuickEdit SID_QUICKEDIT
GroupId = GID_OPTIONS;
]
-SfxBoolItem RectangleToolbox SID_DRAWTBX_RECTANGLES
+SfxVoidItem RectangleToolbox SID_DRAWTBX_RECTANGLES
[
/* flags: */
@@ -5994,7 +5994,7 @@ SfxBoolItem TextAutoFitToSize SID_OUTLINE_TEXT_AUTOFIT
GroupId = GID_FORMAT;
]
-SfxBoolItem TextToolbox SID_DRAWTBX_TEXT
+SfxVoidItem TextToolbox SID_DRAWTBX_TEXT
[
/* flags: */
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index af30ec2..53a31f8 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -258,6 +258,11 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
}
}
+OUString FuConstructCustomShape::GetShapeType() const
+{
+ return aCustomShape;
+}
+
SdrObject* FuConstructCustomShape::CreateDefaultObject(const sal_uInt16, const Rectangle& rRectangle)
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index b2d2d10..b3eefc1 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -420,7 +420,6 @@ protected:
void SetupPage( Size &rSize, long nLeft, long nRight, long nUpper, long nLower,
bool bSize, bool bMargin, bool bScaleAll );
- static sal_uInt16 GetIdBySubId( sal_uInt16 nSId );
void GetMenuStateSel(SfxItemSet& rSet);
private:
diff --git a/sd/source/ui/inc/fuconcs.hxx b/sd/source/ui/inc/fuconcs.hxx
index 63c6b71..5e253a2 100644
--- a/sd/source/ui/inc/fuconcs.hxx
+++ b/sd/source/ui/inc/fuconcs.hxx
@@ -46,6 +46,7 @@ public:
virtual void Activate() SAL_OVERRIDE;
void SetAttributes( SdrObject* pObj );
+ OUString GetShapeType() const;
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle) SAL_OVERRIDE;
diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx
index 291cff7..15731f7 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -190,7 +190,6 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
else
mpView->InsertObjectAtView(pObj, *pPV, SdrInsertFlags::SETDEFLAYER);
- Invalidate(SID_DRAWTBX_INSERT);
rReq.Ignore();
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=NULL);
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 7108b35..9999d01 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1111,7 +1111,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
SetCurrentFunction( FuInsertGraphic::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
Cancel();
rReq.Ignore ();
- Invalidate(SID_DRAWTBX_INSERT);
}
break;
@@ -1121,8 +1120,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
Cancel();
rReq.Ignore ();
-
- Invalidate(SID_DRAWTBX_INSERT);
}
break;
@@ -1142,8 +1139,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
SetOldFunction( FuSelection::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
Cancel();
rReq.Ignore ();
-
- Invalidate(SID_DRAWTBX_INSERT);
}
break;
#if HAVE_FEATURE_GLTF
@@ -1153,8 +1148,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
Cancel();
rReq.Ignore ();
-
- Invalidate(SID_DRAWTBX_INSERT);
}
break;
#endif
@@ -1187,8 +1180,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
Broadcast (ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END));
Cancel();
rReq.Done ();
-
- Invalidate(SID_DRAWTBX_INSERT);
}
break;
@@ -1205,8 +1196,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_BEHIND_OBJ:
{
SetCurrentFunction( FuDisplayOrder::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
- Invalidate( SID_POSITION );
- rReq.Ignore ();
+ rReq.Done();
// finishes itself, no Cancel() needed!
}
break;
@@ -1214,7 +1204,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_REVERSE_ORDER: // BASIC
{
mpDrawView->ReverseOrderOfMarked();
- Invalidate( SID_POSITION );
Cancel();
rReq.Done ();
}
@@ -2421,7 +2410,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
mpDrawView->PutMarkedToTop();
Cancel();
- Invalidate( SID_POSITION );
rReq.Done ();
}
break;
@@ -2430,7 +2418,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
mpDrawView->MovMarkedToTop();
Cancel();
- Invalidate( SID_POSITION );
rReq.Done ();
}
break;
@@ -2439,7 +2426,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
mpDrawView->MovMarkedToBtm();
Cancel();
- Invalidate( SID_POSITION );
rReq.Done ();
}
break;
@@ -2448,7 +2434,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
mpDrawView->PutMarkedToBtm();
Cancel();
- Invalidate( SID_POSITION );
rReq.Done ();
}
break;
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index ca5023b..b773cff 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -82,6 +82,7 @@
#include "Window.hxx"
#include "fuediglu.hxx"
#include "fubullet.hxx"
+#include "fuconcs.hxx"
#include "fuformatpaintbrush.hxx"
#include <config_features.h>
@@ -278,11 +279,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if(HasCurrentFunction())
{
sal_uInt16 nSId = GetCurrentFunction()->GetSlotID();
- sal_uInt16 nMainId = GetIdBySubId( nSId );
-
rSet.Put( SfxBoolItem( nSId, true ) );
- if ( nMainId != 0 )
- rSet.Put( SfxBoolItem( nMainId, true ) );
}
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
@@ -1047,7 +1044,6 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
nCurrentSId = SID_ATTR_CHAR;
rSet.Put( SfxBoolItem( nCurrentSId, true ) );
- rSet.Put( SfxBoolItem( SID_DRAWTBX_TEXT, true ) );
}
if ( GetDocSh()->IsReadOnly() )
@@ -1334,20 +1330,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if( xSlideshow.is() && xSlideshow->isRunning() )
{
- rSet.ClearItem(SID_ZOOM_TOOLBOX);
- rSet.ClearItem(SID_OBJECT_CHOOSE_MODE);
- rSet.ClearItem(SID_DRAWTBX_TEXT);
- rSet.ClearItem(SID_DRAWTBX_RECTANGLES);
- rSet.ClearItem(SID_DRAWTBX_ELLIPSES);
- rSet.ClearItem(SID_DRAWTBX_LINES);
- rSet.ClearItem(SID_DRAWTBX_ARROWS);
- rSet.ClearItem(SID_DRAWTBX_3D_OBJECTS);
- rSet.ClearItem(SID_DRAWTBX_CONNECTORS);
- rSet.ClearItem(SID_OBJECT_CHOOSE_MODE );
- rSet.ClearItem(SID_DRAWTBX_INSERT);
rSet.ClearItem(SID_INSERTFILE);
rSet.ClearItem(SID_OBJECT_ROTATE);
- rSet.ClearItem(SID_POSITION);
rSet.ClearItem(SID_FM_CONFIG);
rSet.ClearItem(SID_ANIMATION_EFFECTS);
rSet.ClearItem(SID_ANIMATION_OBJECTS);
@@ -1538,22 +1522,23 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
//highlight selected custom shape
{
- sal_uInt16 nCurrentSId = 0;
if(HasCurrentFunction())
- nCurrentSId = GetCurrentFunction()->GetSlotID();
+ {
+ rtl::Reference< FuPoor > xFunc( GetCurrentFunction() );
+ FuConstructCustomShape* pShapeFunc = dynamic_cast< FuConstructCustomShape* >( xFunc.get() );
+
+ static const sal_uInt16 nCSTbArray[] = { SID_DRAWTBX_CS_BASIC, SID_DRAWTBX_CS_SYMBOL,
+ SID_DRAWTBX_CS_ARROW, SID_DRAWTBX_CS_FLOWCHART,
+ SID_DRAWTBX_CS_CALLOUT, SID_DRAWTBX_CS_STAR };
- if ( SfxItemState::DEFAULT == rSet.GetItemState( SID_DRAWTBX_CS_BASIC ) )
- rSet.Put(SfxBoolItem(SID_DRAWTBX_CS_BASIC, SID_DRAWTBX_CS_BASIC == nCurrentSId ));
- if ( SfxItemState::DEFAULT == rSet.GetItemState( SID_DRAWTBX_CS_SYMBOL ) )
- rSet.Put(SfxBoolItem(SID_DRAWTBX_CS_SYMBOL, SID_DRAWTBX_CS_SYMBOL == nCurrentSId ));
- if ( SfxItemState::DEFAULT == rSet.GetItemState( SID_DRAWTBX_CS_ARROW ) )
- rSet.Put(SfxBoolItem(SID_DRAWTBX_CS_ARROW, SID_DRAWTBX_CS_ARROW == nCurrentSId ));
- if ( SfxItemState::DEFAULT == rSet.GetItemState( SID_DRAWTBX_CS_FLOWCHART ) )
- rSet.Put(SfxBoolItem(SID_DRAWTBX_CS_FLOWCHART, SID_DRAWTBX_CS_FLOWCHART == nCurrentSId ));
- if ( SfxItemState::DEFAULT == rSet.GetItemState( SID_DRAWTBX_CS_CALLOUT ) )
- rSet.Put(SfxBoolItem(SID_DRAWTBX_CS_CALLOUT,SID_DRAWTBX_CS_CALLOUT == nCurrentSId ));
- if ( SfxItemState::DEFAULT == rSet.GetItemState( SID_DRAWTBX_CS_STAR ) )
- rSet.Put(SfxBoolItem(SID_DRAWTBX_CS_STAR, SID_DRAWTBX_CS_STAR == nCurrentSId ));
+ const sal_uInt16 nCurrentSId = GetCurrentFunction()->GetSlotID();
+ for ( size_t i = 0; i < SAL_N_ELEMENTS( nCSTbArray ); ++i )
+ {
+ rSet.ClearItem( nCSTbArray[i] ); // Why is this necessary?
+ rSet.Put( SfxStringItem( nCSTbArray[i], nCurrentSId == nCSTbArray[i] && pShapeFunc
+ ? pShapeFunc->GetShapeType() : OUString() ) );
+ }
+ }
}
if ( bDisableEditHyperlink || GetDocSh()->IsReadOnly() )
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index 78afdcf..6195735 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -51,161 +51,6 @@
#include "sdabstdlg.hxx"
namespace sd {
-/**
- * Returns the ID of the group button, if it should be toggled.
- */
-sal_uInt16 DrawViewShell::GetIdBySubId( sal_uInt16 nSId )
-{
- sal_uInt16 nMappedSId = 0;
- switch( nSId )
- {
- case SID_OBJECT_ROTATE:
- case SID_OBJECT_MIRROR:
- case SID_OBJECT_TRANSPARENCE:
- case SID_OBJECT_GRADIENT:
- case SID_OBJECT_SHEAR:
- case SID_OBJECT_CROOK_ROTATE:
- case SID_OBJECT_CROOK_SLANT:
- case SID_OBJECT_CROOK_STRETCH:
- case SID_CONVERT_TO_3D_LATHE:
- {
- nMappedSId = SID_OBJECT_CHOOSE_MODE;
- }
- break;
-
- case SID_BEFORE_OBJ:
- case SID_BEHIND_OBJ:
- {
- nMappedSId = SID_POSITION;
- }
- break;
-
- case SID_ZOOM_PANNING:
- case SID_ZOOM_MODE:
- {
- nMappedSId = SID_ZOOM_TOOLBOX;
- }
- break;
-
- case SID_ATTR_CHAR:
- case SID_TEXT_FITTOSIZE:
- case SID_DRAW_CAPTION:
- case SID_DRAW_FONTWORK:
- case SID_DRAW_FONTWORK_VERTICAL:
- {
- nMappedSId = SID_DRAWTBX_TEXT;
- }
- break;
-
- case SID_DRAW_RECT:
- case SID_DRAW_SQUARE:
- case SID_DRAW_RECT_ROUND:
- case SID_DRAW_SQUARE_ROUND:
- case SID_DRAW_RECT_NOFILL:
- case SID_DRAW_SQUARE_NOFILL:
- case SID_DRAW_RECT_ROUND_NOFILL:
- case SID_DRAW_SQUARE_ROUND_NOFILL:
- {
- nMappedSId = SID_DRAWTBX_RECTANGLES;
- }
- break;
-
- case SID_DRAW_ELLIPSE:
- case SID_DRAW_CIRCLE:
- case SID_DRAW_PIE:
- case SID_DRAW_CIRCLEPIE:
- case SID_DRAW_ELLIPSECUT:
- case SID_DRAW_CIRCLECUT:
- case SID_DRAW_ARC:
- case SID_DRAW_CIRCLEARC:
- case SID_DRAW_ELLIPSE_NOFILL:
- case SID_DRAW_CIRCLE_NOFILL:
- case SID_DRAW_PIE_NOFILL:
- case SID_DRAW_CIRCLEPIE_NOFILL:
- case SID_DRAW_ELLIPSECUT_NOFILL:
- case SID_DRAW_CIRCLECUT_NOFILL:
- {
- nMappedSId = SID_DRAWTBX_ELLIPSES;
- }
- break;
-
- case SID_DRAW_BEZIER_NOFILL:
- case SID_DRAW_POLYGON_NOFILL:
- case SID_DRAW_XPOLYGON_NOFILL:
- case SID_DRAW_FREELINE_NOFILL:
- case SID_DRAW_BEZIER_FILL:
- case SID_DRAW_POLYGON:
- case SID_DRAW_XPOLYGON:
- case SID_DRAW_FREELINE:
- {
- nMappedSId = SID_DRAWTBX_LINES;
- }
- break;
-
- case SID_DRAW_LINE:
- case SID_DRAW_XLINE:
- case SID_DRAW_MEASURELINE:
- case SID_LINE_ARROW_START:
- case SID_LINE_ARROW_END:
- case SID_LINE_ARROWS:
- case SID_LINE_ARROW_CIRCLE:
- case SID_LINE_CIRCLE_ARROW:
- case SID_LINE_ARROW_SQUARE:
- case SID_LINE_SQUARE_ARROW:
- {
- nMappedSId = SID_DRAWTBX_ARROWS;
- }
- break;
-
- case SID_3D_CUBE:
- case SID_3D_TORUS:
- case SID_3D_SPHERE:
- case SID_3D_SHELL:
- case SID_3D_HALF_SPHERE:
- case SID_3D_CYLINDER:
- case SID_3D_CONE:
- case SID_3D_PYRAMID:
- {
- nMappedSId = SID_DRAWTBX_3D_OBJECTS;
- }
- break;
-
- case SID_TOOL_CONNECTOR:
- case SID_CONNECTOR_ARROW_START:
- case SID_CONNECTOR_ARROW_END:
- case SID_CONNECTOR_ARROWS:
- case SID_CONNECTOR_CIRCLE_START:
- case SID_CONNECTOR_CIRCLE_END:
- case SID_CONNECTOR_CIRCLES:
- case SID_CONNECTOR_LINE:
- case SID_CONNECTOR_LINE_ARROW_START:
- case SID_CONNECTOR_LINE_ARROW_END:
- case SID_CONNECTOR_LINE_ARROWS:
- case SID_CONNECTOR_LINE_CIRCLE_START:
- case SID_CONNECTOR_LINE_CIRCLE_END:
- case SID_CONNECTOR_LINE_CIRCLES:
- case SID_CONNECTOR_CURVE:
- case SID_CONNECTOR_CURVE_ARROW_START:
- case SID_CONNECTOR_CURVE_ARROW_END:
- case SID_CONNECTOR_CURVE_ARROWS:
- case SID_CONNECTOR_CURVE_CIRCLE_START:
- case SID_CONNECTOR_CURVE_CIRCLE_END:
- case SID_CONNECTOR_CURVE_CIRCLES:
- case SID_CONNECTOR_LINES:
- case SID_CONNECTOR_LINES_ARROW_START:
- case SID_CONNECTOR_LINES_ARROW_END:
- case SID_CONNECTOR_LINES_ARROWS:
- case SID_CONNECTOR_LINES_CIRCLE_START:
- case SID_CONNECTOR_LINES_CIRCLE_END:
- case SID_CONNECTOR_LINES_CIRCLES:
- {
- nMappedSId = SID_DRAWTBX_CONNECTORS;
- }
- }
- return nMappedSId;
-}
-
-
void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
{
if( ( pObj->ISA( SdrGrafObj ) || pObj->ISA( SdrOle2Obj ) ) && !mpDrawView->IsTextEdit() &&
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 70cd2f6..0eb9f29 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1133,7 +1133,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
- Invalidate( SID_ZOOM_TOOLBOX );
rReq.Done ();
}
break;
@@ -1148,7 +1147,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
- Invalidate( SID_ZOOM_TOOLBOX );
rReq.Done ();
}
break;
@@ -1163,7 +1161,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
- Invalidate( SID_ZOOM_TOOLBOX );
rReq.Done ();
}
break;
@@ -1177,7 +1174,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
mpZoomList->InsertZoomRect(aVisAreaWin);
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_PANNING );
- Invalidate( SID_ZOOM_TOOLBOX );
rReq.Done ();
}
break;
@@ -1194,7 +1190,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
- Invalidate( SID_ZOOM_TOOLBOX );
}
rReq.Done ();
}
@@ -1225,7 +1220,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
- Invalidate( SID_ZOOM_TOOLBOX );
rReq.Done ();
}
break;
@@ -1258,7 +1252,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
- Invalidate( SID_ZOOM_TOOLBOX );
}
rReq.Done ();
}
@@ -1277,7 +1270,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
SetZoomRect(mpZoomList->GetPreviousZoomRect());
}
rReq.Done ();
- Invalidate( SID_ZOOM_TOOLBOX );
}
break;
@@ -1294,7 +1286,6 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
SetZoomRect(mpZoomList->GetNextZoomRect());
}
rReq.Done ();
- Invalidate( SID_ZOOM_TOOLBOX );
}
break;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 04f61b7..e207e8b 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -6668,7 +6668,7 @@ SfxVoidItem ZoomPrevious SID_ZOOM_PREV
]
-SfxBoolItem ZoomToolBox SID_ZOOM_TOOLBOX
+SfxVoidItem ZoomToolBox SID_ZOOM_TOOLBOX
[
/* flags: */
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index fe52a8c..91a7662 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -14174,7 +14174,7 @@ SfxBoolItem BasicShapes SID_DRAWTBX_CS_BASIC
Synchron;
/* status: */
- SlotType = SfxBoolItem
+ SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
@@ -14202,7 +14202,7 @@ SfxBoolItem SymbolShapes SID_DRAWTBX_CS_SYMBOL
Synchron;
/* status: */
- SlotType = SfxBoolItem
+ SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
@@ -14230,7 +14230,7 @@ SfxBoolItem ArrowShapes SID_DRAWTBX_CS_ARROW
Synchron;
/* status: */
- SlotType = SfxBoolItem
+ SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
@@ -14258,7 +14258,7 @@ SfxBoolItem FlowChartShapes SID_DRAWTBX_CS_FLOWCHART
Synchron;
/* status: */
- SlotType = SfxBoolItem
+ SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
@@ -14286,7 +14286,7 @@ SfxBoolItem CalloutShapes SID_DRAWTBX_CS_CALLOUT
Synchron;
/* status: */
- SlotType = SfxBoolItem
+ SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
@@ -14314,7 +14314,7 @@ SfxBoolItem StarShapes SID_DRAWTBX_CS_STAR
Synchron;
/* status: */
- SlotType = SfxBoolItem
+ SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 43b0c0f..be077fd 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -520,7 +520,7 @@ void SwView::GetDrawState(SfxItemSet &rSet)
if ( bWeb )
rSet.DisableItem( nWhich );
else
- rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
+ rSet.Put( SfxStringItem( nWhich, m_nDrawSfxId == nWhich ? m_sDrawCustom : OUString() ) );
}
break;
commit 3c7a7b538e8ca8b310ae9778ae9ace5ae937a4f1
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Mon Jul 20 20:34:31 2015 +0300
Simplify
Change-Id: I6fff5af5d623bff6f8adedf6f3d42d849ea4d24b
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 3a2536d..ce3c4a5 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -168,9 +168,6 @@ private:
SfxBroadcaster* pAccessibilityBroadcaster;
- static const int MASTERENUMCOMMANDS = 6;
- OUString aCurrShapeEnumCommand[ MASTERENUMCOMMANDS ];
-
// ugly hack for Add button in ScNameDlg
boost::ptr_map<OUString, ScRangeName> maRangeMap;
bool mbInSwitch;
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index fefe124..6bf6439 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -310,7 +310,6 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
SFX_REQUEST_ARG( rReq, pEnumCommand, SfxStringItem, nNewId, false );
if ( pEnumCommand )
{
- aCurrShapeEnumCommand[ nNewId - SID_DRAWTBX_CS_BASIC ] = pEnumCommand->GetValue();
SfxBindings& rBind = GetViewFrame()->GetBindings();
rBind.Invalidate( nNewId );
rBind.Update( nNewId );
@@ -441,10 +440,7 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet)
case SID_DRAWTBX_CS_FLOWCHART:
case SID_DRAWTBX_CS_CALLOUT:
case SID_DRAWTBX_CS_STAR:
- {
- bool bCurrentActive = (nDrawSfxId == nWhich) && (aCurrShapeEnumCommand[ nWhich - SID_DRAWTBX_CS_BASIC ] == sDrawCustom);
- rSet.Put( SfxBoolItem( nWhich, bCurrentActive ) );
- }
+ rSet.Put( SfxBoolItem( nWhich, nDrawSfxId == nWhich ) );
break;
}
nWhich = aIter.NextWhich();
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index cd7114f..1c09a8b 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -218,11 +218,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
int m_nSelectionType;
VclPtr<FloatingWindow> m_pFieldPopup;
-
- static const int m_nMASTERENUMCOMMANDS = 6;
-
- OUString m_aCurrShapeEnumCommand[ m_nMASTERENUMCOMMANDS ];
-
sal_uInt16 m_nPageCnt;
// current draw mode
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index b81cf88..d342512 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -320,7 +320,6 @@ void SwView::ExecDraw(SfxRequest& rReq)
if ( pStringItem )
{
m_sDrawCustom = pStringItem->GetValue();
- m_aCurrShapeEnumCommand[ nSlotId - SID_DRAWTBX_CS_BASIC ] = m_sDrawCustom;
SfxBindings& rBind = GetViewFrame()->GetBindings();
rBind.Invalidate( nSlotId );
rBind.Update( nSlotId );
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index a7d2c16..43b0c0f 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -520,10 +520,7 @@ void SwView::GetDrawState(SfxItemSet &rSet)
if ( bWeb )
rSet.DisableItem( nWhich );
else
- {
- bool bCurrentActive = (m_nDrawSfxId == nWhich) && (m_aCurrShapeEnumCommand[ nWhich - SID_DRAWTBX_CS_BASIC ] == m_sDrawCustom);
- rSet.Put( SfxBoolItem( nWhich, bCurrentActive ) );
- }
+ rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
}
break;
More information about the Libreoffice-commits
mailing list