summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2021-03-03 11:03:48 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2021-03-04 08:15:11 +0100
commit6065e4f400390702080c7de3bcc3de670453a347 (patch)
treeccf8af95788bf8f490a5053d11f122993b18312c /svx/source
parent0cbd8a5d4571cdf3601ca8deb64d734d35e234f9 (diff)
tdf#140762 Set texts for items in "Borders" dropdown button
Associate textual descriptions with the images for the items in the "Borders" dropdown button in Calc's formatting toolbar. This e.g. makes them show up as tooltips when hovering over the images with the mouse and makes them accessible to screen readers (e.g. Orca with the gtk3 VCL plugin now says those texts instead of just saying "item 1", "item 2",...). This also adds the strings for the items where no corresponding ones exist yet. Change-Id: I02ce8abfa4aa59e06ca1ab45aff0685a19c323f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111871 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx35
1 files changed, 18 insertions, 17 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index c2765155c3b8..e9cb9b1a0d31 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -453,7 +453,7 @@ private:
rtl::Reference<SvxFrameToolBoxControl> mxControl;
std::unique_ptr<SvxFrmValueSet_Impl> mxFrameSet;
std::unique_ptr<weld::CustomWeld> mxFrameSetWin;
- std::vector<BitmapEx> aImgVec;
+ std::vector<std::pair<BitmapEx, OUString>> aImgVec;
bool bParagraphMode;
void InitImageList();
@@ -2180,12 +2180,12 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl, weld:
sal_uInt16 i = 0;
for ( i=1; i<9; i++ )
- mxFrameSet->InsertItem(i, Image(aImgVec[i-1]));
+ mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second);
//bParagraphMode should have been set in StateChanged
if ( !bParagraphMode )
for ( i = 9; i < 13; i++ )
- mxFrameSet->InsertItem(i, Image(aImgVec[i-1]));
+ mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second);
mxFrameSet->SetColCount( 4 );
mxFrameSet->SetSelectHdl( LINK( this, SvxFrameWindow_Impl, SelectHdl ) );
@@ -2354,7 +2354,7 @@ void SvxFrameWindow_Impl::statusChanged( const css::frame::FeatureStateEvent& rE
else if ( !bTableMode && !bParagraphMode )
{
for ( sal_uInt16 i = 9; i < 13; i++ )
- mxFrameSet->InsertItem(i, Image(aImgVec[i-1]));
+ mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second);
bResize = true;
}
@@ -2376,19 +2376,20 @@ void SvxFrameWindow_Impl::CalcSizeValueSet()
void SvxFrameWindow_Impl::InitImageList()
{
- aImgVec.clear();
- aImgVec.emplace_back(RID_SVXBMP_FRAME1);
- aImgVec.emplace_back(RID_SVXBMP_FRAME2);
- aImgVec.emplace_back(RID_SVXBMP_FRAME3);
- aImgVec.emplace_back(RID_SVXBMP_FRAME4);
- aImgVec.emplace_back(RID_SVXBMP_FRAME5);
- aImgVec.emplace_back(RID_SVXBMP_FRAME6);
- aImgVec.emplace_back(RID_SVXBMP_FRAME7);
- aImgVec.emplace_back(RID_SVXBMP_FRAME8);
- aImgVec.emplace_back(RID_SVXBMP_FRAME9);
- aImgVec.emplace_back(RID_SVXBMP_FRAME10);
- aImgVec.emplace_back(RID_SVXBMP_FRAME11);
- aImgVec.emplace_back(RID_SVXBMP_FRAME12);
+ aImgVec = {
+ {BitmapEx(RID_SVXBMP_FRAME1), SvxResId(RID_SVXSTR_TABLE_PRESET_NONE)},
+ {BitmapEx(RID_SVXBMP_FRAME2), SvxResId(RID_SVXSTR_PARA_PRESET_ONLYLEFT)},
+ {BitmapEx(RID_SVXBMP_FRAME3), SvxResId(RID_SVXSTR_PARA_PRESET_ONLYRIGHT)},
+ {BitmapEx(RID_SVXBMP_FRAME4), SvxResId(RID_SVXSTR_PARA_PRESET_LEFTRIGHT)},
+ {BitmapEx(RID_SVXBMP_FRAME5), SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTOP)},
+ {BitmapEx(RID_SVXBMP_FRAME6), SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM)},
+ {BitmapEx(RID_SVXBMP_FRAME7), SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOM)},
+ {BitmapEx(RID_SVXBMP_FRAME8), SvxResId(RID_SVXSTR_TABLE_PRESET_ONLYOUTER)},
+ {BitmapEx(RID_SVXBMP_FRAME9), SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI)},
+ {BitmapEx(RID_SVXBMP_FRAME10), SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERHORI)},
+ {BitmapEx(RID_SVXBMP_FRAME11), SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERVERI)},
+ {BitmapEx(RID_SVXBMP_FRAME12), SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERALL)}
+ };
}
static Color lcl_mediumColor( Color aMain, Color /*aDefault*/ )