[Libreoffice-commits] core.git: include/svx svx/source

Szymon Kłos eszkadev at gmail.com
Sat Aug 15 20:15:56 PDT 2015


 include/svx/imapdlg.hxx       |    1 
 svx/source/dialog/imapdlg.cxx |   46 +++++++++++++++++++++++++++++++++++++-----
 2 files changed, 42 insertions(+), 5 deletions(-)

New commits:
commit cd3ca5b24eeebd5ab8e3b98c8e1b5edfd9127042
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Aug 14 11:29:40 2015 +0200

    tdf#92411 : don't select all toolbar buttons in the ImageMap Editor
    
    Change-Id: Id69a03b0379becc4c267a85eb7567bbbd41ccf82
    Reviewed-on: https://gerrit.libreoffice.org/17755
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx
index 75d1a25..238b857 100644
--- a/include/svx/imapdlg.hxx
+++ b/include/svx/imapdlg.hxx
@@ -129,6 +129,7 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
 
     void                DoOpen();
     bool                DoSave();
+    void                SetActiveTool( sal_uInt16 nId );
 
 public:
 
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 1c26ad1..5cb34bb 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -356,7 +356,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
             DoSave();
     else if(nNewItemId == mnSelectId)
     {
-        pTbx->CheckItem( nNewItemId );
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetEditMode( true );
         if( pTbx->IsKeyEvent() )
         {
@@ -368,7 +368,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
     }
     else if(nNewItemId == mnRectId)
     {
-        pTbx->CheckItem( nNewItemId );
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetObjKind( OBJ_RECT );
         if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
         {
@@ -378,7 +378,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
     }
     else if(nNewItemId == mnCircleId)
     {
-        pTbx->CheckItem( nNewItemId );
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetObjKind( OBJ_CIRC );
         if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
         {
@@ -388,7 +388,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
     }
     else if(nNewItemId == mnPolyId)
     {
-        pTbx->CheckItem( nNewItemId );
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetObjKind( OBJ_POLY );
         if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
         {
@@ -398,7 +398,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
     }
     else if(nNewItemId == mnFreePolyId)
     {
-        pTbx->CheckItem( nNewItemId );
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetObjKind( OBJ_FREEFILL );
         if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
         {
@@ -419,16 +419,26 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
         pIMapWnd->DoPropertyDialog();
     else if(nNewItemId == mnPolyEditId)
     {
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetPolyEditMode( pTbx->IsItemChecked( TBI_POLYEDIT ) ? SID_BEZIER_MOVE : 0 );
         if( pTbx->IsKeyEvent() && pTbx->IsItemChecked( TBI_POLYEDIT ) )
             pIMapWnd->StartPolyEdit();
     }
     else if(nNewItemId == mnPolyMoveId)
+    {
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetPolyEditMode( SID_BEZIER_MOVE );
+    }
     else if(nNewItemId == mnPolyInsertId)
+    {
+        SetActiveTool( nNewItemId );
         pIMapWnd->SetPolyEditMode( SID_BEZIER_INSERT );
+    }
     else if(nNewItemId == mnPolyDeleteId)
+    {
+        SetActiveTool( nNewItemId );
         pIMapWnd->GetSdrView()->DeleteMarkedPoints();
+    }
     else if(nNewItemId == mnUndoId)
     {
         URLLoseFocusHdl( NULL );
@@ -554,6 +564,32 @@ bool SvxIMapDlg::DoSave()
     return bRet;
 }
 
+void SvxIMapDlg::SetActiveTool( sal_uInt16 nId )
+{
+    m_pTbxIMapDlg1->CheckItem( mnSelectId, mnSelectId == nId );
+    m_pTbxIMapDlg1->CheckItem( mnRectId, mnRectId == nId );
+    m_pTbxIMapDlg1->CheckItem( mnCircleId, mnCircleId == nId );
+    m_pTbxIMapDlg1->CheckItem( mnPolyId, mnPolyId == nId );
+    m_pTbxIMapDlg1->CheckItem( mnFreePolyId, mnFreePolyId == nId );
+
+    m_pTbxIMapDlg1->CheckItem( mnPolyInsertId, mnPolyInsertId == nId );
+    m_pTbxIMapDlg1->CheckItem( mnPolyDeleteId, false );
+
+    bool bMove = mnPolyMoveId == nId
+                || ( mnPolyEditId == nId
+                && !m_pTbxIMapDlg1->IsItemChecked( TBI_POLYINSERT )
+                && !m_pTbxIMapDlg1->IsItemChecked( TBI_POLYDELETE ) );
+
+    m_pTbxIMapDlg1->CheckItem( mnPolyMoveId, bMove );
+
+    bool bEditMode = ( mnPolyEditId == nId )
+                    || ( mnPolyMoveId == nId )
+                    || ( mnPolyInsertId == nId )
+                    || ( mnPolyDeleteId == nId );
+
+    m_pTbxIMapDlg1->CheckItem( mnPolyEditId, bEditMode );
+}
+
 IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd )
 {
     OUString            aStr;


More information about the Libreoffice-commits mailing list