include/svx/strings.hrc          |    5 +++++
 svx/source/tbxctrls/tbcontrl.cxx |   35 ++++++++++++++++++-----------------
 2 files changed, 23 insertions(+), 17 deletions(-)

New commits:
commit 6065e4f400390702080c7de3bcc3de670453a347
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Mar 3 11:03:48 2021 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Mar 4 08:15:11 2021 +0100

    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.wegh...@posteo.de>

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index c8f71976d322..1b59e4d765e8 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1765,12 +1765,17 @@
 #define RID_SVXSTR_TABLE_PRESET_ONLYOUTER           
NC_("RID_SVXSTR_TABLE_PRESET_ONLYOUTER", "Set Outer Border Only")
 #define RID_SVXSTR_TABLE_PRESET_OUTERHORI           
NC_("RID_SVXSTR_TABLE_PRESET_OUTERHORI", "Set Outer Border and Horizontal 
Lines")
 #define RID_SVXSTR_TABLE_PRESET_OUTERALL            
NC_("RID_SVXSTR_TABLE_PRESET_OUTERALL", "Set Outer Border and All Inner Lines")
+#define RID_SVXSTR_TABLE_PRESET_OUTERVERI           
NC_("RID_SVXSTR_TABLE_PRESET_OUTERVERI", "Set Outer Border and Vertical Lines")
 #define RID_SVXSTR_TABLE_PRESET_OUTERINNER          
NC_("RID_SVXSTR_TABLE_PRESET_OUTERINNER", "Set Outer Border Without Changing 
Inner Lines")
 #define RID_SVXSTR_PARA_PRESET_DIAGONAL             
NC_("RID_SVXSTR_PARA_PRESET_DIAGONAL", "Set Diagonal Lines Only")
 #define RID_SVXSTR_PARA_PRESET_ALL                  
NC_("RID_SVXSTR_PARA_PRESET_ALL", "Set All Four Borders")
 #define RID_SVXSTR_PARA_PRESET_LEFTRIGHT            
NC_("RID_SVXSTR_PARA_PRESET_LEFTRIGHT", "Set Left and Right Borders Only")
 #define RID_SVXSTR_PARA_PRESET_TOPBOTTOM            
NC_("RID_SVXSTR_PARA_PRESET_TOPBOTTOM", "Set Top and Bottom Borders Only")
+#define RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI        
NC_("RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI", "Set Top and Bottom Borders, and 
All Horizontal Lines")
 #define RID_SVXSTR_PARA_PRESET_ONLYLEFT             
NC_("RID_SVXSTR_PARA_PRESET_ONLYLEFT", "Set Left Border Only")
+#define RID_SVXSTR_PARA_PRESET_ONLYRIGHT            
NC_("RID_SVXSTR_PARA_PRESET_ONLYRIGHT", "Set Right Border Only")
+#define RID_SVXSTR_PARA_PRESET_ONLYTOP              
NC_("RID_SVXSTR_PARA_PRESET_ONLYTOP", "Set Top Border Only")
+#define RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM          
NC_("RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM", "Set Bottom Border Only")
 #define RID_SVXSTR_HOR_PRESET_ONLYHOR               
NC_("RID_SVXSTR_HOR_PRESET_ONLYHOR", "Set Top and Bottom Borders, and All Inner 
Lines")
 #define RID_SVXSTR_VER_PRESET_ONLYVER               
NC_("RID_SVXSTR_VER_PRESET_ONLYVER", "Set Left and Right Borders, and All Inner 
Lines")
 
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*/ )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to