Kaydet (Commit) 8d119cc1 authored tarafından Yousuf Philips's avatar Yousuf Philips Kaydeden (comit) Andras Timar

tdf#91097 Substitute rectangle and ellipse uno commands

(cherry picked from commit 3080e4c0)
(cherry picked from commit fedf965c)
(cherry picked from commit 4c2339d8)
(cherry picked from commit 1bc911ec)

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/19345Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit be6440f4)
üst 6ee21858
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include <svtools/acceleratorexecute.hxx> #include <svtools/acceleratorexecute.hxx>
#include <svtools/miscopt.hxx> #include <svtools/miscopt.hxx>
#include <uielement/menubarmerger.hxx> #include <uielement/menubarmerger.hxx>
#include <tools/urlobj.hxx>
// Be careful removing this "bad" construct. There are serious problems // Be careful removing this "bad" construct. There are serious problems
// with #define STRICT and including windows.h. Changing this needs some // with #define STRICT and including windows.h. Changing this needs some
...@@ -436,29 +437,45 @@ throw ( RuntimeException, std::exception ) ...@@ -436,29 +437,45 @@ throw ( RuntimeException, std::exception )
} }
else if ( Event.State >>= aItemText ) else if ( Event.State >>= aItemText )
{ {
// Replacement for place holders INetURLObject aURL( aFeatureURL );
if ( aItemText.startsWith("($1)") ) OUString aEnumPart = aURL.GetURLPath().getToken( 1, '.' );
if ( !aEnumPart.isEmpty() && aURL.GetProtocol() == INetProtocol::Uno )
{ {
OUString aTmp(FWK_RESSTR(STR_UPDATEDOC)); // Checkmark or RadioButton
aTmp += " "; m_pVCLMenu->ShowItem( pMenuItemHandler->nItemId, true );
aTmp += aItemText.copy( 4 ); m_pVCLMenu->CheckItem( pMenuItemHandler->nItemId, aItemText == aEnumPart );
aItemText = aTmp;
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)") ) else
{
OUString aTmp(FWK_RESSTR(STR_CLOSEDOC_ANDRETURN));
aTmp += aItemText.copy( 4 );
aItemText = aTmp;
}
else if ( aItemText.startsWith("($3)") )
{ {
OUString aTmp(FWK_RESSTR(STR_SAVECOPYDOC)); // Replacement for place holders
aTmp += aItemText.copy( 4 ); if ( aItemText.startsWith("($1)") )
aItemText = aTmp; {
} 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->ShowItem( pMenuItemHandler->nItemId, true );
m_pVCLMenu->SetItemText( pMenuItemHandler->nItemId, aItemText ); m_pVCLMenu->SetItemText( pMenuItemHandler->nItemId, aItemText );
}
} }
else if ( Event.State >>= aVisibilityStatus ) else if ( Event.State >>= aVisibilityStatus )
{ {
......
...@@ -25,11 +25,9 @@ ...@@ -25,11 +25,9 @@
<toolbar:toolbaritem xlink:href=".uno:Polygon_Unfilled" toolbar:helpid="10395"/> <toolbar:toolbaritem xlink:href=".uno:Polygon_Unfilled" toolbar:helpid="10395"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:Line" toolbar:helpid="10102"/> <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.rectangle"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle" toolbar:visible="false"/> <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: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.ellipse" toolbar:helpid="10110"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Arc" toolbar:visible="false" toolbar:helpid="10114"/> <toolbar:toolbaritem xlink:href=".uno:Arc" toolbar:visible="false" toolbar:helpid="10114"/>
......
...@@ -37,9 +37,7 @@ ...@@ -37,9 +37,7 @@
<toolbar:toolbaritem xlink:href=".uno:Freeline_Unfilled" toolbar:style="radio" toolbar:visible="false"/> <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:Bezier_Unfilled" toolbar:style="radio" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.rectangle" toolbar:style="radio"/> <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:BasicShapes.ellipse" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:Ellipse" toolbar:helpid="10110" toolbar:visible="false"/>
<toolbar:toolbarseparator/> <toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:ArrowsToolbox" toolbar:style="radio dropdown"/> <toolbar:toolbaritem xlink:href=".uno:ArrowsToolbox" toolbar:style="radio dropdown"/>
<toolbar:toolbaritem xlink:href=".uno:LineToolbox" toolbar:style="radio dropdown"/> <toolbar:toolbaritem xlink:href=".uno:LineToolbox" toolbar:style="radio dropdown"/>
......
...@@ -239,8 +239,8 @@ ...@@ -239,8 +239,8 @@
<menu:menu menu:id=".uno:ShapesMenu"> <menu:menu menu:id=".uno:ShapesMenu">
<menu:menupopup> <menu:menupopup>
<menu:menuitem menu:id=".uno:Line"/> <menu:menuitem menu:id=".uno:Line"/>
<menu:menuitem menu:id=".uno:Rect"/> <menu:menuitem menu:id=".uno:BasicShapes.rectangle"/>
<menu:menuitem menu:id=".uno:Ellipse"/> <menu:menuitem menu:id=".uno:BasicShapes.ellipse"/>
<menu:menuitem menu:id=".uno:Polygon_Unfilled"/> <menu:menuitem menu:id=".uno:Polygon_Unfilled"/>
</menu:menupopup> </menu:menupopup>
</menu:menu> </menu:menu>
......
...@@ -29,11 +29,9 @@ ...@@ -29,11 +29,9 @@
<toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal_Unfilled" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal_Unfilled" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal" toolbar:visible="false"/>
<toolbar:toolbarseparator/> <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.rectangle" toolbar:helpid="10104"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle"/> <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.quadrat"/> <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.ellipse" toolbar:helpid="10110"/>
<toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle"/> <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle"/>
<toolbar:toolbaritem xlink:href=".uno:Arc" toolbar:helpid="10114" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:Arc" toolbar:helpid="10114" toolbar:visible="false"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment