[Libreoffice-commits] core.git: 2 commits - cui/source extensions/source include/vcl sc/inc sc/source sc/uiconfig sd/source sw/source vcl/headless vcl/source vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Dec 2 10:10:57 UTC 2018


 cui/source/dialogs/cuigaldlg.cxx                 |    2 
 cui/source/dialogs/showcols.cxx                  |    2 
 cui/source/tabpages/numpages.cxx                 |    4 
 extensions/source/propctrlr/listselectiondlg.cxx |    2 
 include/vcl/BitmapTools.hxx                      |    5 
 include/vcl/seleng.hxx                           |    4 
 include/vcl/vclenum.hxx                          |    2 
 include/vcl/weld.hxx                             |    2 
 sc/inc/strings.hrc                               |    3 
 sc/source/ui/docshell/docsh4.cxx                 |   11 -
 sc/source/ui/inc/sharedocdlg.hxx                 |   22 +--
 sc/source/ui/miscdlgs/instbdlg.cxx               |    2 
 sc/source/ui/miscdlgs/linkarea.cxx               |    2 
 sc/source/ui/miscdlgs/sharedocdlg.cxx            |  115 ++++++-----------
 sc/source/ui/miscdlgs/shtabdlg.cxx               |    2 
 sc/uiconfig/scalc/ui/sharedocumentdlg.ui         |  151 +++++++++--------------
 sd/source/ui/dlg/custsdlg.cxx                    |    2 
 sw/source/ui/misc/num.cxx                        |    4 
 vcl/headless/svpgdi.cxx                          |   53 --------
 vcl/source/app/salvtables.cxx                    |    4 
 vcl/source/bitmap/BitmapTools.cxx                |  123 ++++++++++++------
 vcl/unx/gtk3/gtk3gtkinst.cxx                     |   25 +++
 22 files changed, 252 insertions(+), 290 deletions(-)

New commits:
commit 48d1df74036386ce19cfabd64d90afcd1532d5c9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Dec 1 19:41:15 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Dec 2 11:10:45 2018 +0100

    use same [un]premultiply
    
    Change-Id: Idd1ca1243b64a9ec606382a0895e11376a2ec186
    Reviewed-on: https://gerrit.libreoffice.org/64406
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index 6a8f6c8b9605..ff431783ad24 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -28,6 +28,11 @@ namespace com { namespace sun { namespace star { namespace geometry { struct Int
 namespace vcl {
 namespace bitmap {
 
+typedef sal_uInt8 (*lookup_table)[256];
+
+lookup_table VCL_DLLPUBLIC get_premultiply_table();
+lookup_table VCL_DLLPUBLIC get_unpremultiply_table();
+
 /**
  * Intended to be used to feed into CreateFromData to create a BitmapEx. RGB data format.
  */
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index ec01ec520a86..c936b0e1cbbe 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -29,6 +29,7 @@
 
 #include <sal/log.hxx>
 #include <o3tl/safeint.hxx>
+#include <vcl/BitmapTools.hxx>
 #include <vcl/sysdata.hxx>
 #include <config_cairo_canvas.h>
 #include <basegfx/numeric/ftools.hxx>
@@ -1639,50 +1640,6 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect& rTR,
     drawAlphaBitmap(rTR, rSourceBitmap, rTransparentBitmap);
 }
 
-static sal_uInt8 unpremultiply(sal_uInt8 c, sal_uInt8 a)
-{
-    return (a == 0) ? 0 : (c * 255 + a / 2) / a;
-}
-
-static sal_uInt8 premultiply(sal_uInt8 c, sal_uInt8 a)
-{
-    return (c * a + 127) / 255;
-}
-
-typedef sal_uInt8 (*lookup_table)[256];
-
-static lookup_table get_unpremultiply_table()
-{
-    static bool inited;
-    static sal_uInt8 unpremultiply_table[256][256];
-
-    if (!inited)
-    {
-        for (int a = 0; a < 256; ++a)
-            for (int c = 0; c < 256; ++c)
-                unpremultiply_table[a][c] = unpremultiply(c, a);
-        inited = true;
-    }
-
-    return unpremultiply_table;
-}
-
-static lookup_table get_premultiply_table()
-{
-    static bool inited;
-    static sal_uInt8 premultiply_table[256][256];
-
-    if (!inited)
-    {
-        for (int a = 0; a < 256; ++a)
-            for (int c = 0; c < 256; ++c)
-                premultiply_table[a][c] = premultiply(c, a);
-        inited = true;
-    }
-
-    return premultiply_table;
-}
-
 void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
                                const SalBitmap& rSalBitmap,
                                Color nMaskColor )
@@ -1697,7 +1654,7 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
     }
     sal_Int32 nStride;
     unsigned char *mask_data = aSurface.getBits(nStride);
-    lookup_table unpremultiply_table = get_unpremultiply_table();
+    vcl::bitmap::lookup_table unpremultiply_table = vcl::bitmap::get_unpremultiply_table();
     for (long y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
     {
         unsigned char *row = mask_data + (nStride*y);
@@ -1805,7 +1762,7 @@ Color SvpSalGraphics::getPixel( long nX, long nY )
     cairo_destroy(cr);
 
     cairo_surface_flush(target);
-    lookup_table unpremultiply_table = get_unpremultiply_table();
+    vcl::bitmap::lookup_table unpremultiply_table = vcl::bitmap::get_unpremultiply_table();
     unsigned char *data = cairo_image_surface_get_data(target);
     sal_uInt8 a = data[SVP_CAIRO_ALPHA];
     sal_uInt8 b = unpremultiply_table[a][data[SVP_CAIRO_BLUE]];
@@ -2139,8 +2096,8 @@ void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, cons
         sal_Int32 nUnscaledExtentsRight = nExtentsRight * m_fScale;
         sal_Int32 nUnscaledExtentsTop = nExtentsTop * m_fScale;
         sal_Int32 nUnscaledExtentsBottom = nExtentsBottom * m_fScale;
-        lookup_table unpremultiply_table = get_unpremultiply_table();
-        lookup_table premultiply_table = get_premultiply_table();
+        vcl::bitmap::lookup_table unpremultiply_table = vcl::bitmap::get_unpremultiply_table();
+        vcl::bitmap::lookup_table premultiply_table = vcl::bitmap::get_premultiply_table();
         for (sal_Int32 y = nUnscaledExtentsTop; y < nUnscaledExtentsBottom; ++y)
         {
             unsigned char *true_row = target_surface_data + (nStride*y);
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index 317ef0495195..4bac9745795e 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -268,6 +268,7 @@ BitmapEx* CreateFromCairoSurface(Size aSize, cairo_surface_t * pSurface)
     cairo_surface_flush(pPixels);
     unsigned char *pSrc = cairo_image_surface_get_data( pPixels );
     unsigned int nStride = cairo_image_surface_get_stride( pPixels );
+    vcl::bitmap::lookup_table unpremultiply_table = vcl::bitmap::get_unpremultiply_table();
     for( unsigned long y = 0; y < static_cast<unsigned long>(aSize.Height()); y++ )
     {
         sal_uInt32 *pPix = reinterpret_cast<sal_uInt32 *>(pSrc + nStride * y);
@@ -287,9 +288,9 @@ BitmapEx* CreateFromCairoSurface(Size aSize, cairo_surface_t * pSurface)
             if( nAlpha != 0 && nAlpha != 255 )
             {
                 // Cairo uses pre-multiplied alpha - we do not => re-multiply
-                nR = static_cast<sal_uInt8>(MinMax( (static_cast<sal_uInt32>(nR) * 255) / nAlpha, 0, 255 ));
-                nG = static_cast<sal_uInt8>(MinMax( (static_cast<sal_uInt32>(nG) * 255) / nAlpha, 0, 255 ));
-                nB = static_cast<sal_uInt8>(MinMax( (static_cast<sal_uInt32>(nB) * 255) / nAlpha, 0, 255 ));
+                nR = unpremultiply_table[nAlpha][nR];
+                nG = unpremultiply_table[nAlpha][nG];
+                nB = unpremultiply_table[nAlpha][nB];
             }
             pRGBWrite->SetPixel( y, x, BitmapColor( nR, nG, nB ) );
             pMaskWrite->SetPixelIndex( y, x, 255 - nAlpha );
@@ -726,6 +727,7 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
     ::Color aColor;
     unsigned int nAlpha = 255;
 
+    vcl::bitmap::lookup_table premultiply_table = vcl::bitmap::get_premultiply_table();
     for( nY = 0; nY < nHeight; nY++ )
     {
         ::Scanline pReadScan;
@@ -754,13 +756,13 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
                 aColor = pBitmapReadAcc->GetPaletteColor(*pReadScan++).GetColor();
 
 #ifdef OSL_BIGENDIAN
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetRed() ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetGreen() ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetBlue() ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetRed()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetGreen()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetBlue()];
 #else
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetBlue() ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetGreen() ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetRed() ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetBlue()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetGreen()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetRed()];
                 nOff++;
 #endif
             }
@@ -778,18 +780,18 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
                     nAlpha = data[ nOff ];
                 else
                     nAlpha = data[ nOff ] = 255;
-                data[ nOff + 3 ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff + 2 ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff + 1 ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
+                data[ nOff + 3 ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff + 2 ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff + 1 ] = premultiply_table[nAlpha][*pReadScan++];
                 nOff += 4;
 #else
                 if( pAlphaReadAcc )
                     nAlpha = data[ nOff + 3 ];
                 else
                     nAlpha = data[ nOff + 3 ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
                 nOff++;
 #endif
             }
@@ -807,17 +809,17 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
                     nAlpha = data[ nOff++ ];
                 else
                     nAlpha = data[ nOff++ ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
 #else
                 if( pAlphaReadAcc )
                     nAlpha = data[ nOff + 3 ];
                 else
                     nAlpha = data[ nOff + 3 ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 2 ] ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 1 ] ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 0 ] ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 2 ]];
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 1 ]];
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 0 ]];
                 pReadScan += 3;
                 nOff++;
 #endif
@@ -836,18 +838,18 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
                     nAlpha = data[ nOff++ ];
                 else
                     nAlpha = data[ nOff++ ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 2 ] ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 1 ] ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 0 ] ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 2 ]];
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 1 ]];
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 0 ]];
                 pReadScan += 4;
 #else
                 if( pAlphaReadAcc )
                     nAlpha = data[ nOff + 3 ];
                 else
                     nAlpha = data[ nOff + 3 ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
                 pReadScan++;
                 nOff++;
 #endif
@@ -866,18 +868,18 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
                     nAlpha = data[ nOff ++ ];
                 else
                     nAlpha = data[ nOff ++ ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
+                data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
                 pReadScan++;
 #else
                 if( pAlphaReadAcc )
                     nAlpha = data[ nOff + 3 ];
                 else
                     nAlpha = data[ nOff + 3 ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 2 ] ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 1 ] ) )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 0 ] ) )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 2 ]];
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 1 ]];
+                data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 0 ]];
                 pReadScan += 4;
                 nOff++;
 #endif
@@ -901,17 +903,17 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
                     nAlpha = data[ nOff++ ];
                 else
                     nAlpha = data[ nOff++ ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetRed() )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetGreen() )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetBlue() )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetRed()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetGreen()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetBlue()];
 #else
                 if( pAlphaReadAcc )
                     nAlpha = data[ nOff + 3 ];
                 else
                     nAlpha = data[ nOff + 3 ] = 255;
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetBlue() )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetGreen() )/255 );
-                data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetRed() )/255 );
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetBlue()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetGreen()];
+                data[ nOff++ ] = premultiply_table[nAlpha][aColor.GetRed()];
                 nOff ++;
 #endif
             }
@@ -1044,6 +1046,49 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
         return bRet;
     }
 
+    static sal_uInt8 unpremultiply(sal_uInt8 c, sal_uInt8 a)
+    {
+        return (a == 0) ? 0 : (c * 255 + a / 2) / a;
+    }
+
+    static sal_uInt8 premultiply(sal_uInt8 c, sal_uInt8 a)
+    {
+        return (c * a + 127) / 255;
+    }
+
+    lookup_table get_unpremultiply_table()
+    {
+        static bool inited;
+        static sal_uInt8 unpremultiply_table[256][256];
+
+        if (!inited)
+        {
+            for (int a = 0; a < 256; ++a)
+                for (int c = 0; c < 256; ++c)
+                    unpremultiply_table[a][c] = unpremultiply(c, a);
+            inited = true;
+        }
+
+        return unpremultiply_table;
+    }
+
+    lookup_table get_premultiply_table()
+    {
+        static bool inited;
+        static sal_uInt8 premultiply_table[256][256];
+
+        if (!inited)
+        {
+            for (int a = 0; a < 256; ++a)
+                for (int c = 0; c < 256; ++c)
+                    premultiply_table[a][c] = premultiply(c, a);
+            inited = true;
+        }
+
+        return premultiply_table;
+    }
+
+
 }} // end vcl::bitmap
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit cd5bef5e19c2812386ab6afee4b3bc43fe5541b9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Nov 30 13:29:23 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Dec 2 11:10:31 2018 +0100

    weld ScShareDocumentDlg
    
    Change-Id: I790f957c9ebc6d87a94a355c30215245aaabeb30
    Reviewed-on: https://gerrit.libreoffice.org/64345
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 49ae1aa8657b..42329f0e95b0 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -604,7 +604,7 @@ TPGalleryThemeProperties::TPGalleryThemeProperties(TabPageParent pWindow, const
 {
     m_xLbxFound->set_size_request(m_xLbxFound->get_approximate_digit_width() * 35,
                                   m_xLbxFound->get_height_rows(15));
-    m_xLbxFound->set_selection_mode(true);
+    m_xLbxFound->set_selection_mode(SelectionMode::Multiple);
     xDialogListener->SetDialogClosedLink( LINK( this, TPGalleryThemeProperties, DialogClosedHdl ) );
 }
 
diff --git a/cui/source/dialogs/showcols.cxx b/cui/source/dialogs/showcols.cxx
index e1a454038638..d9dca102beb8 100644
--- a/cui/source/dialogs/showcols.cxx
+++ b/cui/source/dialogs/showcols.cxx
@@ -33,7 +33,7 @@ FmShowColsDialog::FmShowColsDialog(weld::Window* pParent)
     , m_xOK(m_xBuilder->weld_button("ok"))
 {
     m_xList->set_size_request(m_xList->get_approximate_digit_width() * 40, m_xList->get_height_rows(8));
-    m_xList->set_selection_mode(true);
+    m_xList->set_selection_mode(SelectionMode::Multiple);
     m_xOK->connect_clicked(LINK(this, FmShowColsDialog, OnClickedOk));
 }
 
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index df31d118ae28..64b96bbfd562 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1099,7 +1099,7 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(TabPageParent pParent,
     m_xFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl));
     m_xBitmapMB->connect_selected(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl));
     m_xBitmapMB->connect_toggled(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl));
-    m_xLevelLB->set_selection_mode(true);
+    m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
     m_xLevelLB->connect_changed(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl));
     m_xCharFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl));
     m_xWidthMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
@@ -2540,7 +2540,7 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(TabPageParent pParent, const SfxIte
     m_xAlignedAtMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl));
     m_xIndentAtMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl));
 
-    m_xLevelLB->set_selection_mode(true);
+    m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
     m_xLevelLB->connect_changed(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl));
     m_xRelativeCB->connect_toggled(LINK(this, SvxNumPositionTabPage, RelativeHdl_Impl));
     m_xStandardPB->connect_clicked(LINK(this, SvxNumPositionTabPage, StandardHdl_Impl));
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index 5cbe35c7d3fc..29b3b19e3a58 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -72,7 +72,7 @@ namespace pcr
             // initialize the multi-selection flag
             bool bMultiSelection = false;
             OSL_VERIFY( m_xListBox->getPropertyValue( PROPERTY_MULTISELECTION ) >>= bMultiSelection );
-            m_xEntries->set_selection_mode(bMultiSelection);
+            m_xEntries->set_selection_mode(bMultiSelection ? SelectionMode::Single : SelectionMode::Multiple);
 
             // fill the list box with all entries
             Sequence< OUString > aListEntries;
diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx
index e3642330276d..a95bbedc15fc 100644
--- a/include/vcl/seleng.hxx
+++ b/include/vcl/seleng.hxx
@@ -23,6 +23,7 @@
 #include <vcl/dllapi.h>
 #include <vcl/timer.hxx>
 #include <vcl/event.hxx>
+#include <vcl/vclenum.hxx>
 #include <o3tl/typed_flags_set.hxx>
 
 namespace vcl { class Window; }
@@ -34,9 +35,6 @@ class CommandEvent;
 #define SELENG_AUTOREPEAT_INTERVAL_MIN 25
 #define SELENG_AUTOREPEAT_INTERVAL_MAX 300
 
-enum class SelectionMode { NONE, Single, Range, Multiple };
-
-
 class VCL_DLLPUBLIC FunctionSet
 {
 public:
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 4ada41058a22..a55c5b0ceb35 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -23,6 +23,8 @@
 #include <sal/types.h>
 #include <tools/fontenum.hxx>
 
+enum class SelectionMode { NONE, Single, Range, Multiple };
+
 enum class TimeFieldFormat : sal_Int32 { F_NONE, F_SEC, F_SEC_CS };
 
 enum class MenuItemType { DONTKNOW, STRING, IMAGE, STRINGIMAGE, SEPARATOR };
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 946966ca3214..e14c1b34ad45 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -528,7 +528,7 @@ public:
     virtual void set_column_fixed_widths(const std::vector<int>& rWidths) = 0;
     virtual OUString get_column_title(int nColumn) const = 0;
 
-    virtual void set_selection_mode(bool bMultiple) = 0;
+    virtual void set_selection_mode(SelectionMode eMode) = 0;
     virtual int count_selected_rows() const = 0;
 };
 
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index 7158305fe49f..682d02376a67 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -359,6 +359,9 @@
 #define STR_ANCHOR_TO_CELL_RESIZE                   NC_("STR_ANCHOR_TO_CELL_RESIZE", "To cell (resize with cell)")
 #define STR_ANCHOR_TO_PAGE                          NC_("STR_ANCHOR_TO_PAGE", "To page")
 
+#define STR_NO_USER_DATA_AVAILABLE                  NC_("sharedocumentdlg|nouserdata", "No user data available.")
+#define STR_EXCLUSIVE_ACCESS                        NC_("sharedocumentdlg|exclusive", "(exclusive access)")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index b24470891f00..ad89b34082a6 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -970,10 +970,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
                     break;
                 }
 
-                ScopedVclPtrInstance< ScShareDocumentDlg > aDlg( GetActiveDialogParent(), pViewData );
-                if ( aDlg->Execute() == RET_OK )
+                vcl::Window* pWin = GetActiveDialogParent();
+                ScShareDocumentDlg aDlg(pWin ? pWin->GetFrameWeld() : nullptr, pViewData);
+                if (aDlg.run() == RET_OK)
                 {
-                    bool bSetShared = aDlg->IsShareDocumentChecked();
+                    bool bSetShared = aDlg.IsShareDocumentChecked();
                     if ( bSetShared != IsDocShared() )
                     {
                         if ( bSetShared )
@@ -981,7 +982,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
                             bool bContinue = true;
                             if ( HasName() )
                             {
-                                vcl::Window* pWin = GetActiveDialogParent();
                                 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
                                                                                VclMessageType::Question, VclButtonsType::YesNo,
                                                                                ScResId(STR_REIMPORT_AFTER_LOAD)));
@@ -1073,7 +1073,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                         OUString aMessage( ScResId( STR_FILE_LOCKED_TRY_LATER ) );
                                         aMessage = aMessage.replaceFirst( "%1", aUserName );
 
-                                        vcl::Window* pWin = GetActiveDialogParent();
                                         std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
                                                                                    VclMessageType::Warning, VclButtonsType::Ok,
                                                                                    aMessage));
@@ -1081,7 +1080,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                     }
                                     else
                                     {
-                                        vcl::Window* pWin = GetActiveDialogParent();
                                         std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
                                                                                    VclMessageType::Warning, VclButtonsType::YesNo,
                                                                                    ScResId(STR_DOC_DISABLESHARED)));
@@ -1119,7 +1117,6 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                 else
                                 {
                                     xCloseable->close( true );
-                                    vcl::Window* pWin = GetActiveDialogParent();
                                     std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
                                                                                VclMessageType::Warning, VclButtonsType::Ok,
                                                                                ScResId(STR_DOC_NOLONGERSHARED)));
diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx
index 7a6d7a2c5451..ae1d28c9aafc 100644
--- a/sc/source/ui/inc/sharedocdlg.hxx
+++ b/sc/source/ui/inc/sharedocdlg.hxx
@@ -20,9 +20,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_SHAREDOCDLG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_SHAREDOCDLG_HXX
 
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
+#include <vcl/weld.hxx>
 #include <scdllapi.h>
 
 class ScViewData;
@@ -31,25 +29,25 @@ class SvSimpleTable;
 
 // class ScShareDocumentDlg
 
-class ScShareDocumentDlg : public ModalDialog
+class ScShareDocumentDlg : public weld::GenericDialogController
 {
 private:
-    VclPtr<CheckBox>           m_pCbShare;
-    VclPtr<FixedText>          m_pFtWarning;
-    VclPtr<SvSimpleTable>      m_pLbUsers;
-
     OUString            m_aStrNoUserData;
     OUString            m_aStrUnknownUser;
     OUString            m_aStrExclusiveAccess;
 
     ScDocShell*         mpDocShell;
 
-    DECL_LINK( ToggleHandle, CheckBox&, void );
+    std::unique_ptr<weld::CheckButton> m_xCbShare;
+    std::unique_ptr<weld::Label> m_xFtWarning;
+    std::unique_ptr<weld::TreeView> m_xLbUsers;
+
+    DECL_LINK(ToggleHandle, weld::ToggleButton&, void);
+    DECL_LINK(SizeAllocated, const Size&, void);
 
 public:
-           SC_DLLPUBLIC ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewData );
-                        virtual ~ScShareDocumentDlg() override;
-    virtual void        dispose() override;
+    SC_DLLPUBLIC ScShareDocumentDlg(weld::Window* pParent, ScViewData* pViewData);
+    virtual ~ScShareDocumentDlg() override;
 
     bool                IsShareDocumentChecked() const;
     void                UpdateView();
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 854f5f41b171..64142daf5355 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -70,7 +70,7 @@ ScInsertTableDlg::~ScInsertTableDlg()
 
 void ScInsertTableDlg::Init_Impl( bool bFromFile )
 {
-    m_xLbTables->set_selection_mode(true);
+    m_xLbTables->set_selection_mode(SelectionMode::Multiple);
     m_xBtnBrowse->connect_clicked( LINK( this, ScInsertTableDlg, BrowseHdl_Impl ) );
     m_xBtnNew->connect_clicked( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
     m_xBtnFromFile->connect_clicked( LINK( this, ScInsertTableDlg, ChoiceHdl_Impl ) );
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index e5d0fdcdf5d5..c941ef38699a 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -47,7 +47,7 @@ ScLinkedAreaDlg::ScLinkedAreaDlg(weld::Window* pParent)
     , m_xFtSeconds(m_xBuilder->weld_label("secondsft"))
     , m_xBtnOk(m_xBuilder->weld_button("ok"))
 {
-    m_xLbRanges->set_selection_mode(true);
+    m_xLbRanges->set_selection_mode(SelectionMode::Multiple);
 
     m_xCbUrl->connect_entry_activate(LINK(this, ScLinkedAreaDlg, FileHdl));
     m_xBtnBrowse->connect_clicked(LINK( this, ScLinkedAreaDlg, BrowseHdl));
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 6fa9f75ba56c..c6b22b2f757d 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -28,103 +28,69 @@
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
 #include <com/sun/star/document/XDocumentProperties.hpp>
 
+#include <scresid.hxx>
 #include <sharedocdlg.hxx>
+#include <strings.hrc>
 #include <viewdata.hxx>
 
 using namespace ::com::sun::star;
 
-class ScShareTable : public SvSimpleTable
+IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, rSize, void)
 {
-private:
-    OUString m_sWidestAccessString;
-public:
-    explicit ScShareTable(SvSimpleTableContainer& rParent)
-        : SvSimpleTable(rParent)
-    {
-        m_sWidestAccessString = getWidestTime(*ScGlobal::pLocaleData);
-    }
-    virtual void Resize() override
-    {
-        SvSimpleTable::Resize();
-        if (isInitialLayout(this))
-            setColWidths();
-    }
-    void setColWidths()
-    {
-        HeaderBar &rBar = GetTheHeaderBar();
-        if (rBar.GetItemCount() < 2)
-            return;
-
-        long nAccessedWidth = 12 +
-            std::max(rBar.GetTextWidth(rBar.GetItemText(2)),
-            GetTextWidth(m_sWidestAccessString));
-        long nWebSiteWidth = std::max(
-            12 + rBar.GetTextWidth(rBar.GetItemText(1)),
-            GetSizePixel().Width() - nAccessedWidth);
-        long aStaticTabs[]= { 0, nWebSiteWidth };
-        SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel);
-    }
-};
+    OUString sWidestAccessString = getWidestTime(*ScGlobal::pLocaleData);
+    std::vector<int> aWidths;
+    const int nAccessWidth = m_xLbUsers->get_pixel_size(sWidestAccessString).Width() * 2;
+    aWidths.push_back(rSize.Width() - nAccessWidth);
+    m_xLbUsers->set_column_fixed_widths(aWidths);
+}
 
 // class ScShareDocumentDlg
 
-ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewData )
-    : ModalDialog(pParent, "ShareDocumentDialog", "modules/scalc/ui/sharedocumentdlg.ui")
+ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, ScViewData* pViewData)
+    : GenericDialogController(pParent, "modules/scalc/ui/sharedocumentdlg.ui",
+                              "ShareDocumentDialog")
+    , m_aStrNoUserData(ScResId(STR_NO_USER_DATA_AVAILABLE))
+    , m_aStrUnknownUser(ScResId(STR_UNKNOWN_USER_CONFLICT))
+    , m_aStrExclusiveAccess(ScResId(STR_EXCLUSIVE_ACCESS))
     , mpDocShell(nullptr)
+    , m_xCbShare(m_xBuilder->weld_check_button("share"))
+    , m_xFtWarning(m_xBuilder->weld_label("warning"))
+    , m_xLbUsers(m_xBuilder->weld_tree_view("users"))
 {
+
     OSL_ENSURE( pViewData, "ScShareDocumentDlg CTOR: mpViewData is null!" );
     mpDocShell = ( pViewData ? pViewData->GetDocShell() : nullptr );
     OSL_ENSURE( mpDocShell, "ScShareDocumentDlg CTOR: mpDocShell is null!" );
 
-    get(m_pCbShare, "share");
-    get(m_pFtWarning, "warning");
-
-    SvSimpleTableContainer *pCtrl = get<SvSimpleTableContainer>("users");
-    pCtrl->set_height_request(pCtrl->GetTextHeight()*9);
-    m_pLbUsers = VclPtr<ScShareTable>::Create(*pCtrl);
+    std::vector<int> aWidths;
+    aWidths.push_back(m_xLbUsers->get_approximate_digit_width() * 25);
+    m_xLbUsers->set_column_fixed_widths(aWidths);
 
-    m_aStrNoUserData = get<FixedText>("nouserdata")->GetText();
-    m_aStrUnknownUser = get<FixedText>("unknownuser")->GetText();
-    m_aStrExclusiveAccess = get<FixedText>("exclusive")->GetText();
+    m_xLbUsers->set_size_request(-1, m_xLbUsers->get_height_rows(9));
+    m_xLbUsers->connect_size_allocate(LINK(this, ScShareDocumentDlg, SizeAllocated));
 
     bool bIsDocShared = mpDocShell && mpDocShell->IsDocShared();
-    m_pCbShare->Check( bIsDocShared );
-    m_pCbShare->SetToggleHdl( LINK( this, ScShareDocumentDlg, ToggleHandle ) );
-    m_pFtWarning->Enable( bIsDocShared );
-
-    long const nTabs[] = { 0, 0 };
-    m_pLbUsers->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
+    m_xCbShare->set_active(bIsDocShared);
+    m_xCbShare->connect_toggled( LINK( this, ScShareDocumentDlg, ToggleHandle ) );
+    m_xFtWarning->set_sensitive(bIsDocShared);
 
-    OUString aHeader(get<FixedText>("name")->GetText());
-    aHeader += "\t";
-    aHeader += get<FixedText>("accessed")->GetText();
-    m_pLbUsers->InsertHeaderEntry( aHeader, HEADERBAR_APPEND, HeaderBarItemBits::LEFT | HeaderBarItemBits::LEFTIMAGE );
-    m_pLbUsers->SetSelectionMode( SelectionMode::NONE );
+    m_xLbUsers->set_selection_mode(SelectionMode::NONE);
 
     UpdateView();
 }
 
 ScShareDocumentDlg::~ScShareDocumentDlg()
 {
-    disposeOnce();
-}
-
-void ScShareDocumentDlg::dispose()
-{
-    m_pLbUsers.disposeAndClear();
-    m_pCbShare.clear();
-    m_pFtWarning.clear();
-    ModalDialog::dispose();
 }
 
-IMPL_LINK_NOARG(ScShareDocumentDlg, ToggleHandle, CheckBox&, void)
+IMPL_LINK_NOARG(ScShareDocumentDlg, ToggleHandle, weld::ToggleButton&, void)
 {
-    m_pFtWarning->Enable( m_pCbShare->IsChecked() );
+    m_xFtWarning->set_sensitive(m_xCbShare->get_active());
 }
 
 bool ScShareDocumentDlg::IsShareDocumentChecked() const
 {
-    return m_pCbShare->IsChecked();
+    return m_xCbShare->get_active();
 }
 
 void ScShareDocumentDlg::UpdateView()
@@ -180,24 +146,23 @@ void ScShareDocumentDlg::UpdateView()
                         tools::Time aTime( nHours, nMinutes );
                         DateTime aDateTime( aDate, aTime );
 
-                        OUString aString( aUser );
-                        aString += "\t";
-                        aString += formatTime(aDateTime, *ScGlobal::pLocaleData);
+                        OUString aString = formatTime(aDateTime, *ScGlobal::pLocaleData);
 
-                        m_pLbUsers->InsertEntry( aString );
+                        m_xLbUsers->append_text(aUser);
+                        m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, aString, 1);
                     }
                 }
             }
             else
             {
-                m_pLbUsers->InsertEntry( m_aStrNoUserData );
+                m_xLbUsers->append_text(m_aStrNoUserData);
             }
         }
         catch ( uno::Exception& )
         {
             OSL_FAIL( "ScShareDocumentDlg::UpdateView(): caught exception" );
-            m_pLbUsers->Clear();
-            m_pLbUsers->InsertEntry( m_aStrNoUserData );
+            m_xLbUsers->clear();
+            m_xLbUsers->append_text(m_aStrNoUserData);
         }
     }
     else
@@ -225,7 +190,6 @@ void ScShareDocumentDlg::UpdateView()
         }
         aUser += " ";
         aUser += m_aStrExclusiveAccess;
-        OUString aString = aUser + "\t";
 
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
@@ -233,11 +197,12 @@ void ScShareDocumentDlg::UpdateView()
         util::DateTime uDT(xDocProps->getModificationDate());
         DateTime aDateTime(uDT);
 
-        aString += formatTime(aDateTime, *ScGlobal::pLocaleData);
+        OUString aString = formatTime(aDateTime, *ScGlobal::pLocaleData);
         aString += " ";
         aString += ScGlobal::pLocaleData->getTime( aDateTime, false );
 
-        m_pLbUsers->InsertEntry( aString );
+        m_xLbUsers->append_text(aUser);
+        m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, aString, 1);
     }
 }
 
diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx
index b3d65e596ea7..ee21149bd988 100644
--- a/sc/source/ui/miscdlgs/shtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/shtabdlg.cxx
@@ -26,7 +26,7 @@ ScShowTabDlg::ScShowTabDlg(weld::Window* pParent)
     , m_xFrame(m_xBuilder->weld_frame("frame"))
     , m_xLb(m_xBuilder->weld_tree_view("treeview"))
 {
-    m_xLb->set_selection_mode(true);
+    m_xLb->set_selection_mode(SelectionMode::Multiple);
     m_xLb->set_size_request(-1, m_xLb->get_height_rows(10));
     m_xLb->connect_row_activated(LINK(this, ScShowTabDlg, DblClkHdl));
 }
diff --git a/sc/uiconfig/scalc/ui/sharedocumentdlg.ui b/sc/uiconfig/scalc/ui/sharedocumentdlg.ui
index 02e9a7842afe..697229222c29 100644
--- a/sc/uiconfig/scalc/ui/sharedocumentdlg.ui
+++ b/sc/uiconfig/scalc/ui/sharedocumentdlg.ui
@@ -1,13 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sc">
   <requires lib="gtk+" version="3.18"/>
+  <object class="GtkTreeStore" id="liststore1">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name text2 -->
+      <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkDialog" id="ShareDocumentDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="sharedocumentdlg|ShareDocumentDialog">Share Document</property>
     <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -110,12 +126,13 @@
                       <object class="GtkLabel" id="warning">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="yalign">0</property>
                         <property name="xpad">12</property>
                         <property name="label" translatable="yes" context="sharedocumentdlg|warning">Note: Changes to formatting attributes like fonts, colors, and number formats will not be saved and some functionalities like editing charts and drawing objects are not available in shared mode. Turn off shared mode to get exclusive access needed for those changes and functionalities.</property>
                         <property name="wrap">True</property>
+                        <property name="width_chars">72</property>
                         <property name="max_width_chars">72</property>
+                        <property name="xalign">0</property>
+                        <property name="yalign">0</property>
                       </object>
                     </child>
                   </object>
@@ -157,105 +174,59 @@
                         <property name="orientation">vertical</property>
                         <property name="spacing">6</property>
                         <child>
-                          <object class="GtkBox" id="box2">
-                            <property name="can_focus">False</property>
-                            <property name="no_show_all">True</property>
-                            <property name="hexpand">True</property>
-                            <property name="homogeneous">True</property>
-                            <child>
-                              <object class="GtkLabel" id="name">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes" context="sharedocumentdlg|name">Name</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="accessed">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes" context="sharedocumentdlg|accessed">Accessed</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="svtlo-SvSimpleTableContainer" id="users">
+                          <object class="GtkScrolledWindow">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="hexpand">True</property>
                             <property name="vexpand">True</property>
-                            <child internal-child="selection">
-                              <object class="GtkTreeSelection" id="Simple Table Container-selection"/>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box5">
-                            <property name="can_focus">False</property>
-                            <property name="no_show_all">True</property>
-                            <property name="hexpand">True</property>
-                            <property name="homogeneous">True</property>
-                            <child>
-                              <object class="GtkLabel" id="nouserdata">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes" context="sharedocumentdlg|nouserdata">No user data available.</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
+                            <property name="shadow_type">in</property>
                             <child>
-                              <object class="GtkLabel" id="unknownuser">
+                              <object class="GtkTreeView" id="users">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes" context="sharedocumentdlg|unknownuser">Unknown User</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                                <property name="model">liststore1</property>
+                                <property name="headers_visible">True</property>
+                                <property name="search_column">0</property>
+                                <property name="show_expanders">False</property>
+                                <child internal-child="selection">
+                                  <object class="GtkTreeSelection" id="Macro Library List-selection1"/>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                                    <property name="resizable">True</property>
+                                    <property name="spacing">6</property>
+                                    <property name="title" translatable="yes" context="sharedocumentdlg|name">Name</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="cellrenderer1"/>
+                                      <attributes>
+                                        <attribute name="text">0</attribute>
+                                      </attributes>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                                    <property name="resizable">True</property>
+                                    <property name="spacing">6</property>
+                                    <property name="title" translatable="yes" context="sharedocumentdlg|accessed">Accessed</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="cellrenderer2"/>
+                                      <attributes>
+                                        <attribute name="text">1</attribute>
+                                      </attributes>
+                                    </child>
+                                  </object>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="exclusive">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes" context="sharedocumentdlg|exclusive">(exclusive access)</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
-                              </packing>
                             </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">2</property>
+                            <property name="position">1</property>
                           </packing>
                         </child>
                       </object>
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index be696d9ea04e..0df36988aa9a 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -281,7 +281,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg(weld::Window* pWindow, SdDrawDocume
 
     m_xBtnOK->connect_clicked( LINK( this, SdDefineCustomShowDlg, OKHdl ) );
 
-    m_xLbPages->set_selection_mode(true);
+    m_xLbPages->set_selection_mode(SelectionMode::Multiple);
 
     // shape 'em a bit
     m_xLbPages->set_size_request(m_xLbPages->get_approximate_digit_width() * 24, m_xLbPages->get_height_rows(10));
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 1ba855ed1239..eb4c03c4d523 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -90,7 +90,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(TabPageParent pParent, const SfxItemS
 {
     SetExchangeSupport();
 
-    m_xLevelLB->set_selection_mode(true);
+    m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
 
     m_xRelativeCB->set_active(true);
     m_xAlignLB->connect_changed(LINK(this, SwNumPositionTabPage, EditModifyHdl));
@@ -410,7 +410,7 @@ void SwNumPositionTabPage::Reset( const SfxItemSet* rSet )
     if (pOutlineDlg)
     {
         pSaveNum = pOutlineDlg->GetNumRule();
-        m_xLevelLB->set_selection_mode(false);
+        m_xLevelLB->set_selection_mode(SelectionMode::Single);
     }
     else if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_ACT_NUMBER, false, &pItem))
         pSaveNum = const_cast<SwUINumRuleItem*>(static_cast<const SwUINumRuleItem*>(pItem))->GetNumRule();
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e61980febe35..b6c6d68d920a 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2267,9 +2267,9 @@ public:
         m_xTreeView->SetCollapsedEntryBmp(rVclIter.iter, aImage);
     }
 
-    virtual void set_selection_mode(bool bMultiple) override
+    virtual void set_selection_mode(SelectionMode eMode) override
     {
-        m_xTreeView->SetSelectionMode(bMultiple ? SelectionMode::Multiple : SelectionMode::Single);
+        m_xTreeView->SetSelectionMode(eMode);
     }
 
     virtual int count_selected_rows() const override
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index a37d199e1511..265cc49fd982 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2925,6 +2925,27 @@ static GtkButtonsType VclToGtk(VclButtonsType eType)
     return eRet;
 }
 
+static GtkSelectionMode VclToGtk(SelectionMode eType)
+{
+    GtkSelectionMode eRet(GTK_SELECTION_NONE);
+    switch (eType)
+    {
+        case SelectionMode::NONE:
+            eRet = GTK_SELECTION_NONE;
+            break;
+        case SelectionMode::Single:
+            eRet = GTK_SELECTION_SINGLE;
+            break;
+        case SelectionMode::Range:
+            eRet = GTK_SELECTION_BROWSE;
+            break;
+        case SelectionMode::Multiple:
+            eRet = GTK_SELECTION_MULTIPLE;
+            break;
+    }
+    return eRet;
+}
+
 class GtkInstanceScrolledWindow : public GtkInstanceContainer, public virtual weld::ScrolledWindow
 {
 private:
@@ -5065,10 +5086,10 @@ public:
         gtk_widget_hide(m_pWidget);
     }
 
-    virtual void set_selection_mode(bool bMultiple) override
+    virtual void set_selection_mode(SelectionMode eMode) override
     {
         disable_notify_events();
-        gtk_tree_selection_set_mode(gtk_tree_view_get_selection(m_pTreeView), bMultiple ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE);
+        gtk_tree_selection_set_mode(gtk_tree_view_get_selection(m_pTreeView), VclToGtk(eMode));
         enable_notify_events();
     }
 


More information about the Libreoffice-commits mailing list