[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - filter/source include/vcl vcl/source

2015-01-12 Thread Caolán McNamara
 filter/source/msfilter/mstoolbar.cxx |2 -
 include/vcl/dibtools.hxx |3 +-
 vcl/source/gdi/dibtools.cxx  |   39 ---
 3 files changed, 35 insertions(+), 9 deletions(-)

New commits:
commit 7440dd32b7327198e49d3922379780ba5399ab1a
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jan 12 13:27:21 2015 +

Resolves: fdo#87015 image missing from doc

regression from

commit e0cce521f1ad0cc384d30ce2f1077ea229fffe62
Author: Armin Le Grand a...@apache.org
AuthorDate: Thu Jan 10 16:28:40 2013 +
Commit: Caolán McNamara caol...@redhat.com
CommitDate: Thu Jun 13 14:50:46 2013 +0100
Resolves: #i121504# Support for alpha channel in clipboard for all 
systems
(cherry picked from commit ef3931ff410117e1237b3bef7bc090e8b83b9519)

which blindly just bulldozed out the bMSOFormat branch

(cherry picked from commit 470fcca594ba4f6bf473d4d44b415c2ba151b0d9)

Conflicts:
vcl/source/gdi/dibtools.cxx

Change-Id: Iec354f1fb585f0803b9df472bc9ec9e103aa5847

diff --git a/filter/source/msfilter/mstoolbar.cxx 
b/filter/source/msfilter/mstoolbar.cxx
index c4a6c7f..f909e6b 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -713,7 +713,7 @@ bool TBCBitMap::Read( SvStream rS)
 nOffSet = rS.Tell();
 rS  cbDIB;
 // cbDIB = sizeOf(biHeader) + sizeOf(colors) + sizeOf(bitmapData) + 10
-return ReadDIB(mBitMap, rS, false);
+return ReadDIB(mBitMap, rS, false, true);
 }
 
 void TBCBitMap::Print( FILE* fp )
