[Libreoffice-commits] core.git: svx/source vcl/source vcl/workben

2023-11-28 Thread Noel Grandin (via logerrit)
 svx/source/dialog/_bmpmask.cxx|5 +
 vcl/source/graphic/GraphicObject2.cxx |2 +-
 vcl/source/rendercontext/drawmode.cxx |2 +-
 vcl/workben/vcldemo.cxx   |3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit f4edd6258dff38c45e4a6b709e4e1d72a55a446c
Author: Noel Grandin 
AuthorDate: Tue Nov 28 12:43:25 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 28 19:55:51 2023 +0100

simplify some BitmapEx constructions

using the color bitmap __and__ the alpha from another BitmapEx
is equivalent to just doing a straight copy/assign

Change-Id: I134ab8a1197ed538823afc4a8cd28b3d5986c6b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160019
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 1db7e661cdd7..3e6a56a79f91 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -994,10 +994,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic )
 if ( aBitmapEx.GetSizePixel().Width() && 
aBitmapEx.GetSizePixel().Height() )
 {
 ImpMask( aBitmapEx );
-if ( aGraphic.IsTransparent() )
-aGraphic = Graphic( BitmapEx( 
aBitmapEx.GetBitmap(), aBitmapEx.GetAlphaMask() ) );
-else
-aGraphic = aBitmapEx;
+aGraphic = Graphic( aBitmapEx );
 }
 }
 }
diff --git a/vcl/source/graphic/GraphicObject2.cxx 
b/vcl/source/graphic/GraphicObject2.cxx
index 02a9374759bf..2f60e315d5ef 100644
--- a/vcl/source/graphic/GraphicObject2.cxx
+++ b/vcl/source/graphic/GraphicObject2.cxx
@@ -457,7 +457,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx&  
rBmpEx,
 
 if( rBmpEx.IsAlpha() )
 {
-aBmpEx2 = BitmapEx( rBmpEx.GetBitmap(), rBmpEx.GetAlphaMask() 
);
+aBmpEx2 = rBmpEx;
 }
 else
 {
diff --git a/vcl/source/rendercontext/drawmode.cxx 
b/vcl/source/rendercontext/drawmode.cxx
index ab3b36e0223d..fd3f29ac275f 100644
--- a/vcl/source/rendercontext/drawmode.cxx
+++ b/vcl/source/rendercontext/drawmode.cxx
@@ -269,7 +269,7 @@ BitmapEx GetBitmapEx(BitmapEx const& rBitmapEx, 
DrawModeFlags nDrawMode)
 }
 else
 {
-aBmpEx = BitmapEx(aColorBmp, aBmpEx.GetAlphaMask());
+aBmpEx = BitmapEx(aColorBmp);
 }
 }
 
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 346de0b52a09..1214a61a9406 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1406,8 +1406,7 @@ public:
 rDev.DrawBitmap(aBelow, aGrey);
 
 aBelow.Move(aGrey.GetSizePixel().Width(),0);
-BitmapEx aGreyMask(aSrc.GetBitmap(),
-   aSrc.GetAlphaMask());
+BitmapEx aGreyMask(aSrc);
 rDev.DrawBitmapEx(aBelow, aGreyMask);
 
 aLocation.Move(aSrc.GetSizePixel().Width()*6,0);


[Libreoffice-commits] core.git: svx/source vcl/source

2022-11-11 Thread Stephan Bergmann (via logerrit)
 svx/source/svdraw/svddrgmt.cxx |4 ++--
 vcl/source/filter/svm/SvmConverter.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7079cf51a95c8efb1ba250e829bddfcaf6bbc132
Author: Stephan Bergmann 
AuthorDate: Thu Nov 10 18:48:08 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 11 11:23:03 2022 +0100

Revert useless std::move of const objects

...added with 8a843f7e98dfe6bfb04e91e5b16e3a1df18fbf58 "loplugin:moveit".

(I came across this code with an upcoming loplugin:constmove that flags
suspicious uses of std::move involving const-qualified types.)

Change-Id: I099130acd67de7379992ce394226a7e233d6ca55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142561
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 4a332e8271c7..37531632c5b4 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -2881,7 +2881,7 @@ void SdrDragCrook::createSdrDragEntries()
 
 if(aDragRaster.count())
 {
-addSdrDragEntry(std::unique_ptr(new 
SdrDragEntryPolyPolygon(std::move(aDragRaster;
+addSdrDragEntry(std::unique_ptr(new 
SdrDragEntryPolyPolygon(aDragRaster)));
 }
 }
 
@@ -3412,7 +3412,7 @@ void SdrDragDistort::createSdrDragEntries()
 
 if(aDragRaster.count())
 {
-addSdrDragEntry(std::unique_ptr(new 
SdrDragEntryPolyPolygon(std::move(aDragRaster;
+addSdrDragEntry(std::unique_ptr(new 
SdrDragEntryPolyPolygon(aDragRaster)));
 }
 }
 
diff --git a/vcl/source/filter/svm/SvmConverter.cxx 
b/vcl/source/filter/svm/SvmConverter.cxx
index 063c6e45b505..0729a41c767e 100644
--- a/vcl/source/filter/svm/SvmConverter.cxx
+++ b/vcl/source/filter/svm/SvmConverter.cxx
@@ -550,7 +550,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, 
GDIMetaFile& rMtf )
 rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, 
false ) );
 rMtf.AddAction( new MetaPolygonAction( aPoly ) );
 rMtf.AddAction( new MetaPopAction() );
-rMtf.AddAction( new MetaPolyLineAction( std::move(aPoly), 
aLineInfo ) );
+rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) 
);
 }
 else
 rMtf.AddAction( new MetaArcAction( aRect, aPt, aPt1 ) );
@@ -571,7 +571,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, 
GDIMetaFile& rMtf )
 rMtf.AddAction( new MetaLineColorAction( COL_TRANSPARENT, 
false ) );
 rMtf.AddAction( new MetaPolygonAction( aPoly ) );
 rMtf.AddAction( new MetaPopAction() );
-rMtf.AddAction( new MetaPolyLineAction( std::move(aPoly), 
aLineInfo ) );
+rMtf.AddAction( new MetaPolyLineAction( aPoly, aLineInfo ) 
);
 }
 else
 rMtf.AddAction( new MetaPieAction( aRect, aPt, aPt1 ) );


[Libreoffice-commits] core.git: svx/source vcl/source

2022-04-13 Thread Noel Grandin (via logerrit)
 svx/source/unodraw/unoprov.cxx |2 +-
 svx/source/xml/xmlxtimp.cxx|2 +-
 vcl/source/image/ImplImageTree.cxx |   12 
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 05867c4e5f6d244f0f18db2a00e6fbc0d8141a41
Author: Noel Grandin 
AuthorDate: Wed Apr 13 11:29:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 13:44:44 2022 +0200

tdf#80633 speed up dialog layout

some small speedups when opening Format->Paragraph

Change-Id: If97725ecff45b9c2c01b405e153ec05b12882573
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132952
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 85892826ed99..b209f23ac0d3 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -1998,7 +1998,7 @@ static bool 
SvxUnoConvertResourceStringBuiltInFromApi(rtl::OUStringConstExpr con
 if( sStr == pSourceResIds[i].asView() )
 {
 OUString aReplace = SvxResId(pDestResIds[i]);
-rString = rString.replaceAt( 0, 
OUString(pSourceResIds[i]).getLength(), aReplace );
+rString = aReplace + rString.subView( 
pSourceResIds[i].asView().size() );
 return true;
 }
 }
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index 9bf7b6996b43..e79ec19daea8 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -203,7 +203,7 @@ void SvxXMLTableImportContext::importColor( const 
uno::Reference< XFastAttribute
 case XML_ELEMENT(DRAW_OOO, XML_COLOR):
 {
 sal_Int32 nColor(0);
-::sax::Converter::convertColor(nColor, aIter.toString());
+::sax::Converter::convertColor(nColor, aIter.toView());
 rAny <<= nColor;
 break;
 }
diff --git a/vcl/source/image/ImplImageTree.cxx 
b/vcl/source/image/ImplImageTree.cxx
index 4c2e63c57cae..3979206cb184 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -107,10 +107,14 @@ OUString createPath(std::u16string_view name, sal_Int32 
pos, std::u16string_view
 
 OUString getIconCacheUrl(std::u16string_view sVariant, ImageRequestParameters 
const & rParameters)
 {
-OUString sUrl = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/"
-+ rParameters.msStyle + "/" + sVariant + "/" + rParameters.msName;
-rtl::Bootstrap::expandMacros(sUrl);
-return sUrl;
+// the macro expansion can be expensive in bulk, so cache that
+static OUString CACHE_DIR = []()
+{
+OUString sDir = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/";
+rtl::Bootstrap::expandMacros(sDir);
+return sDir;
+}();
+return CACHE_DIR + rParameters.msStyle + "/" + sVariant + "/" + 
rParameters.msName;
 }
 
 OUString createIconCacheUrl(


[Libreoffice-commits] core.git: svx/source vcl/source

2022-02-03 Thread Miklos Vajna (via logerrit)
 svx/source/svdraw/svdpage.cxx  |9 +
 vcl/source/filter/ipdf/pdfread.cxx |3 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 9f7e6d10d863bb206ba3d671e34d2f019e2d2480
Author: Miklos Vajna 
AuthorDate: Thu Feb 3 15:28:11 2022 +0100
Commit: Miklos Vajna 
CommitDate: Fri Feb 4 07:13:45 2022 +0100

svx: show width and height of SdrPages in the xml dump

Which is useful to see, as a 2 page Draw document has 2 normal pages and
a master page (3 sizes), but in practice there can be only a single
size, so it's useful to see what size is coming from where when they
don't match.

Change-Id: I505653029ae67ea0a57c8f8bb61cf475d77aaccb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129425
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 981381643430..536167b04e56 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1841,6 +1841,15 @@ void SdrPage::dumpAsXml(xmlTextWriterPtr pWriter) const
 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SdrPage"));
 SdrObjList::dumpAsXml(pWriter);
 
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("width"));
+(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%s",
+
BAD_CAST(OString::number(mnWidth).getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("height"));
+(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%s",
+
BAD_CAST(OString::number(mnHeight).getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+
 if (mpSdrPageProperties)
 {
 mpSdrPageProperties->dumpAsXml(pWriter);
diff --git a/vcl/source/filter/ipdf/pdfread.cxx 
b/vcl/source/filter/ipdf/pdfread.cxx
index 0780e1c9baaa..595df4fac886 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -7,9 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
+
 #include 
 #include 
-#include 
 
 #include 
 


[Libreoffice-commits] core.git: svx/source vcl/source

2021-09-29 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |4 ++--
 vcl/source/control/edit.cxx|4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit e9564f1d727e89e8ab7c441a80a3944de10b3d3d
Author: Caolán McNamara 
AuthorDate: Wed Sep 29 12:56:32 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 29 15:02:11 2021 +0200

Resolves: tdf#144783 shift+RETURN not searching backwards

In gtk nothing is happening, in gen its searching forwards.  Align
backends so that Activate is emitted only on a bare return in both and
then handle shift+RETURN explicitly for the search widget

Change-Id: I142002bbaf6b3aca83800a442096a4b1024fe097
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122814
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 786c95698c05..d315e79f9b3b 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -297,8 +297,8 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const 
KeyEvent&, rKeyEvent, bool)
 else if ( bMod1 && nCode == KEY_F )
 m_xWidget->select_entry_region(0, -1);
 
-// Execute the search when Ctrl-G or F3 pressed (in addition to 
ActivateHdl conditions)
-else if ( (bMod1 && (KEY_G == nCode)) || (KEY_F3 == nCode) )
+// Execute the search when Ctrl-G, F3 and Shift-RETURN pressed (in 
addition to ActivateHdl condition which handles bare RETURN)
+else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == nCode) || 
(KEY_F3 == nCode) )
 {
 ActivateFind(bShift);
 bRet = true;
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index a42ea92ba5c2..8bb8e15f0834 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1674,10 +1674,8 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
 break;
 
 case KEY_RETURN:
-if (maActivateHdl.IsSet())
-{
+if (maActivateHdl.IsSet() && !rKEvt.GetKeyCode().GetModifier())
 bDone = maActivateHdl.Call(*this);
-}
 break;
 
 default:


[Libreoffice-commits] core.git: svx/source vcl/source

2020-04-21 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx   |2 +-
 vcl/source/control/imp_listbox.cxx |8 +---
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit ca5b322fd47f527c559f8806162b84eec7158615
Author: Caolán McNamara 
AuthorDate: Fri Apr 17 12:15:06 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Apr 21 10:20:07 2020 +0200

don't add maUserItemSize to text width, just use it as-is

which means we don't need the reverse calculation in the style
dropdown to force that result

Change-Id: I3c8421e964af4339abfacb455b75db5ad75456fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92446
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 9dd130a1dcc1..523d2816fa64 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1190,7 +1190,7 @@ IMPL_LINK(SvxStyleBox_Impl, CalcOptimalExtraUserWidth, 
VclWindowEvent&, event, v
 nMaxUserDrawFontWidth = std::max(nWidth, nMaxUserDrawFontWidth);
 }
 
-SetUserItemSize(Size(nMaxUserDrawFontWidth - nMaxNormalFontWidth, 
ITEM_HEIGHT));
+SetUserItemSize(Size(nMaxUserDrawFontWidth, ITEM_HEIGHT));
 }
 
 // test is the color between Font- and background-color to be identify
diff --git a/vcl/source/control/imp_listbox.cxx 
b/vcl/source/control/imp_listbox.cxx
index 3fe90de21906..ad33bb85a3a7 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -667,16 +667,18 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( 
ImplEntryType& rEntry )
 aMetrics.nEntryHeight = std::max( aMetrics.nImgHeight, 
aMetrics.nEntryHeight );
 
 }
-if ( IsUserDrawEnabled() || aMetrics.bImage )
+
+bool bIsUserDrawEnabled = IsUserDrawEnabled();
+if (bIsUserDrawEnabled || aMetrics.bImage)
 {
 aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, 
maUserItemSize.Width() );
-if ( aMetrics.bText )
+if (!bIsUserDrawEnabled && aMetrics.bText)
 aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE;
 aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, 
maUserItemSize.Height() ) + 2,
  aMetrics.nEntryHeight );
 }
 
-if ( !aMetrics.bText && !aMetrics.bImage && !IsUserDrawEnabled() )
+if (!aMetrics.bText && !aMetrics.bImage && !bIsUserDrawEnabled)
 {
 // entries which have no (aka an empty) text, and no image,
 // and are not user-drawn, should be shown nonetheless
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source vcl/source

2020-01-24 Thread Noel Grandin (via logerrit)
 svx/source/gallery2/galtheme.cxx |8 
 vcl/source/gdi/impgraph.cxx  |   20 ++--
 vcl/source/treelist/imap.cxx |4 ++--
 3 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 7589e8413411aa4e0bf437ec0a7080c577a9c1d9
Author: Noel Grandin 
AuthorDate: Thu Jan 23 21:28:03 2020 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 24 19:30:45 2020 +0100

no need for these to be heap-allocated

Change-Id: I50a4350198e3c2b8eb669b43fb40e4b01dcb67ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87291
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 91a141f90bac..3b078f45008b 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -692,11 +692,11 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const 
INetURLObject& rURL, bo
 if( nId1 == COMPAT_FORMAT( 'G', 'A', 'L', 'R' ) &&
 nId2 == COMPAT_FORMAT( 'E', 'S', 'R', 'V' ) )
 {
-std::unique_ptr pCompat(new 
VersionCompat( *pIStm, StreamMode::READ ));
+VersionCompat aCompat( *pIStm, StreamMode::READ );
 
 pIStm->ReadUInt32( nThemeId );
 
-if( pCompat->GetVersion() >= 2 )
+if( aCompat.GetVersion() >= 2 )
 {
 pIStm->ReadCharAsBool( bThemeNameFromResource 
);
 }
@@ -1417,13 +1417,13 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
 nId1 == COMPAT_FORMAT( 'G', 'A', 'L', 'R' ) &&
 nId2 == COMPAT_FORMAT( 'E', 'S', 'R', 'V' ) )
 {
-std::unique_ptr pCompat(new VersionCompat( rIStm, 
StreamMode::READ ));
+VersionCompat   aCompat( rIStm, StreamMode::READ );
 sal_uInt32  nTemp32;
 boolbThemeNameFromResource = false;
 
 rIStm.ReadUInt32( nTemp32 );
 
-if( pCompat->GetVersion() >= 2 )
+if( aCompat.GetVersion() >= 2 )
 {
 rIStm.ReadCharAsBool( bThemeNameFromResource );
 }
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 0591606dba86..067497301e02 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1263,7 +1263,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
 if( GRAPHIC_FORMAT_50 == nId )
 {
 // read new style header
-std::unique_ptr pCompat( new VersionCompat( rIStm, 
StreamMode::READ ) );
+VersionCompat aCompat( rIStm, StreamMode::READ );
 
 rIStm.ReadInt32( nType );
 sal_Int32 nLen;
@@ -1401,7 +1401,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
 rOStm.WriteUInt32( GRAPHIC_FORMAT_50 );
 
 // write new style header
-std::unique_ptr pCompat( new VersionCompat( rOStm, 
StreamMode::WRITE, 1 ) );
+VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 );
 
 rOStm.WriteInt32( static_cast(meType) );
 
@@ -1792,10 +1792,10 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& 
rImpGraphic )
 Graphic aGraphic;
 GfxLink aLink;
 
-// read compat info
-std::unique_ptr pCompat(new VersionCompat( rIStm, 
StreamMode::READ ));
-pCompat.reset(); // destructor writes stuff into the header
-
+// read compat info, destructor writes stuff into the header
+{
+VersionCompat aCompat( rIStm, StreamMode::READ );
+}
 ReadGfxLink( rIStm, aLink );
 
 // set dummy link to avoid creation of additional link after filtering;
@@ -1967,10 +1967,10 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& 
rImpGraphic)
 // native format
 rOStm.WriteUInt32( NATIVE_FORMAT_50 );
 
-// write compat info
-std::unique_ptr pCompat(new VersionCompat( rOStm, 
StreamMode::WRITE, 1 ));
-pCompat.reset(); // destructor writes stuff into the header
-
+// write compat info, destructor writes stuff into the header
+{
+VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 );
+}
 rImpGraphic.mpGfxLink->SetPrefMapMode( 
rImpGraphic.ImplGetPrefMapMode() );
 rImpGraphic.mpGfxLink->SetPrefSize( rImpGraphic.ImplGetPrefSize() );
 WriteGfxLink( rOStm, *rImpGraphic.mpGfxLink );
diff --git a/vcl/source/treelist/imap.cxx b/vcl/source/treelist/imap.cxx
index 536c9c819a8f..3c08c220d3fc 100644
--- a/vcl/source/treelist/imap.cxx
+++ b/vcl/source/treelist/imap.cxx
@@ -79,7 +79,7 @@ void IMapObject::Write( SvStream& rOStm ) const
 rOStm.WriteBool( bActive );
 write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aTarget, eEncoding);
 
-std::unique_ptr pCompat(new IMapCompat( 

[Libreoffice-commits] core.git: svx/source vcl/source

2019-11-01 Thread Marco Cecchetti (via logerrit)
 svx/source/tbxctrls/tbxcolorupdate.cxx |   16 ++--
 vcl/source/window/toolbox.cxx  |3 +++
 2 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 467429fe1dd0a7ab62e90234d71c3809ab270159
Author: Marco Cecchetti 
AuthorDate: Tue Sep 24 16:37:46 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 1 20:37:01 2019 +0100

tdf#126966: Use larger buttons for the colours in the sidebar on iOS - 2

Attempt to merge this with Noel's re-work of the color picker.

Change-Id: I9687546889bc20ef95a50aeafbc6f40e939d57a9
Reviewed-on: https://gerrit.libreoffice.org/81755
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 
Reviewed-on: https://gerrit.libreoffice.org/81900
Tested-by: Jenkins

diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx 
b/svx/source/tbxctrls/tbxcolorupdate.cxx
index 2069f61395f8..9465e9aad2f6 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include 
 #include 
 #include 
@@ -89,7 +88,19 @@ namespace svx
 {
 Image aImage(mpTbx->GetItemImage(mnBtnId));
 Size aItemSize(mbWideButton ? mpTbx->GetItemContentSize(mnBtnId) : 
aImage.GetSizePixel());
-
+#ifdef IOS // tdf#126966
+// Oddly enough, it is in the "not wide button" case that we want the 
larger ones, hmm.
+if (!mbWideButton)
+{
+// usually the normal size is 16
+const long nIOSSize = 40;
+if (aItemSize.getWidth() < nIOSSize)
+{
+aItemSize.setWidth(nIOSSize);
+aItemSize.setHeight(nIOSSize);
+}
+}
+#endif
 const bool bSizeChanged = (maBmpSize != aItemSize);
 const bool bDisplayModeChanged = (mbWasHiContrastMode != 
mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode());
 Color aColor(rColor);
@@ -100,6 +111,7 @@ namespace svx
 
 if ((maCurColor == aColor) && !bSizeChanged && !bDisplayModeChanged && 
!bForceUpdate)
 return;
+
 if (!aItemSize.Width() || !aItemSize.Height())
 return;
 
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 82640c566927..7d0f56c9e804 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1366,6 +1366,9 @@ bool ToolBox::ImplCalcItem()
 longnMinWidth   = 6;
 longnMinHeight  = 6;
 longnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
+#ifdef IOS
+nDropDownArrowWidth *= 3;
+#endif
 
 // set defaults if image or text is needed but empty
 nDefWidth  = GetDefaultImageSize().Width();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: svx/source vcl/source

2019-10-23 Thread Szymon Kłos (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx|   32 
 svx/source/tbxctrls/tbunocontroller.cxx |   32 
 vcl/source/window/toolbox2.cxx  |   26 +++---
 3 files changed, 79 insertions(+), 11 deletions(-)

New commits:
commit c7b97f2e4b8f47107bc91ded0295dcfffd0c71b6
Author: Szymon Kłos 
AuthorDate: Wed Oct 23 13:29:37 2019 +0200
Commit: Szymon Kłos 
CommitDate: Wed Oct 23 16:26:24 2019 +0200

jsdilogs: send data for font name & size toolitems

Change-Id: Ia5ea058ba44b3a511a0bdbfc132a7de2d68f2e6b
Reviewed-on: https://gerrit.libreoffice.org/81380
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index b1230050bc06..5f8ec0491977 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -242,6 +242,7 @@ public:
 virtual boolEventNotify( NotifyEvent& rNEvt ) override;
 virtual Reference< css::accessibility::XAccessible > CreateAccessible() 
override;
 void SetOwnFontList(::std::unique_ptr && _aOwnFontList) { 
m_aOwnFontList = std::move(_aOwnFontList); }
+virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 };
 
 // SelectHdl needs the Modifiers, get them in MouseButtonUp
@@ -1311,6 +1312,7 @@ SvxFontNameBox_Impl::SvxFontNameBox_Impl( vcl::Window* 
pParent, const Reference<
 SetOptimalSize();
 EnableControls_Impl();
 GetSubEdit()->AddEventListener( LINK( this, SvxFontNameBox_Impl, 
CheckAndMarkUnknownFont ));
+set_id("fontnamecombobox");
 }
 
 SvxFontNameBox_Impl::~SvxFontNameBox_Impl()
@@ -1585,6 +1587,36 @@ void SvxFontNameBox_Impl::Select()
 }
 }
 
+boost::property_tree::ptree SvxFontNameBox_Impl::DumpAsPropertyTree()
+{
+boost::property_tree::ptree aTree(FontNameBox::DumpAsPropertyTree());
+
+boost::property_tree::ptree aEntries;
+
+for (int i = 0; i < GetEntryCount(); ++i)
+{
+boost::property_tree::ptree aEntry;
+aEntry.put("", GetEntry(i));
+aEntries.push_back(std::make_pair("", aEntry));
+}
+
+aTree.add_child("entries", aEntries);
+
+boost::property_tree::ptree aSelected;
+
+for (int i = 0; i < GetSelectedEntryCount(); ++i)
+{
+boost::property_tree::ptree aEntry;
+aEntry.put("", GetSelectedEntryPos(i));
+aSelected.push_back(std::make_pair("", aEntry));
+}
+
+aTree.put("selectedCount", GetSelectedEntryCount());
+aTree.add_child("selectedEntries", aSelected);
+
+return aTree;
+}
+
 SvxColorWindow::SvxColorWindow(const OUString&rCommand,
std::shared_ptr const & 
rPaletteManager,
ColorStatus&   rColorStatus,
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx 
b/svx/source/tbxctrls/tbunocontroller.cxx
index b806251dd805..19b2147c8fad 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -96,6 +96,7 @@ public:
 voidSetOptimalSize();
 
 virtual boolEventNotify( NotifyEvent& rNEvt ) override;
+virtual boost::property_tree::ptree DumpAsPropertyTree() override;
 
 protected:
 virtual voidSelect() override;
@@ -125,6 +126,7 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
 {
 SetValue( 0 );
 SetText( "" );
+set_id("fontsizecombobox");
 }
 
 void SvxFontSizeBox_Impl::ReleaseFocus_Impl()
@@ -266,6 +268,36 @@ void SvxFontSizeBox_Impl::DataChanged( const 
DataChangedEvent& rDCEvt )
 FontSizeBox::DataChanged( rDCEvt );
 }
 
+boost::property_tree::ptree SvxFontSizeBox_Impl::DumpAsPropertyTree()
+{
+boost::property_tree::ptree aTree(FontSizeBox::DumpAsPropertyTree());
+
+boost::property_tree::ptree aEntries;
+
+for (int i = 0; i < GetEntryCount(); ++i)
+{
+boost::property_tree::ptree aEntry;
+aEntry.put("", GetEntry(i));
+aEntries.push_back(std::make_pair("", aEntry));
+}
+
+aTree.add_child("entries", aEntries);
+
+boost::property_tree::ptree aSelected;
+
+for (int i = 0; i < GetSelectedEntryCount(); ++i)
+{
+boost::property_tree::ptree aEntry;
+aEntry.put("", GetSelectedEntryPos(i));
+aSelected.push_back(std::make_pair("", aEntry));
+}
+
+aTree.put("selectedCount", GetSelectedEntryCount());
+aTree.add_child("selectedEntries", aSelected);
+
+return aTree;
+}
+
 FontHeightToolBoxControl::FontHeightToolBoxControl( const uno::Reference< 
uno::XComponentContext >& rxContext )
  : svt::ToolboxController( rxContext,
uno::Reference< frame::XFrame >(),
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 4aecf7abfaa6..6700c3466ff2 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1771,21 +1771,25 @@ boost::property_tree::ptree 
ToolBox::DumpAsPropertyTree()
 

[Libreoffice-commits] core.git: svx/source vcl/source

2017-01-16 Thread Julien Nabet
 svx/source/gallery2/galtheme.cxx   |2 +-
 vcl/source/filter/ixpm/xpmread.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bc2dee995b38fd16336541d533a105245aa681d2
Author: Julien Nabet 
Date:   Mon Jan 16 22:20:55 2017 +0100

Typo: charakter->character

Change-Id: Ie925c3f15fc00cbc16f1b73d5e61be4d6fe9b8ec
Reviewed-on: https://gerrit.libreoffice.org/33191
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 02ea64c..db774bd 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -707,7 +707,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const 
INetURLObject& rURL, bo
 OString aTmpStr = 
read_uInt16_lenPrefixed_uInt8s_ToOString(*pIStm);
 aThemeName = OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
 
-// execute a charakter conversion
+// execute a character conversion
 if( nVersion >= 0x0004 )
 {
 sal_uInt32  nCount;
diff --git a/vcl/source/filter/ixpm/xpmread.cxx 
b/vcl/source/filter/ixpm/xpmread.cxx
index 57dd2b3..6193bbb 100644
--- a/vcl/source/filter/ixpm/xpmread.cxx
+++ b/vcl/source/filter/ixpm/xpmread.cxx
@@ -213,7 +213,7 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
 mpAcc->SetPaletteColor( (sal_uInt8)i, Color( 
pPtr[1], pPtr[2], pPtr[3] ) );
 pPtr += ( mnCpp + 4 );
 }
-// using 2 charakters per pixel and less than 257 
Colors we speed up
+// using 2 characters per pixel and less than 257 
Colors we speed up
 if ( mnCpp == 2 )   // by using a 64kb indexing 
table
 {
 const size_t nSize = 256 * 256;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source vcl/source

2016-10-30 Thread Maxim Monastirsky
 svx/source/tbxctrls/tbcontrl.cxx |   10 +++---
 vcl/source/window/dockmgr.cxx|4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 66b75b4ba9f0a1c8003fa52c7a29575e374644a2
Author: Maxim Monastirsky 
Date:   Sun Oct 30 16:43:41 2016 +0200

tdf#103087 Border widget must not have focus initially

... unless it was opened using the keyboard.

Change-Id: I04675211ff043acf7757afed7252e7d7493eadad

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index d1c26ba..2f8a09e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -261,6 +261,7 @@ private:
 
 protected:
 virtual voidGetFocus() override;
+virtual voidKeyInput( const KeyEvent& rKEvt ) override;
 
 public:
 SvxFrameWindow_Impl( svt::ToolboxController& rController, vcl::Window* 
pParentWindow );
@@ -1660,10 +1661,13 @@ void SvxFrameWindow_Impl::dispose()
 void SvxFrameWindow_Impl::GetFocus()
 {
 if (aFrameSet)
-{
-aFrameSet->GrabFocus();
 aFrameSet->StartSelection();
-}
+}
+
+void SvxFrameWindow_Impl::KeyInput( const KeyEvent& rKEvt )
+{
+aFrameSet->GrabFocus();
+aFrameSet->KeyInput( rKEvt );
 }
 
 void SvxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 497d316..cf93ac4 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -1089,11 +1089,11 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox 
*pParentToolBox, FloatWin
 mpFloatWin->StartPopupMode( pParentToolBox, nFlags );
 GetWindow()->Show();
 
-if( bIsToolBox && pParentToolBox->IsKeyEvent() )
+if( pParentToolBox->IsKeyEvent() )
 {
 // send HOME key to subtoolbar in order to select first item
 KeyEvent aEvent( 0, vcl::KeyCode( KEY_HOME ) );
-mpFloatWin->KeyInput(aEvent);
+GetWindow()->KeyInput(aEvent);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source vcl/source

2016-06-28 Thread Caolán McNamara
 svx/source/tbxctrls/tbcontrl.cxx |   25 -
 vcl/source/window/floatwin.cxx   |2 +-
 2 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 886637d355e77cd61d85279f145c06b07385fecd
Author: Caolán McNamara 
Date:   Tue Jun 28 21:26:09 2016 +0100

Resolves: tdf#100574 Crash when selecting and applying border style...

when a first torn off instance was opened just before the second one
and then the second one sends focus back to the first when its popped
down.

The second one listens to losing the focus and disposes itself which leads 
to
dereferencing deleted stuff.

So add a reference count to the places these tear offs call popdown so its
still gets disposed but not deleted during the popdown and then protect 
against
members being disposed with a enough checks to get back to safely

Change-Id: Id5f8eb4771df36305e308a2a9a5035018948f121

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 3c8164c..55bcd10 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1381,6 +1381,8 @@ void SvxColorWindow_Impl::KeyInput( const KeyEvent& rKEvt 
)
 
 IMPL_LINK_TYPED(SvxColorWindow_Impl, SelectHdl, ValueSet*, pColorSet, void)
 {
+VclPtr xThis(this);
+
 Color aColor = pColorSet->GetItemColor( pColorSet->GetSelectItemId() );
 /*  #i33380# DR 2004-09-03 Moved the following line above the Dispatch() 
calls.
 This instance may be deleted in the meantime (i.e. when a dialog is 
opened
@@ -1412,6 +1414,8 @@ IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, 
SelectPaletteHdl, ListBox&, void)
 
 IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, AutoColorClickHdl, Button*, void)
 {
+VclPtr xThis(this);
+
 Color aColor;
 switch ( theSlotId )
 {
@@ -1443,6 +1447,8 @@ IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, 
AutoColorClickHdl, Button*, void)
 
 IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, OpenPickerClickHdl, Button*, void)
 {
+VclPtr xThis(this);
+
 if ( IsInPopupMode() )
 EndPopupMode();
 mrPaletteManager.PopupColorPicker(maCommand);
@@ -1685,6 +1691,8 @@ void SvxFrameWindow_Impl::DataChanged( const 
DataChangedEvent& rDCEvt )
 
 IMPL_LINK_NOARG_TYPED(SvxFrameWindow_Impl, SelectHdl, ValueSet*, void)
 {
+VclPtr xThis(this);
+
 SvxBoxItem  aBorderOuter( SID_ATTR_BORDER_OUTER );
 SvxBoxInfoItem  aBorderInner( SID_ATTR_BORDER_INNER );
 SvxBorderLine   theDefLine;
@@ -1784,10 +1792,13 @@ IMPL_LINK_NOARG_TYPED(SvxFrameWindow_Impl, SelectHdl, 
ValueSet*, void)
 aBorderInner.QueryValue( a );
 aArgs[1].Value = a;
 
-/*  #i33380# DR 2004-09-03 Moved the following line above the Dispatch() 
call.
-This instance may be deleted in the meantime (i.e. when a dialog is 
opened
-while in Dispatch()), accessing members will crash in this case. */
-aFrameSet->SetNoSelection();
+if (aFrameSet)
+{
+/* #i33380# Moved the following line above the Dispatch() call.
+   This instance may be deleted in the meantime (i.e. when a dialog is 
opened
+   while in Dispatch()), accessing members will crash in this case. */
+aFrameSet->SetNoSelection();
+}
 
 SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( 
GetFrame()->getController(), UNO_QUERY ),
  ".uno:SetBorderStyle",
@@ -1973,6 +1984,8 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, 
const Reference< XFrame
 
 IMPL_LINK_NOARG_TYPED(SvxCurrencyList_Impl, SelectHdl, ListBox&, void)
 {
+VclPtr xThis(this);
+
 if ( IsInPopupMode() )
 EndPopupMode();
 
@@ -1987,6 +2000,8 @@ IMPL_LINK_NOARG_TYPED(SvxCurrencyList_Impl, SelectHdl, 
ListBox&, void)
 
 IMPL_LINK_NOARG_TYPED(SvxLineWindow_Impl, SelectHdl, ListBox&, void)
 {
+VclPtr xThis(this);
+
 SvxLineItem aLineItem( SID_FRAME_LINESTYLE );
 SvxBorderStyle  nStyle = SvxBorderStyle( 
m_aLineStyleLb->GetSelectEntryStyle() );
 
@@ -3140,4 +3155,4 @@ void SvxCurrencyToolBoxControl::GetCurrencySymbols( 
std::vector& rList
 }
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 2362f13..38d9a91 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -811,7 +811,7 @@ void FloatingWindow::ImplEndPopupMode( 
FloatWinPopupEndFlags nFlags, const VclPt
 SetTitleType( mnOldTitle );
 
 // set ToolBox again to normal
-if ( mpImplData->mpBox )
+if (mpImplData && mpImplData->mpBox)
 {
 mpImplData->mpBox->ImplFloatControl( false, this );
 mpImplData->mpBox = nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: svx/source vcl/source xmloff/source xmlsecurity/source

2016-03-11 Thread Wastack
 svx/source/form/fmPropBrw.cxx  |2 +-
 svx/source/unodraw/recoveryui.cxx  |6 +++---
 vcl/source/app/brand.cxx   |4 ++--
 xmloff/source/transform/XMLFilterRegistration.cxx  |2 +-
 xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx |2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 7a0b8decb7d81fefced39ee04368dd0112e8ac28
Author: Wastack 
Date:   Fri Mar 11 00:43:10 2016 +0100

tdf#97966: Remove 'static' keywords

Change-Id: Id70f9e55fb4ad7d3a501399b055208ea10369c82
Reviewed-on: https://gerrit.libreoffice.org/23131
Reviewed-by: Stephan Bergmann 
Tested-by: Stephan Bergmann 

diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx
index aff1df1..af7487d 100644
--- a/svx/source/form/fmPropBrw.cxx
+++ b/svx/source/form/fmPropBrw.cxx
@@ -491,7 +491,7 @@ IMPL_LINK_NOARG_TYPED( FmPropBrw, OnAsyncGetFocus, void*, 
void )
 
 namespace
 {
-static bool lcl_shouldEnableHelpSection( const Reference< 
XComponentContext >& _rxContext )
+bool lcl_shouldEnableHelpSection( const Reference< XComponentContext >& 
_rxContext )
 {
 ::utl::OConfigurationTreeRoot aConfiguration(
 ::utl::OConfigurationTreeRoot::createWithComponentContext(
diff --git a/svx/source/unodraw/recoveryui.cxx 
b/svx/source/unodraw/recoveryui.cxx
index 7f436f9..ef3701b 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -176,7 +176,7 @@ css::uno::Any SAL_CALL 
RecoveryUI::dispatchWithReturnValue(const css::util::URL&
 }
 
 
-static OUString GetCrashConfigDir()
+OUString GetCrashConfigDir()
 {
 
 #if defined(_WIN32)
@@ -202,14 +202,14 @@ static OUString GetCrashConfigDir()
 #endif
 
 
-static OUString GetUnsentURL()
+OUString GetUnsentURL()
 {
 OUString aURL = GetCrashConfigDir() + "/" LCKFILE;
 return aURL;
 }
 
 
-static bool delete_pending_crash()
+bool delete_pending_crash()
 {
 OUStringaUnsentURL = GetUnsentURL();
 return ( FileBase::E_None == File::remove( aUnsentURL ) );
diff --git a/vcl/source/app/brand.cxx b/vcl/source/app/brand.cxx
index 5a7bd2d..236ddea 100644
--- a/vcl/source/app/brand.cxx
+++ b/vcl/source/app/brand.cxx
@@ -29,7 +29,7 @@
 #include 
 
 namespace {
-static bool loadPng( const OUString & rPath, BitmapEx )
+bool loadPng( const OUString & rPath, BitmapEx )
 {
 INetURLObject aObj( rPath );
 SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
@@ -41,7 +41,7 @@ namespace {
 else
 return false;
 }
-static bool tryLoadPng( const OUString& rBaseDir, const OUString& rName, 
BitmapEx& rBitmap )
+bool tryLoadPng( const OUString& rBaseDir, const OUString& rName, 
BitmapEx& rBitmap )
 {
 return loadPng( rBaseDir + "/" LIBO_ETC_FOLDER + rName, rBitmap);
 }
diff --git a/xmloff/source/transform/XMLFilterRegistration.cxx 
b/xmloff/source/transform/XMLFilterRegistration.cxx
index e87ea6a..4b7ce03 100644
--- a/xmloff/source/transform/XMLFilterRegistration.cxx
+++ b/xmloff/source/transform/XMLFilterRegistration.cxx
@@ -43,7 +43,7 @@ namespace
 CreateInstance  createInstance;
 };
 
-static const ServiceDescriptor* getServiceDescriptors()
+const ServiceDescriptor* getServiceDescriptors()
 {
 static const ServiceDescriptor aDescriptors[] =
 {
diff --git a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx 
b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
index 1815770..50dcade 100644
--- a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx
@@ -64,7 +64,7 @@ sal_Bool SAL_CALL SanExtensionImpl::isCritical() throw( 
::com::sun::star::uno::R
 
 namespace {
 // Helper functions from nss/lib/certdb/genname.c
-static int GetNamesLength(CERTGeneralName *names)
+int GetNamesLength(CERTGeneralName *names)
 {
 int  length = 0;
 CERTGeneralName  *first;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source vcl/source

2015-10-15 Thread Michael Meeks
 svx/source/tbxctrls/itemwin.cxx |   24 +++-
 vcl/source/control/lstbox.cxx   |   20 +++-
 2 files changed, 34 insertions(+), 10 deletions(-)

New commits:
commit 4421bb8eb51868cfd2d122e198382e605b370ef2
Author: Michael Meeks 
Date:   Thu Oct 15 13:09:54 2015 +0100

tdf#94495 - protect lstbox usage post-dispose, and fix ItemWin focus.

Change-Id: I2e4d1c79f57ec048d66111ed393491b7803ee3b9

diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index b417110..cabc114 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -419,16 +419,19 @@ bool SvxFillTypeBox::PreNotify( NotifyEvent& rNEvt )
 {
 MouseNotifyEvent nType = rNEvt.GetType();
 
-if ( MouseNotifyEvent::MOUSEBUTTONDOWN == nType || 
MouseNotifyEvent::GETFOCUS == nType )
-nCurPos = GetSelectEntryPos();
-else if ( MouseNotifyEvent::LOSEFOCUS == nType
-&& Application::GetFocusWindow()
-&& !IsWindowOrChild( Application::GetFocusWindow(), true ) )
+if (!isDisposed())
 {
-if ( !bSelect )
-SelectEntryPos( nCurPos );
-else
-bSelect = false;
+if ( MouseNotifyEvent::MOUSEBUTTONDOWN == nType || 
MouseNotifyEvent::GETFOCUS == nType )
+nCurPos = GetSelectEntryPos();
+else if ( MouseNotifyEvent::LOSEFOCUS == nType
+  && Application::GetFocusWindow()
+  && !IsWindowOrChild( Application::GetFocusWindow(), true ) )
+{
+if ( !bSelect )
+SelectEntryPos( nCurPos );
+else
+bSelect = false;
+}
 }
 
 return FillTypeLB::PreNotify( rNEvt );
@@ -440,6 +443,9 @@ bool SvxFillTypeBox::Notify( NotifyEvent& rNEvt )
 {
 bool bHandled = FillTypeLB::Notify( rNEvt );
 
+if (isDisposed())
+return false;
+
 if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
 {
 const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index b2998ca..cf1230b 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -971,6 +971,8 @@ void ListBox::DoubleClick()
 
 void ListBox::Clear()
 {
+if (!mpImplLB)
+return;
 mpImplLB->Clear();
 if( IsDropDownBox() )
 {
@@ -1026,13 +1028,15 @@ void ListBox::RemoveEntry( sal_Int32 nPos )
 
 Image ListBox::GetEntryImage( sal_Int32 nPos ) const
 {
-if ( mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
+if ( mpImplLB && mpImplLB->GetEntryList()->HasEntryImage( nPos ) )
 return mpImplLB->GetEntryList()->GetEntryImage( nPos );
 return Image();
 }
 
 sal_Int32 ListBox::GetEntryPos( const OUString& rStr ) const
 {
+if (!mpImplLB)
+return LISTBOX_ENTRY_NOTFOUND;
 sal_Int32 nPos = mpImplLB->GetEntryList()->FindEntry( rStr );
 if ( nPos != LISTBOX_ENTRY_NOTFOUND )
 nPos = nPos - mpImplLB->GetEntryList()->GetMRUCount();
@@ -1041,6 +1045,8 @@ sal_Int32 ListBox::GetEntryPos( const OUString& rStr ) 
const
 
 sal_Int32 ListBox::GetEntryPos( const void* pData ) const
 {
+if (!mpImplLB)
+return LISTBOX_ENTRY_NOTFOUND;
 sal_Int32 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
 if ( nPos != LISTBOX_ENTRY_NOTFOUND )
 nPos = nPos - mpImplLB->GetEntryList()->GetMRUCount();
@@ -1049,11 +1055,15 @@ sal_Int32 ListBox::GetEntryPos( const void* pData ) 
const
 
 OUString ListBox::GetEntry( sal_Int32 nPos ) const
 {
+if (!mpImplLB)
+return OUString();
 return mpImplLB->GetEntryList()->GetEntryText( nPos + 
mpImplLB->GetEntryList()->GetMRUCount() );
 }
 
 sal_Int32 ListBox::GetEntryCount() const
 {
+if (!mpImplLB)
+return 0;
 return mpImplLB->GetEntryList()->GetEntryCount() - 
mpImplLB->GetEntryList()->GetMRUCount();
 }
 
@@ -1064,11 +1074,16 @@ OUString ListBox::GetSelectEntry(sal_Int32 nIndex) const
 
 sal_Int32 ListBox::GetSelectEntryCount() const
 {
+if (!mpImplLB)
+return 0;
 return mpImplLB->GetEntryList()->GetSelectEntryCount();
 }
 
 sal_Int32 ListBox::GetSelectEntryPos( sal_Int32 nIndex ) const
 {
+if (!mpImplLB || !mpImplLB->GetEntryList())
+return LISTBOX_ENTRY_NOTFOUND;
+
 sal_Int32 nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
 if ( nPos != LISTBOX_ENTRY_NOTFOUND )
 {
@@ -1096,6 +,9 @@ void ListBox::SelectEntry( const OUString& rStr, bool 
bSelect )
 
 void ListBox::SelectEntryPos( sal_Int32 nPos, bool bSelect )
 {
+if (!mpImplLB)
+return;
+
 if ( 0 <= nPos && nPos < mpImplLB->GetEntryList()->GetEntryCount() )
 {
 sal_Int32 oldSelectCount = GetSelectEntryCount(), newSelectCount = 0, 
nCurrentPos = mpImplLB->GetCurrentPos();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: svx/source vcl/source

2015-06-19 Thread László Németh
 svx/source/dialog/paraprev.cxx |2 +-
 vcl/source/window/tabpage.cxx  |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 016cf9b21d5c569183b00ed7d228b7b0f2efa685
Author: László Németh laszlo.nem...@collabora.com
Date:   Fri Jun 19 20:58:34 2015 +0200

fix tabpage rendering

Change-Id: I2448787c306a8a4ba531c0560e0435fefadb4dc8

diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx
index 188e197..e68f61f 100644
--- a/svx/source/dialog/paraprev.cxx
+++ b/svx/source/dialog/paraprev.cxx
@@ -204,7 +204,7 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext 
rRenderContext, bool b
 rRenderContext.DrawRect(Lines[i]);
 rRenderContext.SetFillColor(aFillCol);
 }
-DrawRect( aRect );
+rRenderContext.DrawRect( aRect );
 Lines[i] = aRect;
 }
 
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index d2c432e..d4ca13d 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -126,7 +126,7 @@ void TabPage::DataChanged( const DataChangedEvent rDCEvt )
 }
 }
 
-void TabPage::Paint( vcl::RenderContext /*rRenderContext*/, const Rectangle )
+void TabPage::Paint( vcl::RenderContext rRenderContext, const Rectangle )
 {
 // draw native tabpage only inside tabcontrols, standalone tabpages look 
ugly (due to bad dialog design)
 if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL)  
GetParent()  (GetParent()-GetType() == WINDOW_TABCONTROL) )
@@ -143,7 +143,7 @@ void TabPage::Paint( vcl::RenderContext 
/*rRenderContext*/, const Rectangle )
 // pass the whole window region to NWF as the tab body might be a 
gradient or bitmap
 // that has to be scaled properly, clipping makes sure that we do not 
paint too much
 Rectangle aCtrlRegion( aPoint, GetOutputSizePixel() );
-DrawNativeControl( CTRL_TAB_BODY, part, aCtrlRegion, nState,
+rRenderContext.DrawNativeControl( CTRL_TAB_BODY, part, aCtrlRegion, 
nState,
 aControlValue, OUString() );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source vcl/source

2015-01-19 Thread Caolán McNamara
 svx/source/dialog/ruler.src|   22 +++---
 vcl/source/control/tabctrl.cxx |2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 251737f0dd186b0f169f5ba237e1e8c28a320e00
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jan 19 15:38:56 2015 +

Resolves: fdo#88417 Dropdown for ruler settings should show radio buttons

This reverts commit 9995222d1141b326197a387cc7897b3971ce9e9a
and additionally converts the ruler settings to radio buttons and not
checkboxes

Conflicts:
vcl/source/control/tabctrl.cxx

Change-Id: Ie0eac5f07729447942065b7f415398165fbf067c

diff --git a/svx/source/dialog/ruler.src b/svx/source/dialog/ruler.src
index d100a91..b1942de 100644
--- a/svx/source/dialog/ruler.src
+++ b/svx/source/dialog/ruler.src
@@ -26,67 +26,67 @@ Menu RID_SVXMN_RULER
 MenuItem
 {
 Identifier = ID_MM ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Millimeter ;
 };
 MenuItem
 {
 Identifier = ID_CM ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Centimeter ;
 };
 MenuItem
 {
 Identifier = ID_M ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Meter ;
 };
 MenuItem
 {
 Identifier = ID_KM ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Kilometer ;
 };
 MenuItem
 {
 Identifier = ID_INCH ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Inch ;
 };
 MenuItem
 {
 Identifier = ID_FOOT ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Foot ;
 };
 MenuItem
 {
 Identifier = ID_MILE ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Miles ;
 };
 MenuItem
 {
 Identifier = ID_POINT ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Point ;
 };
 MenuItem
 {
 Identifier = ID_PICA ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text [ en-US ] = Pica ;
 };
 MenuItem
 {
 Identifier = ID_CHAR ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text[ en-US ] = Char ;
 };
 MenuItem
 {
 Identifier = ID_LINE ;
-Checkable = TRUE ;
+RadioCheck = TRUE ;
 Text[ en-US ] = Line ;
 };
 };
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 3a8f572..ee09d40 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1448,7 +1448,7 @@ void TabControl::Command( const CommandEvent rCEvt )
 for( std::vector ImplTabItem ::iterator it = 
mpTabCtrlData-maItemList.begin();
  it != mpTabCtrlData-maItemList.end(); ++it )
 {
-aMenu.InsertItem( it-mnId, it-maText, 
MenuItemBits::CHECKABLE );
+aMenu.InsertItem( it-mnId, it-maText, 
MenuItemBits::CHECKABLE | MenuItemBits::RADIOCHECK );
 if ( it-mnId == mnCurPageId )
 aMenu.CheckItem( it-mnId );
 aMenu.SetHelpId( it-mnId, it-maHelpId );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source vcl/source

2014-02-28 Thread Caolán McNamara
 svx/source/svdraw/sdrpaintwindow.cxx |   97 ---
 vcl/source/window/window.cxx |5 +
 2 files changed, 84 insertions(+), 18 deletions(-)

New commits:
commit 1ec2880679d88c89901ce00fe30dd78e584f6960
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Feb 28 16:55:03 2014 +

Resolves: rhbz#1007697 Update on a Window triggering delete on window

Change-Id: Ic6374ce45e3a3ba97217ae77e91f9143f46e277b
Reviewed-on: https://gerrit.libreoffice.org/8396
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/svx/source/svdraw/sdrpaintwindow.cxx 
b/svx/source/svdraw/sdrpaintwindow.cxx
index b8b973d..76e75ac 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -23,34 +23,95 @@
 #include vcl/gdimtf.hxx
 #include vcl/svapp.hxx
 #include vcl/settings.hxx
+#include set
+#include vector
+
+//rhbz#1007697 do this in two loops, one to collect the candidates
+//and another to update them because updating a candidate can
+//trigger the candidate to be deleted, so asking for its
+//sibling after that is going to fail hard
+class CandidateMgr
+{
+std::vectorWindow* m_aCandidates;
+std::setWindow* m_aDeletedCandidates;
+DECL_LINK(WindowEventListener, VclSimpleEvent*);
+public:
+void PaintTransparentChildren(Window  rWindow, Rectangle const 
rPixelRect);
+~CandidateMgr();
+};
+
+IMPL_LINK(CandidateMgr, WindowEventListener, VclSimpleEvent*, pEvent)
+{
+VclWindowEvent* pWinEvent = dynamic_cast VclWindowEvent* ( pEvent );
+if (pWinEvent)
+{
+Window* pWindow = pWinEvent-GetWindow();
+if (pWinEvent-GetId() == VCLEVENT_OBJECT_DYING)
+{
+m_aDeletedCandidates.insert(pWindow);
+}
+}
+
+return 0;
+}
+
+CandidateMgr::~CandidateMgr()
+{
+for (std::vectorWindow*::iterator aI = m_aCandidates.begin();
+ aI != m_aCandidates.end(); ++aI)
+{
+Window* pCandidate = *aI;
+if (m_aDeletedCandidates.find(pCandidate) != 
m_aDeletedCandidates.end())
+continue;
+pCandidate-RemoveEventListener(LINK(this, CandidateMgr, 
WindowEventListener));
+}
+}
 
 void PaintTransparentChildren(Window  rWindow, Rectangle const rPixelRect)
 {
-if (rWindow.IsChildTransparentModeEnabled())
+if (!rWindow.IsChildTransparentModeEnabled())
+return;
+
+CandidateMgr aManager;
+aManager.PaintTransparentChildren(rWindow, rPixelRect);
+}
+
+void CandidateMgr::PaintTransparentChildren(Window  rWindow, Rectangle const 
rPixelRect)
+{
+Window * pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
+while (pCandidate)
 {
-Window * pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
-while (pCandidate)
+if (pCandidate-IsPaintTransparent())
 {
-if (pCandidate-IsPaintTransparent())
+const Rectangle aCandidatePosSizePixel(
+pCandidate-GetPosPixel(),
+pCandidate-GetSizePixel());
+
+if (aCandidatePosSizePixel.IsOver(rPixelRect))
 {
-const Rectangle aCandidatePosSizePixel(
-pCandidate-GetPosPixel(),
-pCandidate-GetSizePixel());
-
-if (aCandidatePosSizePixel.IsOver(rPixelRect))
-{
-pCandidate-Invalidate(
-INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
-// important: actually paint the child here!
-pCandidate-Update();
-}
+m_aCandidates.push_back(pCandidate);
+pCandidate-AddEventListener(LINK(this, CandidateMgr, 
WindowEventListener));
 }
-pCandidate = pCandidate-GetWindow( WINDOW_NEXT );
 }
+pCandidate = pCandidate-GetWindow( WINDOW_NEXT );
 }
-}
-
 
+for (std::vectorWindow*::iterator aI = m_aCandidates.begin();
+ aI != m_aCandidates.end(); ++aI)
+{
+pCandidate = *aI;
+if (m_aDeletedCandidates.find(pCandidate) != 
m_aDeletedCandidates.end())
+continue;
+//rhbz#1007697 this can cause the window itself to be
+//deleted. So we are listening to see if that happens
+//and if so, then skip the update
+pCandidate-Invalidate(INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN);
+// important: actually paint the child here!
+if (m_aDeletedCandidates.find(pCandidate) != 
m_aDeletedCandidates.end())
+continue;
+pCandidate-Update();
+}
+}
 
 SdrPreRenderDevice::SdrPreRenderDevice(OutputDevice rOriginal)
 :   mrOutputDevice(rOriginal)
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 277531b..722da94 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -7483,6 +7483,8 @@ void 

[Libreoffice-commits] core.git: svx/source vcl/source

2014-02-07 Thread Caolán McNamara
 svx/source/tbxctrls/tbcontrl.cxx |5 -
 vcl/source/window/toolbox.cxx|   30 +-
 2 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit b6542ea43ac6141486d3d1f29bbab9b053c26b21
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Feb 7 14:21:36 2014 +

for ToolBox Optimal Size use contents optimal sizes

Change-Id: I614c4fdb6478d1ca8e092dc742886190ec920b7d

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 0a96bd0..d54ec9d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -805,7 +805,10 @@ SvxFontNameBox_Impl::SvxFontNameBox_Impl( Window* pParent, 
const Reference XDis
 m_xFrame (_xFrame),
 mbEndPreview(false)
 {
-SetSizePixel(LogicToPixel( aLogicalSize, MAP_APPFONT ));
+Size aSize(LogicToPixel(aLogicalSize, MAP_APPFONT));
+set_width_request(aSize.Width());
+set_height_request(aSize.Height());
+SetSizePixel(aSize);
 EnableControls_Impl();
 GetSubEdit()-AddEventListener( LINK( this, SvxFontNameBox_Impl, 
CheckAndMarkUnknownFont ));
 }
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index e2799ca..9a54b3f 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4854,7 +4854,35 @@ void ToolBox::Resizing( Size rSize )
 
 Size ToolBox::GetOptimalSize() const
 {
-return ImplCalcSize( this, mnLines );
+// If we have any expandable entries, then force them to their
+// optimal sizes, then reset them afterwards
+std::mapWindow*, Size aExpandables;
+for (size_t i = 0; i  mpData-m_aItems.size(); ++i)
+{
+if (mpData-m_aItems[i].mbExpand)
+{
+Window *pWindow = mpData-m_aItems[i].mpWindow;
+SAL_WARN_IF(!pWindow, vcl.layout, only tabitems with window 
supported at the moment);
+if (!pWindow)
+continue;
+Size aWinSize(pWindow-GetSizePixel());
+aExpandables[pWindow] = aWinSize;
+Size aPrefSize(pWindow-get_preferred_size());
+aWinSize.Width() = aPrefSize.Width();
+pWindow-SetSizePixel(aWinSize);
+}
+}
+
+Size aSize(ImplCalcSize( this, mnLines ));
+
+for (std::mapWindow*, Size::iterator aI = aExpandables.begin(); aI != 
aExpandables.end(); ++aI)
+{
+Window *pWindow = aI-first;
+Size aWinSize = aI-second;
+pWindow-SetSizePixel(aWinSize);
+}
+
+return aSize;
 }
 
 Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits