Kaydet (Commit) 4ebfc203 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

tdf#96075 Frame alignment buttons not using correct tooltips

Tooltips change on state change, and they were taken from another source.
Unify this to reuse the existing strings from the uno command.

Change-Id: I8ff6fc43bc0469f15c9e930695d950f6d664bfdf
Reviewed-on: https://gerrit.libreoffice.org/20629Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit ba659f71)
Reviewed-on: https://gerrit.libreoffice.org/20631
üst aac08c38
...@@ -59,10 +59,8 @@ ...@@ -59,10 +59,8 @@
#define STR_TOP_BASE (RC_GLOBALS_BEGIN + 31) #define STR_TOP_BASE (RC_GLOBALS_BEGIN + 31)
#define STR_BOTTOM_BASE (RC_GLOBALS_BEGIN + 32) #define STR_BOTTOM_BASE (RC_GLOBALS_BEGIN + 32)
#define STR_CENTER_BASE (RC_GLOBALS_BEGIN + 33) #define STR_CENTER_BASE (RC_GLOBALS_BEGIN + 33)
#define STR_TOP (RC_GLOBALS_BEGIN + 34)
#define STR_BOTTOM (RC_GLOBALS_BEGIN + 35) // free
#define STR_CENTER_HORI (RC_GLOBALS_BEGIN + 36)
#define STR_CENTER_VERT (RC_GLOBALS_BEGIN + 37)
#define STR_LOAD_HTML_DOC (RC_GLOBALS_BEGIN + 38) #define STR_LOAD_HTML_DOC (RC_GLOBALS_BEGIN + 38)
......
...@@ -18,25 +18,6 @@ ...@@ -18,25 +18,6 @@
*/ */
#include "frmui.hrc" #include "frmui.hrc"
/*-----------------------------------------------------------------------
Description: V-Align
-----------------------------------------------------------------------*/
String STR_TOP
{
Text [ en-US ] = "~Top" ;
};
String STR_BOTTOM
{
Text [ en-US ] = "~Bottom" ;
};
String STR_CENTER_VERT
{
Text [ en-US ] = "C~enter" ;
};
String STR_CENTER_HORI
{
Text [ en-US ] = "~Center" ;
};
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
Description: V-Rel Description: V-Rel
-----------------------------------------------------------------------*/ -----------------------------------------------------------------------*/
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <svx/hlnkitem.hxx> #include <svx/hlnkitem.hxx>
#include <svx/svdview.hxx> #include <svx/svdview.hxx>
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <drawdoc.hxx> #include <drawdoc.hxx>
...@@ -739,21 +740,25 @@ void SwFrameShell::GetState(SfxItemSet& rSet) ...@@ -739,21 +740,25 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( nWhich ); rSet.DisableItem( nWhich );
else else
{ {
sal_uInt16 nId = 0; // These slots need different labels depending on whether they are anchored in a character
// or on a paragraph/page etc.
OUString sNewLabel;
if (eFrameType & FrameTypeFlags::FLY_INCNT) if (eFrameType & FrameTypeFlags::FLY_INCNT)
{ {
switch (nWhich) switch (nWhich)
{ {
case SID_OBJECT_ALIGN_UP : case SID_OBJECT_ALIGN_UP :
case FN_FRAME_ALIGN_VERT_TOP: case FN_FRAME_ALIGN_VERT_TOP:
nId = STR_TOP_BASE; break; sNewLabel = SW_RES(STR_TOP_BASE);
break;
case SID_OBJECT_ALIGN_MIDDLE : case SID_OBJECT_ALIGN_MIDDLE :
case FN_FRAME_ALIGN_VERT_CENTER: case FN_FRAME_ALIGN_VERT_CENTER:
nId = STR_CENTER_BASE; break; sNewLabel = SW_RES(STR_CENTER_BASE);
break;
case SID_OBJECT_ALIGN_DOWN : case SID_OBJECT_ALIGN_DOWN :
case FN_FRAME_ALIGN_VERT_BOTTOM: case FN_FRAME_ALIGN_VERT_BOTTOM:
if(!bHtmlMode) if(!bHtmlMode)
nId = STR_BOTTOM_BASE; sNewLabel = SW_RES(STR_BOTTOM_BASE);
else else
rSet.DisableItem( nWhich ); rSet.DisableItem( nWhich );
break; break;
...@@ -782,17 +787,20 @@ void SwFrameShell::GetState(SfxItemSet& rSet) ...@@ -782,17 +787,20 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
{ {
case SID_OBJECT_ALIGN_UP : case SID_OBJECT_ALIGN_UP :
case FN_FRAME_ALIGN_VERT_TOP: case FN_FRAME_ALIGN_VERT_TOP:
nId = STR_TOP; break; sNewLabel = vcl::CommandInfoProvider::Instance().GetLabelForCommand(".uno:AlignTop", GetFrame()->GetFrame().GetFrameInterface());
break;
case SID_OBJECT_ALIGN_MIDDLE: case SID_OBJECT_ALIGN_MIDDLE:
case FN_FRAME_ALIGN_VERT_CENTER: case FN_FRAME_ALIGN_VERT_CENTER:
nId = STR_CENTER_VERT; break; sNewLabel = vcl::CommandInfoProvider::Instance().GetLabelForCommand(".uno:AlignVerticalCenter", GetFrame()->GetFrame().GetFrameInterface());
break;
case SID_OBJECT_ALIGN_DOWN: case SID_OBJECT_ALIGN_DOWN:
case FN_FRAME_ALIGN_VERT_BOTTOM: case FN_FRAME_ALIGN_VERT_BOTTOM:
nId = STR_BOTTOM; break; sNewLabel = vcl::CommandInfoProvider::Instance().GetLabelForCommand(".uno:AlignBottom", GetFrame()->GetFrame().GetFrameInterface());
break;
} }
} }
if ( nId ) if ( !sNewLabel.isEmpty() )
rSet.Put( SfxStringItem( nWhich, SW_RES(nId) )); rSet.Put( SfxStringItem( nWhich, sNewLabel ));
} }
break; break;
case SID_HYPERLINK_GETLINK: case SID_HYPERLINK_GETLINK:
......
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