[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - framework/source sc/uiconfig sd/uiconfig sw/uiconfig

Yousuf Philips philipz85 at hotmail.com
Wed Oct 14 01:03:44 PDT 2015


 framework/source/uielement/menubarmanager.cxx |   55 +++++++++++++++++---------
 sc/uiconfig/scalc/toolbar/drawbar.xml         |    2 
 sd/uiconfig/sdraw/toolbar/toolbar.xml         |    2 
 sw/uiconfig/swriter/menubar/menubar.xml       |    4 -
 sw/uiconfig/swriter/toolbar/drawbar.xml       |    2 
 5 files changed, 38 insertions(+), 27 deletions(-)

New commits:
commit be6440f4624be4da84ac8b71e66297d3e43ca249
Author: Yousuf Philips <philipz85 at hotmail.com>
Date:   Sun Oct 4 21:14:00 2015 +0400

    tdf#91097 Substitute rectangle and ellipse uno commands
    
    (cherry picked from commit 3080e4c09b7c4894d4f0f52c9beed4298f3fd23f)
    (cherry picked from commit fedf965c51a9f57e5cde203a3d15a6c244558002)
    (cherry picked from commit 4c2339d8177d610cc23619e787c1517ce8e8afd7)
    (cherry picked from commit 1bc911eca173131fdc6e7e3889d128fa03adbf72)
    
    Conflicts:
    	framework/source/uielement/menubarmanager.cxx
    	sc/uiconfig/scalc/menubar/menubar.xml
    	sd/uiconfig/simpress/menubar/menubar.xml
    	sw/uiconfig/swriter/menubar/menubar.xml
    
    Change-Id: Ib6578ddd7897d9c5d63b5dc8d8465f6107cc24a6
    Reviewed-on: https://gerrit.libreoffice.org/19345
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 62400e4..9e36073 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -76,6 +76,7 @@
 #include <svtools/acceleratorexecute.hxx>
 #include <svtools/miscopt.hxx>
 #include <uielement/menubarmerger.hxx>
+#include <tools/urlobj.hxx>
 
 // Be careful removing this "bad" construct. There are serious problems
 // with #define STRICT and including windows.h. Changing this needs some
@@ -436,29 +437,45 @@ throw ( RuntimeException, std::exception )
                 }
                 else if ( Event.State >>= aItemText )
                 {
-                    // Replacement for place holders
-                    if ( aItemText.startsWith("($1)") )
+                    INetURLObject aURL( aFeatureURL );
+                    OUString aEnumPart = aURL.GetURLPath().getToken( 1, '.' );
+                    if ( !aEnumPart.isEmpty() && aURL.GetProtocol() == INetProtocol::Uno )
                     {
-                        OUString aTmp(FWK_RESSTR(STR_UPDATEDOC));
-                        aTmp += " ";
-                        aTmp += aItemText.copy( 4 );
-                        aItemText = aTmp;
+                        // Checkmark or RadioButton
+                        m_pVCLMenu->ShowItem( pMenuItemHandler->nItemId, true );
+                        m_pVCLMenu->CheckItem( pMenuItemHandler->nItemId, aItemText == aEnumPart );
+
+                        MenuItemBits nBits = m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId );
+                        //If not already designated RadioButton set as CheckMark
+                        if (!(nBits & MenuItemBits::RADIOCHECK))
+                            m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId, nBits | MenuItemBits::CHECKABLE );
                     }
-                    else if ( aItemText.startsWith("($2)") )
-                    {
-                        OUString aTmp(FWK_RESSTR(STR_CLOSEDOC_ANDRETURN));
-                        aTmp += aItemText.copy( 4 );
-                        aItemText = aTmp;
-                    }
-                    else if ( aItemText.startsWith("($3)") )
+                    else
                     {
-                        OUString aTmp(FWK_RESSTR(STR_SAVECOPYDOC));
-                        aTmp += aItemText.copy( 4 );
-                        aItemText = aTmp;
-                    }
+                        // Replacement for place holders
+                        if ( aItemText.startsWith("($1)") )
+                        {
+                            OUString aTmp(FWK_RESSTR(STR_UPDATEDOC));
+                            aTmp += " ";
+                            aTmp += aItemText.copy( 4 );
+                            aItemText = aTmp;
+                        }
+                        else if ( aItemText.startsWith("($2)") )
+                        {
+                            OUString aTmp(FWK_RESSTR(STR_CLOSEDOC_ANDRETURN));
+                            aTmp += aItemText.copy( 4 );
+                            aItemText = aTmp;
+                        }
+                        else if ( aItemText.startsWith("($3)") )
+                        {
+                            OUString aTmp(FWK_RESSTR(STR_SAVECOPYDOC));
+                            aTmp += aItemText.copy( 4 );
+                            aItemText = aTmp;
+                        }
 
-                    m_pVCLMenu->ShowItem( pMenuItemHandler->nItemId, true );
-                    m_pVCLMenu->SetItemText( pMenuItemHandler->nItemId, aItemText );
+                        m_pVCLMenu->ShowItem( pMenuItemHandler->nItemId, true );
+                        m_pVCLMenu->SetItemText( pMenuItemHandler->nItemId, aItemText );
+                    }
                 }
                 else if ( Event.State >>= aVisibilityStatus )
                 {
diff --git a/sc/uiconfig/scalc/toolbar/drawbar.xml b/sc/uiconfig/scalc/toolbar/drawbar.xml
index 4dc2424..f4bf9a7 100644
--- a/sc/uiconfig/scalc/toolbar/drawbar.xml
+++ b/sc/uiconfig/scalc/toolbar/drawbar.xml
@@ -25,11 +25,9 @@
  <toolbar:toolbaritem xlink:href=".uno:Polygon_Unfilled" toolbar:helpid="10395"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:Line" toolbar:helpid="10102"/>
- <toolbar:toolbaritem xlink:href=".uno:Rect" toolbar:helpid="10104" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.rectangle"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.quadrat" toolbar:visible="false"/>
- <toolbar:toolbaritem xlink:href=".uno:Ellipse" toolbar:helpid="10110" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ellipse" toolbar:helpid="10110"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Arc" toolbar:visible="false" toolbar:helpid="10114"/>
diff --git a/sd/uiconfig/sdraw/toolbar/toolbar.xml b/sd/uiconfig/sdraw/toolbar/toolbar.xml
index 79c1c7d..5ecd2d9 100644
--- a/sd/uiconfig/sdraw/toolbar/toolbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/toolbar.xml
@@ -37,9 +37,7 @@
  <toolbar:toolbaritem xlink:href=".uno:Freeline_Unfilled" toolbar:style="radio" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Bezier_Unfilled" toolbar:style="radio" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.rectangle" toolbar:style="radio"/>
- <toolbar:toolbaritem xlink:href=".uno:Rect" toolbar:helpid="10104" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ellipse" toolbar:style="radio"/>
- <toolbar:toolbaritem xlink:href=".uno:Ellipse" toolbar:helpid="10110" toolbar:visible="false"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ArrowsToolbox" toolbar:style="radio dropdown"/>
  <toolbar:toolbaritem xlink:href=".uno:LineToolbox" toolbar:style="radio dropdown"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index e290530..a7184c3 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -239,8 +239,8 @@
       <menu:menu menu:id=".uno:ShapesMenu">
        <menu:menupopup>
         <menu:menuitem menu:id=".uno:Line"/>
-        <menu:menuitem menu:id=".uno:Rect"/>
-        <menu:menuitem menu:id=".uno:Ellipse"/>
+        <menu:menuitem menu:id=".uno:BasicShapes.rectangle"/>
+        <menu:menuitem menu:id=".uno:BasicShapes.ellipse"/>
         <menu:menuitem menu:id=".uno:Polygon_Unfilled"/>
        </menu:menupopup>
       </menu:menu>
diff --git a/sw/uiconfig/swriter/toolbar/drawbar.xml b/sw/uiconfig/swriter/toolbar/drawbar.xml
index df7353b..b025ff5 100644
--- a/sw/uiconfig/swriter/toolbar/drawbar.xml
+++ b/sw/uiconfig/swriter/toolbar/drawbar.xml
@@ -29,11 +29,9 @@
  <toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal_Unfilled" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal" toolbar:visible="false"/>
  <toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:Rect" toolbar:helpid="10104" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.rectangle" toolbar:helpid="10104"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.quadrat"/>
- <toolbar:toolbaritem xlink:href=".uno:Ellipse" toolbar:helpid="10110" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ellipse" toolbar:helpid="10110"/>
  <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle"/>
  <toolbar:toolbaritem xlink:href=".uno:Arc" toolbar:helpid="10114" toolbar:visible="false"/>


More information about the Libreoffice-commits mailing list