diff --git a/include/vcl/dibtools.hxx b/include/vcl/dibtools.hxx
index b880147..113d821 100644
--- a/include/vcl/dibtools.hxx
+++ b/include/vcl/dibtools.hxx
@@ -36,7 +36,8 @@ class Bitmap;
 bool VCL_DLLPUBLIC ReadDIB( // ReadDIB(rBitmap, rIStm, true);
 Bitmap rTarget,
 SvStream rIStm,
-bool bFileHeader);
+bool bFileHeader,
+bool bMSOFormat=false);
 
 bool VCL_DLLPUBLIC ReadDIBBitmapEx(
 BitmapEx rTarget,
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 077f0b0..87c42b9 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -166,7 +166,7 @@ namespace
 
 //
 
-bool ImplReadDIBInfoHeader(SvStream rIStm, DIBV5Header rHeader, bool 
bTopDown)
+bool ImplReadDIBInfoHeader(SvStream rIStm, DIBV5Header rHeader, bool 
bTopDown, bool bMSOFormat)
 {
 // BITMAPINFOHEADER or BITMAPCOREHEADER or BITMAPV5HEADER
 const sal_Size aStartPos(rIStm.Tell());
@@ -182,6 +182,29 @@ bool ImplReadDIBInfoHeader(SvStream rIStm, DIBV5Header 
rHeader, bool bTopDown
 rIStm  rHeader.nPlanes;
 rIStm  rHeader.nBitCount;
 }
+else if ( bMSOFormat  rHeader.nSize == DIBINFOHEADERSIZE )
+{
+sal_Int16 nTmp16(0);
+rIStm  nTmp16;
+rHeader.nWidth = nTmp16;
+rIStm  nTmp16;
+rHeader.nHeight = nTmp16;
+sal_uInt8 nTmp8(0);
+rIStm  nTmp8;
+rHeader.nPlanes = nTmp8;
+rIStm  nTmp8;
+rHeader.nBitCount = nTmp8;
+rIStm  nTmp16;
+rHeader.nSizeImage = nTmp16;
+rIStm  nTmp16;
+rHeader.nCompression = nTmp16;
+if ( !rHeader.nSizeImage ) // uncompressed?
+rHeader.nSizeImage = ((rHeader.nWidth * rHeader.nBitCount + 31)  
~31) / 8 * rHeader.nHeight;
+rIStm  rHeader.nXPelsPerMeter;
+rIStm  rHeader.nYPelsPerMeter;
+rIStm  rHeader.nColsUsed;
+rIStm  rHeader.nColsImportant;
+}
 else
 {
 // BITMAPCOREHEADER, BITMAPV5HEADER or unknown. Read as far as possible
@@ -617,14 +640,14 @@ bool ImplReadDIBBits(SvStream rIStm, DIBV5Header 
rHeader, BitmapWriteAccess r
 return( rIStm.GetError() == 0UL );
 }
 
-bool ImplReadDIBBody( SvStream rIStm, Bitmap rBmp, Bitmap* pBmpAlpha, 
sal_uLong nOffset )
+bool ImplReadDIBBody( SvStream rIStm, Bitmap rBmp, Bitmap* pBmpAlpha, 
sal_uLong nOffset, bool bMSOFormat = false )
 {
 DIBV5Header aHeader;
 const sal_uLong nStmPos = rIStm.Tell();
 bool bRet(false);
 bool bTopDown(false);
 
-if(ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown)  aHeader.nWidth  
aHeader.nHeight  aHeader.nBitCount)
+if(ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown, bMSOFormat)  
aHeader.nWidth  aHeader.nHeight  aHeader.nBitCount)
 {
 // In case ImplReadDIB() didn't call ImplReadDIBFileHeader() before
 // this method, nOffset is 0, that's OK.
@@ -1357,7 +1380,8 @@ bool ImplReadDIB(
 Bitmap rTarget, Bitmap*
 pTargetAlpha,
 SvStream rIStm,
-bool bFileHeader)
+bool bFileHeader,
+bool bMSOFormat=false)
 {
 const sal_uInt16 nOldFormat(rIStm.GetNumberFormatInt());
 const sal_uLong nOldPos(rIStm.Tell());
@@ -1375,7 +1399,7 @@ bool ImplReadDIB(
 }
 else
 {
-bRet = ImplReadDIBBody(rIStm, rTarget, 0, nOffset);
+bRet = 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - filter/source

2014-10-23 Thread Andras Timar
 filter/source/svg/svgexport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d70884569c5ed09675c3b3f50117aa54636cc479
Author: Andras Timar andras.ti...@collabora.com
Date:   Thu Oct 23 12:56:35 2014 +0200

Resolves: fdo#62682 crash on second export of svg

because the first export has left dangling CalcFieldValueHdl Links in
Outliners that got created based on the Drawing Outliner while it had a
temporary CalcFieldValueHdl installed, and didn't get the old 
CalcFieldValueHdl
installed when the old Drawing Outliner one was re-installed.

(cherry picked from commit 5bdfa8c12472eb9ff6ca054c2ada7150b1869fff)

Change-Id: I064a154ece488c9a4c3467b753451df7e73ae883

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 4265f35..e6cf93a 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -619,7 +619,7 @@ sal_Bool SVGFilter::implExport( const Sequence 
PropertyValue  rDescriptor )
 //the maOldFieldHdl for all that have ended up using
 //maNewFieldHdl
 std::vectorSdrOutliner* 
aOutliners(mpSdrModel-GetActiveOutliners());
-for (auto aIter = aOutliners.begin(); aIter != 
aOutliners.end(); ++aIter)
+for (std::vectorSdrOutliner*::iterator aIter = 
aOutliners.begin(); aIter != aOutliners.end(); ++aIter)
 {
 SdrOutliner* pOutliner = *aIter;
 if (maNewFieldHdl == 
pOutliner-GetCalcFieldValueHdl())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - filter/source include/svx svx/source

2014-10-18 Thread Caolán McNamara
 filter/source/svg/svgexport.cxx|   18 --
 filter/source/svg/svgfilter.hxx|1 +
 include/svx/svdmodel.hxx   |2 ++
 svx/source/inc/svdoutlinercache.hxx|7 +++
 svx/source/svdraw/svdmodel.cxx |   11 +++
 svx/source/svdraw/svdoutlinercache.cxx |2 ++
 6 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit 9b8cc24d5e6a6a216582c5ddbe80bcbd53d337b0
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Oct 17 15:03:34 2014 +0100

Resolves: fdo#62682 crash on second export of svg

because the first export has left dangling CalcFieldValueHdl Links in
Outliners that got created based on the Drawing Outliner while it had a
temporary CalcFieldValueHdl installed, and didn't get the old 
CalcFieldValueHdl
installed when the old Drawing Outliner one was re-installed.

Change-Id: I064a154ece488c9a4c3467b753451df7e73ae883

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index a9cfc01..4265f35 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -598,7 +598,8 @@ sal_Bool SVGFilter::implExport( const Sequence 
PropertyValue  rDescriptor )
 SdrOutliner rOutl = 
mpSdrModel-GetDrawOutliner(NULL);
 
 maOldFieldHdl = 
rOutl.GetCalcFieldValueHdl();
-rOutl.SetCalcFieldValueHdl( LINK( this, 
SVGFilter, CalcFieldHdl) );
+maNewFieldHdl = LINK(this, SVGFilter, 
CalcFieldHdl);
+rOutl.SetCalcFieldValueHdl(maNewFieldHdl);
 }
 }
 bRet = implExportDocument();
@@ -611,7 +612,20 @@ sal_Bool SVGFilter::implExport( const Sequence 
PropertyValue  rDescriptor )
 }
 
 if( mpSdrModel )
-mpSdrModel-GetDrawOutliner( NULL 
).SetCalcFieldValueHdl( maOldFieldHdl );
+{
+//fdo#62682 The maNewFieldHdl can end up getting copied
+//into various other outliners which live past this
+//method, so get the full list of outliners and restore
+//the maOldFieldHdl for all that have ended up using
+//maNewFieldHdl
+std::vectorSdrOutliner* 
aOutliners(mpSdrModel-GetActiveOutliners());
+for (auto aIter = aOutliners.begin(); aIter != 
aOutliners.end(); ++aIter)
+{
+SdrOutliner* pOutliner = *aIter;
+if (maNewFieldHdl == 
pOutliner-GetCalcFieldValueHdl())
+pOutliner-SetCalcFieldValueHdl(maOldFieldHdl);
+}
+}
 
 delete mpSVGWriter, mpSVGWriter = NULL;
 mpSVGExport = NULL; // pointed object is released by 
xSVGExport dtor at the end of this scope
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 85fab2b..09c41d2 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -263,6 +263,7 @@ private:
 XDrawPageSequence   mMasterPageTargets;
 
 LinkmaOldFieldHdl;
+LinkmaNewFieldHdl;
 
 sal_BoolimplImport( const Sequence 
PropertyValue  rDescriptor ) throw (RuntimeException);
 
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 81df0c4..fa7f18a 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -233,6 +233,8 @@ public:
 sal_uIntPtr nSwapGraphicsMode;
 
 SdrOutlinerCache* mpOutlinerCache;
+//get a vector of all the SdrOutliner belonging to the model
+std::vectorSdrOutliner* GetActiveOutliners() const;
 SdrModelImpl*   mpImpl;
 sal_uInt16  mnCharCompressType;
 sal_uInt16  mnHandoutPageCount;
diff --git a/svx/source/inc/svdoutlinercache.hxx 
b/svx/source/inc/svdoutlinercache.hxx
index 6dbf728..03572fc 100644
--- a/svx/source/inc/svdoutlinercache.hxx
+++ b/svx/source/inc/svdoutlinercache.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SVX_SOURCE_INC_SVDOUTLINERCACHE_HXX
 
 #include sal/types.h
+#include vector
 
 class SdrModel;
 class SdrOutliner;
@@ -33,12 +34,18 @@ private:
 
 SdrOutliner*mpModeOutline;
 SdrOutliner*mpModeText;
+
+std::vectorSdrOutliner* maActiveOutliners;
 public:
 SdrOutlinerCache( SdrModel* pModel );
 ~SdrOutlinerCache();
 
 SdrOutliner* createOutliner( sal_uInt16 nOutlinerMode );
 void disposeOutliner( SdrOutliner* pOutliner );
+std::vectorSdrOutliner* GetActiveOutliners() const
+{
+return maActiveOutliners;
+}
 };
 
 #endif
diff --git 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - filter/source

2014-06-12 Thread Jan Holesovsky
 filter/source/graphicfilter/ipict/ipict.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ec2b9de03d25ed8a3e2cbf4fbbc21c5ff81f0b27
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue Jun 10 17:13:38 2014 +0200

pct import: Reset clip region before closing the metafile.

Otherwise parts of the image are missing.

Change-Id: If9018c32807359862a9be825b0ebdaacce2d3490

diff --git a/filter/source/graphicfilter/ipict/ipict.cxx 
b/filter/source/graphicfilter/ipict/ipict.cxx
index f1903e9..a78f9bc 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -1852,6 +1852,7 @@ void PictReader::ReadPict( SvStream  rStreamPict, 
GDIMetaFile  rGDIMetaFile )
 pPict-Seek(nPos);
 }
 
+pVirDev-SetClipRegion();
 rGDIMetaFile.Stop();
 delete pVirDev;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits