[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-09-23 Thread Caolán McNamara
 vcl/source/gdi/regionband.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit efe052be8f2a1ba7c3fbc4fcdf2a0f913c05cd8e
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Sep 21 17:37:05 2014 +0100

set mpFirstBand back to 0 after deleting it

bff + valgrind

==30470== Invalid read of size 8
==30470==at 0xA02103F: RegionBand::isSingleRectangle() const 
(regionband.cxx:294)
==30470==by 0xA01F562: WriteRegion(SvStream, Region const) 
(region.cxx:1640)
==30470==by 0x9F01FD4: MetaClipRegionAction::Write(SvStream, 
ImplMetaWriteData*) (metaact.cxx:2487)
...
==30470==  Address 0x1d175980 is 0 bytes inside a block of size 56 free'd
==30470==at 0x4A07991: operator delete(void*) (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30470==by 0xA020BB1: RegionBand::implReset() (regionband.cxx:87)
==30470==by 0xA020EF2: RegionBand::load(SvStream) (regionband.cxx:249)

(cherry picked from commit 1ca892488a7a6a9c35fc99c41cd4af788fe0df6e)

Conflicts:
vcl/source/gdi/regionband.cxx

Change-Id: I2468d43c7e73b3390f355358990f8af30b5f026e
Reviewed-on: https://gerrit.libreoffice.org/11571
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/gdi/regionband.cxx b/vcl/source/gdi/regionband.cxx
index 4268e0f..3097f37 100644
--- a/vcl/source/gdi/regionband.cxx
+++ b/vcl/source/gdi/regionband.cxx
@@ -103,6 +103,7 @@ void RegionBand::implReset()
 }
 
 mpLastCheckedBand = 0;
+mpFirstBand = 0;
 
 DBG_CHKTHIS(RegionBand, ImplDbgTestRegionBand);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-08-26 Thread Tor Lillqvist
 vcl/source/gdi/bitmap4.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a19c6beaddf13df6f62bd347e7220f3f741e9979
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Aug 26 16:24:31 2014 +0300

bnc#719994: Fix the duotone filter to actually produce duotone

Not sure what it tried to do earlier, but it was obviously wrong.

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

diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index dbda9e6..04ca76d 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -1192,10 +1192,11 @@ bool Bitmap::ImplDuotoneFilter( const sal_uLong 
nColorOne, const sal_uLong nColo
 for( int y = 0; y  nHeight; y++ )
 {
 BitmapColor aColor = pReadAcc-GetColor( y, x );
+sal_uInt8 luminance = aColor.GetLuminance();
 BitmapColor aResultColor(
-lcl_getDuotoneColorComponent( aColor.GetRed(), 
aColorOne.GetRed(), aColorTwo.GetRed() ) ,
-lcl_getDuotoneColorComponent( aColor.GetGreen(), 
aColorOne.GetGreen(), aColorTwo.GetGreen() ) ,
-lcl_getDuotoneColorComponent( aColor.GetBlue(), 
aColorOne.GetBlue(), aColorTwo.GetBlue() ) );
+lcl_getDuotoneColorComponent( luminance, 
aColorOne.GetRed(), aColorTwo.GetRed() ) ,
+lcl_getDuotoneColorComponent( luminance, 
aColorOne.GetGreen(), aColorTwo.GetGreen() ) ,
+lcl_getDuotoneColorComponent( luminance, 
aColorOne.GetBlue(), aColorTwo.GetBlue() ) );
 pWriteAcc-SetPixel( y, x, aResultColor );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-08-20 Thread Caolán McNamara
 vcl/source/window/layout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 14bdff6f667ab28e14618fcb3dfb83bf2c2c765f
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 19 16:14:23 2014 +0100

facepalm: nAvailHeight is not derived from allocation Width

Change-Id: Ic99c6519b02c546e0d3574cb756e3fb172d1ff52
(cherry picked from commit 36490fff3f4d1b4a7e4b7902a866abb177a0bf54)
Reviewed-on: https://gerrit.libreoffice.org/11024
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 8d8ab0d..517fa33 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1692,7 +1692,7 @@ void VclScrolledWindow::setAllocation(const Size 
rAllocation)
 if (pChild  pChild-IsVisible())
 aChildReq = getLayoutRequisition(*pChild);
 
-long nAvailHeight = rAllocation.Width();
+long nAvailHeight = rAllocation.Height();
 long nAvailWidth = rAllocation.Width();
 // vert. ScrollBar
 if (GetStyle()  WB_AUTOVSCROLL)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-08-20 Thread Caolán McNamara
 vcl/source/window/layout.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit daecdd8ba0f3fed88febb35564e4b5d939cec0b6
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 19 17:20:00 2014 +0100

only subtract height of hscroll if visible

otherwise infinite loop in extensions update check

Change-Id: I0dbf4f34208f1bf0854e365006a79470b26571f3
(cherry picked from commit 749f7548b4ee746d69c20a828ea6d3b853eba8d3)
Reviewed-on: https://gerrit.libreoffice.org/11034
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 517fa33..06f387b 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1704,8 +1704,11 @@ void VclScrolledWindow::setAllocation(const Size 
rAllocation)
 // horz. ScrollBar
 if (GetStyle()  WB_AUTOHSCROLL)
 {
-m_aHScroll.Show(nAvailWidth  aChildReq.Width());
-nAvailHeight -= getLayoutRequisition(m_aHScroll).Height();
+bool bShowHScroll = nAvailWidth  aChildReq.Width();
+m_aHScroll.Show(bShowHScroll);
+
+if (bShowHScroll)
+nAvailHeight -= getLayoutRequisition(m_aHScroll).Height();
 
 if (GetStyle()  WB_AUTOVSCROLL)
 m_aVScroll.Show(nAvailHeight  aChildReq.Height());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-08-18 Thread Caolán McNamara
 vcl/source/filter/igif/decode.cxx |   26 ++
 vcl/source/filter/igif/decode.hxx |2 +-
 2 files changed, 19 insertions(+), 9 deletions(-)

New commits:
commit feb51015416c5ccceff0d74f7d0305f87febe75b
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Aug 17 16:14:16 2014 +0100

check that AddToTable can be done validly

Change-Id: I0ee69279e3bb1d9871feba17b908b8307f0ec5b4
(cherry picked from commit 43b39d3e47ffd179071732c0a8fc201c31b2bb46)
Reviewed-on: https://gerrit.libreoffice.org/10950
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/vcl/source/filter/igif/decode.cxx 
b/vcl/source/filter/igif/decode.cxx
index 5900b4c..1418c3a 100644
--- a/vcl/source/filter/igif/decode.cxx
+++ b/vcl/source/filter/igif/decode.cxx
@@ -49,12 +49,14 @@ GIFLZWDecompressor::GIFLZWDecompressor( sal_uInt8 cDataSize 
) :
 
 pTable = new GIFLZWTableEntry[ 4098 ];
 
-for( sal_uInt16 i = 0; i  nTableSize; i++ )
+for (sal_uInt16 i = 0; i  nTableSize; ++i)
 {
 pTable[i].pPrev = NULL;
 pTable[i].pFirst = pTable + i;
 pTable[i].nData = (sal_uInt8) i;
 }
+
+memset(pTable + nTableSize, 0, sizeof(GIFLZWTableEntry) * (4098 - 
nTableSize));
 }
 
 // 
@@ -111,9 +113,7 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, 
sal_uInt8 cBufSize,
 return pTarget;
 }
 
-// 
-
-void GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 
nCodeFirstData )
+bool GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 
nCodeFirstData )
 {
 GIFLZWTableEntry* pE;
 
@@ -122,12 +122,16 @@ void GIFLZWDecompressor::AddToTable( sal_uInt16 
nPrevCode, sal_uInt16 nCodeFirst
 pE = pTable + nTableSize;
 pE-pPrev = pTable + nPrevCode;
 pE-pFirst = pE-pPrev-pFirst;
-pE-nData = pTable[ nCodeFirstData ].pFirst-nData;
+GIFLZWTableEntry *pEntry = pTable[nCodeFirstData].pFirst;
+if (!pEntry)
+return false;
+pE-nData = pEntry-nData;
 nTableSize++;
 
 if ( ( nTableSize == (sal_uInt16) (1  nCodeSize) )  ( nTableSize  
4096 ) )
 nCodeSize++;
 }
+return true;
 }
 
 // 
@@ -161,17 +165,23 @@ bool GIFLZWDecompressor::ProcessOneCode()
 
 if ( nCode  nClearCode )
 {
+bool bOk = true;
 if ( nOldCode != 0x )
-AddToTable( nOldCode, nCode );
+bOk = AddToTable(nOldCode, nCode);
+if (!bOk)
+return false;
 }
 else if ( ( nCode  nEOICode )  ( nCode = nTableSize ) )
 {
 if ( nOldCode != 0x )
 {
+bool bOk;
 if ( nCode == nTableSize )
-AddToTable( nOldCode, nOldCode );
+bOk = AddToTable( nOldCode, nOldCode );
 else
-AddToTable( nOldCode, nCode );
+bOk = AddToTable( nOldCode, nCode );
+if (!bOk)
+return false;
 }
 }
 else
diff --git a/vcl/source/filter/igif/decode.hxx 
b/vcl/source/filter/igif/decode.hxx
index 3e1a783..737a495 100644
--- a/vcl/source/filter/igif/decode.hxx
+++ b/vcl/source/filter/igif/decode.hxx
@@ -43,7 +43,7 @@ class GIFLZWDecompressor
 sal_uInt8   nBlockBufSize;
 sal_uInt8   nBlockBufPos;
 
-voidAddToTable(sal_uInt16 nPrevCode, sal_uInt16 
nCodeFirstData);
+boolAddToTable(sal_uInt16 nPrevCode, sal_uInt16 
nCodeFirstData);
 boolProcessOneCode();
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-08-07 Thread Michael Stahl
 vcl/source/fontsubset/cff.cxx |   20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

New commits:
commit 5591c9c2ab77d32a923200f980e8fe7af61ffd5b
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 5 12:50:05 2014 +0200

fdo#81516: vcl: limit number of CFFs read from font

(cherry picked from commit 45b0b47d114437198c9e0872d427576e6e7e6cc6)

Conflicts:
vcl/source/fontsubset/cff.cxx

Change-Id: I9928b9805169a2dbb41be669dc37617b30bc672b
Reviewed-on: https://gerrit.libreoffice.org/10752
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 35b6679..476e458 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -369,7 +369,7 @@ public:
 explicit CffSubsetterContext( const U8* pBasePtr, int nBaseLen);
 virtual ~CffSubsetterContext( void);
 
-voidinitialCffRead( void);
+boolinitialCffRead();
 boolemitAsType1( class Type1Emitter,
 const long* pGlyphIDs, const U8* pEncoding,
 GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo );
@@ -1569,9 +1569,7 @@ CffGlobal::CffGlobal( void)
 // TODO; maFontMatrix.clear();
 }
 
-// 
-
-void CffSubsetterContext::initialCffRead( void)
+bool CffSubsetterContext::initialCffRead()
 {
 // get the CFFHeader
 mpReadPtr = mpBasePtr;
@@ -1629,7 +1627,11 @@ void CffSubsetterContext::initialCffRead( void)
 //  assert( mnFontDictBase == tellRel());
 mpReadPtr = mpBasePtr + mnFontDictBase;
 mnFDAryCount = (mpReadPtr[0]8) + mpReadPtr[1];
-assert( mnFDAryCount  (int)(sizeof(maCffLocal)/sizeof(*maCffLocal)));
+if (static_castsize_t(mnFDAryCount) = SAL_N_ELEMENTS(maCffLocal))
+{
+SAL_INFO(vcl.fonts, CffSubsetterContext: too many CFF in font);
+return false;
+}
 
 // read FDArray details to get access to the PRIVDICTs
 for( int i = 0; i  mnFDAryCount; ++i) {
@@ -1670,6 +1672,8 @@ void CffSubsetterContext::initialCffRead( void)
 }
 
 // ignore the Notices info
+
+return true;
 }
 
 // 
@@ -2340,14 +2344,16 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter 
rEmitter,
 bool FontSubsetInfo::CreateFontSubsetFromCff( GlyphWidth* pOutGlyphWidths )
 {
 CffSubsetterContext aCff( mpInFontBytes, mnInByteLength);
-aCff.initialCffRead();
+bool bRC = aCff.initialCffRead();
+if (!bRC)
+return bRC;
 
 // emit Type1 subset from the CFF input
 // TODO: also support CFF-CFF subsetting (when PDF-export and PS-printing 
need it)
 const bool bPfbSubset = (0 != (mnReqFontTypeMask  
FontSubsetInfo::TYPE1_PFB));
 Type1Emitter aType1Emitter( mpOutFile, bPfbSubset);
 aType1Emitter.setSubsetName( mpReqFontName);
-bool bRC = aCff.emitAsType1( aType1Emitter,
+bRC = aCff.emitAsType1( aType1Emitter,
 mpReqGlyphIds, mpReqEncodedIds,
 pOutGlyphWidths, mnReqGlyphCount, *this);
 return bRC;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-08-05 Thread Audrey Tang
 vcl/source/fontsubset/cff.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c1a53308423ebf45c7209ca1359b205b6f0ac236
Author: Audrey Tang audr...@audreyt.org
Date:   Tue Aug 5 09:56:53 2014 +0200

fdo#81516 Support fonts like Source Han Sans with  16 FDArray elements

Change-Id: I3f82574f434060d62dc3faeb730341c5b169ce9f
(cherry picked from commit 3b38a2342e48a2aec3c2e4f5aebf883db4b84101)
Reviewed-on: https://gerrit.libreoffice.org/10746
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index e2241a1..35b6679 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -405,7 +405,7 @@ private:
 const char**mpCharStringOps;
 const char**mpCharStringEscs;
 
-CffLocalmaCffLocal[16];
+CffLocalmaCffLocal[256];
 CffLocal*   mpCffLocal;
 
 voidreadDictOp( void);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-07-21 Thread Tomaž Vajngerl
 vcl/source/filter/wmf/winmtf.cxx |   18 +-
 vcl/source/filter/wmf/winmtf.hxx |2 +-
 2 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit f5949d09321e3ac62538df0e70e58284bd1cab32
Author: Tomaž Vajngerl tomaz.vajng...@collabora.com
Date:   Fri Jul 18 13:36:13 2014 +0200

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

Conflicts:
vcl/source/filter/wmf/winmtf.cxx

Change-Id: Ia865b84ee2b159ff7251ab5a769a2b635dd2a1ea
Reviewed-on: https://gerrit.libreoffice.org/10434
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 38e79a8..d8c2a67 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -412,14 +412,22 @@ Point WinMtfOutput::ImplMap( const Point rPt )
 return Point();
 };
 
-
-Size WinMtfOutput::ImplMap( const Size rSz )
+Size WinMtfOutput::ImplMap(const Size rSz, bool bDoWorldTransform)
 {
 if ( mnWinExtX  mnWinExtY )
 {
 // #i121382# apply the whole WorldTransform, else a rotation will be 
misinterpreted
-double fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() * 
maXForm.eM21;
-double fHeight = rSz.Width() * maXForm.eM12 + rSz.Height() * 
maXForm.eM22;
+double fWidth, fHeight;
+if (bDoWorldTransform)
+{
+fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() * maXForm.eM21;
+fHeight = rSz.Width() * maXForm.eM12 + rSz.Height() * maXForm.eM22;
+}
+else
+{
+fWidth = rSz.Width();
+fHeight = rSz.Height();
+}
 
 if ( mnGfxMode == GM_COMPATIBLE )
 {
@@ -483,7 +491,7 @@ void WinMtfOutput::ImplMap( Font rFont )
 {
 // !!! HACK: we now always set the width to zero because the OS width is 
interpreted differently;
 // must later be made portable in SV (KA 1996-02-08)
-Size  aFontSize = ImplMap ( rFont.GetSize() );
+Size  aFontSize = ImplMap (rFont.GetSize(), false);
 
 if( aFontSize.Height()  0 )
 aFontSize.Height() *= -1;
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 9db9245..e2c1f1c 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -632,7 +632,7 @@ class WinMtfOutput
 
 Point   ImplMap( const Point rPt );
 Point   ImplScale( const Point rPt );
-SizeImplMap( const Size rSz );
+SizeImplMap( const Size rSize, bool bDoWorldTransform = 
true);
 Rectangle   ImplMap( const Rectangle rRectangle );
 voidImplMap( Font rFont );
 PolygonImplMap( Polygon rPolygon );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-07-15 Thread Michael Stahl
 vcl/source/gdi/outdev2.cxx |   27 +--
 1 file changed, 1 insertion(+), 26 deletions(-)

New commits:
commit 1c269727b470c03f0ea538cad7e1331fd569a579
Author: Michael Stahl mst...@redhat.com
Date:   Thu Jul 10 17:05:39 2014 +0200

fdo#80498: vcl: Revert fdo#74124: Scale the pictures before calling ...

... ImplDrawAlpha().

This reverts commit 3cf3700b7a903e88f5296076c40ae854bce91cdc.

It may look nicer but is unusably slow when scrolling in Writer.

(same as master commit ee36fc7add892690c95a969530ecdcfc1bc9decc)

Conflicts:
vcl/source/gdi/outdev2.cxx

Change-Id: Ieb3d0b9dedeb3f1688eb30668e59750f3b569d9b
Reviewed-on: https://gerrit.libreoffice.org/10205
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com

diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 48ec303..759c3b4 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1001,29 +1001,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point 
rDestPt, const Size rDestSize
 
 if(aBmpEx.IsAlpha())
 {
-Size aDestSizePixel(LogicToPixel(rDestSize));
-
-BitmapEx aScaledBitmapEx(aBmpEx);
-Point aSrcPtPixel(rSrcPtPixel);
-Size aSrcSizePixel(rSrcSizePixel);
-
-// we have beautiful scaling algorithms, let's use them
-if (aDestSizePixel != rSrcSizePixel  rSrcSizePixel.Width() != 0  
rSrcSizePixel.Height() != 0)
-{
-double fScaleX = std::abs(aDestSizePixel.Width()  / 
double(rSrcSizePixel.Width()));
-double fScaleY = std::abs(aDestSizePixel.Height() / 
double(rSrcSizePixel.Height()));
-
-aScaledBitmapEx.Scale(fScaleX, fScaleY);
-
-// Negative size values are used for mirroring, but Scale already 
takes
-// care of mirroring so convert all negative values to positive.
-aSrcSizePixel = Size(std::abs(aDestSizePixel.Width()),
- std::abs(aDestSizePixel.Height()));
-
-aSrcPtPixel.X() = rSrcPtPixel.X() * fScaleX;
-aSrcPtPixel.Y() = rSrcPtPixel.Y() * fScaleY;
-}
-ImplDrawAlpha(aScaledBitmapEx.GetBitmap(), aScaledBitmapEx.GetAlpha(), 
rDestPt, rDestSize, aSrcPtPixel, aSrcSizePixel);
+ImplDrawAlpha( aBmpEx.GetBitmap(), aBmpEx.GetAlpha(), rDestPt, 
rDestSize, rSrcPtPixel, rSrcSizePixel );
 return;
 }
 
@@ -2085,9 +2063,6 @@ void OutputDevice::ImplDrawAlpha( const Bitmap rBmp, 
const AlphaMask rAlpha,
 if( !bNativeAlpha
   !aBmpRect.Intersection( Rectangle( rSrcPtPixel, 
rSrcSizePixel ) ).IsEmpty() )
 {
-// The scaling in this code path produces really ugly results - it
-// does the most trivial scaling with no smoothing.
-
 GDIMetaFile*pOldMetaFile = mpMetaFile;
 const bool  bOldMap = mbMap;
 mpMetaFile = NULL; // fdo#55044 reset before GetBitmap!
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-07-02 Thread Michael Stahl
 vcl/source/gdi/outdev4.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a071dd3179536f1fb523ff082b5c5b155e443c59
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 1 17:48:28 2014 +0200

fdo#80014: vcl: fix drawing of linear gradients

There is an off-by-one error in OutputDevice::ImplDrawLinearGradient()
that causes the bottom line to remain black.

(regression from 04d937c1ec36c2d9fa8c90604c81a37d30e97da6)

(cherry picked from commit d51f53fedb8cd68b1b3122c7199c4ea2d3a6980f)

Conflicts:
vcl/source/outdev/gradient.cxx

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

diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index e817e57..00e05a9 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -303,7 +303,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle 
rRect,
 
 // Polygon for this color step
 aRect.Top() = (long)( fGradientLine + ((double) i) * fScanInc );
-aRect.Bottom() = (long)( fGradientLine + ( ((double) i) + 1.0 ) * 
fScanInc + fScanInc*.1 );
+aRect.Bottom() = (long)( fGradientLine + ( ((double) i) + 1.0 ) * 
fScanInc);
 aPoly[0] = aRect.TopLeft();
 aPoly[1] = aRect.TopRight();
 aPoly[2] = aRect.BottomRight();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-06-29 Thread Caolán McNamara
 vcl/source/gdi/bitmap3.cxx |   28 ++--
 1 file changed, 18 insertions(+), 10 deletions(-)

New commits:
commit a519b6203eb4ea9be61d8e5c3da7fd51e4d71419
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 25 16:36:28 2014 +0100

Related: fdo#33455 retain color on scaling of 1 bit depth pngs

load test doc and zoom in and out and at certain zoom levels
its correctly black and at others its red

(cherry picked from commit be9d65bb5f5a83c19eec02a037b8f808de70ecb8)

Change-Id: I445ce672742ddb6d6592ef419bf5e14c5f09a5b5
Reviewed-on: https://gerrit.libreoffice.org/9923
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 4fbe1b8..ede020c 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -857,9 +857,7 @@ sal_Bool Bitmap::Scale( const double rScaleX, const 
double rScaleY, sal_uInt32
 {
 bool bRetval(false);
 
-#ifdef DBG_UTIL
 const sal_uInt16 nStartCount(GetBitCount());
-#endif
 
 if(basegfx::fTools::equalZero(rScaleX) || 
basegfx::fTools::equalZero(rScaleY))
 {
@@ -873,6 +871,22 @@ sal_Bool Bitmap::Scale( const double rScaleX, const 
double rScaleY, sal_uInt32
 bRetval = true;
 }
 
+//fdo#33455
+//
+//If we start with a 1 bit image, then after scaling it in any mode except
+//BMP_SCALE_FAST we have a a 24bit image which is perfectly correct, but we
+//are going to down-shift it to mono again and Bitmap::ImplMakeMono just
+//has Bitmap aNewBmp( GetSizePixel(), 1 ); to create a 1 bit bitmap which
+//will default to black/white and the colors mapped to which ever is closer
+//to black/white
+//
+//So the easiest thing to do to retain the colors of 1 bit bitmaps is to
+//just use the fast scale rather than attempting to count unique colors in
+//the other converters and pass all the info down through
+//Bitmap::ImplMakeMono
+if (nStartCount == 1  nScaleFlag != BMP_SCALE_NONE)
+nScaleFlag = BMP_SCALE_FAST;
+
 switch(nScaleFlag)
 {
 case BMP_SCALE_NONE :
@@ -892,7 +906,7 @@ sal_Bool Bitmap::Scale( const double rScaleX, const 
double rScaleY, sal_uInt32
 }
 case BMP_SCALE_SUPER :
 {
-if(GetSizePixel().Width()  2 || GetSizePixel().Height()  2)
+if (GetSizePixel().Width()  2 || GetSizePixel().Height()  2)
 {
 // fallback to ImplScaleFast
 bRetval = ImplScaleFast( rScaleX, rScaleY );
@@ -934,13 +948,7 @@ sal_Bool Bitmap::Scale( const double rScaleX, const 
double rScaleY, sal_uInt32
 }
 }
 
-#ifdef DBG_UTIL
-if(bRetval  nStartCount != GetBitCount())
-{
-OSL_ENSURE(false, Bitmap::Scale has changed the ColorDepth, this 
should *not* happen (!));
-}
-#endif
-
+OSL_ENSURE(!bRetval || nStartCount == GetBitCount(), Bitmap::Scale has 
changed the ColorDepth, this should *not* happen (!));
 return bRetval;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-06-24 Thread Matúš Kukan
 vcl/source/gdi/outdev4.cxx |   27 ---
 1 file changed, 4 insertions(+), 23 deletions(-)

New commits:
commit 87a3fe36ecc3a036806f1ca660c68debc763937d
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Jun 17 12:58:09 2014 +0200

bnc#593614: Avoid rendering artefacts in presentation mode.

By not using XOR rendering, see also fdo#38844.
The first variant seems to work better.

Basically, this is just cherry-pick of
bb5c7d6a79309236d4f19bb2498f2e850f735a2f

Change-Id: I0fdccf60601a47c91f467f9d1321d1c25f1ef68c
Reviewed-on: https://gerrit.libreoffice.org/9824
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 1be80e9..e817e57 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -740,29 +740,10 @@ void OutputDevice::DrawGradient( const PolyPolygon 
rPolyPoly,
 mpMetaFile-AddAction( new MetaCommentAction( XGRAD_SEQ_BEGIN ) 
);
 mpMetaFile-AddAction( new MetaGradientExAction( rPolyPoly, 
rGradient ) );
 
-if( OUTDEV_PRINTER == meOutDevType )
-{
-Push( PUSH_CLIPREGION );
-IntersectClipRegion(Region(rPolyPoly));
-DrawGradient( aRect, rGradient );
-Pop();
-}
-else
-{
-const sal_Bool  bOldOutput = IsOutputEnabled();
-
-EnableOutput( sal_False );
-Push( PUSH_RASTEROP );
-SetRasterOp( ROP_XOR );
-DrawGradient( aRect, rGradient );
-SetFillColor( COL_BLACK );
-SetRasterOp( ROP_0 );
-DrawPolyPolygon( rPolyPoly );
-SetRasterOp( ROP_XOR );
-DrawGradient( aRect, rGradient );
-Pop();
-EnableOutput( bOldOutput );
-}
+Push( PUSH_CLIPREGION );
+IntersectClipRegion(Region(rPolyPoly));
+DrawGradient( aRect, rGradient );
+Pop();
 
 mpMetaFile-AddAction( new MetaCommentAction( XGRAD_SEQ_END ) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-06-05 Thread Caolán McNamara
 vcl/source/fontsubset/sft.cxx |   23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

New commits:
commit 2dd048b2613a8309ba7673ef2cefae6dee56b235
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 4 16:17:28 2014 +0100

Resolves: fdo#78477 ensure offset + sizeof(value) is in bounds

a) ptr is just added to offset, so move addition into 2nd arg

Change-Id: Ia3e8145c69324f19aeec8b0dd97284ec382d20d7
(cherry picked from commit 57ef375bed4480bbedc799aca274a6bd26745008)

b) sort in order of increasing offset

Change-Id: I0d2c880438f47f4527037d7ffaf77cf142d24751
(cherry picked from commit 95e92889d3fb0e8a85cefdeb07a02e57130a9799)

c) fdo#78477 ensure offset + sizeof(value) is in bounds

check that largest offset + value to read is inside available space

Change-Id: I4feac37bdfbae5061b3b75ddf44bb20fc5904656
(cherry picked from commit c888c211072f23cfb4cc488c641d8d822f930a33)
(cherry picked from commit 891e0f76350890a4dd4331820bde8c118ac06ab0)
Reviewed-on: https://gerrit.libreoffice.org/9641
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 868e970..76f8abf 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -45,6 +45,7 @@
 #ifndef NO_TYPE3  /* include CreateT3FromTTGlyphs() */
 #include rtl/crc.h
 #endif
+#include rtl/ustring.hxx
 
 #include osl/endian.h
 #include algorithm
@@ -2649,12 +2650,22 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr)
 NameRecord* rec = (NameRecord*)calloc(n, sizeof(NameRecord));
 
 for (i = 0; i  n; i++) {
-int nStrOffset = GetUInt16(table + 6, 10 + 12 * i, 1);
-rec[i].platformID = GetUInt16(table + 6, 12 * i, 1);
-rec[i].encodingID = GetUInt16(table + 6, 2 + 12 * i, 1);
-rec[i].languageID = GetUInt16(table + 6, 4 + 12 * i, 1);
-rec[i].nameID = GetUInt16(table + 6, 6 + 12 * i, 1);
-rec[i].slen = GetUInt16(table + 6, 8 + 12 * i, 1);
+int nLargestFixedOffsetPos = 6 + 10 + 12 * i;
+int nMinSize = nLargestFixedOffsetPos + sizeof(sal_uInt16);
+if (nMinSize  nTableSize)
+{
+SAL_WARN( vcl.fonts, Font   
OUString::createFromAscii(ttf-fname)   claimed to have 
+ n   name records, but only space for   i);
+n = i;
+break;
+}
+
+rec[i].platformID = GetUInt16(table, 6 + 0 + 12 * i, 1);
+rec[i].encodingID = GetUInt16(table, 6 + 2 + 12 * i, 1);
+rec[i].languageID = GetUInt16(table, 6 + 4 + 12 * i, 1);
+rec[i].nameID = GetUInt16(table, 6 + 6 + 12 * i, 1);
+rec[i].slen = GetUInt16(table, 6 + 8 + 12 * i, 1);
+int nStrOffset = GetUInt16(table, nLargestFixedOffsetPos, 1);
 if (rec[i].slen) {
 if( nStrBase+nStrOffset+rec[i].slen = nTableSize ) {
 rec[i].sptr = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-05-31 Thread Matúš Kukan
 vcl/source/gdi/outdev3.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 27c29269d569cc7ec175da17f012a04123a9ac7c
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue May 27 16:37:30 2014 +0200

Related bnc#822625: Cache FontEntry with the original FontSelectPattern.

Otherwise we do not hit cache directly, only after expensive call to
ImplFindByFont.

(cherry picked from commits a6b00d16eb27a5e7e31c721671001a909ecef960
and 16a62079018aea0e72636bdb00576487b4e830b9)

Change-Id: If15b368feeba94c8fff8ee7cbe049fc4a2069768
Reviewed-on: https://gerrit.libreoffice.org/9520
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 537f8aa..a36fc85 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2214,6 +2214,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( 
ImplDevFontList* pFontList,
 ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
 FontSelectPattern aFontSelData, ImplDirectFontSubstitution* pDevSpecific )
 {
+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;
@@ -2300,8 +2301,9 @@ ImplFontEntry* ImplFontCache::GetFontEntry( 
ImplDevFontList* pFontList,
 }
 #endif
 
-// add the new entry to the cache
-maFontInstanceList[ aFontSelData ] = pEntry;
+// 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;
 }
 
 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-4-2' - vcl/source

2014-05-09 Thread Stephan Bergmann
 vcl/source/gdi/metric.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 9df14a8df187d8e0735da6eea87d199e7d11419a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu May 8 23:42:28 2014 +0200

Fix symbol aliasing code

(cherry picked from commit 434c5d7845ab25f8a518e7bec910f8628725d5b9)
Conflicts:
vcl/source/gdi/impfont.cxx

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

diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 7aad7fb..d708ca2 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -364,12 +364,15 @@ int ImplFontCharMap::GetGlyphIndex( sal_uInt32 cChar ) 
const
 // check that we are inside any range
 if( (nRange == 0)  (cChar  mpRangeCodes[0]) ) {
 // symbol aliasing gives symbol fonts a second chance
-const bool bSymbolic = (mpRangeCodes[0]=0xF000)  
(mpRangeCodes[1]=0xF0FF);
+const bool bSymbolic = cChar = 0xFF  (mpRangeCodes[0]=0xF000)  
(mpRangeCodes[1]=0xF0FF);
 if( !bSymbolic )
 return 0;
 // check for symbol aliasing (U+00xx - U+F0xx)
 cChar |= 0xF000;
 nRange = ImplFindRangeIndex( cChar );
+if( (nRange == 0)  (cChar  mpRangeCodes[0]) ) {
+return 0;
+}
 }
 // check that we are inside a range
 if( (nRange  1) != 0 )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-30 Thread Tomaž Vajngerl
 vcl/source/gdi/outdev2.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 10fef58379630c9d8e8ba76258baee917959e7c5
Author: Tomaž Vajngerl tomaz.vajng...@collabora.com
Date:   Wed Apr 30 16:46:40 2014 +0200

fdo#77126 BitmapEx.Scale already takes care of mirroring

Change-Id: I320a5ec1da62cc1a8b3cb227298ecaf99f305a6f

Signed-off-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 8ec9c21..48ec303 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1010,12 +1010,16 @@ void OutputDevice::ImplDrawBitmapEx( const Point 
rDestPt, const Size rDestSize
 // we have beautiful scaling algorithms, let's use them
 if (aDestSizePixel != rSrcSizePixel  rSrcSizePixel.Width() != 0  
rSrcSizePixel.Height() != 0)
 {
-double fScaleX = double(aDestSizePixel.Width()) / 
rSrcSizePixel.Width();
-double fScaleY = double(aDestSizePixel.Height()) / 
rSrcSizePixel.Height();
+double fScaleX = std::abs(aDestSizePixel.Width()  / 
double(rSrcSizePixel.Width()));
+double fScaleY = std::abs(aDestSizePixel.Height() / 
double(rSrcSizePixel.Height()));
 
 aScaledBitmapEx.Scale(fScaleX, fScaleY);
 
-aSrcSizePixel = aDestSizePixel;
+// Negative size values are used for mirroring, but Scale already 
takes
+// care of mirroring so convert all negative values to positive.
+aSrcSizePixel = Size(std::abs(aDestSizePixel.Width()),
+ std::abs(aDestSizePixel.Height()));
+
 aSrcPtPixel.X() = rSrcPtPixel.X() * fScaleX;
 aSrcPtPixel.Y() = rSrcPtPixel.Y() * fScaleY;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-09 Thread Jan Holesovsky
 vcl/source/window/window.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 972d8d87e46a0b3be651240261952fe428e2e3e2
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue Apr 8 18:50:22 2014 +0200

hidpi: Forgotten rounding.

Change-Id: Ie790b40ac86708768f52084538aa08f99df7def6
Reviewed-on: https://gerrit.libreoffice.org/8895
Reviewed-by: Keith Curtis keit...@gmail.com
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 3fb1f00..be231be 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -743,7 +743,7 @@ static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
 // eg. fdo#77059 - set the value from which we do consider the
 // screen hi-dpi to greater than 168
 if (nDPI  168)
-nResult = std::max(sal_Int32(1), (nDPI) / 96);
+nResult = std::max(sal_Int32(1), (nDPI + 48) / 96);
 #endif
 
 return nResult;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-09 Thread Caolán McNamara
 vcl/source/glyphs/graphite_layout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0d6fb4ed39323634312ec27abb6e8290ad91008f
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Apr 9 16:19:21 2014 +0100

WaE: -Werror=sign-compare

Change-Id: I160a760a13c8e5140d6df295a9dffd05cf5e7b81

diff --git a/vcl/source/glyphs/graphite_layout.cxx 
b/vcl/source/glyphs/graphite_layout.cxx
index 9014669..230583b 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -599,7 +599,7 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs 
rArgs)
 static com::sun::star::uno::Reference 
com::sun::star::i18n::XCharacterClassification  xCharClass;
 if ( !xCharClass.is() )
 xCharClass = vcl::unohelper::CreateCharacterClassification();
-int numchars2 = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, 
fdo#68313, fdo#70666 avoid bad ligature replacement
+size_t numchars2 = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, 
fdo#68313, fdo#70666 avoid bad ligature replacement
 if (numchars  numchars2  xCharClass-getType(rArgs.mpStr, numchars2 
+ 1) == ::com::sun::star::i18n::UnicodeType::LOWERCASE_LETTER)
 numchars = numchars2;
 if (mpFeatures)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-08 Thread Jan Holesovsky
 vcl/source/window/window.cxx |   30 +++---
 1 file changed, 19 insertions(+), 11 deletions(-)

New commits:
commit bcba071c0d583a0b3a62d6d718829b906ecc37f2
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue Apr 8 12:58:51 2014 +0200

fdo#77059, hidpi: Increase the threshold of what DPI we consider hi-dpi.

Conflicts:
vcl/source/window/window.cxx

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

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f477b5c..3fb1f00 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -732,6 +732,23 @@ void Window::ImplInitWindowData( WindowType nType )
 
 // ---
 
+static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
+{
+sal_Int32 nResult = 1;
+
+#ifndef MACOSX
+// Setting of HiDPI is unfortunately all only a heuristic; and to add
+// insult to an injury, the system is constantly lying to us about
+// the DPI and whatnot
+// eg. fdo#77059 - set the value from which we do consider the
+// screen hi-dpi to greater than 168
+if (nDPI  168)
+nResult = std::max(sal_Int32(1), (nDPI) / 96);
+#endif
+
+return nResult;
+}
+
 void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* 
pSystemParentData )
 {
 DBG_ASSERT( mpWindowImpl-mbFrame || pParent, Window::Window(): pParent 
== NULL );
@@ -983,11 +1000,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, 
SystemParentData* pSyste
 }
 
 // setup the scale factor for Hi-DPI displays
-#ifdef MACOSX
-mnDPIScaleFactor = 1;
-#else
-mnDPIScaleFactor = std::max((sal_Int32)1, 
(mpWindowImpl-mpFrameData-mnDPIY + 48) / 96);
-#endif
+mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl-mpFrameData-mnDPIY);
 
 const StyleSettings rStyleSettings = maSettings.GetStyleSettings();
 sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
@@ -1727,12 +1740,7 @@ void Window::ImplInitResolutionSettings()
 mnDPIY = (mpWindowImpl-mpFrameData-mnDPIY*nScreenZoom)/100;
 
 // setup the scale factor for Hi-DPI displays
-#ifdef MACOSX
-mnDPIScaleFactor = 1;
-#else
-mnDPIScaleFactor = std::max((sal_Int32)1, 
(mpWindowImpl-mpFrameData-mnDPIY + 48) / 96);
-#endif
-
+mnDPIScaleFactor = 
CountDPIScaleFactor(mpWindowImpl-mpFrameData-mnDPIY);
 SetPointFont( rStyleSettings.GetAppFont() );
 }
 else if ( mpWindowImpl-mpParent )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-02 Thread Matúš Kukan
 vcl/source/gdi/outdev3.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit d5b3e74e50a2616c85d1955f59e55bb4edba32dd
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Apr 1 13:01:14 2014 +0200

fdo#74302: Adapt to OUString changes and set length exactly.

This was fixed in master by 4c539fac018dfd44cd8db52161a8cb930c627da7

Change-Id: I69219e643f5eff3126191220ce2b1d0e1089a93e
Reviewed-on: https://gerrit.libreoffice.org/8808
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index d97b71b..537f8aa 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5399,6 +5399,9 @@ void OutputDevice::DrawText( const Point rStartPt, const 
OUString rStr,
  OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ).getStr() );
 #endif
 
+if( nLen == STRING_LEN )
+nLen = rStr.getLength() - nIndex;
+
 if ( mpMetaFile )
 mpMetaFile-AddAction( new MetaTextAction( rStartPt, rStr, nIndex, 
nLen ) );
 if( pVector )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-02 Thread Michael Stahl
 vcl/source/gdi/pdfwriter_impl.cxx |   19 ++-
 vcl/source/gdi/pdfwriter_impl.hxx |4 +++-
 2 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 7bea9683e14fcba98e2691fe7fb75f6f68ab0b29
Author: Michael Stahl mst...@redhat.com
Date:   Wed Apr 2 11:09:46 2014 +0200

fdo#63786 rhbz#1081968: fix PDF export of cropped SVG

When a META_FLOATTRANSPARENT_ACTION is exported, the
beginTransparencyGroup()/endTransparencyGroup() will write something
like Q 0 0 0 rg where the Q clears the previously set clipping region,
which is then not restored.

bdf75c7d9bce985ed10a9c41d03420f33ce82142 appears to be a fix for a
previous related problem; this essentially reverts it since it
introduced the current cropping problem.  (Particularly funny is the
comment force reemitting clip region since the commit does the
opposite.)

It does not really make sense to me to write something to the page
content stream from beginRedirect()/endRedirect(), because that does not
actually have any effect on the _content_ of the substream, because the
referencing of the substream is only written _after_ endRedirect()
returns, so basically what is written can in the best case cancel itself
out and in the worst case introduce bugs; the state manipulations there
are just to modify the m_aCurrentPDFState following the push()/pop() (it
is necessary to clear the clip region before starting the substream to
avoid spurious Q at the beginning of the stream).

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

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 8f86255..89355ad 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8662,9 +8662,12 @@ void PDFWriterImpl::beginRedirect( SvStream* pStream, 
const Rectangle rTargetRe
 {
 push( PUSH_ALL );
 
-// force reemitting clip region
+// force reemitting clip region inside the new stream, and
+// prevent emitting an unbalanced Q at the start
 clearClipRegion();
-updateGraphicsState();
+// this is needed to point m_aCurrentPDFState at the pushed state
+// ... but it's pointless to actually write into the outer stream here!
+updateGraphicsState(NOWRITE);
 
 m_aOutputStreams.push_front( StreamRedirect() );
 m_aOutputStreams.front().m_pStream = pStream;
@@ -8701,14 +8704,12 @@ SvStream* PDFWriterImpl::endRedirect()
 }
 
 pop();
-// force reemitting colors and clip region
-clearClipRegion();
-m_aCurrentPDFState.m_bClipRegion = m_aGraphicsStack.front().m_bClipRegion;
-m_aCurrentPDFState.m_aClipRegion = m_aGraphicsStack.front().m_aClipRegion;
+
 m_aCurrentPDFState.m_aLineColor = Color( COL_TRANSPARENT );
 m_aCurrentPDFState.m_aFillColor = Color( COL_TRANSPARENT );
 
-updateGraphicsState();
+// needed after pop() to set m_aCurrentPDFState
+updateGraphicsState(NOWRITE);
 
 return pStream;
 }
@@ -10497,7 +10498,7 @@ void PDFWriterImpl::drawWallpaper( const Rectangle 
rRect, const Wallpaper rWal
 }
 }
 
-void PDFWriterImpl::updateGraphicsState()
+void PDFWriterImpl::updateGraphicsState(Mode const mode)
 {
 OStringBuffer aLine( 256 );
 GraphicsState rNewState = m_aGraphicsStack.front();
@@ -10593,7 +10594,7 @@ void PDFWriterImpl::updateGraphicsState()
 
 // everything is up to date now
 m_aCurrentPDFState = m_aGraphicsStack.front();
-if( !aLine.isEmpty() )
+if ((mode != NOWRITE)   !aLine.isEmpty())
 writeBuffer( aLine.getStr(), aLine.getLength() );
 }
 
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx 
b/vcl/source/gdi/pdfwriter_impl.hxx
index 4602044..8e622fa 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -840,10 +840,12 @@ i12626
 void drawRelief( SalLayout rLayout, const OUString rText, bool 
bTextLines );
 void drawShadow( SalLayout rLayout, const OUString rText, bool 
bTextLines );
 
+enum Mode { DEFAULT, NOWRITE };
+
 /*  writes differences between graphics stack and current real PDF
  *   state to the file
  */
-void updateGraphicsState();
+void updateGraphicsState(Mode mode = DEFAULT);
 
 /* writes a transparency group object */
 bool writeTransparentObject( TransparencyEmit rObject );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-01 Thread Oliver-Rainer Wittmann
 vcl/source/gdi/dibtools.cxx |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 172c33146d7e8b4f741d52ab7c9dfdb55c847401
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Mon Mar 31 14:37:21 2014 +

Resolves: #i124555# restore stream position after Seek to end of stream

(cherry picked from commit 61efddf5ab8cd318e022ca1ac817ba0879a55e23)

Conflicts:
vcl/source/gdi/dibtools.cxx

(cherry picked from commit cc1a7748c867716966b6a38e75f89df5d92ee104)

Conflicts:
vcl/source/gdi/dibtools.cxx

Change-Id: Ie6c0aeab5988b68954a0bdd460317ac9539d8a5f

diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index dac2c8c..2759c20 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -781,17 +781,18 @@ bool ImplReadDIBBody( SvStream rIStm, Bitmap rBmp, 
Bitmap* pBmpAlpha, sal_uLon
 
 bool ImplReadDIBFileHeader( SvStream rIStm, sal_uLong rOffset )
 {
-sal_uInt32  nTmp32;
-sal_uInt16  nTmp16 = 0;
-boolbRet = false;
+bool bRet = false;
 
-const sal_uLong nStreamLength (rIStm.Seek(STREAM_SEEK_TO_END));
-rIStm.Seek(STREAM_SEEK_TO_BEGIN);
+const sal_Size nSavedStreamPos( rIStm.Tell() );
+const sal_Size nStreamLength( rIStm.Seek( STREAM_SEEK_TO_END ) );
+rIStm.Seek( nSavedStreamPos );
 
+sal_uInt16 nTmp16 = 0;
 rIStm  nTmp16;
 
 if ( ( 0x4D42 == nTmp16 ) || ( 0x4142 == nTmp16 ) )
 {
+sal_uInt32 nTmp32(0);
 if ( 0x4142 == nTmp16 )
 {
 rIStm.SeekRel( 12L );
@@ -809,7 +810,7 @@ bool ImplReadDIBFileHeader( SvStream rIStm, sal_uLong 
rOffset )
 bRet = ( rIStm.GetError() == 0UL );
 }
 
-if (rOffset = nStreamLength)
+if ( rOffset = nStreamLength )
 {
 // Offset claims that image starts past the end of the
 // stream.  Unlikely.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-04-01 Thread Caolán McNamara
 vcl/source/gdi/metaact.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a37f474a2272c505778774cd1d92897d8a744863
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 1 16:52:21 2014 +0100

valgrind: Conditional jump or move depends on uninitialised value

(cherry picked from commit e3dad060929de9bd2978f1b1427a91152073)

Conflicts:
vcl/source/gdi/metaact.cxx

Change-Id: Ia0b22f7c394d1c2387d1cad7e3d99c79eaeca81a

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index d205723..e7aed0d 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1066,7 +1066,7 @@ void MetaPolygonAction::Read( SvStream rIStm, 
ImplMetaReadData* )
 
 if( aCompat.GetVersion() = 2 ) // Version 2
 {
-sal_uInt8 bHasPolyFlags;
+sal_uInt8 bHasPolyFlags(0);
 rIStm  bHasPolyFlags;
 if ( bHasPolyFlags )
 maPoly.Read( rIStm );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-03-28 Thread Jürgen Schmidt
 vcl/source/gdi/dibtools.cxx |   24 +++-
 1 file changed, 23 insertions(+), 1 deletion(-)

New commits:
commit a22da299787cea0343a55ae794e88cd52d12057a
Author: Jürgen Schmidt j...@apache.org
Date:   Fri Mar 28 10:56:13 2014 +

Resolves: #i124467# add check for image data offset...

against stream length, some further checks

(cherry picked from commit 9ceda6fa56d31af717cc2c0c7572cf53cdc47af1)

Conflicts:
vcl/source/gdi/dibtools.cxx

(cherry picked from commit f7799c9317cc3187ae8aaedc36f829d478a59e77)

Conflicts:
vcl/source/gdi/dibtools.cxx

Change-Id: I8993b91ef4fa951e7bae702b0d056996015245ba

diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 85d0d9b..dac2c8c 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -384,7 +384,11 @@ void ImplDecodeRLE( sal_uInt8* pBuffer, DIBV5Header 
rHeader, BitmapWriteAccess
 
 bool ImplReadDIBBits(SvStream rIStm, DIBV5Header rHeader, BitmapWriteAccess 
rAcc, BitmapWriteAccess* pAccAlpha, bool bTopDown, bool rAlphaUsed)
 {
-const sal_uLong nAlignedWidth = AlignedWidth4Bytes(rHeader.nWidth * 
rHeader.nBitCount);
+const sal_Int64 nBitsPerLine (static_castsal_Int64(rHeader.nWidth) * 
static_castsal_Int64(rHeader.nBitCount));
+if (nBitsPerLine  SAL_MAX_UINT32)
+return false;
+
+const sal_uLong nAlignedWidth = 
AlignedWidth4Bytes(static_castsal_uLong(nBitsPerLine));
 sal_uInt32 nRMask(( rHeader.nBitCount == 16 ) ? 0x7c00UL : 
0x00ffUL);
 sal_uInt32 nGMask(( rHeader.nBitCount == 16 ) ? 0x03e0UL : 
0xff00UL);
 sal_uInt32 nBMask(( rHeader.nBitCount == 16 ) ? 0x001fUL : 
0x00ffUL);
@@ -622,6 +626,13 @@ bool ImplReadDIBBody( SvStream rIStm, Bitmap rBmp, 
Bitmap* pBmpAlpha, sal_uLon
 
 if(ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown)  aHeader.nWidth  
aHeader.nHeight  aHeader.nBitCount)
 {
+if (aHeader.nSize  nOffset)
+{
+// Header size claims to extend into the image data.
+// Looks like an error.
+return false;
+}
+
 const sal_uInt16 nBitCount(discretizeBitcount(aHeader.nBitCount));
 const Size aSizePixel(aHeader.nWidth, aHeader.nHeight);
 BitmapPalette aDummyPal;
@@ -774,6 +785,9 @@ bool ImplReadDIBFileHeader( SvStream rIStm, sal_uLong 
rOffset )
 sal_uInt16  nTmp16 = 0;
 boolbRet = false;
 
+const sal_uLong nStreamLength (rIStm.Seek(STREAM_SEEK_TO_END));
+rIStm.Seek(STREAM_SEEK_TO_BEGIN);
+
 rIStm  nTmp16;
 
 if ( ( 0x4D42 == nTmp16 ) || ( 0x4142 == nTmp16 ) )
@@ -794,6 +808,14 @@ bool ImplReadDIBFileHeader( SvStream rIStm, sal_uLong 
rOffset )
 rOffset = nTmp32 - 14UL;// adapt offset by 
sizeof(BITMAPFILEHEADER)
 bRet = ( rIStm.GetError() == 0UL );
 }
+
+if (rOffset = nStreamLength)
+{
+// Offset claims that image starts past the end of the
+// stream.  Unlikely.
+rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
+bRet = false;
+}
 }
 else
 rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-03-26 Thread Keith Curtis
 vcl/source/window/toolbox.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e9451c72d4e221c993e1af30652c62a538d033d8
Author: Keith Curtis keit...@gmail.com
Date:   Mon Mar 17 20:16:57 2014 -0400

Hopefully fix Windows HiDPI toolbar layout bug

On Windows HiDPI, toolbar buttons are cut off. This may fix the problem.

Here is a screenshot:
http://i.imgur.com/NADAvYi.png

I can't prove this fixes anything on Windows because I can't see this
on Linux and don't really understand the surrounding code. On the other
hand, it is easy to prove this is reasonable code.

Change-Id: I69c19ad46844bead942ce63883d163cb9d0690c9
Reviewed-on: https://gerrit.libreoffice.org/8637
Tested-by: LibreOffice gerrit bot ger...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit 509441038ab95dd3a60efd1b6c302bf22bfbc631)
Reviewed-on: https://gerrit.libreoffice.org/8743
Reviewed-by: Keith Curtis keit...@gmail.com
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 0d7bf8a..4613879 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1747,8 +1747,8 @@ sal_Bool ToolBox::ImplCalcItem()
 longnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
 
 // set defaults if image or text is needed but empty
-nDefWidth   = GetDefaultImageSize().Width();
-nDefHeight  = GetDefaultImageSize().Height();
+nDefWidth   = GetDefaultImageSize().Width() * GetDPIScaleFactor();
+nDefHeight  = GetDefaultImageSize().Height() * GetDPIScaleFactor();
 
 mnWinHeight = 0;
 // determine minimum size necessary in NWF
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-03-24 Thread Caolán McNamara
 vcl/source/gdi/print3.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 10b44dc538935ab8d61fb11601e16be8d7742fc4
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Mar 22 16:06:35 2014 +

coverity#705969 Dereference before null check

Change-Id: Icb19931bb529e6c2b98621a603cdb86011d68a9e
(cherry picked from commit 51452b7afe858139076010decbe04758321a8396)
Reviewed-on: https://gerrit.libreoffice.org/8732
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Björn Michaelsen bjoern.michael...@canonical.com

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index ad2329c..a5c9745 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -716,7 +716,7 @@ bool Printer::StartJob( const OUString i_rJobName, 
boost::shared_ptrvcl::Print
 
 if( bError )
 {
-mnError = ImplSalPrinterErrorCodeToVCL( 
mpPrinter-GetErrorCode() );
+mnError = mpPrinter ? 
ImplSalPrinterErrorCodeToVCL(mpPrinter-GetErrorCode()) : 0;
 if ( !mnError )
 mnError = PRINTER_GENERALERROR;
 i_pController-setJobState( mnError == PRINTER_ABORT
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-03-21 Thread Caolán McNamara
 vcl/source/fontsubset/sft.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fc70d91713332676dd2b8aa77d67684258493b15
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Mar 21 15:33:53 2014 +

coverity#705966 Dereference before null check

Change-Id: I74507ce67f928bdeb626d4070dbd2a45cc126521
(cherry picked from commit 511d8bbbec6bc95d92a3ac6bbac4c68622738706)
Reviewed-on: https://gerrit.libreoffice.org/8698
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 9880b7b..868e970 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2413,7 +2413,7 @@ bool GetSfntTable( TrueTypeFont* ttf, int nSubtableIndex,
 return false;
 *pRawLength = ttf-tlens[ nSubtableIndex ];
 *ppRawBytes = ttf-tables[ nSubtableIndex ];
-bool bOk = (*pRawLength  0)  (ppRawBytes != NULL);
+bool bOk = (*pRawLength  0)  (*ppRawBytes != NULL);
 return bOk;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-03-12 Thread Jan Holesovsky
 vcl/source/gdi/outdev3.cxx |   29 ++---
 1 file changed, 22 insertions(+), 7 deletions(-)

New commits:
commit ab2739b37d8c331aa5ed26346c7e29199a369571
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Mar 6 18:40:36 2014 +0100

hidpi: Nicer painting of the waved lines.

Change-Id: I8773b47967bc1aa8cf33b9a1edc4f826291d3554
Reviewed-on: https://gerrit.libreoffice.org/8518
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index afe06f7..d97b71b 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -419,6 +419,7 @@ static void ImplFontSubstitute( OUString rFontName,
 }
 }
 
+//hidpi TODO: This routine has hard-coded font-sizes that break places such as 
DialControl
 Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
sal_uLong nFlags, const OutputDevice* 
pOutDev )
 {
@@ -5339,11 +5340,24 @@ void OutputDevice::DrawWaveLine( const Point 
rStartPos, const Point rEndPos,
 }
 
 long nWaveHeight;
+
 if ( nStyle == WAVE_NORMAL )
 {
 nWaveHeight = 3;
 nStartY++;
 nEndY++;
+
+if (mnDPIScaleFactor  1)
+{
+nWaveHeight *= mnDPIScaleFactor;
+
+// odd heights look better than even
+if (mnDPIScaleFactor % 2 == 0)
+{
+nStartY++; // Shift down an additional pixel to create more 
visual separation.
+nWaveHeight--;
+}
+}
 }
 else if( nStyle == WAVE_SMALL )
 {
@@ -5354,14 +5368,15 @@ void OutputDevice::DrawWaveLine( const Point 
rStartPos, const Point rEndPos,
 else // WAVE_FLAT
 nWaveHeight = 1;
 
- // #109280# make sure the waveline does not exceed the descent to avoid 
paint problems
- ImplFontEntry* pFontEntry = mpFontEntry;
- if( nWaveHeight  pFontEntry-maMetric.mnWUnderlineSize )
- nWaveHeight = pFontEntry-maMetric.mnWUnderlineSize;
+// #109280# make sure the waveline does not exceed the descent to avoid 
paint problems
+ImplFontEntry* pFontEntry = mpFontEntry;
+if( nWaveHeight  pFontEntry-maMetric.mnWUnderlineSize )
+nWaveHeight = pFontEntry-maMetric.mnWUnderlineSize;
+
+ImplDrawWaveLine(nStartX, nStartY, 0, 0,
+nEndX-nStartX, nWaveHeight,
+mnDPIScaleFactor, nOrientation, GetLineColor());
 
- ImplDrawWaveLine( nStartX, nStartY, 0, 0,
-  nEndX-nStartX, nWaveHeight, 1,
-  nOrientation, GetLineColor() );
 if( mpAlphaVDev )
 mpAlphaVDev-DrawWaveLine( rStartPos, rEndPos, nStyle );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-03-05 Thread Ahmad H . Al Harthi
 vcl/source/window/splitwin.cxx |   49 ++---
 1 file changed, 12 insertions(+), 37 deletions(-)

New commits:
commit af172141738bf50c7edbc502acf8286191adae95
Author: Ahmad H. Al Harthi aalhar...@kacst.edu.sa
Date:   Tue Feb 11 11:19:16 2014 +0300

fdo#59329 fix docked panels borders

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

diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 8937527..b23a65d 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -137,9 +137,9 @@ static void ImplCalcBorder( WindowAlign eAlign, sal_Bool 
bNoAlign,
 rBottom = 0;
 break;
 case WINDOWALIGN_LEFT:
-rLeft   = 2;
+rLeft   = 0;
 rTop= 2;
-rRight  = 0;
+rRight  = 2;
 rBottom = 2;
 break;
 case WINDOWALIGN_BOTTOM:
@@ -179,48 +179,23 @@ void SplitWindow::ImplDrawBorder( SplitWindow* pWin )
 {
 case WINDOWALIGN_BOTTOM:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
-pWin-DrawLine( Point( 0, 0 ), Point( 0, nDY-1 ) );
-pWin-DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-3 ) );
-
-pWin-SetLineColor( rStyleSettings.GetLightColor() );
-pWin-DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
-pWin-DrawLine( Point( 1, 1 ), Point( 1, nDY-3 ) );
-pWin-DrawLine( Point( nDX-1, 0 ), Point( nDX-1, nDY-1 ) );
+pWin-DrawLine( Point( 0, 6 ), Point( nDX-1, 6 ) );
+pWin-DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
 break;
 case WINDOWALIGN_TOP:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
-pWin-DrawLine( Point( 0, 0 ), Point( 0, nDY-1 ) );
-pWin-DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-1 ) );
-
-pWin-SetLineColor( rStyleSettings.GetLightColor() );
-pWin-DrawLine( Point( 1, 1 ), Point( nDX-3, 1 ) );
-pWin-DrawLine( Point( 1, 1 ), Point( 1, nDY-1 ) );
-pWin-DrawLine( Point( nDX-1, 1 ), Point( nDX-1, nDY-1 ) );
+pWin-DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
+pWin-DrawLine( Point( 0, nDY-7 ), Point( nDX-1, nDY-7 ) );
 break;
 case WINDOWALIGN_LEFT:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
-pWin-DrawLine( Point( 0, 0 ), Point( 0, nDY-1 ) );
-pWin-DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
-
-pWin-SetLineColor( rStyleSettings.GetLightColor() );
-pWin-DrawLine( Point( 1, 1 ), Point( nDX-1, 1 ) );
-pWin-DrawLine( Point( 1, 1 ), Point( 1, nDY-3 ) );
-pWin-DrawLine( Point( 1, nDY-1 ), Point( nDX-1, nDY-1 ) );
+pWin-DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-1 ) );
+pWin-DrawLine( Point( nDX-8, 0 ), Point( nDX-8, nDY-1 ) );
 break;
 default:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( 0, 0 ), Point( nDX-2, 0 ) );
-pWin-DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-3 ) );
-pWin-DrawLine( Point( 0, nDY-2 ), Point( nDX-2, nDY-2 ) );
-
-pWin-SetLineColor( rStyleSettings.GetLightColor() );
-pWin-DrawLine( Point( 0, 1 ), Point( nDX-3, 1 ) );
-pWin-DrawLine( Point( nDX-1, 0 ), Point( nDX-1, nDY-1 ) );
-pWin-DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
-break;
+pWin-DrawLine( Point( 0, 0 ), Point( 0, nDY-1 ) );
+pWin-DrawLine( Point( 6, 0 ), Point( 6, nDY-1 ) );
 }
 }
 }
@@ -1648,7 +1623,7 @@ void SplitWindow::ImplSplitMousePos( Point rMousePos )
 
 void SplitWindow::ImplGetButtonRect( Rectangle rRect, long nEx, sal_Bool 
bTest ) const
 {
-long nSplitSize = mpMainSet-mnSplitSize-2;
+long nSplitSize = mpMainSet-mnSplitSize-1;
 if ( mbAutoHide || mbFadeOut || mbFadeIn )
 nSplitSize += SPLITWIN_SPLITSIZEEX;
 
@@ -1998,7 +1973,7 @@ void SplitWindow::ImplDrawGrip( const Rectangle rRect, 
sal_Bool bHorz, sal_Bool
 int height = (int) (0.5 * rRect.getHeight() + 0.5);
 int i = rRect.Top() + (rRect.getHeight() - height) / 2;
 height += i;
-const int x = rRect.Left() + 1;
+const int x = rRect.Left() + 2;
 ImplDrawFadeArrow( Point( x, i-8), bHorz, bLeft );
 while( i = height )
 {
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-03-05 Thread Ahmad H . Al Harthi
 vcl/source/window/splitwin.cxx |   52 +
 1 file changed, 38 insertions(+), 14 deletions(-)

New commits:
commit 682f723d31e6c4a59254a08f5ec62abc700f3fd6
Author: Ahmad H. Al Harthi aalhar...@kacst.edu.sa
Date:   Sun Mar 2 12:53:14 2014 +0300

fdo#59329 Fix docked window border lines

This patch completes the missing border lines. This is intended
for versions 4.1 and 4.2 only.

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

diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index b23a65d..fdadc8e 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -179,23 +179,43 @@ void SplitWindow::ImplDrawBorder( SplitWindow* pWin )
 {
 case WINDOWALIGN_BOTTOM:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( 0, 6 ), Point( nDX-1, 6 ) );
 pWin-DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
+pWin-DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
+
+pWin-SetLineColor( rStyleSettings.GetLightColor() );
+pWin-DrawLine( Point( 0, 1 ), Point( nDX-1, 1 ) );
+pWin-DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
 break;
 case WINDOWALIGN_TOP:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
+pWin-DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
+pWin-DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
+
+pWin-SetLineColor( rStyleSettings.GetLightColor() );
 pWin-DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
-pWin-DrawLine( Point( 0, nDY-7 ), Point( nDX-1, nDY-7 ) );
+pWin-DrawLine( Point( 0, 1 ), Point( nDX-1, 1 ) );
 break;
 case WINDOWALIGN_LEFT:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-1 ) );
-pWin-DrawLine( Point( nDX-8, 0 ), Point( nDX-8, nDY-1 ) );
+pWin-DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-2 ) );
+pWin-DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
+pWin-DrawLine( Point( 0, nDY-2 ), Point( nDX-2, nDY-2 ) );
+
+pWin-SetLineColor( rStyleSettings.GetLightColor() );
+pWin-DrawLine( Point( nDX-1, 0 ), Point( nDX-1, nDY-1 ) );
+pWin-DrawLine( Point( 0, 1 ), Point( nDX-3, 1 ) );
+pWin-DrawLine( Point( 0, nDY-1 ), Point( nDX-2, nDY-1 ) );
 break;
 default:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( 0, 0 ), Point( 0, nDY-1 ) );
-pWin-DrawLine( Point( 6, 0 ), Point( 6, nDY-1 ) );
+pWin-DrawLine( Point( 0, 0 ), Point( 0, nDY-2 ) );
+pWin-DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
+pWin-DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
+
+pWin-SetLineColor( rStyleSettings.GetLightColor() );
+pWin-DrawLine( Point( 1, 1 ), Point( 1, nDY-3 ) );
+pWin-DrawLine( Point( 1, 1 ), Point( nDX-1, 1 ) );
+pWin-DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
 }
 }
 }
@@ -214,27 +234,31 @@ void SplitWindow::ImplDrawBorderLine( SplitWindow* pWin )
 {
 case WINDOWALIGN_LEFT:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( nDX-SPLITWIN_SPLITSIZEEXLN-1, 0 ), Point( 
nDX-SPLITWIN_SPLITSIZEEXLN-1, nDY-3 ) );
+pWin-DrawLine( Point( nDX-SPLITWIN_SPLITSIZEEXLN-1, 1 ), Point( 
nDX-SPLITWIN_SPLITSIZEEXLN-1, nDY-2 ) );
+
 pWin-SetLineColor( rStyleSettings.GetLightColor() );
-pWin-DrawLine( Point( nDX-SPLITWIN_SPLITSIZEEXLN, 1 ), Point( 
nDX-SPLITWIN_SPLITSIZEEXLN, nDY-4 ) );
+pWin-DrawLine( Point( nDX-SPLITWIN_SPLITSIZEEXLN, 1 ), Point( 
nDX-SPLITWIN_SPLITSIZEEXLN, nDY-3 ) );
 break;
 case WINDOWALIGN_RIGHT:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( SPLITWIN_SPLITSIZEEXLN-1, 0 ), Point( 
SPLITWIN_SPLITSIZEEXLN-1, nDY-3 ) );
+pWin-DrawLine( Point( SPLITWIN_SPLITSIZEEXLN-1, 0 ), Point( 
SPLITWIN_SPLITSIZEEXLN-1, nDY-2 ) );
+
 pWin-SetLineColor( rStyleSettings.GetLightColor() );
-pWin-DrawLine( Point( SPLITWIN_SPLITSIZEEXLN, 1 ), Point( 
SPLITWIN_SPLITSIZEEXLN, nDY-4 ) );
+pWin-DrawLine( Point( SPLITWIN_SPLITSIZEEXLN, 1 ), Point( 
SPLITWIN_SPLITSIZEEXLN, nDY-3 ) );
 break;
 case WINDOWALIGN_TOP:
 pWin-SetLineColor( rStyleSettings.GetShadowColor() );
-pWin-DrawLine( Point( 0, nDY-SPLITWIN_SPLITSIZEEXLN-1 ), Point( 
nDX-3, 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-02-18 Thread Caolán McNamara
 vcl/source/window/layout.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit a9a2b6d63231b514754f16c029ca35bb7383e139
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 17 16:57:44 2014 +

Resolves: fdo#74284 use AccessibleRole::PANEL for VclBoxes under windows

(cherry picked from commit 685ec1899435037205d98a102a32ca8b6a4836d0)

Change-Id: Ic8c743c2646c8610b3d90425024413b40dfdab13
Reviewed-on: https://gerrit.libreoffice.org/8103
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 35e76a4..8d8ab0d 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -322,7 +322,13 @@ bool VclBox::set_property(const OString rKey, const 
OString rValue)
 
 sal_uInt16 VclBox::getDefaultAccessibleRole() const
 {
+#if defined(WNT)
+//fdo#74284 call Boxes Panels, keep then as Filler under
+//at least Linux seeing as that's what Gtk does for GtkBoxes
+return com::sun::star::accessibility::AccessibleRole::PANEL;
+#else
 return com::sun::star::accessibility::AccessibleRole::FILLER;
+#endif
 }
 
 #define DEFAULT_CHILD_MIN_WIDTH 85
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-02-18 Thread Caolán McNamara
 vcl/source/window/printdlg.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 07f0566026db8f5ec048297785f82a43e73a14f6
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Dec 4 16:48:08 2013 +

fdo#41760 rhbz#1038189 refresh printer list when print dialog launched

which is the the same thing the printer settings dialog does

(cherry picked from commit 02efbed152a3a9e364cdb73628af0aed0f5d6f7a)
Signed-off-by: Michael Stahl mst...@redhat.com

Change-Id: I36fb9f057b66faa8c9fce5a9934ed2fb70786363

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index b8cb188..21941ca 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -602,6 +602,8 @@ PrintDialog::PrintDialog( Window* i_pParent, const 
boost::shared_ptrPrinterCont
 // init reverse print
 maJobPage.mpReverseOrderBox-Check( maPController-getReversePrint() );
 
+Printer::updatePrinters();
+
 // fill printer listbox
 const std::vector OUString  rQueues( Printer::GetPrinterQueues() );
 for( std::vector OUString ::const_iterator it = rQueues.begin();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-02-04 Thread Michael Stahl
 vcl/source/gdi/bmpfast.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 67d36215a3b846513335f69a83cb941cc5dcdc11
Author: Michael Stahl mst...@redhat.com
Date:   Wed Jan 29 14:55:47 2014 +0100

vcl: try to fix sizes in ImplBlendToBitmap (related: fdo#74226)

Since commit 2f84b420e0428693fb2d45b68afdc9023dfc08bc,
sw_unoapi test sw.SwAccessibleEndnoteView crashes while trying to blend
a 1107x8 Bitmap into a 97x8 Bitmap; it's not obvious that any of the
parameters passed in is wrong and it's odd that ImplBlendToBitmap()
would use rSrcBuffer.mnHeight and rDstBuffer.mnWidth; presumably
it should use both height and width of the same buffer.

This backport has an additional std::min added for safety; on master we
can try without to see if it's really needed.

(cherry picked from commit 2ca79052d0fab159b017cacd3d7145d8012de850)

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

diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 0fe79ea..a6eccde 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -608,7 +608,8 @@ bool ImplBlendToBitmap( TrueColorPixelPtrSRCFMT rSrcLine,
 nDstLinestep = -nDstLinestep;
 }
 
-for( int y = rSrcBuffer.mnHeight; --y = 0; )
+assert(rDstBuffer.mnHeight = rSrcBuffer.mnHeight); // not sure about that?
+for (int y = std::min(rDstBuffer.mnHeight, rSrcBuffer.mnHeight); --y = 0;)
 {
 ImplBlendLines8( aDstLine, rSrcLine, aMskLine, rDstBuffer.mnWidth );
 aDstLine.AddByteOffset( nDstLinestep );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-01-28 Thread Caolán McNamara
 vcl/source/filter/jpeg/JpegReader.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 5ced55668d729c49c154f9d2d81907f3d44e3593
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jan 27 15:05:33 2014 +

Resolves: fdo#74051 support 8430x11700 jpegs

Change-Id: I1ca95a496bca80e5e2787af2ccbf0f6cd42455a5
(cherry picked from commit 53c803004554a3a0fff26501357a183bba008a26)
Reviewed-on: https://gerrit.libreoffice.org/7696
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com

diff --git a/vcl/source/filter/jpeg/JpegReader.cxx 
b/vcl/source/filter/jpeg/JpegReader.cxx
index 1a2416a..89f9028 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -36,11 +36,11 @@ extern C
 #define JPEG_MIN_READ 512
 #define BUFFER_SIZE  4096
 namespace {
-// Arbitrary maximal size (256M) of bitmaps after they have been decoded.
+// Arbitrary maximal size (512M) of a bitmap after it has been decoded.
 // It is used to prevent excessive swapping due to large buffers in
 // virtual memory.
 // May have to be tuned if it turns out to be too large or too small.
-static const sal_uInt64 MAX_BITMAP_BYTE_SIZE = sal_uInt64(256 * 1024 * 
1024);
+static const sal_uInt64 MAX_BITMAP_BYTE_SIZE = sal_uInt64(512 * 1024 * 
1024);
 }
 
 extern C void* CreateBitmapFromJPEGReader( void* pJPEGReader, void* 
pJPEGCreateBitmapParam )
@@ -235,7 +235,7 @@ void* JPEGReader::CreateBitmap( void* _pParam )
 
 sal_uInt64 nSize = aSize.Width();
 nSize *= aSize.Height();
-if (nSize  SAL_MAX_INT32 / 24)
+if (nSize  SAL_MAX_INT32 / (bGray?1:3))
 return NULL;
 
 // Check if the bitmap is untypically large.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-01-27 Thread Jan Holesovsky
 vcl/source/gdi/outdev2.cxx |   23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 39f0062a074c24fd2bdc5b20f457e51fc322c82b
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon Jan 27 20:11:26 2014 +0100

fdo#74124: Scale the pictures before calling ImplDrawAlpha().

When the source and destination bitmap do not have the same size,
ImplDrawAlpha() does not use direct paint, but instead it gets the image 
from
the screen, blends it with the provided bitmap, and again draws it.

Unfortunately, the blending uses the most trivial (and ugly) way of scaling;
so to produce much better results, let's scale to the destination size 
before
even calling ImplDrawAlpha().

The sideeffect is that we use the direct paint in most cases now; so 
hopefully
it pays off to do the (a bit more expensive) scale first.

Change-Id: I3b6b275710220910709ae4345ad6be3d6e4bf79c
Reviewed-on: https://gerrit.libreoffice.org/7701
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 759c3b4..8ec9c21 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1001,7 +1001,25 @@ void OutputDevice::ImplDrawBitmapEx( const Point 
rDestPt, const Size rDestSize
 
 if(aBmpEx.IsAlpha())
 {
-ImplDrawAlpha( aBmpEx.GetBitmap(), aBmpEx.GetAlpha(), rDestPt, 
rDestSize, rSrcPtPixel, rSrcSizePixel );
+Size aDestSizePixel(LogicToPixel(rDestSize));
+
+BitmapEx aScaledBitmapEx(aBmpEx);
+Point aSrcPtPixel(rSrcPtPixel);
+Size aSrcSizePixel(rSrcSizePixel);
+
+// we have beautiful scaling algorithms, let's use them
+if (aDestSizePixel != rSrcSizePixel  rSrcSizePixel.Width() != 0  
rSrcSizePixel.Height() != 0)
+{
+double fScaleX = double(aDestSizePixel.Width()) / 
rSrcSizePixel.Width();
+double fScaleY = double(aDestSizePixel.Height()) / 
rSrcSizePixel.Height();
+
+aScaledBitmapEx.Scale(fScaleX, fScaleY);
+
+aSrcSizePixel = aDestSizePixel;
+aSrcPtPixel.X() = rSrcPtPixel.X() * fScaleX;
+aSrcPtPixel.Y() = rSrcPtPixel.Y() * fScaleY;
+}
+ImplDrawAlpha(aScaledBitmapEx.GetBitmap(), aScaledBitmapEx.GetAlpha(), 
rDestPt, rDestSize, aSrcPtPixel, aSrcSizePixel);
 return;
 }
 
@@ -2063,6 +2081,9 @@ void OutputDevice::ImplDrawAlpha( const Bitmap rBmp, 
const AlphaMask rAlpha,
 if( !bNativeAlpha
   !aBmpRect.Intersection( Rectangle( rSrcPtPixel, 
rSrcSizePixel ) ).IsEmpty() )
 {
+// The scaling in this code path produces really ugly results - it
+// does the most trivial scaling with no smoothing.
+
 GDIMetaFile*pOldMetaFile = mpMetaFile;
 const bool  bOldMap = mbMap;
 mpMetaFile = NULL; // fdo#55044 reset before GetBitmap!
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2014-01-21 Thread Andras Timar
 vcl/source/filter/wmf/winmtf.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ade704ea4ac7317f2ad300c8321c64ba54d0e692
Author: Andras Timar andras.ti...@collabora.com
Date:   Sun Jan 19 19:13:57 2014 +0100

fdo#73764 partially revert 3998d1abb291

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

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 160416b..38e79a8 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -317,7 +317,7 @@ Point WinMtfOutput::ImplScale( const Point rPt) // Hack to 
set varying defaults
 {
 if (mbIsMapDevSet  mbIsMapWinSet)
 {
-return 
Point((rPt.X())*mnWinExtX/mnDevWidth-mrclFrame.Left(),(rPt.Y())*mnWinExtY/mnDevHeight-mrclFrame.Top());
+return rPt; //fdo#73764
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2013-12-29 Thread Julien Nabet
 vcl/source/gdi/gdimtf.cxx |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 6cc888babdc3e6414e55f57c0df65135f2ef4804
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Dec 29 19:06:11 2013 +0100

Resolves: fdo#72961 Crash when you open ODFver.1.0/1.1 created by 
LibO-3.5/3.6

It seems pAction may be NULL so let's keep on to check it.

Change-Id: Ie1a48c96bfa930364053c7c3ad0c940559544e33
Reviewed-on: https://gerrit.libreoffice.org/7228
Reviewed-by: Andrzej Hunt andrzej.h...@collabora.com
Tested-by: Andrzej Hunt andrzej.h...@collabora.com

diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 1d89dea..2e74172 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2765,15 +2765,17 @@ SvStream operator( SvStream rIStm, GDIMetaFile 
rGDIMetaFile )
 {
 pAction = MetaAction::ReadMetaAction( rIStm, aReadData );
 
-if (pAction-GetType() == META_COMMENT_ACTION)
-{
-MetaCommentAction* pCommentAct = 
static_castMetaCommentAction*(pAction);
-if ( pCommentAct-GetComment() == EMF_PLUS )
-rGDIMetaFile.UseCanvas( sal_True );
-}
 
 if( pAction )
+{
+if (pAction-GetType() == META_COMMENT_ACTION)
+{
+MetaCommentAction* pCommentAct = 
static_castMetaCommentAction*(pAction);
+if ( pCommentAct-GetComment() == EMF_PLUS )
+rGDIMetaFile.UseCanvas( sal_True );
+}
 rGDIMetaFile.AddAction( pAction );
+}
 }
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2013-12-05 Thread Andrzej J . R . Hunt
 vcl/source/gdi/gdimtf.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit daa2340716bcc8a2bea32e4f3e91f34da8fa7224
Author: Andrzej J.R. Hunt andrzej.h...@collabora.com
Date:   Thu Dec 5 11:36:53 2013 +

EMF+: force canvas if EMF+ comments are used.

Without this the drawinglayer renderer is used, whereas
only the canvas renderer supports EMF+.

Change-Id: Id8a10e400e08c1913e7d6864a51f7b73fc9be437
(cherry picked from commit be7d87bea2611eb316b9b379aebc031179d4f794)

diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 820f2a0..1d89dea 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2765,6 +2765,13 @@ SvStream operator( SvStream rIStm, GDIMetaFile 
rGDIMetaFile )
 {
 pAction = MetaAction::ReadMetaAction( rIStm, aReadData );
 
+if (pAction-GetType() == META_COMMENT_ACTION)
+{
+MetaCommentAction* pCommentAct = 
static_castMetaCommentAction*(pAction);
+if ( pCommentAct-GetComment() == EMF_PLUS )
+rGDIMetaFile.UseCanvas( sal_True );
+}
+
 if( pAction )
 rGDIMetaFile.AddAction( pAction );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

2013-12-02 Thread Armin Le Grand
 vcl/source/window/dockwin.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 371591344d5b3a8181de440b49bad0cf2f63fe2c
Author: Armin Le Grand a...@apache.org
Date:   Mon Dec 2 14:14:13 2013 +

Resolves: #i123765# reset buffered DropTarget when undocking

(cherry picked from commit 8d679227fafe9108c4dc6e8adff85a727e4ef3af)

Change-Id: Ia6fba705d91157afea30693fa7078aabc96f02ac
(cherry picked from commit 032a4f6b2d771dd4e1b4a1ceee7c3ef15ca356eb)

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 966b6c3..273f634 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -827,6 +827,11 @@ void DockingWindow::SetFloatingMode( sal_Bool bFloatMode )
 // BorderWindow den Parent umsetzen
 if ( mpOldBorderWin )
 mpOldBorderWin-SetParent( pWin );
+
+// #i123765# reset the buffered DropTargets when undocking, 
else it may not
+// be correctly initialized
+mpWindowImpl-mxDNDListenerContainer.clear();
+
 SetParent( pWin );
 SetPosPixel( Point() );
 mpWindowImpl-mpBorderWindow = pWin;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits