[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-04-06 Thread Michael Stahl
 vcl/source/font/PhysicalFontFamily.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 69e5f9528b453da1cdb08109ca5359ac518e1c4e
Author: Michael Stahl 
Date:   Wed Apr 6 00:20:28 2016 +0200

tdf#98989: vcl: fix handling of non-scalable fonts like "Courier"

For a VirtualDevice only scalable fonts are cloned, but for non-scalable
bitmap fonts still an empty PhysicalFontFamily with no PhysicalFontFace
is created, which causes text to disappear (height 0).

Suppress creation of such families like it was done in LO 4.3, so that
the fall-back can handle it and map "Courier" to "Courier New".

(regression from 8d6697587776136f3121733e1c29d4200720dbd9)

(cherry picked from commit 2f89245fb7e1c94bed49dde10b08ab1cf41b597b)

Change-Id: I6542a3f7a01bdf46ae2bcf328fa04064f7f86332
Reviewed-on: https://gerrit.libreoffice.org/23851
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/font/PhysicalFontFamily.cxx 
b/vcl/source/font/PhysicalFontFamily.cxx
index b3c650c..3077f79 100644
--- a/vcl/source/font/PhysicalFontFamily.cxx
+++ b/vcl/source/font/PhysicalFontFamily.cxx
@@ -270,7 +270,7 @@ void PhysicalFontFamily::UpdateCloneFontList( 
PhysicalFontCollection& rFontColle
 {
 // This is rather expensive to do per face.
 OUString aFamilyName = GetEnglishSearchFontName( GetFamilyName() );
-PhysicalFontFamily* pFamily = rFontCollection.FindOrCreateFamily( 
aFamilyName );
+PhysicalFontFamily* pFamily(nullptr);
 
 for( PhysicalFontFace* pFace = mpFirst; pFace; pFace = 
pFace->GetNextFace() )
 {
@@ -279,6 +279,11 @@ void PhysicalFontFamily::UpdateCloneFontList( 
PhysicalFontCollection& rFontColle
 if( bEmbeddable && !pFace->IsEmbeddable() && !pFace->IsSubsettable() )
 continue;
 
+if (!pFamily)
+{   // tdf#98989 lazy create as family without faces won't work
+pFamily = rFontCollection.FindOrCreateFamily( aFamilyName );
+}
+assert(pFamily);
 PhysicalFontFace* pClonedFace = pFace->Clone();
 
 assert( pClonedFace->GetFamilyName().replaceAll("-", "").trim() == 
GetFamilyName().replaceAll("-", "").trim() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-03-19 Thread Marco Cecchetti
 vcl/source/outdev/polygon.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 778d0154755b4c2b35041a1a7ab58a48c9e0de13
Author: Marco Cecchetti 
Date:   Tue Mar 8 10:03:06 2016 +0100

tdf#98052 - even polygons were not drawn on the alpha device

Change-Id: I5725ec23869b295c8021bef0330ee6f69f206351
Reviewed-on: https://gerrit.libreoffice.org/23025
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index 369551e..0165b0d 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -212,6 +212,8 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
 
 if(bSuccess)
 {
+if( mpAlphaVDev )
+mpAlphaVDev->DrawPolygon( rPoly );
 return;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-03-14 Thread Justin Luth
 vcl/source/edit/textview.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b170aa84afbbb6c984d739aed15846c2269be9ff
Author: Justin Luth 
Date:   Mon Dec 28 14:20:53 2015 +0300

tdf#96687 - force validation after External Input

After external input (EndExtTextInput), the selection was marked
as invalid, but bFormatted remained true, so all the functions that
re-evaluated and marked the portion as valid again were skipped
and therefore the invalid portion was not painted.

Change-Id: Ibb2208bdaeb8ed17a4a34fa378a2fc750abf1b07
Reviewed-on: https://gerrit.libreoffice.org/20986
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 5a217ada5e28e17f052ebec8e53dce05c2aa9cae)
Reviewed-on: https://gerrit.libreoffice.org/23190
Tested-by: Justin Luth 

diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index 0898838..3c65033 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -932,6 +932,7 @@ void TextView::Command( const CommandEvent& rCEvt )
 delete mpImpl->mpTextEngine->mpIMEInfos;
 mpImpl->mpTextEngine->mpIMEInfos = NULL;
 
+mpImpl->mpTextEngine->TextModified();
 mpImpl->mpTextEngine->FormatAndUpdate( this );
 
 SetInsertMode( bInsertMode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-03-04 Thread Marco Cecchetti
 vcl/source/outdev/polygon.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit da2f91b5ceef6d7c6a7b833b25a48f12f58643f5
Author: Marco Cecchetti 
Date:   Fri Mar 4 11:17:47 2016 +0100

tdf#98052 - polypolygons were not drawn on the alpha device

In OutputDevice::DrawPolyPolygon when b2dpolygon are used for drawing
the source polygon is not drawn on the alpha device.

Change-Id: I54f4e5a13469d9844866cea61b074420219b836d
Reviewed-on: https://gerrit.libreoffice.org/22893
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 
Tested-by: Jenkins 
(cherry picked from commit 5bdbf99c3ec6e5e0793c52c34ff4f3a17afab107)
Reviewed-on: https://gerrit.libreoffice.org/22902

diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index 9008acd..369551e 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -103,6 +103,8 @@ void OutputDevice::DrawPolyPolygon( const 
tools::PolyPolygon& rPolyPoly )
 
 if(bSuccess)
 {
+if( mpAlphaVDev )
+mpAlphaVDev->DrawPolyPolygon( rPolyPoly );
 return;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-02-18 Thread Caolán McNamara
 vcl/source/control/edit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e2aa9b7c8c62338c91a3883b0c400b1259793382
Author: Caolán McNamara 
Date:   Thu Feb 18 13:52:55 2016 +

fix inverted logic regression

regression from...

commit 051b29e1025253f35f87a04e297760aa8b40611f
Author: Luboš Luňák 
Date:   Sun Sep 14 15:45:02 2014 +0200

convert Edit autocomplete Hdl to boost signals2

where the conversion was...

- if ( maAutocompleteHdl.IsSet() )
+ if ( autocompleteSignal.empty() )

instead of the correct

+ if ( !autocompleteSignal.empty() )

Reviewed-on: https://gerrit.libreoffice.org/22477
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 
(cherry picked from commit e919bfcaa5561445ebf39f73171bf1c934818d1a)

Change-Id: Ie87944d66958af595e64b41236bbf515ef7a1f98
Reviewed-on: https://gerrit.libreoffice.org/22478
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 7e04604..2a492da 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2114,7 +2114,7 @@ void Edit::Command( const CommandEvent& rCEvt )
 Invalidate();
 
 // #i25161# call auto complete handler for ext text commit also
-if ( autocompleteSignal.empty() )
+if (!autocompleteSignal.empty())
 {
 if ( (maSelection.Min() == maSelection.Max()) && 
(maSelection.Min() == maText.getLength()) )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-02-04 Thread Caolán McNamara
 vcl/source/gdi/pdfwriter_impl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7f99fdda739e041bc5438001bb57460e41d0f7ad
Author: Caolán McNamara 
Date:   Wed Feb 3 12:36:09 2016 +

Resolves: tdf#96653 distorted images on export to pdf

regression from:

commit ffe150ce903d9cdc62c25ad3437e61d24ede17d6
Date:   Fri Dec 4 18:19:08 2015 +0100

tdf#94739 use GetScanlineSize instead of calculating it

which was on the right track in the sense that the original
code was wrong and only worked for <= 8 bit depth images

Change-Id: Iee54a9f29dd0fdaf3e1f2aeb7b9898cecb453e37
(cherry picked from commit 384c815eda697d75706f686dc2ceb227b4d3f245)
Reviewed-on: https://gerrit.libreoffice.org/22076
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index e509b1a..f2974a2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11426,7 +11426,8 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& 
rObject, bool bMask )
 beginCompression();
 if( ! bTrueColor || pAccess->GetScanlineFormat() == 
BMP_FORMAT_24BIT_TC_RGB )
 {
-const int nScanLineBytes = pAccess->GetScanlineSize();
+//With PDF bitmaps, each row is padded to a BYTE boundary 
(multiple of 8 bits).
+const int nScanLineBytes = ((pAccess->GetBitCount() * 
pAccess->Width()) + 7U) / 8U;
 
 for( int i = 0; i < pAccess->Height(); i++ )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-01-26 Thread Caolán McNamara
 vcl/source/window/winproc.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 72c2f90a42dad97cf9bc1a20c15f9946348fe01b
Author: Caolán McNamara 
Date:   Tue Jan 26 14:46:49 2016 +

Resolves: tdf#97331 use VclPtr instead of pointers to avoid crash

(cherry picked from commit 5d29ed1801a07d4649e095c25935b50f5ad32eb4)
(cherry picked from commit 53e693ccfb19aa653ab2b5762c10ae87c9320954)

Change-Id: Ia653a67046cb2cfb7c96367a7483ddc0cb29819e
Reviewed-on: https://gerrit.libreoffice.org/21810
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 304753a..e708e18 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1354,7 +1354,7 @@ static bool ImplCallWheelCommand( vcl::Window* pWindow, 
const Point& rPos,
 
 static bool acceptableWheelScrollTarget(const vcl::Window *pMouseWindow)
 {
-return (pMouseWindow && pMouseWindow->IsInputEnabled() && 
!pMouseWindow->IsInModalMode());
+return (pMouseWindow && !pMouseWindow->isDisposed() && 
pMouseWindow->IsInputEnabled() && !pMouseWindow->IsInModalMode());
 }
 
 //If the last event at the same absolute screen position was handled by a
@@ -1520,26 +1520,26 @@ public:
 bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt)
 {
 static SalWheelMouseEvent aPreviousEvent;
-static vcl::Window *pPreviousWindow;
+static VclPtr xPreviousWindow;
 
 if (!Setup())
 return false;
 
-vcl::Window *pMouseWindow = FindTarget();
+VclPtr xMouseWindow = FindTarget();
 
 // avoid the problem that scrolling via wheel to this point brings a widget
 // under the mouse that also accepts wheel commands, so stick with the old
 // widget if the time gap is very small
-if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && 
acceptableWheelScrollTarget(pPreviousWindow))
+if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && 
acceptableWheelScrollTarget(xPreviousWindow))
 {
-pMouseWindow = pPreviousWindow;
+xMouseWindow = xPreviousWindow.get();
 }
 
 aPreviousEvent = rEvt;
 
-pPreviousWindow = Dispatch(pMouseWindow);
+xPreviousWindow = Dispatch(xMouseWindow);
 
-return pPreviousWindow != NULL;
+return xPreviousWindow;
 }
 
 class HandleGestureEvent : public HandleGestureEventBase
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-01-25 Thread Caolán McNamara
 vcl/source/filter/wmf/enhwmf.cxx |6 +++---
 vcl/source/filter/wmf/winmtf.cxx |   10 --
 vcl/source/filter/wmf/winmtf.hxx |2 +-
 vcl/source/filter/wmf/winwmf.cxx |4 ++--
 4 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 636d45438f317d7ef39d660c11f6bab1dc42302a
Author: Caolán McNamara 
Date:   Thu Jan 21 09:28:12 2016 +

valgrind: memleak on thrown exception

(cherry picked from commit f5aefab2a62a90c631e05ec29022a2f7e19f00c3)

Change-Id: I2788c5fe04a984d6534adbd3186cc652685152e8
Reviewed-on: https://gerrit.libreoffice.org/21737
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index a59d684..f130fad 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -1239,7 +1239,7 @@ bool EnhWMFReader::ReadEnhWMF()
 Rectangle aCropRect( Point( xSrc, ySrc ), 
Size( cxSrc, cySrc ) );
 aBitmap.Crop( aCropRect );
 }
-aBmpSaveList.push_back( new BSaveStruct( aBitmap, 
aRect, dwRop, pOut->GetFillStyle () ) );
+aBmpSaveList.emplace_back(new BSaveStruct(aBitmap, 
aRect, dwRop, pOut->GetFillStyle ()));
 }
 }
 }
@@ -1303,7 +1303,7 @@ bool EnhWMFReader::ReadEnhWMF()
 Rectangle aCropRect( Point( xSrc, ySrc ), 
Size( cxSrc, cySrc ) );
 aBitmap.Crop( aCropRect );
 }
-aBmpSaveList.push_back( new BSaveStruct( aBitmap, 
aRect, dwRop, pOut->GetFillStyle () ) );
+aBmpSaveList.emplace_back(new BSaveStruct(aBitmap, 
aRect, dwRop, pOut->GetFillStyle ()));
 }
 }
 }
@@ -1373,7 +1373,7 @@ bool EnhWMFReader::ReadEnhWMF()
 Rectangle aCropRect( Point( xSrc, ySrc ), 
Size( cxSrc, cySrc ) );
 aBitmap.Crop( aCropRect );
 }
-aBmpSaveList.push_back( new BSaveStruct( aBitmap, 
aRect, dwRop, pOut->GetFillStyle () ) );
+aBmpSaveList.emplace_back(new BSaveStruct(aBitmap, 
aRect, dwRop, pOut->GetFillStyle ()));
 }
 }
 }
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 513751d..b2ae7dc 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1577,7 +1577,7 @@ void WinMtfOutput::ResolveBitmapActions( 
BSaveStructList_impl& rSaveList )
 size_t  nObjectsOfSameSize = 0;
 size_t  nObjectStartIndex = nObjects - nObjectsLeft;
 
-BSaveStruct*pSave = rSaveList[ nObjectStartIndex ];
+BSaveStruct*pSave = rSaveList[nObjectStartIndex].get();
 Rectangle   aRect( pSave->aOutRect );
 
 for ( i = nObjectStartIndex; i < nObjects; )
@@ -1585,7 +1585,7 @@ void WinMtfOutput::ResolveBitmapActions( 
BSaveStructList_impl& rSaveList )
 nObjectsOfSameSize++;
 if ( ++i < nObjects )
 {
-pSave = rSaveList[ i ];
+pSave = rSaveList[i].get();
 if ( pSave->aOutRect != aRect )
 break;
 }
@@ -1595,7 +1595,7 @@ void WinMtfOutput::ResolveBitmapActions( 
BSaveStructList_impl& rSaveList )
 
 for ( i = nObjectStartIndex; i < ( nObjectStartIndex + 
nObjectsOfSameSize ); i++ )
 {
-pSave = rSaveList[ i ];
+pSave = rSaveList[i].get();
 
 sal_uInt32  nWinRop = pSave->nWinRop;
 sal_uInt8   nRasterOperation = (sal_uInt8)( nWinRop >> 16 );
@@ -1623,7 +1623,7 @@ void WinMtfOutput::ResolveBitmapActions( 
BSaveStructList_impl& rSaveList )
 {
 if ( nObjectsOfSameSize == 2 )
 {
-BSaveStruct* pSave2 = rSaveList[ i + 1 ];
+BSaveStruct* pSave2 = rSaveList[i + 1].get();
 if ( ( pSave->aBmp.GetPrefSize() == 
pSave2->aBmp.GetPrefSize() ) &&
  ( pSave->aBmp.GetPrefMapMode() == 
pSave2->aBmp.GetPrefMapMode() ) )
 {
@@ -1792,8 +1792,6 @@ void WinMtfOutput::ResolveBitmapActions( 
BSaveStructList_impl& rSaveList )
 nObjectsLeft -= nObjectsOfSameSize;
 }
 
-for( size_t i = 0, n = rSaveList.size(); i < n; ++i )
-delete rSaveList[ i ];
 rSaveList.clear();
 }
 
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 3b78821..dd35561 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-01-25 Thread Caolán McNamara
 vcl/source/filter/igif/gifread.cxx |   29 +
 1 file changed, 13 insertions(+), 16 deletions(-)

New commits:
commit 85918431993fe3637145cca62b133c0c21cb5430
Author: Caolán McNamara 
Date:   Thu Jan 21 09:54:29 2016 +

valgrind: memleak on thrown exception

(cherry picked from commit 15b1080e624447ca1af1396023bb1fbfdb44fb26)

Change-Id: If562dc69290021f898feff9f8e3983b867075172
Reviewed-on: https://gerrit.libreoffice.org/21736
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/vcl/source/filter/igif/gifread.cxx 
b/vcl/source/filter/igif/gifread.cxx
index 3526a0b..1e8daf9 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -804,33 +804,30 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic )
 
 bool ImportGIF( SvStream & rStm, Graphic& rGraphic )
 {
-GIFReader*  pGIFReader = static_cast(rGraphic.GetContext());
-SvStreamEndian nOldFormat = rStm.GetEndian();
-ReadState   eReadState;
-boolbRet = true;
+std::unique_ptr  
xGIFReader(static_cast(rGraphic.GetContext()));
+rGraphic.SetContext(nullptr);
 
+SvStreamEndian nOldFormat = rStm.GetEndian();
 rStm.SetEndian( SvStreamEndian::LITTLE );
 
-if( !pGIFReader )
-pGIFReader = new GIFReader( rStm );
+if (!xGIFReader)
+xGIFReader.reset(new GIFReader(rStm));
 
-rGraphic.SetContext( NULL );
-eReadState = pGIFReader->ReadGIF( rGraphic );
+bool bRet = true;
 
-if( eReadState == GIFREAD_ERROR )
+ReadState eReadState = xGIFReader->ReadGIF(rGraphic);
+
+if (eReadState == GIFREAD_ERROR)
 {
 bRet = false;
-delete pGIFReader;
 }
-else if( eReadState == GIFREAD_OK )
-delete pGIFReader;
-else
+else if (eReadState == GIFREAD_NEED_MORE)
 {
-rGraphic = pGIFReader->GetIntermediateGraphic();
-rGraphic.SetContext( pGIFReader );
+rGraphic = xGIFReader->GetIntermediateGraphic();
+rGraphic.SetContext(xGIFReader.release());
 }
 
-rStm.SetEndian( nOldFormat );
+rStm.SetEndian(nOldFormat);
 
 return bRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2016-01-12 Thread Matúš Kukan
 vcl/source/filter/jpeg/JpegWriter.cxx |   39 +++---
 1 file changed, 18 insertions(+), 21 deletions(-)

New commits:
commit 39f0277ba71c8f3834579003c046d12fa4650e8f
Author: Matúš Kukan 
Date:   Mon Jan 11 21:32:55 2016 +0100

tdf#94831: Check for null mpReadAccess before first use

There was erroneously added code before check in
45e8e0fbee40f9a8d91f4c559c8bbb16dd7b3f36.

Change-Id: Ie2e84cfc061097c25e5d799e9c388abd9724bd93
(cherry picked from commit d5dcfe40ff3774d82a7b8f9f3d75b5b3cdac78ba)
Reviewed-on: https://gerrit.libreoffice.org/21373
Tested-by: Jenkins 
Reviewed-by: David Tardon 

diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx 
b/vcl/source/filter/jpeg/JpegWriter.cxx
index fe03540..28143ac 100644
--- a/vcl/source/filter/jpeg/JpegWriter.cxx
+++ b/vcl/source/filter/jpeg/JpegWriter.cxx
@@ -200,32 +200,29 @@ bool JPEGWriter::Write( const Graphic& rGraphic )
 }
 
 mpReadAccess = aGraphicBmp.AcquireReadAccess();
+if( mpReadAccess )
+{
+if ( !mbGreys )  // bitmap was not explicitly converted into greyscale,
+{// check if source is greyscale only
+bool bIsGrey = true;
 
-if ( !mbGreys )  // bitmap was not explicitly converted into greyscale,
-{// check if source is greyscale only
-
-bool bIsGrey = true;
-
-long nWidth = mpReadAccess->Width();
-for ( long nY = 0; bIsGrey && ( nY < mpReadAccess->Height() ); nY++ )
-{
-BitmapColor aColor;
-for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ )
+long nWidth = mpReadAccess->Width();
+for ( long nY = 0; bIsGrey && ( nY < mpReadAccess->Height() ); 
nY++ )
 {
-aColor = mpReadAccess->HasPalette() ? 
mpReadAccess->GetPaletteColor( mpReadAccess->GetPixelIndex( nY, nX ) )
-: mpReadAccess->GetPixel( nY, nX );
-bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( 
aColor.GetRed() == aColor.GetBlue() );
+BitmapColor aColor;
+for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ )
+{
+aColor = mpReadAccess->HasPalette() ? 
mpReadAccess->GetPaletteColor( mpReadAccess->GetPixelIndex( nY, nX ) )
+: mpReadAccess->GetPixel( nY, 
nX );
+bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( 
aColor.GetRed() == aColor.GetBlue() );
+}
 }
+if ( bIsGrey )
+mbGreys = true;
 }
-if ( bIsGrey )
-mbGreys = true;
-}
+if( mpExpWasGrey )
+*mpExpWasGrey = mbGreys;
 
-if( mpExpWasGrey )
-*mpExpWasGrey = mbGreys;
-
-if( mpReadAccess )
-{
 mbNative = ( mpReadAccess->GetScanlineFormat() == 
BMP_FORMAT_24BIT_TC_RGB );
 
 if( !mbNative )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-12-16 Thread Caolán McNamara
 vcl/source/window/syswin.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit f307d1a01a4eeb3e4c9ee207aa0385c8c4586806
Author: Caolán McNamara 
Date:   Thu Dec 3 11:36:42 2015 +

Resolves: tdf#95700 index dialog cut off

queue_resize needs to invalidate the size cache even
if there is a pending layout idle awaiting

Change-Id: I6dba3d37fbb33125cc3f5d17aff6d2f7a3388654
(cherry picked from commit d40d756f4079a228035b5db346da50fe7aed0bd2)
(cherry picked from commit c3a4bfcb0b6191665e63440b99fbf57080bd5c56)
Reviewed-on: https://gerrit.libreoffice.org/20374
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index dcb455d..9399ffd 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1004,11 +1004,13 @@ const Link<>& SystemWindow::GetCloseHdl() const
 
 void SystemWindow::queue_resize(StateChangedType /*eReason*/)
 {
-if (hasPendingLayout() || isCalculatingInitialLayoutSize())
-return;
 if (!isLayoutEnabled())
 return;
+if (isCalculatingInitialLayoutSize())
+return;
 InvalidateSizeCache();
+if (hasPendingLayout())
+return;
 maLayoutIdle.Start();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-12-11 Thread Tomaž Vajngerl
 vcl/source/gdi/pdfwriter_impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ffe150ce903d9cdc62c25ad3437e61d24ede17d6
Author: Tomaž Vajngerl 
Date:   Fri Dec 4 18:19:08 2015 +0100

tdf#94739 use GetScanlineSize instead of calculating it

We calculate the scanline size wrongly when writing a PDF so the
image is not exported correctly. BitmapAccess already has a method
to determine the scanline size so use that instead.

Change-Id: Icccba8f26c5e0fd4bd4c37bba7c5a7fe8d0094bd
(cherry picked from commit 82e0c38e1205a3c8a70234a95ca33ab1400fbe57)
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/20595
Tested-by: Jenkins 

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 0b7fa46..e509b1a 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11426,7 +11426,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& 
rObject, bool bMask )
 beginCompression();
 if( ! bTrueColor || pAccess->GetScanlineFormat() == 
BMP_FORMAT_24BIT_TC_RGB )
 {
-const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( 
pAccess->Width() - 1 ) / 8U );
+const int nScanLineBytes = pAccess->GetScanlineSize();
 
 for( int i = 0; i < pAccess->Height(); i++ )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-12-04 Thread Tomaž Vajngerl
 vcl/source/edit/vclmedit.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 52fe817a32bf69417563e0b66d451e8fca19d212
Author: Tomaž Vajngerl 
Date:   Tue Dec 1 17:44:23 2015 +0100

tdf#94138 Use correct fonts for multiline edit when printing

When drawing a multiline edit we need to use a different device
(current window) to get the correct font and adjust for the Draw
method's input device.

Change-Id: I7993790c02d10e4283c7a4e2caefff0c7747e978
(cherry picked from commit 6c41727484a04ab89005ffb052937dae5d7dc223)
Reviewed-on: https://gerrit.libreoffice.org/20332
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index b6044dc..525f847 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -1362,11 +1362,17 @@ void VclMultiLineEdit::DataChanged( const 
DataChangedEvent& rDCEvt )
 
 void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const 
Size& rSize, sal_uLong nFlags )
 {
-ImplInitSettings( true, true, true );
+ImplInitSettings(true, true, true);
 
 Point aPos = pDev->LogicToPixel( rPos );
 Size aSize = pDev->LogicToPixel( rSize );
-vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetDrawPixelFont( pDev );
+
+vcl::Font aFont = pImpVclMEdit->GetTextWindow()->GetPointFont(*this);
+Size aFontSize = aFont.GetSize();
+MapMode aPtMapMode(MAP_POINT);
+aFontSize = pDev->LogicToPixel(aFontSize, aPtMapMode);
+aFont.SetSize(aFontSize);
+
 aFont.SetTransparent( true );
 OutDevType eOutDevType = pDev->GetOutDevType();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-11-26 Thread Tor Lillqvist
 vcl/source/gdi/sallayout.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit b8711f6600216ca482627a928099a33612008734
Author: Tor Lillqvist 
Date:   Wed Nov 25 13:24:09 2015 +0200

tdf#95783: Don't calculate width of text with glyph fallback as way too wide

The old code in MultiSalLayout::GetTextBreak() only makes sense if the
base level character width is zero where a fallback level has a
non-zero character width, and vice versa. But this is not the case for
Windows, at least not any more now when using UniscribeLayout and not
SimpleWinLayout.

This simple change fixes that: Only use the width from a fallback
level if the width at the base level is zero. Hopefully it does not
cause regressions for other documents or on other platforms. (But, I
repeat, I find it hard to believe that the intent of the code could
really have been to ever add two or more non-zero widths for the same
character from different levels of fallback and use that.)

Change-Id: Ic66c55db4b7463f9e04fcedec76f1c44f5e62e03
(cherry picked from commit a0d112a53023758a28d180ffd12766b4d325bf52)
Reviewed-on: https://gerrit.libreoffice.org/20172
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 4bd388d..7edfc7f 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1979,9 +1979,12 @@ sal_Int32 MultiSalLayout::GetTextBreak( DeviceCoordinate 
nMaxWidth, DeviceCoordi
 fUnitMul /= rLayout.GetUnitsPerPixel();
 for( int i = 0; i < nCharCount; ++i )
 {
-DeviceCoordinate w = pCharWidths[ i + nCharCount ];
-w = (DeviceCoordinate)(w * fUnitMul + 0.5);
-pCharWidths[ i ] += w;
+if( pCharWidths[ i ] == 0 )
+{
+DeviceCoordinate w = pCharWidths[ i + nCharCount ];
+w = (DeviceCoordinate)(w * fUnitMul + 0.5);
+pCharWidths[ i ] = w;
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-11-26 Thread Michael Stahl
 vcl/source/outdev/text.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 273be431c62aaf5fabe218cae57e8f3f9fe049e1
Author: Michael Stahl 
Date:   Wed Nov 25 22:42:16 2015 +0100

vcl: OutputDevice::GetTextArray() should always init pDXAry

CppunitTest_writerperfect_writer file libmwaw/pass/Acta_1.0.hqx uses the
font "Courier", and for unknown reasons we can't properly load that
font, because the PhysicalFontFamily::mpFirst for "courier" is null.

This causes OutputDevice::GetTextArray() to fail to create a SalLayout
and return early before initializing the passed pDXAry, which then
generates lots of DrMemory warnings.

Let's hope the callers are happy about an all-0 pDXAry.

Change-Id: I07b29a59660cf5cd060fd77da5d96021f9d8f9f5
(cherry picked from commit e6e409b684f9b046dcde9f0615018508f769c369)
Reviewed-on: https://gerrit.libreoffice.org/20206
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index faf8fa9..173aa52 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1007,7 +1007,7 @@ long OutputDevice::GetTextArray( const OUString& rStr, 
long* pDXAry,
 }
 
 if( nIndex >= rStr.getLength() )
-return 0;
+return 0; // TODO: this looks like a buggy caller?
 
 if( nLen < 0 || nIndex + nLen >= rStr.getLength() )
 {
@@ -1017,7 +1017,19 @@ long OutputDevice::GetTextArray( const OUString& rStr, 
long* pDXAry,
 SalLayout *const pSalLayout = ImplLayout(rStr, nIndex, nLen,
 Point(0,0), 0, nullptr, SalLayoutFlags::NONE, pLayoutCache);
 if( !pSalLayout )
+{
+// The caller expects this to init the elements of pDXAry.
+// Adapting all the callers to check that GetTextArray succeeded seems
+// too much work.
+// Init here to 0 only in the (rare) error case, so that any missing
+// element init in the happy case will still be found by tools,
+// and hope that is sufficient.
+if (pDXAry)
+{
+memset(pDXAry, 0, nLen * sizeof(*pDXAry));
+}
 return 0;
+}
 #if VCL_FLOAT_DEVICE_PIXEL
 DeviceCoordinate* pDXPixelArray = NULL;
 if(pDXAry)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-11-12 Thread Caolán McNamara
 vcl/source/window/dialog.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5a1d267a1ed7557db3fe4c73bc0749c885f0ebef
Author: Caolán McNamara 
Date:   Thu Nov 12 16:05:44 2015 +

Resolves: tdf#93317 Modified Document Dialog misses focus on Gtk3

Change-Id: I16ddac82a76a1e665797e4be192d3642f2660d9f
(cherry picked from commit 82abd23f3ee1900b7579e5a0afa23581d5836f01)
Reviewed-on: https://gerrit.libreoffice.org/19933
Tested-by: Jenkins 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 72652ae..4ce15de 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -816,6 +816,7 @@ bool Dialog::ImplStartExecuteModal()
 ImplAdjustNWFSizes();
 
 Show();
+ToTop();
 
 pSVData->maAppData.mnModalMode++;
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-11-11 Thread Armin Le Grand
 vcl/source/outdev/bitmap.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 5a86268e5dabaa5c02cf912e3793ce0f44c03a0b
Author: Armin Le Grand 
Date:   Mon Nov 9 14:00:50 2015 +0100

tdf#95481 catch out-of-range access in vcl bitmap

blendBitmap24 assumes bitmap is 2 lines high for doing
interpolation. For bitmaps of height 1, really nothing to interpolate
there. Fix cornercase by 'blending' between the very same line instead.

Reviewed-on: https://gerrit.libreoffice.org/19863
Tested-by: Jenkins 
Reviewed-by: Norbert Thiebaud 

Cherry-picked from 99e3ab6effa9356a1a444160e60ed8df099b15a3

Change-Id: I9b94000aa563e525d0bb2418346ad2c86af26df8
Reviewed-on: https://gerrit.libreoffice.org/19888
Reviewed-by: Katarina Behrens 
Tested-by: Katarina Behrens 

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 2ae0236..3f415d4 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -807,11 +807,13 @@ public:
 const long nMapY  = mpMapY[nY];
 const long nMapFY = mpMapYOffset[nY];
 
-pLine0 = pSource->GetScanline(nMapY);
-pLine1 = pSource->GetScanline(nMapY + 1);
+ pLine0 = pSource->GetScanline(nMapY);
+// tdf#95481 guard nMapY + 1 to be within bounds
+pLine1 = (nMapY + 1 < pSource->Height()) ? 
pSource->GetScanline(nMapY + 1) : pLine0;
 
 pLineAlpha0 = pSourceAlpha->GetScanline(nMapY);
-pLineAlpha1 = pSourceAlpha->GetScanline(nMapY + 1);
+// tdf#95481 guard nMapY + 1 to be within bounds
+pLineAlpha1 = (nMapY + 1 < pSourceAlpha->Height()) ? 
pSourceAlpha->GetScanline(nMapY + 1) : pLineAlpha0;
 
 pDestScanline = pDestination->GetScanline(nY);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-11-09 Thread Michael Stahl
 vcl/source/filter/wmf/winmtf.cxx |5 ++---
 vcl/source/filter/wmf/winmtf.hxx |1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 08337202b175b8ccf4bd1336abad5d817b006213
Author: Michael Stahl 
Date:   Thu Nov 5 13:16:50 2015 +0100

compilerplugins: enhance "badstatics" plugin to find members

Finds static variables of types that have bad non-static members.

(cherry picked from commit 10afa00c8ce4f0de9191cd182409a3a5d8e55bb8)

Omit the actual compiler plugin, just the fix for the release branch.

Change-Id: I81ee940580c0f043feb543840ea4d3dd27734202
Reviewed-on: https://gerrit.libreoffice.org/19829
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 3f54ae8..513751d 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -944,12 +944,11 @@ sal_uInt32 WinMtfOutput::SetRasterOp( sal_uInt32 
nRasterOp )
 if ( nRasterOp != mnRop )
 {
 mnRop = nRasterOp;
-static WinMtfFillStyle aNopFillStyle;
 static WinMtfLineStyle aNopLineStyle;
 
 if ( mbNopMode && ( nRasterOp != R2_NOP ) )
 {   // changing modes from R2_NOP so set pen and brush
-maFillStyle = aNopFillStyle;
+maFillStyle = m_NopFillStyle;
 maLineStyle = aNopLineStyle;
 mbNopMode = false;
 }
@@ -968,7 +967,7 @@ sal_uInt32 WinMtfOutput::SetRasterOp( sal_uInt32 nRasterOp )
 meRasterOp = ROP_OVERPAINT;
 if( !mbNopMode )
 {
-aNopFillStyle = maFillStyle;
+m_NopFillStyle = maFillStyle;
 aNopLineStyle = maLineStyle;
 maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), 
true );
 maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), 
true );
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index d50fb37..3b78821 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -545,6 +545,7 @@ class WinMtfOutput
 WinMtfLineStyle maLineStyle;
 WinMtfFillStyle maLatestFillStyle;
 WinMtfFillStyle maFillStyle;
+WinMtfFillStyle m_NopFillStyle;
 vcl::Font   maLatestFont;
 vcl::Font   maFont;
 sal_uInt32  mnLatestTextAlign;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-30 Thread Tomaž Vajngerl
 vcl/source/control/edit.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d36d2d68f3cb5f270081243269ca83109a2a3732
Author: Tomaž Vajngerl 
Date:   Wed Oct 28 20:27:48 2015 +0100

tdf#94138 also apply settings when printing (Draw call)

(cherry picked from commit 93a007b1b02c13025b08bcefe19dd54e24e2b80f)

Change-Id: I72056f3e167923f00c37648a24190b533eb9b471
Reviewed-on: https://gerrit.libreoffice.org/19655
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 3250845..7e04604 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1804,6 +1804,8 @@ void Edit::Resize()
 
 void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, 
sal_uLong nFlags )
 {
+ApplySettings(*pDev);
+
 Point aPos = pDev->LogicToPixel( rPos );
 Size aSize = pDev->LogicToPixel( rSize );
 vcl::Font aFont = GetDrawPixelFont( pDev );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-27 Thread Caolán McNamara
 vcl/source/filter/wmf/winmtf.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 8965f2b4d9f9436d2353b041c84b67165d729f34
Author: Caolán McNamara 
Date:   Fri Oct 23 16:40:25 2015 +0100

take the world scaling factor for fonts, but not the rotation

regression from

commit 8f705df1221c3f92d8cde68bdf726a7c3ce8fe1b
Author: Tomaž Vajngerl 
Date:   Fri Jul 18 13:36:13 2014 +0200

bnc#881024 Don't world transform font size in WMF/EMF import

which seems to be a regression from

commit 1281c1f52b77c4c4fb08e129542c2c4912b38555
Author: Armin Le Grand 
Date:   Mon Dec 10 16:08:58 2012 +

Resolves: #i121382# Corrected size handling including font size 
handling...

for EMF/WMF imports

Change-Id: I87307c9993d3343b4db636257e2567b10a73b79d
(cherry picked from commit 4eb70290210022860294644d67ba50d55806621c)
Reviewed-on: https://gerrit.libreoffice.org/19559
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index c5d1cf9..3f54ae8 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -408,8 +408,18 @@ Size WinMtfOutput::ImplMap(const Size& rSz, bool 
bDoWorldTransform)
 }
 else
 {
-fWidth = rSz.Width();
-fHeight = rSz.Height();
+//take the scale, but not the rotation
+basegfx::B2DHomMatrix aMatrix(maXForm.eM11, maXForm.eM12, 0,
+  maXForm.eM21, maXForm.eM22, 0);
+basegfx::B2DTuple aScale, aTranslate;
+double fRotate, fShearX;
+if (!aMatrix.decompose(aScale, aTranslate, fRotate, fShearX))
+{
+aScale.setX(1.0);
+aScale.setY(1.0);
+}
+fWidth = rSz.Width() * aScale.getX();
+fHeight = rSz.Height() * aScale.getY();
 }
 
 if ( mnGfxMode == GM_COMPATIBLE )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-23 Thread Tomaž Vajngerl
 vcl/source/control/edit.cxx   |2 ++
 vcl/source/window/window2.cxx |2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 356ac58e6ac6d6c37f4aaffe2904fe118eaf
Author: Tomaž Vajngerl 
Date:   Thu Oct 22 19:03:01 2015 +0200

tdf#94138 fix printing of edit form fields

There are 2 bugs:

- In Window::GetDrawPixelFont we asked for the font to the
current window, which didn't work correctly when printing. The
device itself should provide the font and not the window.

- In paint method the font wasn't setup correctly which should
happen before painting by calling ApplySettings. The effect of
this is that print preview didn't show the correct font for the
edit control and similar when you copy + paste the edit control.
The work around for this is to call ApplySettings again.

Change-Id: I74960355823c71c1d5a18a82bbc86561a3c4b760
(cherry picked from commit 825b3df7f1d987021ec4a08ff8e7ed78e5772c97)
Reviewed-on: https://gerrit.libreoffice.org/19530
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index d83b7f2..3250845 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -495,6 +495,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, 
const Rectangle& rRec
 if (!IsReallyVisible())
 return;
 
+ApplySettings(rRenderContext);
+
 OUString aText = ImplGetText();
 sal_Int32 nLen = aText.getLength();
 
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index e3c19d5..0be48c7 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -654,7 +654,7 @@ Size Window::CalcOutputSize( const Size& rWinSz ) const
 
 vcl::Font Window::GetDrawPixelFont(OutputDevice* pDev) const
 {
-vcl::Font aFont = GetPointFont(*const_cast(this));
+vcl::Font aFont = GetPointFont(*pDev);
 Size aFontSize = aFont.GetSize();
 MapMode aPtMapMode(MAP_POINT);
 aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-22 Thread Tomaž Vajngerl
 vcl/source/gdi/impimage.cxx |   27 ---
 1 file changed, 24 insertions(+), 3 deletions(-)

New commits:
commit 6b7ae3f8dd917d4c3a77c8adda502ca98f86c683
Author: Tomaž Vajngerl 
Date:   Thu Oct 15 22:21:09 2015 +0200

tdf#94384 change the black icons fix for LO 5.0

commit 15195fb801b354a2f2356aa3cea0a06b9eb1e066 removed the Windows
specific codepath in ImplUpdateDisplayBmp, but it is much safer for
LO 5.0 to skip the problematic codepath only when OpenGL is enabled.

The codepath will stay removed only in master.

Change-Id: I438e8194f5ebfee2c58193aeb7fd00e1d44b9690
Reviewed-on: https://gerrit.libreoffice.org/19403
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index ce6323f..4acbc62 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -29,6 +29,10 @@
 #include 
 #include 
 
+#if defined WNT
+#include 
+#endif
+
 #define IMPSYSIMAGEITEM_MASK( 0x01 )
 #define IMPSYSIMAGEITEM_ALPHA   ( 0x02 )
 
@@ -327,11 +331,28 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* 
pOutDev,
 }
 }
 
-void ImplImageBmp::ImplUpdateDisplayBmp(OutputDevice*)
+void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice*
+#if defined WNT
+pOutDev
+#endif
+)
 {
-if (!mpDisplayBmp && !maBmpEx.IsEmpty())
+if( !mpDisplayBmp && !maBmpEx.IsEmpty() )
 {
-mpDisplayBmp = new BitmapEx(maBmpEx);
+#if defined WNT
+if( !maBmpEx.IsAlpha() && !OpenGLHelper::isVCLOpenGLEnabled())
+{
+// FIXME: this looks like rather an obsolete code-path to me.
+const Bitmap aBmp( maBmpEx.GetBitmap().CreateDisplayBitmap( 
pOutDev ) );
+
+if( maBmpEx.IsTransparent() )
+mpDisplayBmp = new BitmapEx( aBmp, 
maBmpEx.GetMask().CreateDisplayBitmap( pOutDev ) );
+else
+mpDisplayBmp = new BitmapEx( aBmp );
+}
+else
+#endif
+mpDisplayBmp = new BitmapEx( maBmpEx );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-14 Thread Tomaž Vajngerl
 vcl/source/gdi/impimage.cxx |   23 +++
 1 file changed, 3 insertions(+), 20 deletions(-)

New commits:
commit 15195fb801b354a2f2356aa3cea0a06b9eb1e066
Author: Tomaž Vajngerl 
Date:   Mon Oct 12 10:49:26 2015 +0200

tdf#94384 fix black icons with OpenGL enabled on Windows

Looks like the Windows specific code in ImplUpdateDisplayBmp is
not needed anymore and causes problems with OpenGL. The icons after
the change still seem to be drawn correctly with OpenGL enabled
or disabled.

Change-Id: I3ae1a0ceb947254aaadbc3d772f0d662b291b594
(cherry picked from commit c97ca26f2d5790d46b712813c15bb6731f0232b0)
Reviewed-on: https://gerrit.libreoffice.org/19346
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index 8ea787e..ce6323f 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -327,28 +327,11 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* 
pOutDev,
 }
 }
 
-void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice*
-#if defined WNT
-pOutDev
-#endif
-)
+void ImplImageBmp::ImplUpdateDisplayBmp(OutputDevice*)
 {
-if( !mpDisplayBmp && !maBmpEx.IsEmpty() )
+if (!mpDisplayBmp && !maBmpEx.IsEmpty())
 {
-#if defined WNT
-if( !maBmpEx.IsAlpha() )
-{
-// FIXME: this looks like rather an obsolete code-path to me.
-const Bitmap aBmp( maBmpEx.GetBitmap().CreateDisplayBitmap( 
pOutDev ) );
-
-if( maBmpEx.IsTransparent() )
-mpDisplayBmp = new BitmapEx( aBmp, 
maBmpEx.GetMask().CreateDisplayBitmap( pOutDev ) );
-else
-mpDisplayBmp = new BitmapEx( aBmp );
-}
-else
-#endif
-mpDisplayBmp = new BitmapEx( maBmpEx );
+mpDisplayBmp = new BitmapEx(maBmpEx);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-09 Thread Tor Lillqvist
 vcl/source/opengl/OpenGLHelper.cxx |   24 
 1 file changed, 20 insertions(+), 4 deletions(-)

New commits:
commit 33e418bbaadec02bf911b606e0d588d7fe4d5808
Author: Tor Lillqvist 
Date:   Thu Oct 8 13:24:12 2015 +0300

Don't re-read the same glsl files over and over again

Change-Id: I10b4badaba01630e1a054b3d4d9cc4720822511a
(cherry picked from commit 048076b8e32a8d348e4b1b4dc72fef860f4498bd)
Reviewed-on: https://gerrit.libreoffice.org/19245
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 538e467..651e63e 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -11,6 +11,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -66,6 +67,7 @@ OString loadShader(const OUString& rFilename)
 {
 OUString aFileURL = getShaderFolder() + rFilename +".glsl";
 osl::File aFile(aFileURL);
+SAL_INFO("vcl.opengl", "Reading " << aFileURL);
 if(aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
 {
 sal_uInt64 nSize = 0;
@@ -85,6 +87,20 @@ OString loadShader(const OUString& rFilename)
 return OString();
 }
 
+OString& getShaderSource(const OUString& rFilename)
+{
+static std::unordered_map aMap;
+static osl::Mutex aMutex;
+osl::MutexGuard aGuard(aMutex);
+
+if (aMap.find(rFilename) == aMap.end())
+{
+aMap[rFilename] = loadShader(rFilename);
+}
+
+return aMap[rFilename];
+}
+
 }
 
 namespace {
@@ -189,8 +205,8 @@ namespace
  const OString& rPreamble )
 {
 // read shaders source
-OString aVertexShaderSource = loadShader( rVertexShaderName );
-OString aFragmentShaderSource = loadShader( rFragmentShaderName );
+OString aVertexShaderSource = getShaderSource( rVertexShaderName );
+OString aFragmentShaderSource = getShaderSource( rFragmentShaderName );
 
 // get info about the graphic device
 #if defined( SAL_UNX ) && !defined( MACOSX ) && !defined( IOS )&& !defined( 
ANDROID )
@@ -374,8 +390,8 @@ GLint OpenGLHelper::LoadShaders(const OUString& 
rVertexShaderName,
 GLint ProgramID = glCreateProgram();
 
 // read shaders from file
-OString aVertexShaderSource = loadShader(rVertexShaderName);
-OString aFragmentShaderSource = loadShader(rFragmentShaderName);
+OString aVertexShaderSource = getShaderSource(rVertexShaderName);
+OString aFragmentShaderSource = getShaderSource(rFragmentShaderName);
 
 
 GLint bBinaryResult = GL_FALSE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-08 Thread László Németh
 vcl/source/window/menufloatingwindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 48a7d0492dbae60d644dd7be9b1b0826fdf36f63
Author: László Németh 
Date:   Wed Sep 30 22:29:46 2015 +0200

tdf#92702 Unable to select menu items that were initially off-screen

Revert "Last item of menu with title cannot be hilighted"

This reverts commit 8ced97caa409d6dc8f69230145e9c9f281fb84fe.

(Cherry-picked from the commit 4f1dca5083c5a301181786b563b165f19a9dec7f)

Change-Id: Ic8c2195d4791900ada0296215c335b9dc39db220
Reviewed-on: https://gerrit.libreoffice.org/19048
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/window/menufloatingwindow.cxx 
b/vcl/source/window/menufloatingwindow.cxx
index 972ec16..5ff6cc2 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -190,7 +190,7 @@ void MenuFloatingWindow::ImplHighlightItem( const 
MouseEvent& rMEvt, bool bMBDow
 long nY = GetInitialItemY();
 long nMouseY = rMEvt.GetPosPixel().Y();
 Size aOutSz = GetOutputSizePixel();
-if ( ( nMouseY >= nY ) && ( nMouseY < ( aOutSz.Height() + nY ) ) )
+if ( ( nMouseY >= nY ) && ( nMouseY < ( aOutSz.Height() - nY ) ) )
 {
 bool bHighlighted = false;
 size_t nCount = pMenu->pItemList->size();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-08 Thread Caolán McNamara
 vcl/source/gdi/sallayout.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 92eed31707e655e484e263fee2b0c0ae93d73748
Author: Caolán McNamara 
Date:   Fri Oct 2 11:25:29 2015 +0100

Resolves: tdf#92993 access violation on particular .docx on glyph layout

Change-Id: I69dfd6747e37ddb1727dd41b99d1b70eaed83425
(cherry picked from commit ae850353151cd6a79f7b4a012d0a411013c841a4)
Reviewed-on: https://gerrit.libreoffice.org/19095
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 69d162f..4bd388d 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1720,8 +1720,9 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
 maFallbackRuns[n].ResetPos();
 // get the next codepoint index that needs fallback
 int nActiveCharPos = nCharPos[0];
+int nActiveCharIndex = nActiveCharPos - mnMinCharPos;
 // get the end index of the active run
-int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])?
+int nLastRunEndChar = (nActiveCharIndex >= 0 && vRtl[nActiveCharIndex]) ?
 rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1;
 int nRunVisibleEndChar = nCharPos[0];
 // merge the fallback levels
@@ -1870,7 +1871,8 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
 if( !bLTR )
 nOldRunAdv = -nOldRunAdv;
 #endif
-if (vRtl[nActiveCharPos - mnMinCharPos])
+nActiveCharIndex = nActiveCharPos - mnMinCharPos;
+if (nActiveCharIndex >= 0 && vRtl[nActiveCharIndex])
 {
   if (nRunVisibleEndChar > mnMinCharPos && nRunVisibleEndChar <= 
mnEndCharPos)
   nRunAdvance -= aMultiArgs.mpDXArray[nRunVisibleEndChar - 1 - 
mnMinCharPos];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-10-06 Thread Tomaž Vajngerl
 vcl/source/gdi/virdev.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 08ef823974901a42bf6c39aabcc55397784e0699
Author: Tomaž Vajngerl 
Date:   Mon Sep 28 12:51:02 2015 +0200

don't allocate (by eraseing) an un-initialized 1x1 virtual device

Change-Id: I11c7063d7ac689866461ceabf8648f1c3c7bb17d
(cherry picked from commit d76c5aa78f0b9004c6719dcc4d2be052c0703ba5)
Reviewed-on: https://gerrit.libreoffice.org/19162
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 04ac2d7..b24378d 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -129,6 +129,8 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* 
pOutDev,
 {
 SAL_INFO( "vcl.virdev", "ImplInitVirDev(" << nDX << "," << nDY << "," << 
nBitCount << ")" );
 
+bool bErase = nDX > 0 && nDY > 0;
+
 if ( nDX < 1 )
 nDX = 1;
 
@@ -191,7 +193,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* 
pOutDev,
 SetBackground( Wallpaper( Color( COL_WHITE ) ) );
 
 // #i59283# don't erase user-provided surface
-if( !pData )
+if( !pData && bErase)
 Erase();
 
 // register VirDev in the list
@@ -212,7 +214,7 @@ VirtualDevice::VirtualDevice( sal_uInt16 nBitCount )
  "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for 
BitCount, not " << nBitCount );
 SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" 
);
 
-ImplInitVirDev( Application::GetDefaultDevice(), 1, 1, nBitCount );
+ImplInitVirDev( Application::GetDefaultDevice(), 0, 0, nBitCount );
 }
 
 VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 
nBitCount )
@@ -223,7 +225,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, 
sal_uInt16 nBitCount
  "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for 
BitCount, not " << nBitCount );
 SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" 
);
 
-ImplInitVirDev( , 1, 1, nBitCount );
+ImplInitVirDev( , 0, 0, nBitCount );
 }
 
 VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 
nBitCount, sal_uInt16 nAlphaBitCount )
@@ -235,7 +237,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, 
sal_uInt16 nBitCount
 SAL_INFO( "vcl.gdi",
 "VirtualDevice::VirtualDevice( " << nBitCount << ", " << 
nAlphaBitCount << " )" );
 
-ImplInitVirDev( , 1, 1, nBitCount );
+ImplInitVirDev( , 0, 0, nBitCount );
 
 // Enable alpha channel
 mnAlphaDepth = sal::static_int_cast(nAlphaBitCount);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source vcl/unx

2015-09-28 Thread Mark Hung
 vcl/source/gdi/sallayout.cxx|2 +-
 vcl/unx/generic/gdi/cairotextrender.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ea91af84c13f37caf97cd3823a1593d46957a6db
Author: Mark Hung 
Date:   Tue Aug 18 20:17:05 2015 +0800

tdf#83252 - Wrong punctuation direction after Chinese characters in

vertical layout.

Change-Id: I6391e665db205545f0d660e3de826755c954f286
Reviewed-on: https://gerrit.libreoffice.org/17836
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/18879
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index cdf7cb88..69d162f 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -200,7 +200,7 @@ int GetVerticalFlags( sal_UCS4 nChar )
  are GF_NONE also, but already handled in the outer if condition
 */
 if((nChar >= 0x3008 && nChar <= 0x301C && nChar != 0x3012)
-|| (nChar == 0xFF3B || nChar == 0xFF3D)
+|| (nChar == 0xFF3B || nChar == 0xFF3D || nChar==0xFF08 || 
nChar==0xFF09)
 || (nChar >= 0xFF5B && nChar <= 0xFF9F) // halfwidth forms
 || (nChar == 0xFFE3) )
 return GF_NONE; // not rotated
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx 
b/vcl/unx/generic/gdi/cairotextrender.cxx
index a3248b7..2e3aa90 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -248,7 +248,7 @@ void CairoTextRender::DrawServerFontLayout( const 
ServerFontLayout& rLayout )
 {
 int nGlyphRotation = *aI;
 
-std::vector::const_iterator aNext = std::find_if(aI+1, aEnd, 
hasRotation);
+std::vector::const_iterator aNext = 
nGlyphRotation?(aI+1):std::find_if(aI+1, aEnd, hasRotation);
 
 size_t nStartIndex = std::distance(aStart, aI);
 size_t nLen = std::distance(aI, aNext);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-21 Thread Caolán McNamara
 vcl/source/outdev/transparent.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 79a3a1ee610297ba6982e482cd471ee743e6ce8f
Author: Caolán McNamara 
Date:   Fri Sep 18 13:05:31 2015 +0100

valgrind: memory leak in scoped_ptr/unique_ptr -> VclPtr convert

regression from

commit 820576af4fd6441a752742b43d804e9837839925
Author: Noel Grandin 
Date:   Thu Mar 19 13:54:12 2015 +0200

start wrapping OutputDevice in VclPtr

 9,800 (568 direct, 9,232 indirect) bytes in 1 blocks are definitely lost 
in loss record 12,696 of 12,898
by 0xC602E72: 
ScopedVclPtrInstance::ScopedVclPtrInstance<>() (vclptr.hxx:375)

(cherry picked from commit 23d4d2f6ac5aa2ca94109e07421a1ed8330b85bd)

Change-Id: I356f39c339fd28a9e19a00d61b6f1bee492f2638
Reviewed-on: https://gerrit.libreoffice.org/18689
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/outdev/transparent.cxx 
b/vcl/source/outdev/transparent.cxx
index 69a4244..7f3b355 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -751,7 +751,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& 
rMtf, const Point& rPos,
 
 const AlphaMask aAlpha(xVDev->GetBitmap(aPoint, 
xVDev->GetOutputSizePixel()));
 
-xVDev.reset();
+xVDev.disposeAndClear();
 
 // draw masked content to target and restore MapMode
 DrawBitmapEx(aDstRect.TopLeft(), BitmapEx(aPaint, aAlpha));
@@ -799,7 +799,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& 
rMtf, const Point& rPos,
 
 aAlpha = xVDev->GetBitmap( Point(), 
xVDev->GetOutputSizePixel() );
 
-xVDev.reset();
+xVDev.disposeAndClear();
 
 EnableMapMode( false );
 DrawBitmapEx( aDstRect.TopLeft(), BitmapEx( aPaint, aAlpha 
) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-16 Thread Michael Meeks
 vcl/source/window/event.cxx  |   10 +-
 vcl/source/window/status.cxx |6 ++
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit f7554e3e6ff17c850f444bd58767e68e8741387a
Author: Michael Meeks 
Date:   Tue Sep 15 23:42:52 2015 +0100

tdf#94213 - calc re-size flicker turns out to be the status bar.

Using vdev's associated with old contexts, is un-necessary and a
recipe for context switching & hence flicker.

Change-Id: I37ed967a7816e5ca0240908ab4793ce1e68570ee
Reviewed-on: https://gerrit.libreoffice.org/18602
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/18608
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 852cc0c..35c3e38 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -453,7 +454,14 @@ void Window::ImplCallResize()
 {
 mpWindowImpl->mbCallResize = false;
 
-if( GetBackground().IsGradient() )
+// OpenGL has a charming feature of black clearing the whole window
+// some legacy code eg. the app-menu has the beautiful feature of
+// avoiding re-paints when width doesn't change => invalidate all.
+if( OpenGLWrapper::isVCLOpenGLEnabled() )
+Invalidate();
+
+// Normally we avoid blanking on re-size unless people might notice:
+else if( GetBackground().IsGradient() )
 Invalidate();
 
 Resize();
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index e8e2aaf..76c2de3 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -731,6 +732,11 @@ void StatusBar::Paint(vcl::RenderContext& rRenderContext, 
const Rectangle&)
 // Do offscreen only when we are not recording layout..
 bool bOffscreen = !rRenderContext.ImplIsRecordLayout();
 
+// tdf#94213 - un-necessary virtual-device in GL mode
+// causes context switch & hence flicker during sizing.
+if( OpenGLWrapper::isVCLOpenGLEnabled() )
+bOffscreen = false;
+
 for (sal_uInt16 i = 0; i < nItemCount; i++)
 {
 ImplDrawItem(rRenderContext, bOffscreen, i, true, true);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-11 Thread Miklos Vajna
 vcl/source/outdev/font.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 170eddb183293bc5740e3d2af09f4bc0a65b985d
Author: Miklos Vajna 
Date:   Fri Sep 4 16:06:46 2015 +0200

tdf#92505 vcl: fix substituting missing glyphs

Commit a6b00d16eb27a5e7e31c721671001a909ecef960 (Related bnc#822625:
Cache FontEntry with the original FontSelectPattern.) and the follow-up
16a62079018aea0e72636bdb00576487b4e830b9 (Oops, this reference can't be
const., 2014-05-28) changed the font cache key, so that it's directly
what was the argument to ImplFontCache::GetFontEntry(), which leads to
missing glyphs in the bugdoc, e.g. the 4 check mark characters are
rendered as a check mark only in the DejaVu Sans case on my machine, the
other 3 cases result in placeholders.

Fix the problem by changing back the key to aFontSelData, which is
possibly modified in ImplFontCache::GetFontEntry() before used as a key.

Change-Id: I80eb4ba0f986a10100b6ae421d1346f235ce83b7
(cherry picked from commit e047caf4bb461fb168d9fe08228c049938ca1698)
Reviewed-on: https://gerrit.libreoffice.org/18437
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index eb98b2c..1e46329 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1258,7 +1258,6 @@ ImplFontEntry* ImplFontCache::GetFontEntry( 
PhysicalFontCollection* pFontList,
 ImplFontEntry* ImplFontCache::GetFontEntry( PhysicalFontCollection* pFontList,
 FontSelectPattern& aFontSelData )
 {
-const FontSelectPattern aFontSelDataOrig(aFontSelData);
 // check if a directly matching logical font instance is already cached,
 // the most recently used font usually has a hit rate of >50%
 ImplFontEntry *pEntry = NULL;
@@ -1345,9 +1344,8 @@ ImplFontEntry* ImplFontCache::GetFontEntry( 
PhysicalFontCollection* pFontList,
 }
 #endif
 
-// Add the new entry to the cache with the original FontSelectPattern,
-// so that we can find it next time as a direct cache hit.
-maFontInstanceList[ aFontSelDataOrig ] = pEntry;
+// add the new entry to the cache
+maFontInstanceList[ aFontSelData ] = pEntry;
 }
 
 mpFirstEntry = pEntry;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-11 Thread Miklos Vajna
 vcl/source/window/cursor.cxx |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 8488315d565a061749546df27d2507d0927a8993
Author: Miklos Vajna 
Date:   Fri Sep 4 09:16:44 2015 +0200

Related: tdf#92982 vcl rendercontext: optimize non-buffered paint of Cursor

Change-Id: Ic8065d4f656d42f1e2e7d8b4c602010fa0ae2d34
Reviewed-on: https://gerrit.libreoffice.org/18343
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 1968a26..945789a 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -44,8 +44,11 @@ struct ImplCursorData
 static void ImplCursorInvert( ImplCursorData* pData )
 {
 vcl::Window* pWindow  = pData->mpWindow;
-PaintBufferGuard aGuard(pWindow->ImplGetWindowImpl()->mpFrameData, 
pWindow);
-vcl::RenderContext* pRenderContext = aGuard.GetRenderContext();
+std::unique_ptr pGuard;
+const bool bDoubleBuffering = pWindow->SupportsDoubleBuffering();
+if (bDoubleBuffering)
+pGuard.reset(new 
PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow));
+vcl::RenderContext* pRenderContext = bDoubleBuffering ? 
pGuard->GetRenderContext() : pWindow;
 Rectangle aPaintRect;
 boolbMapMode = pRenderContext->IsMapModeEnabled();
 pRenderContext->EnableMapMode( false );
@@ -111,16 +114,19 @@ static void ImplCursorInvert( ImplCursorData* pData )
 if ( pData->mnOrientation )
 aPoly.Rotate( pData->maPixRotOff, pData->mnOrientation );
 pRenderContext->Invert( aPoly, nInvertStyle );
-aPaintRect = aPoly.GetBoundRect();
+if (bDoubleBuffering)
+aPaintRect = aPoly.GetBoundRect();
 }
 }
 else
 {
 pRenderContext->Invert( aRect, nInvertStyle );
-aPaintRect = aRect;
+if (bDoubleBuffering)
+aPaintRect = aRect;
 }
 pRenderContext->EnableMapMode( bMapMode );
-aGuard.SetPaintRect(pRenderContext->PixelToLogic(aPaintRect));
+if (bDoubleBuffering)
+pGuard->SetPaintRect(pRenderContext->PixelToLogic(aPaintRect));
 }
 
 void vcl::Cursor::ImplDraw()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-11 Thread Miklos Vajna
 vcl/source/opengl/OpenGLContext.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit b7ffafe77d95c72402bdac0328ca3bfcb7444067
Author: Miklos Vajna 
Date:   Thu Sep 10 11:39:44 2015 +0200

windows opengl: mpCurrentProgram seen as 0

in JunitTest_sc_unoapi_3.

Change-Id: Ibe12a31c1158f782bd7df115171b07e1843d025c
(cherry picked from commit 57fc41adc9292f8980bb80d7983310fe6fe3)
Reviewed-on: https://gerrit.libreoffice.org/18489
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index d1df28b..ea9664e 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1751,6 +1751,13 @@ OpenGLProgram* OpenGLContext::UseProgram( const 
OUString& rVertexShader, const O
 return pProgram;
 
 mpCurrentProgram = pProgram;
+
+if (!mpCurrentProgram)
+{
+SAL_WARN("vcl.opengl", "OpenGLContext::UseProgram: mpCurrentProgram is 
0");
+return 0;
+}
+
 mpCurrentProgram->Use();
 
 return mpCurrentProgram;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-08 Thread Markus Mohrhard
 vcl/source/opengl/OpenGLContext.cxx |   22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

New commits:
commit 2fd94938a9e45ef143aac51a589654387796e388
Author: Markus Mohrhard 
Date:   Mon Sep 7 22:33:22 2015 +0200

don't use a null display

Change-Id: Iab0a53abd723f0309f40742636315079a4b2c532
(cherry picked from commit c94d60d6c164e4552b491d348ab0f5c198b6e856)
Signed-off-by: Michael Stahl 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index db39c73..5ca7704 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -465,18 +465,24 @@ public:
 TempErrorHandler(Display* dpy, errorHandler newErrorHandler):
 mdpy(dpy)
 {
-XLockDisplay(dpy);
-XSync(dpy, false);
-oldErrorHandler = XSetErrorHandler(newErrorHandler);
+if (mdpy)
+{
+XLockDisplay(dpy);
+XSync(dpy, false);
+oldErrorHandler = XSetErrorHandler(newErrorHandler);
+}
 }
 
 ~TempErrorHandler()
 {
-// sync so that we possibly get an XError
-glXWaitGL();
-XSync(mdpy, false);
-XSetErrorHandler(oldErrorHandler);
-XUnlockDisplay(mdpy);
+if (mdpy)
+{
+// sync so that we possibly get an XError
+glXWaitGL();
+XSync(mdpy, false);
+XSetErrorHandler(oldErrorHandler);
+XUnlockDisplay(mdpy);
+}
 }
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-07 Thread Markus Mohrhard
 vcl/source/opengl/OpenGLContext.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 42674aaed9b3f88fa95eb73a3cd88d4fb56264e1
Author: Markus Mohrhard 
Date:   Mon Sep 7 16:39:04 2015 +0200

tdf#93989 - prevent crash with non-vcl OpenGL contexts

Change-Id: Ia829b0f723c8ded1237e52d48f034da3c1ac249e
Signed-off-by: Michael Meeks 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index e217690..978fdd7f 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1505,7 +1505,8 @@ void OpenGLContext::resetCurrent()
 #elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
 // nothing
 #elif defined( UNX )
-glXMakeCurrent(m_aGLWin.dpy, None, NULL);
+if (m_aGLWin.dpy)
+glXMakeCurrent(m_aGLWin.dpy, None, NULL);
 #endif
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-07 Thread Markus Mohrhard
 vcl/source/opengl/OpenGLContext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 367fa7d8de5d4e163d1b7e50f3880d17bcdf887b
Author: Markus Mohrhard 
Date:   Mon Sep 7 21:13:26 2015 +0200

avoid some OpenGL calls when vcl OpenGL is not enabled

There are even more and it is causing a number of performance issues.
This just fixes the most obvious place.

Change-Id: Id85c13b5b7f4bb0bc077e62c39258067e17c0094
Signed-off-by: Michael Meeks 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 978fdd7f..5893cf6 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1397,7 +1397,7 @@ bool OpenGLContext::isCurrent()
 return false;
 #elif defined( UNX )
 GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win;
-return (glXGetCurrentContext() == m_aGLWin.ctx &&
+return (m_aGLWin.ctx && glXGetCurrentContext() == m_aGLWin.ctx &&
 glXGetCurrentDrawable() == nDrawable);
 #endif
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-03 Thread Stephan Bergmann
 vcl/source/gdi/bitmap3.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 65305ee03a64a90fa011b5b11b7076ddecf7728b
Author: Stephan Bergmann 
Date:   Thu Sep 3 16:29:31 2015 +0200

Fix mis-merge

...where fb6f2e1109abdd09e80dbcd6660a9530fc06ff0f "Resolves: #i121407# 
Gallery
reorganizations..." first cherry-picked the younger 
8012fae6cedcf325130d70adf0a486e8918f452f
before f7d373d18f965b36f310d44044bdba6476f6eb03 "Added ColorDepth change 
test with assertion to
the Bitmap::Scale method" then cherry-picked the older 
4be8cc079667cca2cae91dba9e46c16ccff1537f,
leading to the two checks at the top of Bitmap::Scale to not return early 
as intended.

Thanks to clang-tidy clang-analyzer-deadcode.DeadStores for flagging this.

Change-Id: Id89cc517a9f7efdff040c70f3b0e640d969cf24d
(cherry picked from commit 0aa9cd69598e1c022aa676f81dc7bc2f03e58b2c)
Reviewed-on: https://gerrit.libreoffice.org/18310
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 9a656d6..f5f6c32 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -866,22 +866,20 @@ bool Bitmap::ImplConvertGhosted()
 
 bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag 
nScaleFlag )
 {
-bool bRetval(false);
-
-const sal_uInt16 nStartCount(GetBitCount());
-
 if(basegfx::fTools::equalZero(rScaleX) || 
basegfx::fTools::equalZero(rScaleY))
 {
 // no scale
-bRetval = true;
+return true;
 }
 
 if(basegfx::fTools::equal(rScaleX, 1.0) && basegfx::fTools::equal(rScaleY, 
1.0))
 {
 // no scale
-bRetval = true;
+return true;
 }
 
+const sal_uInt16 nStartCount(GetBitCount());
+
 if( mpImpBmp )
 {
 // implementation specific scaling
@@ -917,6 +915,8 @@ bool Bitmap::Scale( const double& rScaleX, const double& 
rScaleY, BmpScaleFlag n
 if (nStartCount == 1 && nScaleFlag != BmpScaleFlag::NONE)
 nScaleFlag = BmpScaleFlag::Fast;
 
+bool bRetval(false);
+
 switch(nScaleFlag)
 {
 case BmpScaleFlag::NONE :
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-02 Thread Jan Holesovsky
 vcl/source/opengl/OpenGLContext.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 56e49887e0c348297f9c75bb9eb5497b39f9fbfa
Author: Jan Holesovsky 
Date:   Wed Sep 2 11:37:17 2015 +0200

windows opengl: Avoid an unnecessary wglMakeCurrent() call.

Change-Id: I1c1287a29067c053565c49c0ce96918a2d27d87f
Reviewed-on: https://gerrit.libreoffice.org/18260
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 84d8a79..16e499d 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1278,7 +1278,6 @@ void OpenGLContext::reset()
 // destroy all programs
 if( !maPrograms.empty() )
 {
-
 makeCurrent();
 maPrograms.clear();
 }
@@ -1296,7 +1295,8 @@ void OpenGLContext::reset()
 if (itr != g_vShareList.end())
 g_vShareList.erase(itr);
 
-wglMakeCurrent(NULL, NULL);
+if (wglGetCurrentContext() != NULL)
+wglMakeCurrent(NULL, NULL);
 wglDeleteContext( m_aGLWin.hRC );
 ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-02 Thread Michael Meeks
 vcl/source/opengl/OpenGLHelper.cxx |   71 -
 1 file changed, 55 insertions(+), 16 deletions(-)

New commits:
commit 419522f7256865aeceb1b30f1a333e87fdd72fc9
Author: Michael Meeks 
Date:   Wed Sep 2 11:18:42 2015 +0100

tdf#93850 - Defer watchdog during shader compiles.

Shader compilation can take a while the first time; best not to
disable GL at that point. Have more of a hair trigger at other times.
Also explicitly exit if we appear to have hung in std::abort handling.

Conflicts:
vcl/source/opengl/OpenGLHelper.cxx

Change-Id: I45f0873672f950fb3baba0ca859d854a0bb25064
Reviewed-on: https://gerrit.libreoffice.org/18265
Reviewed-by: Michael Meeks 
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index deaf91c..526e124 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -28,6 +28,7 @@
 
 #include "svdata.hxx"
 
+#include "salinst.hxx"
 #include "opengl/zone.hxx"
 #include "opengl/watchdog.hxx"
 #include 
@@ -38,6 +39,10 @@
 #include "opengl/win/WinDeviceInfo.hxx"
 #endif
 
+static bool volatile gbInShaderCompile = false;
+sal_uInt64 volatile OpenGLZone::gnEnterCount = 0;
+sal_uInt64 volatile OpenGLZone::gnLeaveCount = 0;
+
 namespace {
 
 OUString getShaderFolder()
@@ -140,6 +145,8 @@ GLint OpenGLHelper::LoadShaders(const OUString& 
rVertexShaderName,const OUString
 {
 OpenGLZone aZone;
 
+gbInShaderCompile = true;
+
 VCL_GL_INFO("vcl.opengl", "Load shader: vertex " << rVertexShaderName << " 
fragment " << rFragmentShaderName);
 // Create the shaders
 GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER);
@@ -190,6 +197,11 @@ GLint OpenGLHelper::LoadShaders(const OUString& 
rVertexShaderName,const OUString
 return LogCompilerError(ProgramID, "program", "", false);
 
 CHECK_GL_ERROR();
+
+// Ensure we bump our counts before we leave the shader zone.
+{ OpenGLZone aMakeProgress; }
+gbInShaderCompile = false;
+
 return ProgramID;
 }
 
@@ -462,9 +474,6 @@ bool OpenGLHelper::supportsVCLOpenGL()
 return true;
 }
 
-sal_uInt64 volatile OpenGLZone::gnEnterCount = 0;
-sal_uInt64 volatile OpenGLZone::gnLeaveCount = 0;
-
 void OpenGLZone::enter() { gnEnterCount++; }
 void OpenGLZone::leave() { gnLeaveCount++; }
 
@@ -481,13 +490,17 @@ OpenGLWatchdogThread::OpenGLWatchdogThread()
 
 void OpenGLWatchdogThread::execute()
 {
-static const int nDisableEntries = 4; // 2 seconds - disable GL
-static const int nAbortAfter = 10;   // 5 seconds - not coming back; abort
+// delays to take various actions in 1/4 of a second increments.
+static const int nDisableEntries[2] = { 6 /* 1.5s */, 20 /* 5s */ };
+static const int nAbortAfter[2] = { 20 /* 10s */, 120 /* 30s */ };
+
 int nUnchanged = 0; // how many unchanged nEnters
 
 TimeValue aHalfSecond;
 aHalfSecond.Seconds = 0;
-aHalfSecond.Nanosec = 1000*1000*1000/2;
+aHalfSecond.Nanosec = 1000*1000*1000/4;
+
+bool bAbortFired = false;
 
 do {
 sal_uInt64 nLastEnters = OpenGLZone::gnEnterCount;
@@ -496,28 +509,54 @@ void OpenGLWatchdogThread::execute()
 
 if (OpenGLZone::isInZone())
 {
+int nType = 0;
+// The shader compiler can take a long time, first time.
+if (gbInShaderCompile)
+nType = 1;
+
 if (nLastEnters == OpenGLZone::gnEnterCount)
 nUnchanged++;
 else
 nUnchanged = 0;
 SAL_INFO("vcl.opengl", "GL watchdog - unchanged " <<
  nUnchanged << " enter count " <<
- OpenGLZone::gnEnterCount);
+ OpenGLZone::gnEnterCount << " type " <<
+ (nType ? "in shader" : "normal gl") <<
+ "breakpoints mid: " << nDisableEntries[nType] <<
+ " max " << nAbortAfter[nType]);
 
 // Not making progress
-if (nUnchanged == nDisableEntries)
+if (nUnchanged >= nDisableEntries[nType])
 {
-gbWatchdogFiring = true;
-SAL_WARN("vcl.opengl", "Watchdog triggered: hard disable GL");
-OpenGLZone::hardDisable();
-gbWatchdogFiring = false;
+static bool bFired = false;
+if (!bFired)
+{
+gbWatchdogFiring = true;
+SAL_WARN("vcl.opengl", "Watchdog triggered: hard disable 
GL");
+OpenGLZone::hardDisable();
+gbWatchdogFiring = false;
+}
+bFired = true;
+
+// we can hang using VCL in the abort handling -> be impatient
+if 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-01 Thread Michael Meeks
 vcl/source/opengl/OpenGLHelper.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit bce18e962dacdf6246123493690aa4b942568d10
Author: Michael Meeks 
Date:   Mon Aug 31 21:29:21 2015 +0100

tdf#93822 - disable horror legacy menu background saving for OpenGL.

Change-Id: Icaa5fb197f3fa234da4538a2a7b21131cab89277
Reviewed-on: https://gerrit.libreoffice.org/18203
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 958d523..859cda3 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -26,6 +26,8 @@
 #include 
 #include 
 
+#include "svdata.hxx"
+
 #include "opengl/zone.hxx"
 #include "opengl/watchdog.hxx"
 #include 
@@ -629,7 +631,10 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
 bRet = bEnable;
 }
 if (bRet)
+{
 OpenGLWatchdogThread::start();
+ImplGetSVData()->maWinData.mbNoSaveBackground = true;
+}
 
 return bRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-01 Thread Markus Mohrhard
 vcl/source/opengl/OpenGLContext.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 8cb5adc2c1ce42cda302b72ac145053bc906d7c6
Author: Markus Mohrhard 
Date:   Fri Jun 12 02:45:54 2015 +0200

get rid of a few thousand unnecessary OpenGL calls

For each iteration of the (gtk) main loop we are dropping the yield
mutext which results in calling OpenGLContext::clearCurrent. That method
calls OpenGLContext::ReleaseFramebuffers which would call in the end
glBindFramebuffer for each framebuffer related to that context.

This would easily grow into the thousand OpenGL calls without doing any
work.

Change-Id: I209cc534fe58a5e11ef7df7f850a787916b8bd43
Reviewed-on: https://gerrit.libreoffice.org/16241
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 
Reviewed-on: https://gerrit.libreoffice.org/18218
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 5c64448..d4c2a83 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1633,8 +1633,11 @@ void OpenGLContext::ReleaseFramebuffers()
 OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
 while( pFramebuffer )
 {
-BindFramebuffer( pFramebuffer );
-pFramebuffer->DetachTexture();
+if (!pFramebuffer->IsFree())
+{
+BindFramebuffer( pFramebuffer );
+pFramebuffer->DetachTexture();
+}
 pFramebuffer = pFramebuffer->mpPrevFramebuffer;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-01 Thread Michael Meeks
 vcl/source/opengl/OpenGLContext.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit bcef0483cfbff181ca940fe219226d11cbb0e6a4
Author: Michael Meeks 
Date:   Thu Aug 27 20:39:19 2015 +0100

tdf#93530 - glClear our depth, stencil and buffer contents on init.

Change-Id: I117fd5f5fd12fd6534b9d10532a39807ad82ce71
Reviewed-on: https://gerrit.libreoffice.org/18069
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 
Reviewed-on: https://gerrit.libreoffice.org/18220
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 388a1a0..20b510f 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -871,6 +871,9 @@ bool OpenGLContext::ImplInit()
 
 bool bRet = InitGLEW();
 InitGLEWDebugging();
+
+glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+
 return bRet;
 }
 
@@ -1013,6 +1016,8 @@ bool OpenGLContext::ImplInit()
 m_aGLWin.Width = clientRect.right - clientRect.left;
 m_aGLWin.Height = clientRect.bottom - clientRect.top;
 
+glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-01 Thread Jan Holesovsky
 vcl/source/opengl/OpenGLContext.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7017ab3559f8298f9afa364171531a10782d8d29
Author: Jan Holesovsky 
Date:   Tue Sep 1 18:38:27 2015 +0200

windows opengl: When the 2nd param is NULL, the 1st is ignored anyway.

Change-Id: I840e8bb2d2ccae869c330bb32dba484b4a835a51
Reviewed-on: https://gerrit.libreoffice.org/18248
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index c4ff6d8..84d8a79 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1296,7 +1296,7 @@ void OpenGLContext::reset()
 if (itr != g_vShareList.end())
 g_vShareList.erase(itr);
 
-wglMakeCurrent( m_aGLWin.hDC, 0 );
+wglMakeCurrent(NULL, NULL);
 wglDeleteContext( m_aGLWin.hRC );
 ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC );
 }
@@ -1473,7 +1473,7 @@ void OpenGLContext::resetCurrent()
 OpenGLZone aZone;
 
 #if defined( WNT )
-wglMakeCurrent( m_aGLWin.hDC, 0 );
+wglMakeCurrent(NULL, NULL);
 #elif defined( MACOSX )
 (void) this; // loplugin:staticmethods
 OpenGLWrapper::resetCurrent();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-01 Thread Miklos Vajna
 vcl/source/opengl/OpenGLContext.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 9a267b265a800c9abcd54eefc0f69ba1f98ac25a
Author: Miklos Vajna 
Date:   Tue Sep 1 09:39:29 2015 +0200

Revert "windows opengl: Set PFD_DOUBLEBUFFER even for single buffer 
rendering"

This reverts commit 6fd7199230bfc81d6aadf53b3c115def8caba90c. Kendy says the
original problem can't be reproduced anymore, and most unexpected flickering
goes away with this for my nvidia card.

Also, it's a good idea in general to keep PFD_DOUBLEBUFFER and
WGL_DOUBLE_BUFFER_ARB in sync, which is now the case.

Change-Id: I7a809d1c85be4206c01720d5de9b0a5617a59c87
(cherry picked from commit dbf5882af35a7644aca74c7049fbbbd9e8c11693)
Reviewed-on: https://gerrit.libreoffice.org/18223
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 8f3cce8..5e47f78 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -915,9 +915,8 @@ bool OpenGLContext::ImplInit()
 0, 0, 0 // Layer Masks Ignored
 };
 
-// interestingly we need this flag being set even if we use single buffer
-// rendering - otherwise we get errors with virtual devices
-PixelFormatFront.dwFlags |= PFD_DOUBLEBUFFER;
+if (mbUseDoubleBufferedRendering)
+PixelFormatFront.dwFlags |= PFD_DOUBLEBUFFER;
 
 if (mbRequestVirtualDevice)
 PixelFormatFront.dwFlags |= PFD_DRAW_TO_BITMAP;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-01 Thread Jan Holesovsky
 vcl/source/opengl/OpenGLContext.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e52845efc27fc73975ae35f3a250cdb245193c62
Author: Jan Holesovsky 
Date:   Tue Sep 1 14:46:32 2015 +0200

windows opengl: Call InitGLEWDebugging() after we have the context.

Change-Id: I1582443cf6799dd73a3909660d524eaacbc2d909
Reviewed-on: https://gerrit.libreoffice.org/18237
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 5e47f78..63588fd 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -998,7 +998,6 @@ bool OpenGLContext::ImplInit()
 }
 
 wglMakeCurrent(NULL, NULL);
-InitGLEWDebugging();
 wglDeleteContext(hTempRC);
 
 if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC))
@@ -1008,6 +1007,8 @@ bool OpenGLContext::ImplInit()
 return false;
 }
 
+InitGLEWDebugging();
+
 g_vShareList.push_back(m_aGLWin.hRC);
 
 RECT clientRect;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-09-01 Thread Michael Meeks
 vcl/source/opengl/OpenGLHelper.cxx |1 +
 vcl/source/window/paint.cxx|8 
 2 files changed, 9 insertions(+)

New commits:
commit 06c595d788a0120834e53c978cc66b39887bfd99
Author: Michael Meeks 
Date:   Sat Aug 29 20:54:21 2015 +0100

Extended GL painting debug tracing.

Change-Id: I52158729d240ca3cb9e7977bc6d1f5acb14437ad
Reviewed-on: https://gerrit.libreoffice.org/18134
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 859cda3..deaf91c 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -140,6 +140,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& 
rVertexShaderName,const OUString
 {
 OpenGLZone aZone;
 
+VCL_GL_INFO("vcl.opengl", "Load shader: vertex " << rVertexShaderName << " 
fragment " << rFragmentShaderName);
 // Create the shaders
 GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER);
 GLuint FragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index bc0050a..80de1a4 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define IMPL_PAINT_PAINT((sal_uInt16)0x0001)
 #define IMPL_PAINT_PAINTALL ((sal_uInt16)0x0002)
@@ -245,6 +246,7 @@ void PaintHelper::PaintBuffer()
 void PaintHelper::DoPaint(const vcl::Region* pRegion)
 {
 WindowImpl* pWindowImpl = m_pWindow->ImplGetWindowImpl();
+
 vcl::Region* pWinChildClipRegion = m_pWindow->ImplGetWinChildClipRegion();
 ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData;
 if (pWindowImpl->mnPaintFlags & IMPL_PAINT_PAINTALL || 
pFrameData->mbInBufferedPaint)
@@ -271,6 +273,9 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
 pWindowImpl->mnPaintFlags = 0;
 if (!pWindowImpl->maInvalidateRegion.IsEmpty())
 {
+VCL_GL_INFO("vcl.opengl", "PaintHelper::DoPaint on " <<
+typeid( *m_pWindow ).name() << " '" << 
m_pWindow->GetText() << "' begin");
+
 m_pWindow->BeginPaint();
 
 // double-buffering: setup the buffer if it does not exist
@@ -302,6 +307,9 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
 }
 
 m_pWindow->EndPaint();
+
+VCL_GL_INFO("vcl.opengl", "PaintHelper::DoPaint end on " <<
+typeid( *m_pWindow ).name() << " '" << 
m_pWindow->GetText() << "'");
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-31 Thread Caolán McNamara
 vcl/source/window/builder.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d3f5b205e4600bfa2ca062f404bb8e58b657c621
Author: Caolán McNamara 
Date:   Tue Jul 7 14:16:42 2015 +0100

VclPtr: no dialog loaded from a .ui ever actually destructed

Change-Id: I51a0596049a43cbc80f914f3d8491c2125c8109e
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/18158
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 40d4614..dba80c0 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -543,6 +543,7 @@ void VclBuilder::disposeBuilder()
 delete aI->m_pMenu;
 }
 m_aMenus.clear();
+m_pParent.clear();
 }
 
 void VclBuilder::handleTranslations(xmlreader::XmlReader )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-31 Thread Michael Meeks
 vcl/source/opengl/OpenGLHelper.cxx |   16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 11fc36a480e4b775fc1b3fbe70b816a860379f9a
Author: Michael Meeks 
Date:   Mon Aug 31 11:25:18 2015 +0100

tdf#93798 - avoid apitrace provoked infinite loop dumping errors.

Change-Id: I6c42e6a9ead90ed6fad2f289cd686a72cffa0c2d
Reviewed-on: https://gerrit.libreoffice.org/18165
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index f255b3a..958d523 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -400,9 +400,14 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t 
nLine)
 {
 OpenGLZone aZone;
 
-GLenum glErr = glGetError();
-if (glErr != GL_NO_ERROR)
+int nErrors = 0;
+for (;;)
 {
+GLenum glErr = glGetError();
+if (glErr == GL_NO_ERROR)
+{
+break;
+}
 const char* sError = OpenGLHelper::GLErrorString(glErr);
 
 if (sError)
@@ -410,7 +415,12 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t 
nLine)
 else
 SAL_WARN("vcl.opengl", "GL Error #" << glErr << " (no message 
available) in File " << pFile << " at line: " << nLine);
 
-glErr = glGetError();
+// tdf#93798 - apitrace appears to sometimes cause issues with an 
infinite loop here.
+if (++nErrors >= 8)
+{
+SAL_WARN("vcl.opengl", "Breaking potentially recursive glGetError 
loop");
+break;
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-30 Thread Michael Meeks
 vcl/source/window/stacking.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 18d447443d160c40d42621644b557eecc42ee765
Author: Michael Meeks michael.me...@collabora.com
Date:   Sat Aug 29 23:52:06 2015 +0100

tdf#93536 - avoid crash when calling ToTop on disposed window.

Change-Id: I677f47f6b60271dc56c9d3d123cf982c00866eb9
Reviewed-on: https://gerrit.libreoffice.org/18136
Reviewed-by: Maxim Monastirsky momonas...@gmail.com
Tested-by: Maxim Monastirsky momonas...@gmail.com

diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index dc0f78e..52d9685 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -438,6 +438,8 @@ void Window::ImplHideAllOverlaps()
 
 void Window::ToTop( sal_uInt16 nFlags )
 {
+if (!mpWindowImpl)
+return;
 
 ImplStartToTop( nFlags );
 ImplFocusToTop( nFlags, IsReallyVisible() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-25 Thread Caolán McNamara
 vcl/source/gdi/salgdilayout.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f9410a54f8d01e8eafceb9e2239f339d9bb8f094
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Aug 23 20:46:53 2015 +0100

don't mirror 0, RECT_EMPTY, 0, RECT_EMPTY rectangle

leave it untouched to make gtk3 rtl spin buttons possible
where the additional mirrorValue contains the region
of the spinbuttons to render within this rectangle

Change-Id: I2648d98ed36373c95947cc4d78e2e54797f01155
Reviewed-on: https://gerrit.libreoffice.org/17940
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-on: https://gerrit.libreoffice.org/17942
Tested-by: Jenkins c...@libreoffice.org

diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index b7ffccf..bd5d8bd 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -728,7 +728,9 @@ bool SalGraphics::DrawNativeControl( ControlType nType, 
ControlPart nPart, const
 if( (m_nLayout  SalLayoutFlags::BiDiRtl) || (pOutDev  
pOutDev-IsRTLEnabled()) )
 {
 Rectangle rgn( rControlRegion );
-mirror( rgn, pOutDev );
+Rectangle aNull;
+if (rgn != aNull)
+mirror(rgn, pOutDev);
 std::unique_ptr ImplControlValue  mirrorValue( aValue.clone());
 mirror( *mirrorValue, pOutDev );
 bool bRet = drawNativeControl( nType, nPart, rgn, nState, 
*mirrorValue, aCaption );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-24 Thread Maxim Monastirsky
 vcl/source/gdi/salgdilayout.cxx |   36 ++--
 1 file changed, 30 insertions(+), 6 deletions(-)

New commits:
commit 287aaa33c27a651ace5c37ed71f1dad4f1b28379
Author: Maxim Monastirsky momonas...@gmail.com
Date:   Sun Aug 23 15:09:59 2015 +0300

tdf#89381 Revert vcl: SalGraphics::mirror() - always use 
GetGraphicsWidth()

This reverts commit 28effca640fff262866d1d3ada6e51a3821a6725.

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

diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index f25b956..b7ffccf 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -99,7 +99,11 @@ bool SalGraphics::drawTransformedBitmap(
 
 void SalGraphics::mirror( long x, const OutputDevice *pOutDev, bool bBack ) 
const
 {
-long w = GetGraphicsWidth();
+long w;
+if( pOutDev  pOutDev-GetOutDevType() == OUTDEV_VIRDEV )
+w = pOutDev-GetOutputWidthPixel();
+else
+w = GetGraphicsWidth();
 
 if( w )
 {
@@ -131,7 +135,11 @@ void SalGraphics::mirror( long x, const OutputDevice 
*pOutDev, bool bBack ) con
 
 void SalGraphics::mirror( long x, long nWidth, const OutputDevice *pOutDev, 
bool bBack ) const
 {
-long w = GetGraphicsWidth();
+long w;
+if( pOutDev  pOutDev-GetOutDevType() == OUTDEV_VIRDEV )
+w = pOutDev-GetOutputWidthPixel();
+else
+w = GetGraphicsWidth();
 
 if( w )
 {
@@ -164,7 +172,11 @@ void SalGraphics::mirror( long x, long nWidth, const 
OutputDevice *pOutDev, bo
 
 bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint 
*pPtAry2, const OutputDevice *pOutDev, bool bBack ) const
 {
-long w = GetGraphicsWidth();
+long w;
+if( pOutDev  pOutDev-GetOutDevType() == OUTDEV_VIRDEV )
+w = pOutDev-GetOutputWidthPixel();
+else
+w = GetGraphicsWidth();
 
 if( w )
 {
@@ -286,7 +298,11 @@ void SalGraphics::mirror( Rectangle rRect, const 
OutputDevice *pOutDev, bool bB
 
 basegfx::B2DPoint SalGraphics::mirror( const basegfx::B2DPoint i_rPoint, 
const OutputDevice *i_pOutDev, bool i_bBack ) const
 {
-long w = GetGraphicsWidth();
+long w;
+if( i_pOutDev  i_pOutDev-GetOutDevType() == OUTDEV_VIRDEV )
+w = i_pOutDev-GetOutputWidthPixel();
+else
+w = GetGraphicsWidth();
 
 DBG_ASSERT( w, missing graphics width );
 
@@ -311,7 +327,11 @@ basegfx::B2DPoint SalGraphics::mirror( const 
basegfx::B2DPoint i_rPoint, const
 
 basegfx::B2DPolygon SalGraphics::mirror( const basegfx::B2DPolygon i_rPoly, 
const OutputDevice *i_pOutDev, bool i_bBack ) const
 {
-long w = GetGraphicsWidth();
+long w;
+if( i_pOutDev  i_pOutDev-GetOutDevType() == OUTDEV_VIRDEV )
+w = i_pOutDev-GetOutputWidthPixel();
+else
+w = GetGraphicsWidth();
 
 DBG_ASSERT( w, missing graphics width );
 
@@ -337,7 +357,11 @@ basegfx::B2DPolygon SalGraphics::mirror( const 
basegfx::B2DPolygon i_rPoly, con
 
 basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon 
i_rPoly, const OutputDevice *i_pOutDev, bool i_bBack ) const
 {
-long w = GetGraphicsWidth();
+long w;
+if( i_pOutDev  i_pOutDev-GetOutDevType() == OUTDEV_VIRDEV )
+w = i_pOutDev-GetOutputWidthPixel();
+else
+w = GetGraphicsWidth();
 
 DBG_ASSERT( w, missing graphics width );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-17 Thread Thorsten Behrens
 vcl/source/gdi/pdfwriter_impl.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit a9b3f13abc4ba780ce5a48fa910de631644da236
Author: Thorsten Behrens thorsten.behr...@cib.de
Date:   Thu Aug 13 17:17:22 2015 +0200

tdf#44388: handle the NULL clip correctly for pdf output

With the rework to use basegfx polygon clipping (a334752), the case
'fully clipped away', aka NULL clip, aka nothing visible, stopped
working.

Manifests itself as an empty clip polygon, but with m_bClipRegion being
true. Explicitely write out as zero-surface clip polygon.

i#65128 is related.

Change-Id: I57389fcd057d75dfa4e0de9ebb86794437c70b55
(cherry picked from commit 86b47f5138c0c5b882359a48052a796bc91a5afb)
Reviewed-on: https://gerrit.libreoffice.org/17725
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index cdfccbb..db66f60 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11982,14 +11982,14 @@ void PDFWriterImpl::updateGraphicsState(Mode const 
mode)
 if( m_aCurrentPDFState.m_bClipRegion != rNewState.m_bClipRegion ||
 ( rNewState.m_bClipRegion  m_aCurrentPDFState.m_aClipRegion != 
rNewState.m_aClipRegion ) )
 {
-if( m_aCurrentPDFState.m_bClipRegion  
m_aCurrentPDFState.m_aClipRegion.count() )
+if( m_aCurrentPDFState.m_bClipRegion )
 {
 aLine.append( Q  );
 // invalidate everything but the clip region
 m_aCurrentPDFState = GraphicsState();
 rNewState.m_nUpdateFlags = 
sal::static_int_castsal_uInt16(~GraphicsState::updateClipRegion);
 }
-if( rNewState.m_bClipRegion  rNewState.m_aClipRegion.count() )
+if( rNewState.m_bClipRegion )
 {
 // clip region is always stored in private PDF mapmode
 MapMode aNewMapMode = rNewState.m_aMapMode;
@@ -11998,7 +11998,10 @@ void PDFWriterImpl::updateGraphicsState(Mode const 
mode)
 m_aCurrentPDFState.m_aMapMode = rNewState.m_aMapMode;
 
 aLine.append( q  );
-m_aPages.back().appendPolyPolygon( rNewState.m_aClipRegion, 
aLine );
+if( rNewState.m_aClipRegion.count() )
+m_aPages.back().appendPolyPolygon( 
rNewState.m_aClipRegion, aLine );
+else
+aLine.append( 0 0 m h  ); // NULL clip, i.e. nothing 
visible
 aLine.append( W* n\n );
 rNewState.m_aMapMode = aNewMapMode;
 getReferenceDevice()-SetMapMode( rNewState.m_aMapMode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-11 Thread Miklos Vajna
 vcl/source/gdi/impanmvw.cxx |   49 +---
 1 file changed, 37 insertions(+), 12 deletions(-)

New commits:
commit c5551a6a9ed7dbeb15cda52f0de0a5113f5c1551
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Aug 10 15:49:09 2015 +0200

tdf#93325 ImplAnimView rendercontext: stop painting animgifs directly

(cherry picked from commits 131d5b01f400899470925757658841080b09283a and
cd064472ce4ff9d1dd6720c32fde22f36eb232f4)

Change-Id: I34fb235a2e44eb510a630fb8dbcc2ec68cf96b79
Reviewed-on: https://gerrit.libreoffice.org/17642
Reviewed-by: Tor Lillqvist t...@collabora.com
Tested-by: Tor Lillqvist t...@collabora.com

diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index 9d7cea0b..8dc2c49 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -18,6 +18,7 @@
  */
 
 #include impanmvw.hxx
+#include window.h
 #include vcl/virdev.hxx
 #include vcl/window.hxx
 #include tools/helpers.hxx
@@ -153,8 +154,18 @@ void ImplAnimView::getPosSize( const AnimationBitmap 
rAnm, Point rPosPix, Size
 
 void ImplAnimView::drawToPos( sal_uLong nPos )
 {
+VclPtrvcl::RenderContext pRenderContext = mpOut;
+
+std::unique_ptrPaintBufferGuard pGuard;
+if (mpOut-GetOutDevType() == OUTDEV_WINDOW)
+{
+vcl::Window* pWindow = static_castvcl::Window*(mpOut.get());
+pGuard.reset(new 
PaintBufferGuard(pWindow-ImplGetWindowImpl()-mpFrameData, pWindow));
+pRenderContext = pGuard-GetRenderContext();
+}
+
 ScopedVclPtrInstanceVirtualDevice aVDev;
-std::unique_ptrvcl::Region xOldClip(!maClip.IsNull() ? new vcl::Region( 
mpOut-GetClipRegion() ) : NULL);
+std::unique_ptrvcl::Region xOldClip(!maClip.IsNull() ? new vcl::Region( 
pRenderContext-GetClipRegion() ) : NULL);
 
 aVDev-SetOutputSizePixel( maSzPix, false );
 nPos = std::min( nPos, (sal_uLong) mpParent-Count() - 1UL );
@@ -163,17 +174,29 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
 draw( i, aVDev.get() );
 
 if (xOldClip)
-mpOut-SetClipRegion( maClip );
+pRenderContext-SetClipRegion( maClip );
 
-mpOut-DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *aVDev.get() );
+pRenderContext-DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, 
*aVDev.get() );
+if (pGuard)
+pGuard-SetPaintRect(Rectangle(maDispPt, maDispSz));
 
 if (xOldClip)
-mpOut-SetClipRegion(*xOldClip);
+pRenderContext-SetClipRegion(*xOldClip);
 }
 
 void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
 {
-Rectangle aOutRect( mpOut-PixelToLogic( Point() ), mpOut-GetOutputSize() 
);
+VclPtrvcl::RenderContext pRenderContext = mpOut;
+
+std::unique_ptrPaintBufferGuard pGuard;
+if (!pVDev  mpOut-GetOutDevType() == OUTDEV_WINDOW)
+{
+vcl::Window* pWindow = static_castvcl::Window*(mpOut.get());
+pGuard.reset(new 
PaintBufferGuard(pWindow-ImplGetWindowImpl()-mpFrameData, pWindow));
+pRenderContext = pGuard-GetRenderContext();
+}
+
+Rectangle aOutRect( pRenderContext-PixelToLogic( Point() ), 
pRenderContext-GetOutputSize() );
 
 // check, if output lies out of display
 if( aOutRect.Intersection( Rectangle( maDispPt, maDispSz ) ).IsEmpty() )
@@ -219,7 +242,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* 
pVDev )
 {
 pDev = VclPtrVirtualDevice::Create();
 pDev-SetOutputSizePixel( maSzPix, false );
-pDev-DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
+pDev-DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, 
*pRenderContext );
 }
 else
 pDev = pVDev;
@@ -260,23 +283,25 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* 
pVDev )
 
 if( !pVDev )
 {
-std::unique_ptrvcl::Region xOldClip(!maClip.IsNull() ? new 
vcl::Region( mpOut-GetClipRegion() ) : NULL);
+std::unique_ptrvcl::Region xOldClip(!maClip.IsNull() ? new 
vcl::Region( pRenderContext-GetClipRegion() ) : NULL);
 
 if (xOldClip)
-mpOut-SetClipRegion( maClip );
+pRenderContext-SetClipRegion( maClip );
 
-mpOut-DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *pDev );
+pRenderContext-DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, 
*pDev );
+if (pGuard)
+pGuard-SetPaintRect(Rectangle(maDispPt, maDispSz));
 
 if( xOldClip)
 {
-mpOut-SetClipRegion(*xOldClip);
+pRenderContext-SetClipRegion(*xOldClip);
 xOldClip.reset();
 }
 
 pDev.disposeAndClear();
 
-if( mpOut-GetOutDevType() == OUTDEV_WINDOW )
-static_castvcl::Window*( mpOut.get() )-Sync();
+if( pRenderContext-GetOutDevType() == OUTDEV_WINDOW )
+static_castvcl::Window*( pRenderContext.get() )-Sync();
 }
 }
 }

[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-07 Thread Miklos Vajna
 vcl/source/control/edit.cxx |   21 +
 vcl/source/window/paint.cxx |   12 
 2 files changed, 21 insertions(+), 12 deletions(-)

New commits:
commit 207edc05ceadda49e311758cae67be1ea2d0e49d
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Aug 6 18:11:44 2015 +0200

tdf#92982 vcl rendercontext: fix missing background repaint of Edit

Change-Id: Ic45f65d10835eb39b6709e7adeed1392905ea631
(cherry picked from commit f4a2c604c73337cd21cd98d975b4f2b943fbab60)
Reviewed-on: https://gerrit.libreoffice.org/17564
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 7ddad42..e9f5c82 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1023,6 +1023,27 @@ void Edit::ImplClearBackground(vcl::RenderContext 
rRenderContext, long nXStart,
 
 if( !(ImplUseNativeBorder(rRenderContext, GetStyle()) || 
IsPaintTransparent()))
 rRenderContext.Erase(aRect);
+else if (SupportsDoubleBuffering()  mbIsSubEdit)
+{
+// ImplPaintBorder() is a NOP, we have a native border, and this is a 
sub-edit of a control.
+// That means we have to draw the parent native widget to paint the 
edit area to clear our background.
+long nLeft = mnXOffset + ImplGetExtraXOffset();
+long nTop = ImplGetTextYPosition();
+long nRight = GetOutputWidthPixel();
+long nHeight = GetTextHeight();
+Rectangle aEditArea(nLeft, nTop, nRight, nTop + nHeight);
+
+ControlType aCtrlType = ImplGetNativeControlType();
+ControlPart aCtrlPart = PART_ENTIRE_CONTROL;
+Rectangle aCtrlRegion(0, 0, GetParent()-GetOutputWidthPixel(), 
GetParent()-GetOutputHeightPixel());
+ControlState nState = ControlState::ENABLED;
+ImplControlValue aControlValue;
+
+rRenderContext.Push(PushFlags::CLIPREGION);
+rRenderContext.SetClipRegion(vcl::Region(aEditArea));
+rRenderContext.DrawNativeControl(aCtrlType, aCtrlPart, aCtrlRegion, 
nState, aControlValue, OUString());
+rRenderContext.Pop();
+}
 }
 
 void Edit::ImplPaintBorder(vcl::RenderContext rRenderContext, long nXStart, 
long nXEnd)
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index a02d600..81f601d 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -190,18 +190,6 @@ void PaintHelper::StartBufferedPaint()
 ImplFrameData* pFrameData = m_pWindow-mpWindowImpl-mpFrameData;
 assert(!pFrameData-mbInBufferedPaint);
 
-// Instead of creating a new VirtualDevice, just erase the area we'll be
-// painting over, as VirtualDevice::ImplInitVirDev() would do.
-// The painted area is m_aPaintRect, or in case it's empty, then the whole 
window.
-pFrameData-mpBuffer-SetBackground(Wallpaper(Color(COL_WHITE)));
-{
-PaintBufferGuard g(pFrameData, m_pWindow);
-if (m_aPaintRect.IsEmpty())
-pFrameData-mpBuffer-Erase(Rectangle(Point(0, 0), 
m_pWindow-GetOutputSize()));
-else
-pFrameData-mpBuffer-Erase(m_aPaintRect);
-}
-
 pFrameData-mbInBufferedPaint = true;
 m_bStartedBufferedPaint = true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-06 Thread Miklos Vajna
 vcl/source/window/window.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 884856481774a6e6eb3e350bf76b3900c2e62b0d
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Aug 5 11:25:02 2015 +0200

tdf#92982 vcl rendercontext: fix buffer size with empty user profile

I did not notice this before, as my user profile had a custom window
size; but with an empty user profile the buffer had a 0,0 size, so the
buffered result was empty, as no ImplHandleResize() was invoked.

Change-Id: Ie299ad1323944941afc407dc90f2459d72885d42
(cherry picked from commit 968bc55adebd0158349b32a31ea341be292d8aa1)
Reviewed-on: https://gerrit.libreoffice.org/17532
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Tomaž Vajngerl qui...@gmail.com

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f24e4bb..e8d2b96 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2481,6 +2481,10 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags)
 mpWindowImpl-mpFrame-GetClientSize( nOutWidth, nOutHeight );
 ImplHandleResize( this, nOutWidth, nOutHeight );
 }
+
+if (mpWindowImpl-mpFrameData-mpBuffer  
mpWindowImpl-mpFrameData-mpBuffer-GetOutputSizePixel() != 
GetOutputSizePixel())
+// Make sure that the buffer size matches the window size, 
even if no resize was needed.
+
mpWindowImpl-mpFrameData-mpBuffer-SetOutputSizePixel(GetOutputSizePixel());
 }
 
 if( aDogTag.IsDead() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-04 Thread Miklos Vajna
 vcl/source/window/paint.cxx |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit ac2bd6e1c50b0155707b90d301ccb9df5cd91a92
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Aug 3 10:58:58 2015 +0200

tdf#92982 vcl rendercontext: no need to call SetupBuffer() twice

No need to call it in PaintHelper::StartBufferedPaint(), which would
happen only for the root of the paint hierarchy. It's enough to do it in
PaintHelper::DoPaint(), which happens for each widget.

(cherry picked from commits 27f6b2c038f5daf16a7fff4adf478b603eb08399 and
8bb963c3e51725fba649a5db0f5deb8778f1232b)

Change-Id: Iaf3306ef746bedbe64be36c4efeae73afd75db2a
Reviewed-on: https://gerrit.libreoffice.org/17500
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Tomaž Vajngerl qui...@gmail.com

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index c529d13..ee5d47a 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -52,7 +52,7 @@ private:
 sal_uInt16 m_nPaintFlags;
 bool m_bPop : 1;
 bool m_bRestoreCursor : 1;
-bool m_bCreatedBuffer : 1; /// This PaintHelper created the buffer for 
the double-buffering, and should dispose it when being destructed (if it is 
still alive by then).
+bool m_bStartedBufferedPaint : 1; /// This PaintHelper started a buffered 
paint, and should paint it on the screen when being destructed.
 public:
 PaintHelper(vcl::Window* pWindow, sal_uInt16 nPaintFlags);
 void SetPop()
@@ -103,7 +103,7 @@ PaintHelper::PaintHelper(vcl::Window *pWindow, sal_uInt16 
nPaintFlags)
 , m_nPaintFlags(nPaintFlags)
 , m_bPop(false)
 , m_bRestoreCursor(false)
-, m_bCreatedBuffer(false)
+, m_bStartedBufferedPaint(false)
 {
 }
 
@@ -122,9 +122,7 @@ void PaintHelper::StartBufferedPaint()
 pFrameData-mpBuffer-Erase(m_aPaintRect);
 
 pFrameData-mbInBufferedPaint = true;
-m_bCreatedBuffer = true;
-
-SetupBuffer();
+m_bStartedBufferedPaint = true;
 
 // Remember what was the map mode of m_aPaintRect.
 m_aPaintRectMapMode = m_pWindow-GetMapMode();
@@ -171,7 +169,7 @@ void PaintHelper::PaintBuffer()
 {
 ImplFrameData* pFrameData = m_pWindow-mpWindowImpl-mpFrameData;
 assert(pFrameData-mbInBufferedPaint);
-assert(m_bCreatedBuffer);
+assert(m_bStartedBufferedPaint);
 
 pFrameData-mpBuffer-mnOutOffX = 0;
 pFrameData-mpBuffer-mnOutOffY = 0;
@@ -524,7 +522,7 @@ PaintHelper::~PaintHelper()
 
 // double-buffering: paint in case we created the buffer, the children are
 // already painted inside
-if (m_bCreatedBuffer  pFrameData-mbInBufferedPaint)
+if (m_bStartedBufferedPaint  pFrameData-mbInBufferedPaint)
 {
 PaintBuffer();
 pFrameData-mbInBufferedPaint = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-08-03 Thread Miklos Vajna
 vcl/source/window/paint.cxx   |9 +
 vcl/source/window/winproc.cxx |7 +++
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 4acfac8501cebf24e614be090efde12b3b4df392
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Jul 31 15:28:20 2015 +0200

tdf#92982 vcl rendercontext: set buffer size in ImplHandleResize()

Instead of in PaintHelper::StartBufferedPaint(). If the buffer size is
set to match the size of a sub-widget (for which the paint was
triggered), then client using the buffer as a persistent vdev are unable
to paint at arbitrary locations.

For example, if we painted the ruler, then the blinking cursor won't be
able to paint to the SwEditWin area.

(cherry picked from commits 161f7533ac177c25516ec206233936bd6982e3df and
43ac95ab64980ed958ba144c33971f897791d15f)

Change-Id: Iba07070baafb5b802fc6da200696611afd2010d7
Reviewed-on: https://gerrit.libreoffice.org/17490
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Tomaž Vajngerl qui...@gmail.com

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 406c141..c529d13 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -114,8 +114,12 @@ void PaintHelper::StartBufferedPaint()
 
 // Instead of creating a new VirtualDevice, just erase the area we'll be
 // painting over, as VirtualDevice::ImplInitVirDev() would do.
+// The painted area is m_aPaintRect, or in case it's empty, then the whole 
window.
 pFrameData-mpBuffer-SetBackground(Wallpaper(Color(COL_WHITE)));
-pFrameData-mpBuffer-Erase(m_aPaintRect);
+if (m_aPaintRect.IsEmpty())
+pFrameData-mpBuffer-Erase(Rectangle(Point(0, 0), 
m_pWindow-GetOutputSize()));
+else
+pFrameData-mpBuffer-Erase(m_aPaintRect);
 
 pFrameData-mbInBufferedPaint = true;
 m_bCreatedBuffer = true;
@@ -125,9 +129,6 @@ void PaintHelper::StartBufferedPaint()
 // Remember what was the map mode of m_aPaintRect.
 m_aPaintRectMapMode = m_pWindow-GetMapMode();
 
-// update the output size now, after all the settings were copied
-pFrameData-mpBuffer-SetOutputSize(m_pWindow-GetOutputSize());
-
 // we need to remember the mnOutOffX / mnOutOffY, but actually really
 // set it just temporarily for the subwidgets - so we are setting it here
 // only to remember the value  to be able to pass it to the descendants
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 06d8fa8..304753a 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -35,6 +35,7 @@
 #include vcl/help.hxx
 #include vcl/dockwin.hxx
 #include vcl/menu.hxx
+#include vcl/virdev.hxx
 #include touch/touch.h
 
 #include svdata.hxx
@@ -1712,6 +1713,12 @@ void ImplHandleResize( vcl::Window* pWindow, long 
nNewWidth, long nNewHeight )
 }
 else
 pWindow-ImplGetWindowImpl()-mbCallResize = true;
+
+if (pWindow-SupportsDoubleBuffering()  
pWindow-ImplGetWindowImpl()-mbFrame)
+{
+// Propagate resize for the frame's buffer.
+
pWindow-ImplGetWindowImpl()-mpFrameData-mpBuffer-SetOutputSizePixel(pWindow-GetOutputSizePixel());
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-31 Thread Miklos Vajna
 vcl/source/window/cursor.cxx |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit c618e888ca92afa2a301eebc5ce8de77f318d00a
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jul 29 18:09:32 2015 +0200

tdf#92982 vcl::Cursor: handle rendercontext

With this, vcl::Cursor does not paint on the vcl::Window directly, and
in case the output should be something other than pRenderContext, it
should be a one-liner change to do that.

(cherry picked from commit 79c9598d0a586f44757954556661ce6eda1f997e)

Conflicts:
vcl/source/window/cursor.cxx

Change-Id: I57833f6f8589286260d96f412f1fcc681e6c5c8c
Reviewed-on: https://gerrit.libreoffice.org/17433
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Tomaž Vajngerl qui...@gmail.com

diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index bd96802..0bcad80 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -44,8 +44,9 @@ struct ImplCursorData
 static void ImplCursorInvert( ImplCursorData* pData )
 {
 vcl::Window* pWindow  = pData-mpWindow;
-boolbMapMode = pWindow-IsMapModeEnabled();
-pWindow-EnableMapMode( false );
+vcl::RenderContext* pRenderContext = pWindow-GetOutDev();
+boolbMapMode = pRenderContext-IsMapModeEnabled();
+pRenderContext-EnableMapMode( false );
 sal_uInt16 nInvertStyle;
 if ( pData-mnStyle  CURSOR_SHADOW )
 nInvertStyle = INVERT_50;
@@ -107,12 +108,12 @@ static void ImplCursorInvert( ImplCursorData* pData )
 
 if ( pData-mnOrientation )
 aPoly.Rotate( pData-maPixRotOff, pData-mnOrientation );
-pWindow-Invert( aPoly, nInvertStyle );
+pRenderContext-Invert( aPoly, nInvertStyle );
 }
 }
 else
-pWindow-Invert( aRect, nInvertStyle );
-pWindow-EnableMapMode( bMapMode );
+pRenderContext-Invert( aRect, nInvertStyle );
+pRenderContext-EnableMapMode( bMapMode );
 }
 
 void vcl::Cursor::ImplDraw()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-21 Thread Lionel Elie Mamane
 vcl/source/control/field2.cxx |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit f838b4f5495f1e70d005bbb1e991b63409ada5a8
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Tue Jul 21 14:02:59 2015 +0200

avoid 1-past-the-end string access

Change-Id: Ia475ce737c430fab8d019e1b8a762f81897e0847
Reviewed-on: https://gerrit.libreoffice.org/17260
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Eike Rathke er...@redhat.com

diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 3f343b2..c9253f8 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -432,15 +432,14 @@ static sal_Int32 ImplPatternRightPos( const OUString 
rStr, const OString rEdit
 {
 // search non-literal successor
 sal_Int32 nNewPos = nCursorPos;
-sal_Int32 nTempPos = nNewPos;
-while ( nTempPos  rEditMask.getLength() )
+;
+for(sal_Int32 nTempPos = nNewPos+1; nTempPos  rEditMask.getLength(); 
++nTempPos )
 {
-if ( rEditMask[nTempPos+1] != EDITMASK_LITERAL )
+if ( rEditMask[nTempPos] != EDITMASK_LITERAL )
 {
-nNewPos = nTempPos+1;
+nNewPos = nTempPos;
 break;
 }
-nTempPos++;
 }
 ImplPatternMaxPos( rStr, rEditMask, nFormatFlags, bSameMask, nCursorPos, 
nNewPos );
 return nNewPos;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-14 Thread Caolán McNamara
 vcl/source/filter/igif/decode.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit c4f0878e3800e981e5dec75d06983600dd37fe71
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jul 14 12:43:05 2015 +0100

use same limit in ProcessOneCode as AddToTable

Change-Id: Id0345e5d867d18bf7eb341f04086226b7fa79680
(cherry picked from commit 59197f1892777a5629bad210b9ed1071ed550570)
Reviewed-on: https://gerrit.libreoffice.org/17041
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/vcl/source/filter/igif/decode.cxx 
b/vcl/source/filter/igif/decode.cxx
index 2b445e9..0008f63 100644
--- a/vcl/source/filter/igif/decode.cxx
+++ b/vcl/source/filter/igif/decode.cxx
@@ -109,11 +109,9 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, 
sal_uInt8 cBufSize,
 
 bool GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 
nCodeFirstData )
 {
-GIFLZWTableEntry* pE;
-
 if( nTableSize  4096 )
 {
-pE = pTable + nTableSize;
+GIFLZWTableEntry* pE = pTable + nTableSize;
 pE-pPrev = pTable + nPrevCode;
 pE-pFirst = pE-pPrev-pFirst;
 GIFLZWTableEntry *pEntry = pTable[nCodeFirstData].pFirst;
@@ -130,7 +128,6 @@ bool GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, 
sal_uInt16 nCodeFirst
 
 bool GIFLZWDecompressor::ProcessOneCode()
 {
-GIFLZWTableEntry*   pE;
 sal_uInt16  nCode;
 boolbRet = false;
 boolbEndOfBlock = false;
@@ -193,11 +190,11 @@ bool GIFLZWDecompressor::ProcessOneCode()
 
 nOldCode = nCode;
 
-if (nCode  4096)
+if (nCode = 4096)
 return false;
 
 // write character(/-sequence) of code nCode in the output buffer:
-pE = pTable + nCode;
+GIFLZWTableEntry* pE = pTable + nCode;
 do
 {
 if (pOutBufData == pOutBuf) //can't go back past start
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-13 Thread Caolán McNamara
 vcl/source/gdi/jobset.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 964000d415bcf491704dad57aee7e0656ea60dab
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jul 13 11:02:56 2015 +0100

min legal size here is  4

(cherry picked from commit 3131205c05a3fde4ef1e3322cc48ca23c443f6d3)

Change-Id: I9f68d000b32623db4d949d13284043630f5689f4

diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index ab6d0cd..67109134 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -222,7 +222,7 @@ SvStream ReadJobSetup( SvStream rIStream, JobSetup 
rJobSetup )
 {
 sal_uInt16 nLen = 0;
 rIStream.ReadUInt16( nLen );
-if ( !nLen )
+if (nLen = 4)
 return rIStream;
 
 sal_uInt16 nSystem = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-13 Thread Caolán McNamara
 vcl/source/filter/wmf/winwmf.cxx |   21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit e0d7f9a7ca24f06b393f37a34c099cd10b9d2da0
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jul 10 11:34:03 2015 +0100

fix potential hang here

Change-Id: Id62cdb90420b9ccf4e98fc1af46c70db6ed60ee0
(cherry picked from commit 7eef63bb2a4d14cb35201f84f38855910f468e20)
Reviewed-on: https://gerrit.libreoffice.org/16922
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: David Tardon dtar...@redhat.com

diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 5e25949..7c153c7 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1735,14 +1735,19 @@ bool WMFReader::GetPlaceableBound( Rectangle 
rPlaceableBound, SvStream* pStm )
 }
 break;
 }
-nPos += nRSize * 2;
- if ( nPos = nEnd )
- pStm-Seek( nPos );
- else
- {
- pStm-SetError( SVSTREAM_FILEFORMAT_ERROR );
- bRet = false;
- }
+
+const sal_uInt32 nAvailableBytes = nEnd - nPos;
+const sal_uInt32 nMaxPossibleRecordSize = nAvailableBytes/2;
+if (nRSize = nMaxPossibleRecordSize)
+{
+nPos += nRSize * 2;
+pStm-Seek( nPos );
+}
+else
+{
+pStm-SetError( SVSTREAM_FILEFORMAT_ERROR );
+bRet = false;
+}
 }
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source vcl/unx

2015-07-11 Thread Simon Long
 vcl/source/window/menu.cxx   |9 -
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |8 +++-
 2 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 86deb192de0803b5c59a4b07590b3d725f22c089
Author: Simon Long si...@raspberrypi.org
Date:   Wed Jul 8 13:51:10 2015 +0100

tdf#92243 Read menu highlight text colour correctly from GTK theme

Change-Id: Iade050c8504a1cc65b5ac345141da32898e7ebff
Reviewed-on: https://gerrit.libreoffice.org/16887
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit ae4ec7a75b0048af2fba12953a84fe5b26d89b9a)
Signed-off-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index afe44c6..cb83637 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1853,12 +1853,11 @@ void Menu::ImplPaint(vcl::RenderContext rRenderContext,
 
rRenderContext.SetTextColor(rSettings.GetMenuBarRolloverTextColor());
 else if (bHighlighted)
 
rRenderContext.SetTextColor(rSettings.GetMenuBarHighlightTextColor());
+else
+
rRenderContext.SetTextColor(rSettings.GetMenuBarTextColor());
 }
-else
-{
-if (bHighlighted)
-
rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor());
-}
+else if (bHighlighted)
+
rRenderContext.SetTextColor(rSettings.GetMenuHighlightTextColor());
 }
 
 Point aPos(aTopLeft);
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 802e499..0e0331e 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -4049,8 +4049,8 @@ void GtkSalGraphics::updateSettings( AllSettings 
rSettings )
 
 aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( 
getColor( pMenubarStyle-fg[GTK_STATE_NORMAL] ) );
 aStyleSet.SetMenuBarTextColor( aTextColor );
-aStyleSet.SetMenuBarRolloverTextColor( aTextColor );
-
aStyleSet.SetMenuBarHighlightTextColor(aStyleSet.GetMenuHighlightTextColor());
+
aStyleSet.SetMenuBarRolloverTextColor(getColor(pMenubarStyle-fg[GTK_STATE_PRELIGHT]));
+
aStyleSet.SetMenuBarHighlightTextColor(getColor(pMenubarStyle-fg[GTK_STATE_SELECTED]));
 
 #if OSL_DEBUG_LEVEL  1
 std::fprintf( stderr, ==\n );
@@ -4081,9 +4081,7 @@ void GtkSalGraphics::updateSettings( AllSettings 
rSettings )
 }
 
 aHighlightColor = getColor( pMenuItemStyle-bg[ GTK_STATE_SELECTED ] );
-aHighlightTextColor = getColor( pMenuTextStyle-fg[ GTK_STATE_PRELIGHT ] );
-if( aHighlightColor == aHighlightTextColor )
-aHighlightTextColor = (aHighlightColor.GetLuminance()  128) ? Color( 
COL_WHITE ) : Color( COL_BLACK );
+aHighlightTextColor = getColor( pMenuItemStyle-fg[ GTK_STATE_SELECTED ] );
 aStyleSet.SetMenuHighlightColor( aHighlightColor );
 aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-09 Thread Michael Meeks
 vcl/source/window/brdwin.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit c63fbe170276d65aa97a29ba2f53fce63272b428
Author: Michael Meeks michael.me...@collabora.com
Date:   Thu Jul 9 14:17:30 2015 +0100

tdf#92055 - make ImplBorderWindow more tolerant of post-dispose events.

Change-Id: I9556c920e6fc8b5595eee6bd00d36669e1684e25
Reviewed-on: https://gerrit.libreoffice.org/16892
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com
Reviewed-on: https://gerrit.libreoffice.org/16896
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 33db8bd..97dbc5b 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1851,27 +1851,32 @@ void ImplBorderWindow::dispose()
 
 void ImplBorderWindow::MouseMove( const MouseEvent rMEvt )
 {
-mpBorderView-MouseMove( rMEvt );
+if (mpBorderView)
+mpBorderView-MouseMove( rMEvt );
 }
 
 void ImplBorderWindow::MouseButtonDown( const MouseEvent rMEvt )
 {
-mpBorderView-MouseButtonDown( rMEvt );
+if (mpBorderView)
+mpBorderView-MouseButtonDown( rMEvt );
 }
 
 void ImplBorderWindow::Tracking( const TrackingEvent rTEvt )
 {
-mpBorderView-Tracking( rTEvt );
+if (mpBorderView)
+mpBorderView-Tracking( rTEvt );
 }
 
 void ImplBorderWindow::Paint( vcl::RenderContext rRenderContext, const 
Rectangle )
 {
-mpBorderView-DrawWindow(rRenderContext, BORDERWINDOW_DRAW_ALL);
+if (mpBorderView)
+mpBorderView-DrawWindow(rRenderContext, BORDERWINDOW_DRAW_ALL);
 }
 
 void ImplBorderWindow::Draw( const Rectangle, OutputDevice* pOutDev, const 
Point rPos )
 {
-mpBorderView-DrawWindow(*pOutDev, BORDERWINDOW_DRAW_ALL, rPos);
+if (mpBorderView)
+mpBorderView-DrawWindow(*pOutDev, BORDERWINDOW_DRAW_ALL, rPos);
 }
 
 void ImplBorderWindow::Activate()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-09 Thread Miklos Vajna
 vcl/source/window/paint.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 1b232a5624a8cb273bfb13e1b483724b96c9bc63
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jul 8 16:36:28 2015 +0200

vcl rendercontext: fix off-by-one error in PaintHelper::PaintBuffer()

With this, Writer no longer has leftover 1-pixel-width/height lines on
scrolling at the right/bottom of the SwEditWin area.

The problem was that PaintBuffer() painted one less row/column of pixels
than intended. This happened because Rectangle::GetSize() uses
GetWidth() and GetHeight(), which return bound2 - bound1 + 1, but
because the map mode was in twips, the +1 had no effect.

For example, if top=127 and bottom=762 in pixels, then the needed height
is 636, but (assuming e.g. 96 DPI) counting 11430-1905+1 in twips, then
converting to pixels is only 635, so the last row/column is not painted.

Fix the problem by making sure that GetSize() is invoked on a rectangle
that has the size in pixels, that's how e.g.
SdrPreRenderDevice::OutputPreRenderDevice() uses DrawOutDev(), too.

Change-Id: I6f8686e0a91ba402db93982c25be76992c260abe
(cherry picked from commit b3e645cde951906d883f015d342f85fc0eedb2ec)

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 4a6fb2e..e4e7531 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -182,7 +182,19 @@ void PaintHelper::PaintBuffer()
 m_pWindow-SetMapMode(m_aPaintRectMapMode);
 m_pBuffer-SetMapMode(m_aPaintRectMapMode);
 
-m_pWindow-DrawOutDev(m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), 
m_aPaintRect.TopLeft(), m_aPaintRect.GetSize(), *m_pBuffer.get());
+// Make sure that the +1 value GetSize() adds to the size is in pixels.
+Size aPaintRectSize;
+if (m_pWindow-GetMapMode().GetMapUnit() == MAP_PIXEL)
+{
+aPaintRectSize = m_aPaintRect.GetSize();
+}
+else
+{
+Rectangle aRectanglePixel = m_pWindow-LogicToPixel(m_aPaintRect);
+aPaintRectSize = 
m_pWindow-PixelToLogic(aRectanglePixel.GetSize());
+}
+
+m_pWindow-DrawOutDev(m_aPaintRect.TopLeft(), aPaintRectSize, 
m_aPaintRect.TopLeft(), aPaintRectSize, *m_pBuffer.get());
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-08 Thread Tomaž Vajngerl
 vcl/source/opengl/OpenGLHelper.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 5de8f1559afafe4a5430142c305549223d467606
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Jul 3 14:38:24 2015 +0900

tdf#88831 fix inverted textures when OpenGL is enabled

GLX returns a wrong value if the y coords are inverted. Most other
programs don't even ask for this (gnome-shell for example) and just
assumes true (and this works because most relevant X servers work
like this). We make this more robust and assume true only if the
returned value is GLX_DONT_CARE (-1).

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

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 3acb0c6..41881da 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -539,7 +539,11 @@ GLXFBConfig OpenGLHelper::GetPixmapFBConfig( Display* 
pDisplay, bool bInverted
 }
 
 glXGetFBConfigAttrib( pDisplay, aFbConfigs[i], GLX_Y_INVERTED_EXT, 
nValue );
-bInverted = nValue == True;
+
+// Looks like that X sends GLX_DONT_CARE but this usually means true 
for most
+// of the X implementations. Investigation on internet pointed that 
this could be
+// safely true all the time (for example gnome-shell always assumes 
true).
+bInverted = nValue == True || nValue == int(GLX_DONT_CARE);
 
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-08 Thread Miklos Vajna
 vcl/source/window/paint.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit bc1dcbe0b6489f955fffbd23f8c7b21e81eb8678
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jul 7 14:11:51 2015 +0200

vcl rendercontext: avoid CopyArea() in Window::ImplScroll()

Direct CopyArea() does more harm than good in case of double buffering:
to avoid touching the window directly, just invalidate the whole area
and avoid copying.

Change-Id: I678c5b0a38fc089675fd030d2da4132684a5d6a6
(cherry picked from commit f3f2a4fc8565ca558d89cdf6377df7f9f8592616)

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 7b00628..4a6fb2e 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1563,7 +1563,11 @@ void Window::ImplScroll( const Rectangle rRect,
 Rectangle aDestRect( aRectMirror );
 aDestRect.Move( bReMirror ? -nHorzScroll : nHorzScroll, 
nVertScroll );
 vcl::Region aWinInvalidateRegion( aRectMirror );
-aWinInvalidateRegion.Exclude( aDestRect );
+if (!SupportsDoubleBuffering())
+// There will be no CopyArea() call below, so invalidate the
+// whole visible area, not only the smaller one that was just
+// scrolled in.
+aWinInvalidateRegion.Exclude(aDestRect);
 
 aInvalidateRegion.Union( aWinInvalidateRegion );
 }
@@ -1609,7 +1613,9 @@ void Window::ImplScroll( const Rectangle rRect,
 // rendering is all there is.
 
 SalGraphics* pGraphics = ImplGetFrameGraphics();
-if ( pGraphics )
+// The invalidation area contains the area what would be copied here,
+// so avoid copying in case of double buffering.
+if (pGraphics  !SupportsDoubleBuffering())
 {
 if( bReMirror )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-07 Thread Caolán McNamara
 vcl/source/window/menu.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9f7970dfc403b3d90c19a6226e1853d5d3fca4a6
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jul 7 15:08:05 2015 +0100

Resolves: tdf#92539 reversed logic on enable/disable

Change-Id: I26ef918c0a68a84c22da3979c1180a2aee7a8109
(cherry picked from commit 13d08f07b4d67afe211997ca37934c45208d50a6)
Reviewed-on: https://gerrit.libreoffice.org/16823
Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com
Tested-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 8f2a93f..4e2345a 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1892,7 +1892,7 @@ void Menu::ImplPaint(vcl::RenderContext rRenderContext,
 if 
(rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR))
 {
 ControlState nState = ControlState::NONE;
-if (pData-bEnabled  !pWindow-IsEnabled())
+if (pData-bEnabled  pWindow-IsEnabled())
 nState |= ControlState::ENABLED;
 if (bHighlighted)
 nState |= ControlState::SELECTED;
@@ -1948,7 +1948,7 @@ void Menu::ImplPaint(vcl::RenderContext rRenderContext,
 if (pData-bChecked)
 nState |= ControlState::PRESSED;
 
-if (pData-bEnabled  !pWindow-IsEnabled())
+if (pData-bEnabled  pWindow-IsEnabled())
 nState |= ControlState::ENABLED;
 
 if (bHighlighted)
@@ -2089,7 +2089,7 @@ void Menu::ImplPaint(vcl::RenderContext rRenderContext,
 aSpacing = nOuterSpaceX;
 }
 
-if (pData-bEnabled  !pWindow-IsEnabled())
+if (pData-bEnabled  pWindow-IsEnabled())
 nState |= ControlState::ENABLED;
 if (bHighlighted)
 nState |= ControlState::SELECTED;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-06 Thread Michael Meeks
 vcl/source/window/window.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2ffc7299718376fa684decb0af20e24758fd734d
Author: Michael Meeks michael.me...@collabora.com
Date:   Fri Jul 3 15:50:38 2015 +0100

tdf#92392 - tolerate Window::SetText post dispose.

Change-Id: I458f8e8665373d3e5ab9ed20e39783f4d34ca128
Reviewed-on: https://gerrit.libreoffice.org/16752
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 372ea7d..8afd412 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3184,7 +3184,7 @@ void Window::SetCursor( vcl::Cursor* pCursor )
 
 void Window::SetText( const OUString rStr )
 {
-if (rStr == mpWindowImpl-maText)
+if (!mpWindowImpl || rStr == mpWindowImpl-maText)
 return;
 
 OUString oldTitle( mpWindowImpl-maText );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-04 Thread László Németh
 vcl/source/glyphs/graphite_layout.cxx |   33 +++--
 1 file changed, 15 insertions(+), 18 deletions(-)

New commits:
commit eef0577c5e90ca5c48d58793945d2d8684644cc0
Author: László Németh laszlo.nem...@collabora.com
Date:   Sat Jul 4 15:06:01 2015 +0200

tdf#52540 Revert fdo#52540 refix graphite layout generally

This reverts commit 12168aeea91a57e63159c3103c904d630c44c62e,
because that caused a regression in hyphenation, see tdf#52540.

Change-Id: I75613b17de241a5c4fa6da5df7fdaf05db1692b6
Reviewed-on: https://gerrit.libreoffice.org/16755
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/glyphs/graphite_layout.cxx 
b/vcl/source/glyphs/graphite_layout.cxx
index 474756f..a4aa99c 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -561,36 +561,33 @@ gr_segment * 
GraphiteLayout::CreateSegment(ImplLayoutArgs rArgs)
 int limit = rArgs.mnEndCharPos;
 if (!(SalLayoutFlags::ComplexDisabled  rArgs.mnFlags))
 {
-int nSegCharMin = maximumint(0, mnMinCharPos - 
EXTRA_CONTEXT_LENGTH);
-int nSegCharLimit = minimum(rArgs.mnLength, mnEndCharPos + 
EXTRA_CONTEXT_LENGTH);
-while (nSegCharMin  mnSegCharOffset)
+const int nSegCharMin = maximumint(0, mnMinCharPos - 
EXTRA_CONTEXT_LENGTH);
+const int nSegCharLimit = minimum(rArgs.mnLength, mnEndCharPos + 
EXTRA_CONTEXT_LENGTH);
+if (nSegCharMin  mnSegCharOffset)
 {
-int sameDirEnd = nSegCharMin + findSameDirLimit(rArgs.mpStr + 
nSegCharMin,
+int sameDirEnd = findSameDirLimit(rArgs.mpStr + nSegCharMin,
 rArgs.mnEndCharPos - nSegCharMin, bRtl);
-if (sameDirEnd = rArgs.mnMinCharPos)
-{
+if (sameDirEnd == rArgs.mnEndCharPos)
 mnSegCharOffset = nSegCharMin;
-break;
-}
-else
-nSegCharMin = sameDirEnd;
 }
 if (nSegCharLimit  limit)
 {
 limit += findSameDirLimit(rArgs.mpStr + rArgs.mnEndCharPos,
 nSegCharLimit - rArgs.mnEndCharPos, bRtl);
-if (limit  rArgs.mnLength)
-limit = rArgs.mnLength;
 }
 }
-else
-{
-limit = minimum(rArgs.mnLength, mnEndCharPos + 
EXTRA_CONTEXT_LENGTH);
-mnSegCharOffset = maximumint(0, mnMinCharPos - 
EXTRA_CONTEXT_LENGTH);
-}
 
 size_t numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + 
mnSegCharOffset,
- rArgs.mpStr + limit, NULL);
+ rArgs.mpStr + (rArgs.mnLength  limit + 64 ? limit + 64 : 
rArgs.mnLength), NULL);
+static com::sun::star::uno::Reference 
com::sun::star::i18n::XCharacterClassification  xCharClass;
+if ( !xCharClass.is() )
+xCharClass = vcl::unohelper::CreateCharacterClassification();
+size_t numchars2 = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, 
fdo#68313, fdo#70666 avoid bad ligature replacement, fdo#88051 layout problem
+if (numchars  numchars2  (rArgs.mpStr[mnSegCharOffset + numchars2] 
== '\t' ||
+xCharClass-getType(rArgs.mpStr + mnSegCharOffset, numchars2 + 1) 
== ::com::sun::star::i18n::UnicodeType::LOWERCASE_LETTER))
+{
+numchars = numchars2;
+}
 if (mpFeatures)
 pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures-values(), 
gr_utf16,
 rArgs.mpStr + mnSegCharOffset, 
numchars, bRtl);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-07-02 Thread Caolán McNamara
 vcl/source/control/ilstbox.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit a8ddd3b0280baa1b770f439fbbca9ff073faa16b
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jul 2 16:21:26 2015 +0100

Resolves: tdf#92467 crashes with empty history list on pressing down

regression from some 16-32 bit listbox limit changing

Change-Id: I045eeef935afed4154fe11bfd11916c2d6a722e9
(cherry picked from commit c51d5706205cd0282c07d778ffac5f265c3eaf5f)

diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 98655e6..2c8bab9 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -1613,8 +1613,9 @@ bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent 
rKEvt )
 )
 {
 DBG_ASSERT( !mpEntryList-IsEntryPosSelected( nSelect ) || mbMulti, 
ImplListBox: Selecting same Entry );
-if( nSelect = mpEntryList-GetEntryCount() )
-nSelect = mpEntryList-GetEntryCount()-1;
+sal_Int32 nCount = mpEntryList-GetEntryCount();
+if (nSelect = nCount)
+nSelect = nCount ? nCount-1 : LISTBOX_ENTRY_NOTFOUND;
 bool bCurPosChange = (mnCurrentPos != nSelect);
 mnCurrentPos = nSelect;
 if(SelectEntries( nSelect, eLET, bShift, bCtrl, bCurPosChange))
@@ -1674,8 +1675,9 @@ void ImplListBoxWindow::SelectEntry( 
vcl::StringEntryIdentifier _entry )
 
 // normalize
 OSL_ENSURE( nSelect  mpEntryList-GetEntryCount(), 
ImplListBoxWindow::SelectEntry: how that? );
-if( nSelect = mpEntryList-GetEntryCount() )
-nSelect = mpEntryList-GetEntryCount()-1;
+sal_Int32 nCount = mpEntryList-GetEntryCount();
+if (nSelect = nCount)
+nSelect = nCount ? nCount-1 : LISTBOX_ENTRY_NOTFOUND;
 
 // make visible
 ShowProminentEntry( nSelect );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-30 Thread Caolán McNamara
 vcl/source/window/window.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 18d6d789cae7cd684156dbd41d473892bc17392c
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jun 30 20:51:29 2015 +0100

gtk3: bizarro macosx default text area height calc infected gtk3

mbNoFocusRects is also the case now for gtk3, but this unfortunate
heuristic makes the database and chart wizards and various other
things just way too tall. This is likely a desperate effort to
make pre layout dialogs size to something sensible

Change-Id: I501f04ad96063935dd1f162e009ffd5053a820c4
(cherry picked from commit 93b615d220d3f12e314920dc8b18c8ae8fc23c94)

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 58463b5..757b2d1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1191,6 +1191,7 @@ void Window::ImplInitAppFontData( vcl::Window* pWindow )
 pSVData-maGDIData.mnAppFontX = nTextWidth * 10 / 8;
 pSVData-maGDIData.mnAppFontY = nTextHeight * 10;
 
+#ifdef MACOSX
 // FIXME: this is currently only on OS X, check with other
 // platforms
 if( pSVData-maNWFData.mbNoFocusRects )
@@ -1212,6 +1213,7 @@ void Window::ImplInitAppFontData( vcl::Window* pWindow )
 pSVData-maGDIData.mnAppFontY = (aContentRgn.GetHeight()-4) * 
10;
 }
 }
+#endif
 
 pSVData-maGDIData.mnRealAppFontX = pSVData-maGDIData.mnAppFontX;
 if ( pSVData-maAppData.mnDialogScaleX )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-24 Thread Andras Timar
 vcl/source/window/builder.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b530da968be856ea8fc23887104da46a266e09be
Author: Andras Timar andras.ti...@collabora.com
Date:   Wed Jun 24 02:16:00 2015 -0700

tdf#91380 add WB_MOVEABLE bit to docking windows

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 51bab75..40d4614 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1045,7 +1045,7 @@ namespace
 else if (sType == popup-menu)
 nBits |= WB_SYSTEMWINDOW | WB_DIALOGCONTROL | WB_POPUP;
 else if (sType == dock)
-nBits |= WB_DOCKABLE;
+nBits |= WB_DOCKABLE | WB_MOVEABLE;
 else
 nBits |= WB_MOVEABLE;
 return nBits;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-23 Thread Jan Holesovsky
 vcl/source/outdev/wallpaper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fead68bbf107ca9f2632bdaf1d8407921a0320f2
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue Jun 23 09:25:11 2015 +0200

rendencontext: Wallpaper needs to fit the provided dimensions, not the 
outdev.

Otherwise we are painting according to the rendercontext size in the
double-buffered case.

This fixes the rendering of the image in the startcenter.

Change-Id: I2630137c5d176d818bc1a68a970a9e5256ace97c
Reviewed-on: https://gerrit.libreoffice.org/16420
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index 367ecea..1b9fd21 100644
--- a/vcl/source/outdev/wallpaper.cxx
+++ b/vcl/source/outdev/wallpaper.cxx
@@ -175,7 +175,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
 else
 {
 aPos = Point( 0, 0 );
-aSize = Size( mnOutWidth, mnOutHeight );
+aSize = Size( nWidth, nHeight );
 }
 
 mpMetaFile = NULL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-23 Thread Michael Meeks
 vcl/source/window/toolbox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 575629963e370e05c0ca90d58838094a5b4d11ff
Author: Michael Meeks michael.me...@collabora.com
Date:   Wed Jun 17 15:12:30 2015 +0200

tdf#92088 - don't invalidate disposed toolbar items.

Change-Id: Ie90906f1ed8dc205850df3a48688f66b7a72a4f4
Reviewed-on: https://gerrit.libreoffice.org/16343
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com
Reviewed-on: https://gerrit.libreoffice.org/16428
Reviewed-by: Jan Holesovsky ke...@collabora.com
Tested-by: Jan Holesovsky ke...@collabora.com

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index f79fa80..20ab55d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -5610,7 +5610,7 @@ void ToolBox::ImplShowFocus()
 if( mnHighItemId  HasFocus() )
 {
 ImplToolItem* pItem = ImplGetItem( mnHighItemId );
-if( pItem-mpWindow )
+if( pItem-mpWindow  !pItem-mpWindow-IsDisposed() )
 {
 vcl::Window *pWin = 
pItem-mpWindow-ImplGetWindowImpl()-mpBorderWindow ? 
pItem-mpWindow-ImplGetWindowImpl()-mpBorderWindow : pItem-mpWindow;
 pWin-ImplGetWindowImpl()-mbDrawSelectionBackground = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-19 Thread Andras Timar
 vcl/source/control/fixed.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cbf61deb87dad3868c3a65279daf540a870ff2b4
Author: Andras Timar andras.ti...@collabora.com
Date:   Fri Jun 19 16:25:40 2015 +0200

tdf#91467 FixedText vertical orientation restored

Change-Id: Ic4b74d769ee4370c5182c9921483c7ec0b2c7a94
(cherry picked from commit c7658a1efd3ce9158ff9db1dd30b681d24462b51)

diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 57741fb..4851085 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -546,7 +546,7 @@ void FixedLine::ImplDraw(vcl::RenderContext 
rRenderContext, bool bLayout)
 long nWidth = rRenderContext.GetTextWidth(aText);
 rRenderContext.Push(PushFlags::FONT);
 vcl::Font aFont(rRenderContext.GetFont());
-aFont.SetOrientation(00);
+aFont.SetOrientation(900);
 SetFont(aFont);
 Point aStartPt(aOutSize.Width() / 2, aOutSize.Height() - 1);
 if (nWinStyle  WB_VCENTER)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-19 Thread Jan Holesovsky
 vcl/source/control/ilstbox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6002026cdc792b425e8064dbfdaf65040ade7249
Author: Jan Holesovsky ke...@collabora.com
Date:   Fri Jun 19 18:13:56 2015 +0200

rendercontext: Fix painting of double-buffered listbox.

Everything after the selected entry was invisible ;-)

Change-Id: I06ee1ac424293e71eaa0654b38a5e74e4462d185

diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 3259a77..c6c82b2 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -1714,7 +1714,7 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext 
rRenderContext, sal_Int32
 }
 else
 {
-ApplySettings(*this);
+ApplySettings(rRenderContext);
 if (!IsEnabled())
 rRenderContext.SetTextColor(rStyleSettings.GetDisableColor());
 rRenderContext.SetTextFillColor();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-19 Thread Jan Holesovsky
 vcl/source/control/spinfld.cxx |   35 +--
 vcl/source/window/brdwin.cxx   |2 +-
 2 files changed, 26 insertions(+), 11 deletions(-)

New commits:
commit b36585f9c0ab2fb1f675997fea39969b34f3a991
Author: Jan Holesovsky ke...@collabora.com
Date:   Fri Jun 19 21:23:26 2015 +0200

rendercontext: Fix painting of double-buffered spinboxes.

Change-Id: I8cd2275d2607559c283d84d66b6d1f0588944cbe

diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index f64c5a7..0b0485e 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -93,18 +93,26 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext 
rRenderContext, vcl::Window* pW
 Rectangle aClipRect(rSpinbuttonValue.maLowerRect);
 aClipRect.Union(rSpinbuttonValue.maUpperRect);
 
-// convert from screen space to borderwin space
-
aClipRect.SetPos(pBorder-ScreenToOutputPixel(pWin-OutputToScreenPixel(aClipRect.TopLeft(;
-
-vcl::Region oldRgn(pBorder-GetClipRegion());
-pBorder-SetClipRegion(vcl::Region(aClipRect));
-
+vcl::RenderContext* pContext = rRenderContext;
+vcl::Region oldRgn;
 Point aPt;
 Size aSize(pBorder-GetOutputSizePixel());// the size of the 
border window, i.e., the whole control
-Rectangle aBound, aContent;
 Rectangle aNatRgn(aPt, aSize);
+
+if (!pWin-SupportsDoubleBuffering())
+{
+// convert from screen space to borderwin space
+
aClipRect.SetPos(pBorder-ScreenToOutputPixel(pWin-OutputToScreenPixel(aClipRect.TopLeft(;
+
+oldRgn = pBorder-GetClipRegion();
+pBorder-SetClipRegion(vcl::Region(aClipRect));
+
+pContext = pBorder;
+}
+
+Rectangle aBound, aContent;
 if (!ImplGetSVData()-maNWFData.mbCanDrawWidgetAnySize 
-pBorder-GetNativeControlRegion(CTRL_SPINBOX, 
PART_ENTIRE_CONTROL,
+pContext-GetNativeControlRegion(CTRL_SPINBOX, 
PART_ENTIRE_CONTROL,
 aNatRgn, ControlState::NONE, 
rSpinbuttonValue,
 OUString(), aBound, aContent))
 {
@@ -112,10 +120,17 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext 
rRenderContext, vcl::Window* pW
 }
 
 Rectangle aRgn(aPt, aSize);
-bNativeOK = pBorder-DrawNativeControl(CTRL_SPINBOX, 
PART_ENTIRE_CONTROL, aRgn,
+if (pWin-SupportsDoubleBuffering())
+{
+// convert from borderwin space, to the pWin's space
+
aRgn.SetPos(pWin-ScreenToOutputPixel(pBorder-OutputToScreenPixel(aRgn.TopLeft(;
+}
+
+bNativeOK = pContext-DrawNativeControl(CTRL_SPINBOX, 
PART_ENTIRE_CONTROL, aRgn,
ControlState::ENABLED, 
rSpinbuttonValue, OUString());
 
-pBorder-SetClipRegion(vcl::Region(oldRgn));
+if (!pWin-SupportsDoubleBuffering())
+pBorder-SetClipRegion(vcl::Region(oldRgn));
 }
 }
 return bNativeOK;
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 0d6ab4e..33db8bd 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -753,7 +753,7 @@ void 
ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext rRenderContext, s
 if ((aCtrlType == CTRL_SPINBOX)  
!pCtrl-IsNativeControlSupported(CTRL_SPINBOX, PART_BUTTON_UP))
 {
 Edit* pEdit = static_castEdit*(pCtrl)-GetSubEdit();
-if (pEdit)
+if (pEdit  !pEdit-SupportsDoubleBuffering())
 pCtrl-Paint(*pCtrl, Rectangle());  // make sure the buttons 
are also drawn as they might overwrite the border
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-18 Thread Philippe Jung
 vcl/source/window/menu.cxx |   29 ++---
 1 file changed, 18 insertions(+), 11 deletions(-)

New commits:
commit fd5c9d91b1d3b1cb7c8a66487c1cb2b27b982199
Author: Philippe Jung phil.j...@free.fr
Date:   Thu Jun 18 11:04:10 2015 +0200

Better position for Toolbar name

The text is badly centered. Replaced GetTextHeight by GetTextBoundRect
and updated computation of text bounds.

Change-Id: I1e177a15787c6eddf2878a7d0254f71f3501ec34
Reviewed-on: https://gerrit.libreoffice.org/16355
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Jan Holesovsky ke...@collabora.com

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index d2b5716..7acd139 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -85,7 +85,7 @@ using namespace ::com::sun::star;
 using namespace vcl;
 
 #define EXTRAITEMHEIGHT 4
-#define SPACE_AROUND_TITLE  2
+#define SPACE_AROUND_TITLE  4
 
 static bool ImplAccelDisabled()
 {
@@ -1631,16 +1631,21 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
 // Additional space for title
 nTitleHeight = 0;
 if (!IsMenuBar()  aTitleText.getLength()  0) {
-// Vertically, one height of char + extra space for decoration
-nTitleHeight = nFontHeight + 4 * SPACE_AROUND_TITLE ;
-aSz.Height() += nTitleHeight;
-
-// Horizontally, compute text width with bold font
+// Set expected font
 pWin-Push(PushFlags::FONT);
 vcl::Font aFont = pWin-GetFont();
 aFont.SetWeight(WEIGHT_BOLD);
 pWin-SetFont(aFont);
-long nWidth = pWin-GetTextWidth( aTitleText ) + 4 * 
SPACE_AROUND_TITLE;
+
+// Compute text bounding box
+Rectangle aTextBoundRect;
+pWin-GetTextBoundRect(aTextBoundRect, aTitleText);
+
+// Vertically, one height of char + extra space for decoration
+nTitleHeight =  aTextBoundRect.GetSize().Height() + 4 * 
SPACE_AROUND_TITLE ;
+aSz.Height() += nTitleHeight;
+
+long nWidth = aTextBoundRect.GetSize().Width() + 4 * 
SPACE_AROUND_TITLE;
 pWin-Pop();
 if ( nWidth  nMaxWidth )
 nMaxWidth = nWidth;
@@ -1784,10 +1789,12 @@ void Menu::ImplPaintMenuTitle(vcl::RenderContext 
rRenderContext, const Rectangl
 rRenderContext.DrawRect(aBgRect);
 
 // Draw the text centered
-Point aTextTopLeft(rRect.TopLeft());
-long textWidth = rRenderContext.GetTextWidth(aTitleText);
-aTextTopLeft.X() += (aBgRect.getWidth() - textWidth) / 2;
-aTextTopLeft.Y() += SPACE_AROUND_TITLE;
+Point aTextTopLeft(aBgRect.TopLeft());
+Rectangle aTextBoundRect;
+rRenderContext.GetTextBoundRect( aTextBoundRect, aTitleText );
+aTextTopLeft.X() += (aBgRect.getWidth() - 
aTextBoundRect.GetSize().Width()) / 2;
+aTextTopLeft.Y() += (aBgRect.GetHeight() - 
aTextBoundRect.GetSize().Height()) / 2
+- aTextBoundRect.TopLeft().Y();
 rRenderContext.DrawText(aTextTopLeft, aTitleText, 0, 
aTitleText.getLength());
 
 // Restore
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-18 Thread Jan Holesovsky
 vcl/source/window/menu.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c10f209a3d1ff541c38f3182f2a5c77a835637df
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Jun 18 09:59:23 2015 +0200

rendercontext: Fix rendering of double-buffered menubar.

Change-Id: Iea74564ef0ae2188ae29f106c4416df1fe827b42

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 34c485d..d2b5716 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1822,7 +1822,9 @@ void Menu::ImplPaint(vcl::RenderContext rRenderContext,
 aTopLeft.Y() += ImplGetSVData()-maNWFData.mnMenuFormatBorderY;
 }
 
-Size aOutSz = rRenderContext.GetOutputSizePixel();
+// for the computations, use size of the underlying window, not of 
RenderContext
+Size aOutSz = pWindow-GetOutputSizePixel();
+
 size_t nCount = pItemList-size();
 if (bLayout)
 mpLayoutData-m_aVisibleItemBoundRects.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-18 Thread Jan Holesovsky
 vcl/source/control/fixed.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d0b03ab8c5e33b3b4d8127650e24aa550b13fa9f
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Jun 18 10:25:31 2015 +0200

rendercontext: Fix rendering of double-buffered fixed line.

Change-Id: I809beb7187530cc30aca5dce8b2d4fb244554c55

diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 92ff28c..57741fb 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -515,7 +515,10 @@ const Color FixedLine::GetCanonicalTextColor( const 
StyleSettings _rStyle ) co
 
 void FixedLine::ImplDraw(vcl::RenderContext rRenderContext, bool bLayout)
 {
-Size aOutSize = rRenderContext.GetOutputSizePixel();
+// we need to measure according to the window, not according to the
+// RenderContext we paint to
+Size aOutSize = GetOutputSizePixel();
+
 OUString aText = GetText();
 WinBits nWinStyle = GetStyle();
 MetricVector* pVector = bLayout ? 
mpControlData-mpLayoutData-m_aUnicodeBoundRects : NULL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-18 Thread Jan Holesovsky
 vcl/source/window/paint.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 47636da7327574bdfdcf790c1138ba6de043cd95
Author: Jan Holesovsky ke...@collabora.com
Date:   Sat May 23 18:24:47 2015 +0200

rendercontext: PushPaintHelper needs the buffer as param too.

Change-Id: I4e787356bd17fcaffdbe0dc51a549b359f416766

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 8fe3819..c09c495 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -229,7 +229,7 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
 m_pBuffer-mnOutOffX = m_pWindow-GetOutOffXPixel() - 
m_pBuffer-mnOutOffX;
 m_pBuffer-mnOutOffY = m_pWindow-GetOutOffYPixel() - 
m_pBuffer-mnOutOffY;
 
-m_pWindow-PushPaintHelper(this, *m_pWindow);
+m_pWindow-PushPaintHelper(this, *m_pBuffer.get());
 m_pWindow-Paint(*m_pBuffer.get(), m_aPaintRect);
 
 // restore the mnOutOffX/Y value
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-09 Thread Philippe Jung
 vcl/source/window/menufloatingwindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ab78b52b249bfd32892786c51d93bfd61a4db371
Author: Philippe Jung phil.j...@free.fr
Date:   Tue Jun 9 16:01:54 2015 +0200

Last item of menu with title cannot be hilighted

Seing the fix, it probably also impacts scrolled floating menus.

Change-Id: Ia740573c3ed54cf01a57575a2ca00d49165be28d
Reviewed-on: https://gerrit.libreoffice.org/16188
Reviewed-by: Jan Holesovsky ke...@collabora.com
Tested-by: Jan Holesovsky ke...@collabora.com

diff --git a/vcl/source/window/menufloatingwindow.cxx 
b/vcl/source/window/menufloatingwindow.cxx
index abebd19..8127536 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -190,7 +190,7 @@ void MenuFloatingWindow::ImplHighlightItem( const 
MouseEvent rMEvt, bool bMBDow
 long nY = GetInitialItemY();
 long nMouseY = rMEvt.GetPosPixel().Y();
 Size aOutSz = GetOutputSizePixel();
-if ( ( nMouseY = nY )  ( nMouseY  ( aOutSz.Height() - nY ) ) )
+if ( ( nMouseY = nY )  ( nMouseY  ( aOutSz.Height() + nY ) ) )
 {
 bool bHighlighted = false;
 size_t nCount = pMenu-pItemList-size();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-09 Thread Caolán McNamara
 vcl/source/app/settings.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit df0965356cb90b20fb6d8a26859aebb623b38ef4
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jun 9 14:06:10 2015 +0100

tdf#91462 MenuBarHighlightTextColor should default to MenuHighlightTextColor

Change-Id: I17607b0040f8adc2f0cbbe98a1d3a9af7b19c816
(cherry picked from commit 753fa7ca2fbeb6dfc3f014a68c7d48c6e227be34)

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index bb75d80..3d6f3c1 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -736,7 +736,7 @@ void ImplStyleData::SetStandardStyles()
 maMenuTextColor = Color( COL_BLACK );
 maMenuBarTextColor  = Color( COL_BLACK );
 maMenuBarRolloverTextColor  = Color( COL_WHITE );
-maMenuBarHighlightTextColor = Color( COL_BLUE );
+maMenuBarHighlightTextColor = Color( COL_WHITE );
 maMenuHighlightColor= Color( COL_BLUE );
 maMenuHighlightTextColor= Color( COL_WHITE );
 maHighlightColor= Color( COL_BLUE );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-07 Thread Caolán McNamara
 vcl/source/window/dockwin.cxx |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 29d0bfee79174ff3b49e3abf4ba10816bfe718b3
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Jun 7 17:39:06 2015 +0100

Resolves: tdf#89104 Missing actions from toolbar

Toolboxes derive from Docking Windows, they are
not layout aware, which is ok, but they need
to tell the thing they are inserted in that their
state has changed if the parent is layout aware.

i.e. docking windows are not toplevel things like
dialogs and need to pass on queue_resize to things
above them

Change-Id: If0eeff90314bef4e828355661a75a0d34a6fc1bc
(cherry picked from commit 81fb7720e5e40858a43ad6639f71bb125091aefb)

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index e76b1c6..66fee6c 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -1127,14 +1127,23 @@ Size DockingWindow::GetOptimalSize() const
 return Window::CalcWindowSize(aSize);
 }
 
-void DockingWindow::queue_resize(StateChangedType /*eReason*/)
+void DockingWindow::queue_resize(StateChangedType eReason)
 {
+bool bTriggerLayout = true;
 if (hasPendingLayout() || isCalculatingInitialLayoutSize())
-return;
+{
+bTriggerLayout = false;
+}
 if (!isLayoutEnabled())
-return;
-InvalidateSizeCache();
-maLayoutIdle.Start();
+{
+bTriggerLayout = false;
+}
+if (bTriggerLayout)
+{
+InvalidateSizeCache();
+maLayoutIdle.Start();
+}
+vcl::Window::queue_resize(eReason);
 }
 
 IMPL_LINK_NOARG_TYPED(DockingWindow, ImplHandleLayoutTimerHdl, Idle*, void)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-05 Thread Tomaž Vajngerl
 vcl/source/window/status.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit d132cf6c18fc78c844cc5dcf210df4e8c2267172
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Fri Jun 5 15:01:02 2015 +0900

Use status offscreen rendering when not in RecordLayout mode

Change-Id: I770dc9a91bc1239e64ec8e538be0f6a4b03dd08e

diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 0909bb7..157925d 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -728,8 +728,13 @@ void StatusBar::Paint(vcl::RenderContext rRenderContext, 
const Rectangle)
 // draw items
 if (mbVisibleItems)
 {
+// Do offscreen only when we are not recording layout..
+bool bOffscreen = !rRenderContext.ImplIsRecordLayout();
+
 for (sal_uInt16 i = 0; i  nItemCount; i++)
-ImplDrawItem(rRenderContext, false, i, true, true);
+{
+ImplDrawItem(rRenderContext, bOffscreen, i, true, true);
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-04 Thread Tomaž Vajngerl
 vcl/source/window/status.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5c6b66249e05ab1cbc4e29d08552347c1dc29c29
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Thu Jun 4 21:07:32 2015 +0900

disable off-screen drawing of statusbar items (for now)

Change-Id: I5deac9924b99ac1b3e1440623364004b0b44aaf5

diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 01de587..0909bb7 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -729,7 +729,7 @@ void StatusBar::Paint(vcl::RenderContext rRenderContext, 
const Rectangle)
 if (mbVisibleItems)
 {
 for (sal_uInt16 i = 0; i  nItemCount; i++)
-ImplDrawItem(rRenderContext, true, i, true, true);
+ImplDrawItem(rRenderContext, false, i, true, true);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-04 Thread László Németh
 vcl/source/window/paint.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 907f01dc76fe822dd61fcf1463e095a30752db98
Author: László Németh laszlo.nem...@collabora.com
Date:   Thu Jun 4 18:01:55 2015 +0200

fix rendercontext rendering of standard toolbar icons

(cherry-picked from 177f8e8bbdc2a554f3f795e4e766c2e184410f81)

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

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 8e538da..743b3b8 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -177,7 +177,7 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
 {
 WindowImpl* pWindowImpl = m_pWindow-ImplGetWindowImpl();
 vcl::Region* pWinChildClipRegion = m_pWindow-ImplGetWinChildClipRegion();
-if (pWindowImpl-mnPaintFlags  IMPL_PAINT_PAINTALL)
+if (pWindowImpl-mnPaintFlags  IMPL_PAINT_PAINTALL || m_pBuffer)
 {
 pWindowImpl-maInvalidateRegion = *pWinChildClipRegion;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-03 Thread Jan Holesovsky
 vcl/source/app/IconThemeSelector.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8aeb66d1b31b171b9268342d987d358930196f38
Author: Jan Holesovsky ke...@collabora.com
Date:   Wed Jun 3 19:44:21 2015 +0200

OS X: Default to the 'breeze' icon theme.

As agreed in the Design team meeting today.

Change-Id: I660462fb7b56eb3c8f883f8540cf88801e48165c
Reviewed-on: https://gerrit.libreoffice.org/16065
Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com
Tested-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/vcl/source/app/IconThemeSelector.cxx 
b/vcl/source/app/IconThemeSelector.cxx
index 4ef0031..6f77375 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -63,7 +63,7 @@ IconThemeSelector::GetIconThemeForDesktopEnvironment(const 
OUString desktopEnvi
 r = breeze;
 }
 else if ( desktopEnvironment.equalsIgnoreAsciiCase(MacOSX) ) {
-r = sifr;
+r = breeze;
 }
 else {
 r = FALLBACK_ICON_THEME_ID;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-06-03 Thread László Németh
 vcl/source/window/toolbox.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 103790cefe77c7aa46c9177b91997b1342a65d67
Author: László Németh laszlo.nem...@collabora.com
Date:   Tue Jun 2 18:08:36 2015 +0200

fix rendercontext rendering of toolbox

(cherry-picked from 751d697db61341a481178b86c6b28efa7d3c7d64)

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

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index e179501..f79fa80 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3095,7 +3095,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext 
rRenderContext, sal_uInt16 nPos,
 mpData-m_pLayoutData-m_aLineItemIds.push_back( pItem-mnId );
 mpData-m_pLayoutData-m_aLineItemPositions.push_back( nPos );
 }
-DrawCtrlText( aPos, pItem-maText, 0, pItem-maText.getLength(), 
DrawTextFlags::Mnemonic, pVector, pDisplayText );
+rRenderContext.DrawCtrlText( aPos, pItem-maText, 0, 
pItem-maText.getLength(), DrawTextFlags::Mnemonic, pVector, pDisplayText );
 if (bClip)
 rRenderContext.SetClipRegion();
 rRenderContext.SetFont(aOldFont);
@@ -3258,7 +3258,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext 
rRenderContext, sal_uInt16 nPos,
 mpData-m_pLayoutData-m_aLineItemIds.push_back( pItem-mnId );
 mpData-m_pLayoutData-m_aLineItemPositions.push_back( nPos );
 }
-DrawCtrlText( Point( nTextOffX, nTextOffY ), pItem-maText,
+rRenderContext.DrawCtrlText( Point( nTextOffX, nTextOffY ), 
pItem-maText,
   0, pItem-maText.getLength(), nTextStyle, pVector, 
pDisplayText );
 if ( bRotate )
 SetFont( aOldFont );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-05-29 Thread Caolán McNamara
 vcl/source/app/settings.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 90b6e05493188457ba93fbfa31af3aab7451394a
Author: Caolán McNamara caol...@redhat.com
Date:   Fri May 29 15:03:44 2015 +0100

fix base wizard size

if we are forced to fetch the theme early before the MiscSettings in svtools
sets it then don't cache the value so that when the MiscSettings kicks in 
that
the SettingsChanged signal is sent out and we get the right fontsize (or
something like that)

Change-Id: I0447c934ec184232591183c6c099a4d7217183fb
(cherry picked from commit e9bb7c9e6467a8dd5aa1683563228c619edc)

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 0f1a4b7..3484e58 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -3026,23 +3026,23 @@ StyleSettings::SetIconTheme(const OUString theme)
 OUString
 StyleSettings::DetermineIconTheme() const
 {
-if (mxData-mIconTheme.isEmpty())
+OUString sTheme(mxData-mIconTheme);
+if (sTheme.isEmpty())
 {
 // read from the configuration, or fallback to what the desktop wants
 uno::Referenceuno::XComponentContext 
xContext(comphelper::getProcessComponentContext());
 if (xContext.is())
 {
-mxData-mIconTheme = 
officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
+sTheme = 
officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
 
-if (mxData-mIconTheme.isEmpty() || mxData-mIconTheme == auto)
-mxData-mIconTheme = GetAutomaticallyChosenIconTheme();
+if (sTheme.isEmpty() || sTheme == auto)
+sTheme = GetAutomaticallyChosenIconTheme();
 }
 }
 
 OUString r = mxData-mIconThemeSelector-SelectIconTheme(
 mxData-mIconThemeScanner-GetFoundIconThemes(),
-mxData-mIconTheme
-);
+sTheme);
 return r;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-05-28 Thread Jan Holesovsky
 vcl/source/window/window2.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit f8d738134d1cbbee775d68b33755239d750b5825
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu May 28 16:39:48 2015 +0200

vcl: Do nothing when we don't have mpWindowImpl.

Avoids a crash in Impress search.

Change-Id: I07106e0185a1fe4cfa09a6783396c0d48b028f10

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 1e70a62..b8d822f 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1723,6 +1723,8 @@ bool Window::set_property(const OString rKey, const 
OString rValue)
 
 void Window::set_height_request(sal_Int32 nHeightRequest)
 {
+if (!mpWindowImpl)
+return;
 
 WindowImpl *pWindowImpl = mpWindowImpl-mpBorderWindow ? 
mpWindowImpl-mpBorderWindow-mpWindowImpl : mpWindowImpl;
 
@@ -1735,6 +1737,8 @@ void Window::set_height_request(sal_Int32 nHeightRequest)
 
 void Window::set_width_request(sal_Int32 nWidthRequest)
 {
+if (!mpWindowImpl)
+return;
 
 WindowImpl *pWindowImpl = mpWindowImpl-mpBorderWindow ? 
mpWindowImpl-mpBorderWindow-mpWindowImpl : mpWindowImpl;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-05-27 Thread Tomaž Vajngerl
 vcl/source/edit/vclmedit.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a9116e4b7d312d67c075469158cb8eceabe63dba
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Wed May 27 16:18:56 2015 +0900

tdf#91450 fix infinite invalidation loop

Change-Id: I86f4e881011b2e3f50a0186fc301b142a65ccdf6

diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 66ae929..1dc3478 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -1002,7 +1002,8 @@ void VclMultiLineEdit::ApplySettings(vcl::RenderContext 
rRenderContext)
 theFont.SetFillColor(IsControlBackground() ? GetControlBackground() : 
rStyleSettings.GetFieldColor());
 
 pImpVclMEdit-GetTextWindow()-SetFont(theFont);
-pImpVclMEdit-GetTextWindow()-GetTextEngine()-SetFont(theFont);
+// FIXME: next call causes infinite invalidation loop, rethink how to 
properly fix this situation
+// pImpVclMEdit-GetTextWindow()-GetTextEngine()-SetFont(theFont);
 pImpVclMEdit-GetTextWindow()-SetTextColor(aTextColor);
 
 if (IsPaintTransparent())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-05-26 Thread Caolán McNamara
 vcl/source/window/floatwin.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit abc4d0c705095582cb4a983180e73faef0d913c8
Author: Caolán McNamara caol...@redhat.com
Date:   Sat May 23 09:21:50 2015 +0100

Resolves: tdf#90155 don't hide+show window before initial show completes

(cherry picked from commit c4bae028efbd32c8938c3a6051d58c1f202d5b8a)

Change-Id: I16f6fb4ef025f2e464ca581fc348e8dd18981285

diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index ef051fc..5d11517 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -637,10 +637,6 @@ void FloatingWindow::SetTitleType( FloatWinTitleType 
nTitle )
 
 void FloatingWindow::StartPopupMode( const Rectangle rRect, 
FloatWinPopupFlags nFlags )
 {
-// avoid flickering
-if ( IsVisible() )
-Show( false, SHOW_NOFOCUSCHANGE );
-
 if ( IsRollUp() )
 RollDown();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-05-25 Thread Jan Holesovsky
 vcl/source/app/settings.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 5397a8ad5306a670355824f703da702f7401524a
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon May 25 11:39:42 2015 +0200

tdf#90127: Read icon theme from the config when called too early.

Change-Id: I150cafde6b103cf1a80232113b7a3d11cfdb

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index ff49e02..0f1a4b7 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -3026,6 +3026,19 @@ StyleSettings::SetIconTheme(const OUString theme)
 OUString
 StyleSettings::DetermineIconTheme() const
 {
+if (mxData-mIconTheme.isEmpty())
+{
+// read from the configuration, or fallback to what the desktop wants
+uno::Referenceuno::XComponentContext 
xContext(comphelper::getProcessComponentContext());
+if (xContext.is())
+{
+mxData-mIconTheme = 
officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
+
+if (mxData-mIconTheme.isEmpty() || mxData-mIconTheme == auto)
+mxData-mIconTheme = GetAutomaticallyChosenIconTheme();
+}
+}
+
 OUString r = mxData-mIconThemeSelector-SelectIconTheme(
 mxData-mIconThemeScanner-GetFoundIconThemes(),
 mxData-mIconTheme
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

2015-05-23 Thread Tomaž Vajngerl
 vcl/source/window/toolbox.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit f7a40e1470431d8978d4ca96e7651af9b0609df3
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Wed May 20 20:11:24 2015 +0900

tdf#91404 check if the item position is valid

Change-Id: I963cf83d32bb976095274be913806de19bdf7a86

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 76051f8..09d5403 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -2980,7 +2980,7 @@ void ToolBox::ImplDrawButton(vcl::RenderContext 
rRenderContext, const Rectangle
 void ToolBox::ImplDrawItem(vcl::RenderContext rRenderContext, sal_uInt16 
nPos, sal_uInt16 nHighlight, bool bPaint, bool bLayout)
 {
 
-if( nPos = mpData-m_aItems.size() )
+if (nPos = mpData-m_aItems.size())
 return;
 
 // execute pending paint requests
@@ -4055,8 +4055,11 @@ void ToolBox::Tracking( const TrackingEvent rTEvt )
 
 void ToolBox::InvalidateItem(sal_uInt16 nPosition)
 {
-ImplToolItem* pItem = mpData-m_aItems[nPosition];
-Invalidate(pItem-maRect);
+if (nPosition  mpData-m_aItems.size())
+{
+ImplToolItem* pItem = mpData-m_aItems[nPosition];
+Invalidate(pItem-maRect);
+}
 }
 
 void ToolBox::InvalidateMenuButton()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits