[Libreoffice-commits] core.git: 2 commits - drawinglayer/source sc/source sw/source

2023-11-19 Thread Noel Grandin (via logerrit)
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |   24 +-
 drawinglayer/source/tools/primitive2dxmldump.cxx   |  110 ++---
 sc/source/ui/view/output.cxx   |2 
 sc/source/ui/view/output2.cxx  |   62 +++
 sc/source/ui/view/viewfunc.cxx |2 
 sw/source/core/layout/atrfrm.cxx   |6 
 sw/source/filter/basflt/fltshell.cxx   |2 
 7 files changed, 104 insertions(+), 104 deletions(-)

New commits:
commit a5f5eb28d0dcb66d5d947db7087f501ec73e00d7
Author: Noel Grandin 
AuthorDate: Sun Nov 19 18:49:25 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 20 07:25:52 2023 +0100

use the cheaper variant of SfxItemPool::areSame where possible

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

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 47fdab381c9f..9d0fe1430550 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -766,7 +766,7 @@ static bool lcl_EqualBack( const RowInfo& rFirst, const 
RowInfo& rOther,
 const ScPatternAttr* pPat1 = rFirst.cellInfo(nX).pPatternAttr;
 const ScPatternAttr* pPat2 = rOther.cellInfo(nX).pPatternAttr;
 if ( !pPat1 || !pPat2 ||
-!SfxPoolItem::areSame(>GetItem(ATTR_PROTECTION), 
>GetItem(ATTR_PROTECTION) ) )
+!SfxPoolItem::areSame(pPat1->GetItem(ATTR_PROTECTION), 
pPat2->GetItem(ATTR_PROTECTION) ) )
 return false;
 }
 }
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 2d6cda3d652a..473671ea1cf3 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1029,67 +1029,67 @@ static bool StringDiffer( const ScPatternAttr*& 
rpOldPattern, const ScPatternAtt
 return false;
 else if ( !rpOldPattern )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( ATTR_FONT ), 
>GetItem( ATTR_FONT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( ATTR_FONT ), 
rpOldPattern->GetItem( ATTR_FONT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( ATTR_CJK_FONT ), 
>GetItem( ATTR_CJK_FONT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( ATTR_CJK_FONT ), 
rpOldPattern->GetItem( ATTR_CJK_FONT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( ATTR_CTL_FONT ), 
>GetItem( ATTR_CTL_FONT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( ATTR_CTL_FONT ), 
rpOldPattern->GetItem( ATTR_CTL_FONT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( ATTR_FONT_HEIGHT 
), >GetItem( ATTR_FONT_HEIGHT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( ATTR_FONT_HEIGHT ), 
rpOldPattern->GetItem( ATTR_FONT_HEIGHT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( 
ATTR_CJK_FONT_HEIGHT ), >GetItem( ATTR_CJK_FONT_HEIGHT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( 
ATTR_CJK_FONT_HEIGHT ), rpOldPattern->GetItem( ATTR_CJK_FONT_HEIGHT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( 
ATTR_CTL_FONT_HEIGHT ), >GetItem( ATTR_CTL_FONT_HEIGHT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( 
ATTR_CTL_FONT_HEIGHT ), rpOldPattern->GetItem( ATTR_CTL_FONT_HEIGHT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( ATTR_FONT_WEIGHT 
), >GetItem( ATTR_FONT_WEIGHT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( ATTR_FONT_WEIGHT ), 
rpOldPattern->GetItem( ATTR_FONT_WEIGHT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( 
ATTR_CJK_FONT_WEIGHT ), >GetItem( ATTR_CJK_FONT_WEIGHT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( 
ATTR_CJK_FONT_WEIGHT ), rpOldPattern->GetItem( ATTR_CJK_FONT_WEIGHT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( 
ATTR_CTL_FONT_WEIGHT ), >GetItem( ATTR_CTL_FONT_WEIGHT ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( 
ATTR_CTL_FONT_WEIGHT ), rpOldPattern->GetItem( ATTR_CTL_FONT_WEIGHT ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( ATTR_FONT_POSTURE 
), >GetItem( ATTR_FONT_POSTURE ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( ATTR_FONT_POSTURE 
), rpOldPattern->GetItem( ATTR_FONT_POSTURE ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( 
ATTR_CJK_FONT_POSTURE ), >GetItem( ATTR_CJK_FONT_POSTURE ) ) )
+else if ( !SfxPoolItem::areSame( pNewPattern->GetItem( 
ATTR_CJK_FONT_POSTURE ), rpOldPattern->GetItem( ATTR_CJK_FONT_POSTURE ) ) )
 return true;
-else if ( !SfxPoolItem::areSame( >GetItem( 
ATTR_CTL_FONT_POSTURE ), >GetItem( 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source editeng/source include/drawinglayer

2023-07-22 Thread Khaled Hosny (via logerrit)
 drawinglayer/source/primitive2d/textlayoutdevice.cxx  |   23 --
 editeng/source/accessibility/AccessibleStringWrap.cxx |7 ++---
 include/drawinglayer/primitive2d/textlayoutdevice.hxx |3 --
 3 files changed, 3 insertions(+), 30 deletions(-)

New commits:
commit 60c8a8062cc4632b400e5498310d4ade84b8fe34
Author: Khaled Hosny 
AuthorDate: Wed Jul 19 13:36:19 2023 +0300
Commit: خالد حسني 
CommitDate: Sun Jul 23 06:04:47 2023 +0200

drawinglayer: Drop recently unused TextLayouterDevice::getCaretPositions()

Change-Id: I07255d45bc03a5f86a22d7f392c14053eec7f6ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154648
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx 
b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 2b0356518285..1c551ce01363 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -317,29 +317,6 @@ std::vector TextLayouterDevice::getTextArray(const 
OUString& rText, sal_
 return aRetval;
 }
 
-std::vector TextLayouterDevice::getCaretPositions(const OUString& 
rText, sal_uInt32 nIndex,
-  sal_uInt32 nLength) 
const
-{
-std::vector aRetval;
-sal_uInt32 nTextLength(nLength);
-const sal_uInt32 nStringLength(rText.getLength());
-
-if (nTextLength + nIndex > nStringLength)
-{
-nTextLength = nStringLength - nIndex;
-}
-
-if (nTextLength)
-{
-aRetval.reserve(2 * nTextLength);
-std::vector aArray(2 * nTextLength);
-mrDevice.GetCaretPositions(rText, aArray.data(), nIndex, nTextLength);
-aRetval.assign(aArray.begin(), aArray.end());
-}
-
-return aRetval;
-}
-
 // helper methods for vcl font handling
 
 vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& 
rFontAttribute,
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx 
b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
index dfb5ba6c5c37..6f98b50a4f06 100644
--- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -98,9 +98,6 @@ public:
 
 ::std::vector getTextArray(const OUString& rText, sal_uInt32 
nIndex, sal_uInt32 nLength,
bool bCaret = false) const;
-
-::std::vector getCaretPositions(const OUString& rText, sal_uInt32 
nIndex,
-sal_uInt32 nLength) const;
 };
 
 // helper methods for vcl font handling
commit d9ae579c8a2f5d305fd6419069ed00cf4d8bb015
Author: Khaled Hosny 
AuthorDate: Wed Jul 19 10:15:26 2023 +0300
Commit: خالد حسني 
CommitDate: Sun Jul 23 06:04:39 2023 +0200

editeng: Use GetTextArray() instead of GetCaretPositions()

One way of getting text widths should be enough.

Change-Id: I21e24c3f69a116e5210685d76268936219aae279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154639
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/editeng/source/accessibility/AccessibleStringWrap.cxx 
b/editeng/source/accessibility/AccessibleStringWrap.cxx
index 519a1feb7b83..5461aad9f4c8 100644
--- a/editeng/source/accessibility/AccessibleStringWrap.cxx
+++ b/editeng/source/accessibility/AccessibleStringWrap.cxx
@@ -57,12 +57,11 @@ void AccessibleStringWrap::GetCharacterBounds( sal_Int32 
nIndex, tools::Rectangl
 }
 else
 {
-sal_Int32 aXArray[2];
-mrDev.GetCaretPositions( maText, aXArray, nIndex, 1 );
+KernArray aDXArray;
+mrDev.GetTextArray(maText, , nIndex, 1);
 rRect.SetLeft( 0 );
 rRect.SetTop( 0 );
-rRect.SetSize( Size(mrDev.GetTextHeight(), std::abs(aXArray[0] - 
aXArray[1])) );
-rRect.Move( std::min(aXArray[0], aXArray[1]), 0 );
+rRect.SetSize(Size(mrDev.GetTextHeight(), aDXArray[0]));
 }
 
 if( mrFont.IsVertical() )


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/tools tools/source

2023-07-22 Thread Noel Grandin (via logerrit)
 drawinglayer/source/tools/primitive2dxmldump.cxx |   10 ++
 include/tools/XmlWriter.hxx  |   14 +
 tools/source/xml/XmlWriter.cxx   |   33 ---
 3 files changed, 35 insertions(+), 22 deletions(-)

New commits:
commit 81f4f1ea1d13dcdf8ea693a48ce2d753729d87aa
Author: Noel Grandin 
AuthorDate: Sat Jul 22 16:23:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 22 23:01:02 2023 +0200

simplify some calls to XmlWriter::attribute

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

diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx 
b/drawinglayer/source/tools/primitive2dxmldump.cxx
index 38e6a3ea9773..0585ce7168f8 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -616,8 +616,7 @@ public:
 default:
 {
 rWriter.startElement("unhandled");
-rWriter.attribute("id",
-  OUStringToOString(sCurrentElementTag, 
RTL_TEXTENCODING_UTF8));
+rWriter.attribute("id", sCurrentElementTag);
 rWriter.attribute("idNumber", nId);
 
 drawinglayer::geometry::ViewInformation3D 
aViewInformation3D;
@@ -1217,8 +1216,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
 }
 }
 rWriter.startElement(aName);
-rWriter.attribute("id",
-  OUStringToOString(sCurrentElementTag, 
RTL_TEXTENCODING_UTF8));
+rWriter.attribute("id", sCurrentElementTag);
 rWriter.attribute("idNumber", nId);
 
 auto pBufferedDecomposition
commit 2006d7455f529d3d6f44d09a83be9a80e73b1d34
Author: Noel Grandin 
AuthorDate: Sat Jul 22 16:20:16 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 22 23:00:53 2023 +0200

no need to create OString temporaries when calling XmlWriter methods

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

diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx 
b/drawinglayer/source/tools/primitive2dxmldump.cxx
index a68692649f46..38e6a3ea9773 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -925,7 +925,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
 for (size_t iDx = 0; iDx < aDx.size(); ++iDx)
 {
 OString sName = "dx" + OString::number(iDx);
-rWriter.attribute(sName, OUString::number(aDx[iDx]));
+rWriter.attribute(sName, OString::number(aDx[iDx]));
 }
 }
 rWriter.endElement();
@@ -1207,7 +1207,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
 
 default:
 {
-OString aName("unhandled");
+const char* aName = "unhandled";
 switch (nId)
 {
 case PRIMITIVE2D_ID_RANGE_SVX | 14: // 
PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D
diff --git a/include/tools/XmlWriter.hxx b/include/tools/XmlWriter.hxx
index e8f6579b0e95..400748611bd5 100644
--- a/include/tools/XmlWriter.hxx
+++ b/include/tools/XmlWriter.hxx
@@ -44,21 +44,23 @@ public:
 bool startDocument(sal_Int32 nIndent = 2, bool bWriteXmlHeader = true);
 void endDocument();
 
+void startElement(const char* sName);
 void startElement(const OString& sName);
 void startElement(const OString& sPrefix, const OString& sName, const 
OString& sNamespaceUri);
 void endElement();
 
+void attribute(const char* sTagName, const OString& aValue);
 void attribute(const OString& sTagName, const OString& aValue);
-void attribute(const OString& sTagName, std::u16string_view aValue);
-void attribute(const OString& sTagName, sal_Int32 aNumber);
-void attributeDouble(const OString& sTagName, double aNumber);
-void attributeBase64(const OString& sTagName, std::vector 
const& rValueInBytes);
-void attributeBase64(const OString& sTagName, std::vector const& 
rValueInBytes);
+void attribute(const char* sTagName, std::u16string_view aValue);
+void attribute(const char* sTagName, sal_Int32 aNumber);
+void attributeDouble(const char* sTagName, double aNumber);
+void attributeBase64(const char* sTagName, std::vector const& 
rValueInBytes);
+void attributeBase64(const char* sTagName, std::vector const& 
rValueInBytes);
 
 void content(const OString& sValue);
 void content(std::u16string_view sValue);
 
-void element(const OString& sName);
+void element(const char* sName);
 };
 
 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/drawinglayer

2023-07-21 Thread Sarper Akdemir (via logerrit)
 drawinglayer/source/processor2d/hittestprocessor2d.cxx  |   40 
 include/drawinglayer/processor2d/hittestprocessor2d.hxx |   10 ++--
 2 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit 3dc2f4f0d2a8a7c51d01d29fd55ca9e4e6926596
Author: Sarper Akdemir 
AuthorDate: Fri Jul 21 15:29:17 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Jul 21 18:26:10 2023 +0200

related tdf#152992: fix minor logic error in hittestprocessor2d

Fix logic errors I've missed previously on
(2c8c436c4a8546276e285dd18f3f7ded091a2c4e) where initialization of
aDiscreteHalfLineVector wasn't adapted to new HitTolerancePerAxis in
PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D & 
PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D.

Change-Id: I5d9f0347e489301d7e4f06f98f4a9c9d1385d6d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154717
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 77b396f60f5d..b760b24f845a 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -291,7 +291,7 @@ namespace drawinglayer::processor2d
 {
 // for all other B2DLINEJOIN_* do a hairline 
HitTest with expanded tolerance
 const basegfx::B2DVector 
aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
-* 
basegfx::B2DVector(rLineAttribute.getWidth() * 0.5, 0.0));
+* 
basegfx::B2DVector(rLineAttribute.getWidth() * 0.5, rLineAttribute.getWidth() * 
0.5));
 mbHit = checkHairlineHitWithTolerance(
 rPolygonCandidate.getB2DPolygon(),
 getDiscreteHitTolerance() + 
aDiscreteHalfLineVector);
@@ -328,7 +328,7 @@ namespace drawinglayer::processor2d
 }
 
 const basegfx::B2DVector 
aDiscreteHalfLineVector(getViewInformation2D().getObjectToViewTransformation()
-* basegfx::B2DVector(fLogicHitTolerance, 0.0));
+* basegfx::B2DVector(fLogicHitTolerance, 
fLogicHitTolerance));
 
 mbHit = checkHairlineHitWithTolerance(
 rPolygonCandidate.getB2DPolygon(),
commit 2acfc1448facebd254bda18b2bf286a29be636a7
Author: Sarper Akdemir 
AuthorDate: Fri Jul 21 13:47:21 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Fri Jul 21 18:25:59 2023 +0200

related tdf#152992: rename HitTolerance to HitTolerancePerAxis

Rename ...HitTolerance instances to ...HitTolerancePerAxis as
suggested by Noel on:

https://gerrit.libreoffice.org/c/core/+/154694/2/include/drawinglayer/processor2d/hittestprocessor2d.hxx#45

Change-Id: I9c5b69218a4809f795c9a6324d76b2e2c1b12343
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154716
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 6e624fa4ef97..77b396f60f5d 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -41,25 +41,25 @@ namespace drawinglayer::processor2d
 {
 HitTestProcessor2D::HitTestProcessor2D(const 
geometry::ViewInformation2D& rViewInformation,
 const basegfx::B2DPoint& rLogicHitPosition,
-const basegfx::B2DVector& rLogicHitTolerance,
+const basegfx::B2DVector& rLogicHitTolerancePerAxis,
 bool bHitTextOnly)
 :   BaseProcessor2D(rViewInformation),
-maDiscreteHitTolerance(rLogicHitTolerance),
+maDiscreteHitTolerancePerAxis(rLogicHitTolerancePerAxis),
 mbCollectHitStack(false),
 mbHit(false),
 mbHitTextOnly(bHitTextOnly)
 {
 // ensure input parameters for hit tolerance is >= 0.0
-if (maDiscreteHitTolerance.getX() < 0.0)
-maDiscreteHitTolerance.setX(0.0);
-if (maDiscreteHitTolerance.getY() < 0.0)
-maDiscreteHitTolerance.setY(0.0);
+if (maDiscreteHitTolerancePerAxis.getX() < 0.0)
+maDiscreteHitTolerancePerAxis.setX(0.0);
+if (maDiscreteHitTolerancePerAxis.getY() < 0.0)
+maDiscreteHitTolerancePerAxis.setY(0.0);
 
-if (!maDiscreteHitTolerance.equalZero())
+if (!maDiscreteHitTolerancePerAxis.equalZero())
 {
 // generate discrete hit tolerance
-maDiscreteHitTolerance
-= getViewInformation2D().getObjectToViewTransformation() 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/drawinglayer include/svx svx/source sw/inc sw/source vcl/inc vcl/qa vcl/source

2023-07-14 Thread Mike Kaganski (via logerrit)
 drawinglayer/source/primitive2d/structuretagprimitive2d.cxx  |4 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |   27 +--
 include/drawinglayer/primitive2d/structuretagprimitive2d.hxx |6 
 include/svx/svdobj.hxx   |2 
 svx/source/sdr/contact/viewobjectcontact.cxx |6 
 svx/source/svdraw/svdobj.cxx |4 
 sw/inc/EnhancedPDFExportHelper.hxx   |6 
 sw/inc/dcontact.hxx  |2 
 sw/source/core/text/EnhancedPDFExportHelper.cxx  |   86 +--
 sw/source/uibase/docvw/AnnotationWin.cxx |   81 +++---
 sw/source/uibase/docvw/AnnotationWin2.cxx|   13 -
 vcl/inc/pdf/pdfwriter_impl.hxx   |2 
 vcl/qa/cppunit/pdfexport/data/tdf154982.odt  |binary
 vcl/qa/cppunit/pdfexport/pdfexport.cxx   |   83 ++
 vcl/source/gdi/pdfwriter_impl.cxx|5 
 15 files changed, 190 insertions(+), 137 deletions(-)

New commits:
commit a22f1aa4ff46328327d209e524300d8bfe464511
Author: Mike Kaganski 
AuthorDate: Fri Jul 14 11:16:26 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jul 14 14:57:01 2023 +0200

Simplify the logic a bit

At least for me, it's easier to understand it this way.

Change-Id: Ib66d4163c85263971e93390161c37614c0e5d87b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154436
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 4654e376e464..c8f442dafc26 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -235,8 +235,9 @@ void SwAnnotationWin::ToggleResolved()
 
 void SwAnnotationWin::ToggleResolvedForThread()
 {
-GetTopReplyNote()->ToggleResolved();
-mrMgr.UpdateResolvedStatus(GetTopReplyNote());
+auto pTop = GetTopReplyNote();
+pTop->ToggleResolved();
+mrMgr.UpdateResolvedStatus(pTop);
 mrMgr.LayoutPostIts();
 }
 
@@ -263,17 +264,15 @@ sal_uInt32 SwAnnotationWin::CreateUniqueParaId()
 void SwAnnotationWin::DeleteThread()
 {
 // Go to the top and delete each comment one by one
-SwAnnotationWin *current, *topNote;
-current = topNote = GetTopReplyNote();
-SwAnnotationWin* next = mrMgr.GetNextPostIt(KEY_PAGEDOWN, current);
-
-while(next && next->GetTopReplyNote() == topNote)
+SwAnnotationWin* topNote = GetTopReplyNote();
+for (SwAnnotationWin* current = topNote;;)
 {
+SwAnnotationWin* next = mrMgr.GetNextPostIt(KEY_PAGEDOWN, current);
 current->mnDeleteEventId = Application::PostUserEvent( LINK( current, 
SwAnnotationWin, DeleteHdl), nullptr, true );
+if (!next || next->GetTopReplyNote() != topNote)
+return;
 current = next;
-next = mrMgr.GetNextPostIt(KEY_PAGEDOWN, current);
 }
-current->mnDeleteEventId = Application::PostUserEvent( LINK( current, 
SwAnnotationWin, DeleteHdl), nullptr, true );
 }
 
 bool SwAnnotationWin::IsResolved() const
@@ -285,21 +284,15 @@ bool SwAnnotationWin::IsThreadResolved()
 {
 /// First Get the top note
 // then iterate downwards checking resolved status
-SwAnnotationWin *pTopNote, *TopNote;
-pTopNote = TopNote = GetTopReplyNote();
-if (!pTopNote->IsResolved())
-return false;
-
-SwAnnotationWin* pSidebarWin = mrMgr.GetNextPostIt(KEY_PAGEDOWN, pTopNote);
-
-while (pSidebarWin && pSidebarWin->GetTopReplyNote() == TopNote)
+SwAnnotationWin* topNote = GetTopReplyNote();
+for (SwAnnotationWin* current = topNote;;)
 {
-pTopNote = pSidebarWin;
-if (!pTopNote->IsResolved())
+if (!current->IsResolved())
 return false;
-pSidebarWin = mrMgr.GetNextPostIt(KEY_PAGEDOWN, pSidebarWin);
+current = mrMgr.GetNextPostIt(KEY_PAGEDOWN, current);
+if (!current || current->GetTopReplyNote() != topNote)
+return true;
 }
-return true;
 }
 
 void SwAnnotationWin::UpdateData()
@@ -377,45 +370,33 @@ sal_uInt32 SwAnnotationWin::MoveCaret()
 sal_uInt32 SwAnnotationWin::CalcParent()
 {
 SwTextField* pTextField = mpFormatField->GetTextField();
-SwPosition aPosition( pTextField->GetTextNode(), pTextField->GetStart() );
-SwTextAttr * const pTextAttr =
-pTextField->GetTextNode().GetTextAttrForCharAt(
-aPosition.GetContentIndex() - 1,
-RES_TXTATR_ANNOTATION );
-const SwField* pField = pTextAttr ? pTextAttr->GetFormatField().GetField() 
: nullptr;
-sal_uInt32 nParentId = 0;
-if (pField && pField->Which() == SwFieldIds::Postit)
-{
-const SwPostItField* pPostItField = static_cast(pField);
-nParentId = pPostItField->GetPostItId();
-}
-return nParentId;
+if (SwPosition 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source wizards/source

2023-05-18 Thread Andrea Gelmini (via logerrit)
 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |2 +-
 wizards/source/sfdialogs/SF_Dialog.xba|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4967fc20eb3120016d9017c1af6d8cf78fd6699f
Author: Andrea Gelmini 
AuthorDate: Thu May 18 12:17:16 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu May 18 12:37:39 2023 +0200

Fix typo

Change-Id: I372395970887c4201e973aa0583c288714fdbf6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151947
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/wizards/source/sfdialogs/SF_Dialog.xba 
b/wizards/source/sfdialogs/SF_Dialog.xba
index e297bf296026..299e073b7a06 100644
--- a/wizards/source/sfdialogs/SF_Dialog.xba
+++ b/wizards/source/sfdialogs/SF_Dialog.xba
@@ -2357,7 +2357,7 @@ Try:
.Width = vPlace.Width
.Height = vPlace.Height
Else
-   Leave eveything to zero
+   Leave everything to zero
End If
End With
 
commit 6b43043dc0c7dbce786b6afc5813a189ecc59827
Author: Andrea Gelmini 
AuthorDate: Thu May 18 12:17:00 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu May 18 12:37:25 2023 +0200

Fix typo

Change-Id: I7a79c2a4d145d1d847d71e5b36ccdb42278b06cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151946
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx 
b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 37dae31a4e26..c76225194dd7 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -535,7 +535,7 @@ void impBufferDevice::paint(double fTrans)
 // use Former for now.
 //
 // To easily allow to change this (maybe system-dependent) I add a 
static switch here,
-// also for evetually experimenting (hint: can be changed in the 
debugger).
+// also for eventually experimenting (hint: can be changed in the 
debugger).
 static bool bUseNew(false);
 
 if (bUseNew)


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source

2023-05-08 Thread Stephan Bergmann (via logerrit)
 drawinglayer/source/texture/texture.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 93915c0be321c79821bbeca0b0af95ba452c5011
Author: Stephan Bergmann 
AuthorDate: Mon May 8 10:06:33 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 8 15:17:06 2023 +0200

Avoid more division by zero

Similar to  "Avoid division 
by
zero", CppunitTest_sw_ooxmlexport7 CPPUNIT_TEST_NAME=testFdo78957::TestBody
started to fail with

> drawinglayer/source/texture/texture.cxx:470:71: runtime error: division 
by zero
>  #0 in 
drawinglayer::texture::GeoTexSvxGradientRadial::appendTransformationsAndColors(std::function) at 
drawinglayer/source/texture/texture.cxx:470:71
>  #1 in 
drawinglayer::primitive2d::FillGradientPrimitive2D::generateMatricesAndColors(std::function) const at 
drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:99:31
>  #2 in 
drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D(drawinglayer::primitive2d::FillGradientPrimitive2D
 const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:1017:24
>  #3 in 
drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D
 const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:363:13
>  #4 in 
drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #5 in 
drawinglayer::processor2d::VclProcessor2D::RenderMaskPrimitive2DPixel(drawinglayer::primitive2d::MaskPrimitive2D
 const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:866:9
>  #6 in 
drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D
 const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:257:13
>  #7 in 
drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #8 in 
drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #9 in 
drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&,
 drawinglayer::geometry::ViewInformation2D const&) const at 
drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14
>  #10 in 
drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #11 in 
drawinglayer::processor2d::VclPixelProcessor2D::processPolyPolygonGradientPrimitive2D(drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D
 const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:490:9
>  #12 in 
drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D
 const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:232:13
>  #13 in 
drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #14 in 
drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #15 in 
drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&,
 drawinglayer::geometry::ViewInformation2D const&) const at 
drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14
>  #16 in 
drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #17 in 
drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D
 const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13
>  #18 in 
drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21
>  #19 in 
drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer
 const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13
>  #20 in 
drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&,
 drawinglayer::geometry::ViewInformation2D const&) const at 
drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14
>  #21 in 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/vcl vcl/headless

2022-12-23 Thread Caolán McNamara (via logerrit)
 drawinglayer/source/processor2d/cairopixelprocessor2d.cxx |  148 +-
 include/vcl/BitmapTools.hxx   |4 
 vcl/headless/CairoCommon.cxx  |6 
 3 files changed, 145 insertions(+), 13 deletions(-)

New commits:
commit 7c3a255e42f17c312af26684c2aed567c1c5a5a3
Author: Caolán McNamara 
AuthorDate: Thu Dec 22 14:41:37 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 23 10:20:45 2022 +

SDPR: Add rendering of BitmapPrimitive2D for Cairo

pretty nasty copy of bitmap data for split alpha and so on, head
scratching for a while to figure out to scale the pattern matrix, but it
seems to render ok

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

diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
index 278b55f86723..9235bc095c81 100644
--- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -160,6 +161,65 @@ void addB2DPolygonToPathGeometry(cairo_t* cr, const 
basegfx::B2DPolygon& rPolygo
 cairo_close_path(cr);
 }
 }
+
+// split alpha remains as a constant irritant
+std::vector createBitmapData(const BitmapEx& rBitmapEx)
+{
+const Size& rSizePixel(rBitmapEx.GetSizePixel());
+const bool bAlpha(rBitmapEx.IsAlpha());
+const sal_uInt32 nStride
+= cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, 
rSizePixel.Width());
+std::vector aData(nStride * rSizePixel.Height());
+
+if (bAlpha)
+{
+Bitmap aSrcAlpha(rBitmapEx.GetAlpha().GetBitmap());
+Bitmap::ScopedReadAccess 
pReadAccess(const_cast(rBitmapEx.GetBitmap()));
+Bitmap::ScopedReadAccess pAlphaReadAccess(bAlpha ? 
aSrcAlpha.AcquireReadAccess() : nullptr,
+  aSrcAlpha);
+const tools::Long nHeight(pReadAccess->Height());
+const tools::Long nWidth(pReadAccess->Width());
+
+for (tools::Long y = 0; y < nHeight; ++y)
+{
+unsigned char* pPixelData = aData.data() + (nStride * y);
+for (tools::Long x = 0; x < nWidth; ++x)
+{
+const BitmapColor aColor(pReadAccess->GetColor(y, x));
+const BitmapColor aAlpha(pAlphaReadAccess->GetColor(y, x));
+const sal_uInt16 nAlpha(255 - aAlpha.GetRed());
+
+pPixelData[SVP_CAIRO_RED] = vcl::bitmap::premultiply(nAlpha, 
aColor.GetRed());
+pPixelData[SVP_CAIRO_GREEN] = vcl::bitmap::premultiply(nAlpha, 
aColor.GetGreen());
+pPixelData[SVP_CAIRO_BLUE] = vcl::bitmap::premultiply(nAlpha, 
aColor.GetBlue());
+pPixelData[SVP_CAIRO_ALPHA] = nAlpha;
+pPixelData += 4;
+}
+}
+}
+else
+{
+Bitmap::ScopedReadAccess 
pReadAccess(const_cast(rBitmapEx.GetBitmap()));
+const tools::Long nHeight(pReadAccess->Height());
+const tools::Long nWidth(pReadAccess->Width());
+
+for (tools::Long y = 0; y < nHeight; ++y)
+{
+unsigned char* pPixelData = aData.data() + (nStride * y);
+for (tools::Long x = 0; x < nWidth; ++x)
+{
+const BitmapColor aColor(pReadAccess->GetColor(y, x));
+pPixelData[SVP_CAIRO_RED] = aColor.GetRed();
+pPixelData[SVP_CAIRO_GREEN] = aColor.GetGreen();
+pPixelData[SVP_CAIRO_BLUE] = aColor.GetBlue();
+pPixelData[SVP_CAIRO_ALPHA] = 255;
+pPixelData += 4;
+}
+}
+}
+
+return aData;
+}
 }
 
 namespace drawinglayer::processor2d
@@ -267,15 +327,91 @@ void 
CairoPixelProcessor2D::processPolyPolygonColorPrimitive2D(
 cairo_restore(mpRT);
 }
 
-#if 0
-
 void CairoPixelProcessor2D::processBitmapPrimitive2D(
 const primitive2d::BitmapPrimitive2D& rBitmapCandidate)
 {
-// TODO: All the smarts to get/make a cairo_surface_t from a BitmapEx is 
internal to vcl at the moment
-}
+// check if graphic content is inside discrete local ViewPort
+const basegfx::B2DRange& 
rDiscreteViewPort(getViewInformation2D().getDiscreteViewport());
+const basegfx::B2DHomMatrix aLocalTransform(
+getViewInformation2D().getObjectToViewTransformation() * 
rBitmapCandidate.getTransform());
 
-#endif
+if (!rDiscreteViewPort.isEmpty())
+{
+basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
+
+aUnitRange.transform(aLocalTransform);
+
+if (!aUnitRange.overlaps(rDiscreteViewPort))
+{
+// content is outside discrete local ViewPort
+return;
+}
+}
+
+BitmapEx 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source

2022-12-22 Thread Stephan Bergmann (via logerrit)
 drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 00b2c42a838a95861cbba50bfeedc7afb10ff31c
Author: Stephan Bergmann 
AuthorDate: Thu Dec 22 09:41:03 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 22 10:44:25 2022 +

-Werror,-Wshadow (clang-cl)

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

diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
index 05640481113a..bc9b81daddec 100644
--- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
@@ -1302,7 +1302,7 @@ void D2DPixelProcessor2D::processMaskPrimitive2DPixel(
 if (SUCCEEDED(hr))
 {
 ID2D1Layer* pLayer = nullptr;
-HRESULT hr = getRenderTarget().CreateLayer(nullptr, );
+hr = getRenderTarget().CreateLayer(nullptr, );
 
 if (SUCCEEDED(hr))
 {
commit 2c6e919854e5a3f9873669d96ac735d1ec670c0d
Author: Stephan Bergmann 
AuthorDate: Thu Dec 22 09:45:36 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 22 10:44:16 2022 +

loplugin:redundantfcast (clang-cl)

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

diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
index 13224cd972b6..05640481113a 100644
--- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
@@ -1629,8 +1629,7 @@ void D2DPixelProcessor2D::processPolygonStrokePrimitive2D(
 for (auto& value : rStrokeAttribute.getDotDashArray())
 {
 dashes.push_back(
-basegfx::B2DVector(rObjectToView * 
basegfx::B2DVector(value, 0.0))
-.getLength()
+(rObjectToView * basegfx::B2DVector(value, 
0.0)).getLength()
 / fDiscreteLineWidth);
 }
 }


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source

2022-12-22 Thread Armin Le Grand (allotropia) (via logerrit)
 drawinglayer/source/primitive2d/Tools.cxx   |6 ++
 drawinglayer/source/primitive2d/glowprimitive2d.cxx |9 +
 drawinglayer/source/primitive2d/softedgeprimitive2d.cxx |9 +
 3 files changed, 24 insertions(+)

New commits:
commit 7207e46264b464711874fb6da0f9249cb4cf334c
Author: Armin Le Grand (allotropia) 
AuthorDate: Wed Dec 21 16:04:04 2022 +0100
Commit: Armin Le Grand 
CommitDate: Thu Dec 22 10:17:06 2022 +

Added names for new Primitives to idToString (II)

Change-Id: I43aa64afdd6b92beddc8484daa97babf4d6a6745
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144690
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/drawinglayer/source/primitive2d/Tools.cxx 
b/drawinglayer/source/primitive2d/Tools.cxx
index 6a3482319963..9c09ef24ee0c 100644
--- a/drawinglayer/source/primitive2d/Tools.cxx
+++ b/drawinglayer/source/primitive2d/Tools.cxx
@@ -225,6 +225,12 @@ OUString idToString(sal_uInt32 nId)
 return "GLOWPRIMITIVE";
 case PRIMITIVE2D_ID_SOFTEDGEPRIMITIVE2D:
 return "SOFTEDGEPRIMITIVE";
+case PRIMITIVE2D_ID_LINERECTANGLEPRIMITIVE2D:
+return "LINERECTANGLEPRIMITIVE";
+case PRIMITIVE2D_ID_FILLEDRECTANGLEPRIMITIVE2D:
+return "FILLEDRECTANGLEPRIMITIVE";
+case PRIMITIVE2D_ID_SINGLELINEPRIMITIVE2D:
+return "SINGLELINEPRIMITIVE";
 default:
 return OUString::number((nId >> 16) & 0xFF) + "|" + 
OUString::number(nId & 0xFF);
 }
commit a31dd1e645b1b330e79291218e8ee0fbdd5b99eb
Author: Armin Le Grand (allotropia) 
AuthorDate: Wed Dec 21 17:52:18 2022 +0100
Commit: Armin Le Grand 
CommitDate: Thu Dec 22 10:16:54 2022 +

Corrected errors when Blur effect was re-used in shadow

For GlowPrimitive2D and SoftEdgePrimitive2D I had to correct
the view-dependent decomposition in the case where shadow
was activated for the shape that was used. That creates an
extra transformation, e.g. shadow offset, that needs to be
taken into account, here by operating in discrete view-
coordinates to solve the problem.

NOTE: This is not needed for ShadowPrimitive2D itself when
ShadowBlur is used due to the primitives this is based on
are already handled with the needed offset.

Change-Id: I87dd8db9467fbd27008d6154b78599f28057ce45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144693
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/drawinglayer/source/primitive2d/glowprimitive2d.cxx 
b/drawinglayer/source/primitive2d/glowprimitive2d.cxx
index 47103ac9a011..8504b1a902a8 100644
--- a/drawinglayer/source/primitive2d/glowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/glowprimitive2d.cxx
@@ -96,6 +96,12 @@ bool GlowPrimitive2D::prepareValuesAndcheckValidity(
 basegfx::B2DRange aVisibleArea(rViewInformation.getViewport());
 aVisibleArea.grow(getGlowRadius());
 
+// To do this correctly, it needs to be done in discrete coordinates.
+// The object may be transformed relative to the original#
+// ObjectTransformation, e.g. when re-used in shadow
+aVisibleArea.transform(rViewInformation.getViewTransformation());
+
rClippedRange.transform(rViewInformation.getObjectToViewTransformation());
+
 // calculate ClippedRange
 rClippedRange.intersect(aVisibleArea);
 
@@ -103,6 +109,9 @@ bool GlowPrimitive2D::prepareValuesAndcheckValidity(
 // will be empty and we are done
 if (rClippedRange.isEmpty())
 return false;
+
+// convert result back to object coordinates
+
rClippedRange.transform(rViewInformation.getInverseObjectToViewTransformation());
 }
 
 // calculate discrete pixel size of GlowRange. If it's too small to 
visualize, we are done
diff --git a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx 
b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
index e4cbb0d58a4f..ef34f0eb40e1 100644
--- a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
@@ -88,6 +88,12 @@ bool SoftEdgePrimitive2D::prepareValuesAndcheckValidity(
 basegfx::B2DRange aVisibleArea(rViewInformation.getViewport());
 aVisibleArea.grow(getRadius() * 2);
 
+// To do this correctly, it needs to be done in discrete coordinates.
+// The object may be transformed relative to the original#
+// ObjectTransformation, e.g. when re-used in shadow
+aVisibleArea.transform(rViewInformation.getViewTransformation());
+
rClippedRange.transform(rViewInformation.getObjectToViewTransformation());
+
 // calculate ClippedRange
 rClippedRange.intersect(aVisibleArea);
 
@@ -95,6 +101,9 @@ bool SoftEdgePrimitive2D::prepareValuesAndcheckValidity(
 // will be empty and we are done
 if (rClippedRange.isEmpty())

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

2022-10-13 Thread Caolán McNamara (via logerrit)
 drawinglayer/source/processor2d/vclprocessor2d.cxx |   13 +-
 include/svx/sdr/overlay/overlayobject.hxx  |9 -
 include/vcl/rendercontext/DrawModeFlags.hxx|5 
 svx/source/sdr/overlay/overlaymanager.cxx  |   10 -
 svx/source/sdr/overlay/overlayobject.cxx   |2 
 svx/source/sdr/overlay/overlayrectangle.cxx|4 
 svx/source/svdraw/svdedxv.cxx  |  131 ++---
 vcl/source/outdev/gradient.cxx |7 -
 vcl/source/rendercontext/drawmode.cxx  |   30 +++-
 9 files changed, 171 insertions(+), 40 deletions(-)

New commits:
commit 2734d2e058182a34c576e558138d84358c69ca5a
Author: Caolán McNamara 
AuthorDate: Thu Oct 13 10:41:25 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 13 14:52:51 2022 +0200

tdf#150622 use high contrast selection fg/bg colors for text selection

with SettingsForSelection
SettingsText -> HighlightTextColor
SettingsFill -> HighlightColor
SettingsLine -> HighlightColor

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

diff --git a/include/svx/sdr/overlay/overlayobject.hxx 
b/include/svx/sdr/overlay/overlayobject.hxx
index 294ceb3447f8..643007cc3fde 100644
--- a/include/svx/sdr/overlay/overlayobject.hxx
+++ b/include/svx/sdr/overlay/overlayobject.hxx
@@ -109,10 +109,11 @@ namespace sdr::overlay
 // it is switched to false
 boolmbAllowsAntiAliase 
: 1;
 
-// Flag to control if this OverlayObject is allowed to ignore the
-// DrawMode settings which force use of colors to High Contrast 
fg/bg
+// In High Contrast mode all fg and bg and forced to the a pair of 
normal
+// high contrast colors. If this flag is set, then in High 
Contrast mode
+// the colors are instead forced to the high contrast selection 
fg/bg pair.
 // Default is false.
-bool
mbOverruleDrawModeSettings : 1;
+bool
mbHighContrastSelection : 1;
 
 // set changed flag. Call after change, since the old range is 
invalidated
 // and then the new one is calculated and invalidated, too. This 
will only
@@ -148,7 +149,7 @@ namespace sdr::overlay
 bool allowsAntiAliase() const { return mbAllowsAntiAliase; }
 
 // read access to DrawModeSettings flag
-bool overrulesDrawModeSettings() const { return 
mbOverruleDrawModeSettings; }
+bool isHighContrastSelection() const { return 
mbHighContrastSelection; }
 
 // read access to baseRange. This may trigger createBaseRange() if
 // object is changed.
diff --git a/include/vcl/rendercontext/DrawModeFlags.hxx 
b/include/vcl/rendercontext/DrawModeFlags.hxx
index edfa27626a9a..b51b1798e877 100644
--- a/include/vcl/rendercontext/DrawModeFlags.hxx
+++ b/include/vcl/rendercontext/DrawModeFlags.hxx
@@ -45,11 +45,12 @@ enum class DrawModeFlags : sal_uInt32
 SettingsFill = 0x0002,
 SettingsText = 0x0004,
 SettingsGradient = 0x0008,
-NoTransparency = 0x0010,
+SettingsForSelection = 0x0010,
+NoTransparency = 0x0020,
 };
 namespace o3tl
 {
-template <> struct typed_flags : is_typed_flags
+template <> struct typed_flags : is_typed_flags
 {
 };
 }
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx 
b/svx/source/sdr/overlay/overlaymanager.cxx
index 3d501b814da5..c29138de8b87 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -51,8 +51,6 @@ namespace sdr::overlay
 // but it seems reasonable to allow overlays to use the selection 
color
 // taken from the system High Contrast settings
 const DrawModeFlags 
nOriginalDrawMode(rDestinationDevice.GetDrawMode());
-const DrawModeFlags nForceSettings = DrawModeFlags::SettingsLine | 
DrawModeFlags::SettingsFill |
- DrawModeFlags::SettingsText | 
DrawModeFlags::SettingsGradient;
 
 // create processor
 std::unique_ptr 
pProcessor(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
@@ -81,16 +79,16 @@ namespace sdr::overlay
 rDestinationDevice.SetAntialiasing(nOriginalAA 
& ~AntialiasingFlags::Enable);
 }
 
-const bool bOverrulesDrawModeSettings = 
rCandidate.overrulesDrawModeSettings();
-if (bOverrulesDrawModeSettings)
+const bool bIsHighContrastSelection = 
rCandidate.isHighContrastSelection();
+if (bIsHighContrastSelection)
   

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

2022-08-24 Thread Caolán McNamara (via logerrit)
 drawinglayer/source/processor2d/vclprocessor2d.cxx |4 
 svx/source/styles/CommonStylePreviewRenderer.cxx   |1 +
 2 files changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 87de096032b0665abebed521f2f07f0ad893de0c
Author: Caolán McNamara 
AuthorDate: Wed Aug 24 12:39:21 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 24 15:13:03 2022 +0200

cid#1510129 Logically dead code

triggered by the recent flatten, but there since:

commit 36f21914b31a28f75ec2195c266424a18408f747
Date:   Tue Oct 29 17:40:43 2013 +

Resolves: i123564 corrected some aspects when working with bitmaps...
with low color depth or small size

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

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 5c4b15a906c9..a9be11911e82 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -519,10 +519,6 @@ bool VclProcessor2D::RenderFillGraphicPrimitive2DImpl(
 const sal_Int32 nBWidth(std::max(sal_Int32(1), 
basegfx::fround(aGraphicRange.getWidth(;
 const sal_Int32 nBHeight(std::max(sal_Int32(1), 
basegfx::fround(aGraphicRange.getHeight(;
 
-// only do something when bitmap fill has a size in discrete units
-if (nBWidth <= 0 || nBHeight <= 0)
-return true;
-
 // nBWidth, nBHeight is the pixel size of the needed bitmap. To not need 
to scale it
 // in vcl many times, create a size-optimized version
 const Size aNeededBitmapSizePixel(nBWidth, nBHeight);
commit c61c70e51cd6bc1721ec0d840aad28b5ed284ae7
Author: Caolán McNamara 
AuthorDate: Wed Aug 24 12:35:29 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 24 15:12:49 2022 +0200

cid#1510131 Uninitialized scalar field

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

diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx 
b/svx/source/styles/CommonStylePreviewRenderer.cxx
index 66fbb9e72603..3a78a3df22f8 100644
--- a/svx/source/styles/CommonStylePreviewRenderer.cxx
+++ b/svx/source/styles/CommonStylePreviewRenderer.cxx
@@ -53,6 +53,7 @@ CommonStylePreviewRenderer::CommonStylePreviewRenderer(
 , maFontColor(COL_AUTO)
 , maHighlightColor(COL_AUTO)
 , maBackgroundColor(COL_AUTO)
+, mnHeight(0)
 , maStyleName(mpStyle->GetName())
 {
 }


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/vcl

2020-06-15 Thread Caolán McNamara (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   53 
 drawinglayer/source/processor2d/vclpixelprocessor2d.hxx |2 
 include/vcl/dockwin.hxx |2 
 3 files changed, 56 insertions(+), 1 deletion(-)

New commits:
commit 4ce1ff56bb63f0e9a10a129f31e604c20007d5d1
Author: Caolán McNamara 
AuthorDate: Mon Jun 15 09:15:57 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jun 15 11:56:03 2020 +0200

fix DockingManager::EndPopupMode related build failure

undefined reference to `DockingManager::StartPopupMode(vcl::Window const*, 
tools::Rectangle const&, FloatWinPopupFlags)´
sc/source/ui/cctrl/checklistmenu.o: In function 
`ScCheckListMenuControl::handleMenuTimeout(ScCheckListMenuControl::SubMenuItemData
 const*)´:
sc/source/ui/cctrl/checklistmenu.cxx:239: undefined reference to 
`DockingManager::EndPopupMode(vcl::Window const*)´
sc/source/ui/cctrl/checklistmenu.cxx:225: undefined reference to 
`DockingManager::EndPopupMode(vcl::Window const*)´

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

diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index 689a2f4c60c3..820a8efe057a 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -168,7 +168,7 @@ public:
 SizeGetSizePixel() const;
 };
 
-class UNLESS_MERGELIBS(VCL_DLLPUBLIC) DockingManager
+class VCL_DLLPUBLIC DockingManager
 {
 std::vector>> mvDockingWindows;
 
commit b435c4fe82e77a82fde6464d6722281e5fc4f394
Author: A_GAN 
AuthorDate: Mon Jun 8 21:36:34 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 15 11:55:53 2020 +0200

Add process function to create the blur shadow

Create processShadowPrimitive2D function which uses the blur radius
from the shadow primitive to generate mask for the shadow bitmap.

Change-Id: Iba86bdbe1728153d866dd559a1b12eb5570ced51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95859
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 3a57695f81e0..864f5ca107b6 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -392,6 +393,12 @@ void VclPixelProcessor2D::processBasePrimitive2D(const 
primitive2d::BasePrimitiv
 static_cast(rCandidate));
 break;
 }
+case PRIMITIVE2D_ID_SHADOWPRIMITIVE2D:
+{
+processShadowPrimitive2D(
+static_cast(rCandidate));
+break;
+}
 default:
 {
 SAL_INFO("drawinglayer", "default case for " << 
drawinglayer::primitive2d::idToString(
@@ -1067,6 +1074,52 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D(
 SAL_WARN("drawinglayer", "Temporary buffered virtual device is not 
visible");
 }
 
+void VclPixelProcessor2D::processShadowPrimitive2D(const 
primitive2d::ShadowPrimitive2D& rCandidate)
+{
+if (rCandidate.getShadowBlur() == 0)
+{
+process(rCandidate);
+return;
+}
+
+basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+aRange.transform(maCurrentTransformation);
+basegfx::B2DVector aBlurRadiusVector(rCandidate.getShadowBlur(), 0);
+aBlurRadiusVector *= maCurrentTransformation;
+const double fBlurRadius = aBlurRadiusVector.getLength();
+
+impBufferDevice aBufferDevice(*mpOutputDevice, aRange, true);
+if (aBufferDevice.isVisible())
+{
+OutputDevice* pLastOutputDevice = mpOutputDevice;
+mpOutputDevice = ();
+mpOutputDevice->Erase();
+
+process(rCandidate);
+
+const tools::Rectangle 
aRect(static_cast(std::floor(aRange.getMinX())),
+ 
static_cast(std::floor(aRange.getMinY())),
+ 
static_cast(std::ceil(aRange.getMaxX())),
+ 
static_cast(std::ceil(aRange.getMaxY(;
+
+BitmapEx bitmapEx = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), 
aRect.GetSize());
+
+AlphaMask mask = ProcessAndBlurAlphaMask(bitmapEx.GetAlpha(), 0, 
fBlurRadius, 0);
+
+const basegfx::BColor aShadowColor(
+
maBColorModifierStack.getModifiedColor(rCandidate.getShadowColor()));
+
+Bitmap bitmap = bitmapEx.GetBitmap();
+bitmap.Erase(Color(aShadowColor));
+BitmapEx result(bitmap, mask);
+
+mpOutputDevice = pLastOutputDevice;
+mpOutputDevice->DrawBitmapEx(aRect.TopLeft(), result);
+}
+else
+SAL_WARN("drawinglayer", "Temporary buffered virtual 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source

2020-05-28 Thread Mike Kaganski (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   21 ++--
 drawinglayer/source/processor2d/vclprocessor2d.cxx  |5 +++
 2 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit d5a995c0296df61cd6c9341779bccbf8989ecc75
Author: Mike Kaganski 
AuthorDate: Thu May 14 14:42:24 2020 +0300
Commit: Mike Kaganski 
CommitDate: Fri May 29 06:25:05 2020 +0200

Use buffer with alpha in VclProcessor2D::RenderTransparencePrimitive2D

This allows TransparencePrimitive2D to produce truly transparent image,
usable later in the stack - specifically by soft edge effect.

Change-Id: I54e6f9a8fd196247b1130446af3d21b082820f01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95038
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 9e3cf43208bc..60b372b0ef48 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -870,7 +870,7 @@ void VclProcessor2D::RenderTransparencePrimitive2D(
 
 basegfx::B2DRange 
aRange(rTransCandidate.getChildren().getB2DRange(getViewInformation2D()));
 aRange.transform(maCurrentTransformation);
-impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
+impBufferDevice aBufferDevice(*mpOutputDevice, aRange, true);
 
 if (!aBufferDevice.isVisible())
 return;
@@ -878,6 +878,7 @@ void VclProcessor2D::RenderTransparencePrimitive2D(
 // remember last OutDev and set to content
 OutputDevice* pLastOutputDevice = mpOutputDevice;
 mpOutputDevice = ();
+mpOutputDevice->Erase();
 
 // paint content to it
 process(rTransCandidate.getChildren());
@@ -889,6 +890,8 @@ void VclProcessor2D::RenderTransparencePrimitive2D(
 basegfx::BColorModifierStack 
aLastBColorModifierStack(maBColorModifierStack);
 maBColorModifierStack = basegfx::BColorModifierStack();
 
+mpOutputDevice->Erase();
+
 // paint mask to it (always with transparence intensities, evtl. with AA)
 process(rTransCandidate.getTransparence());
 
commit 425125e31f9053e0e4895fb13e1e267ec5d26487
Author: Mike Kaganski 
AuthorDate: Thu May 28 15:13:15 2020 +0300
Commit: Mike Kaganski 
CommitDate: Fri May 29 06:24:53 2020 +0200

tdf#49247: Reimplement soft edges to keep object transparency

So the objects that were semi-transparent don't become opaque upon
applying soft edge effect. This requires that the objects are
actually semi-transparent, so that we can get alpha mask from bitmap

Change-Id: Ic4af9bea19e5e71139d3f065797583f7c7c78815
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95034
Tested-by: Jenkins
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 9e44ef292d34..3c1a1087adcf 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1027,33 +1027,28 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D(
 // Blur radius is equal to soft edge radius
 const double fBlurRadius = aRadiusVector.getLength();
 
-impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
+impBufferDevice aBufferDevice(*mpOutputDevice, aRange, true);
 if (aBufferDevice.isVisible())
 {
 // remember last OutDev and set to content
 OutputDevice* pLastOutputDevice = mpOutputDevice;
 mpOutputDevice = ();
-// Processing will draw whatever geometry on white background, 
applying *black*
-// replacement color
 mpOutputDevice->Erase();
-rCandidate.setMaskGeneration();
 process(rCandidate);
-rCandidate.setMaskGeneration(false);
+
 const tools::Rectangle 
aRect(static_cast(std::floor(aRange.getMinX())),
  
static_cast(std::floor(aRange.getMinY())),
  
static_cast(std::ceil(aRange.getMaxX())),
  
static_cast(std::ceil(aRange.getMaxY(;
-Bitmap bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), 
aRect.GetSize());
-
-AlphaMask mask = ProcessAndBlurAlphaMask(bitmap, -fBlurRadius, 
fBlurRadius, 0);
+BitmapEx bitmap = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), 
aRect.GetSize());
 
-// The end result is the original bitmap with blurred 8-bit alpha mask
+AlphaMask aMask = bitmap.GetAlpha();
+AlphaMask blurMask = ProcessAndBlurAlphaMask(aMask, -fBlurRadius, 
fBlurRadius, 0);
 
-mpOutputDevice->Erase();
-process(rCandidate);
-bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), aRect.GetSize());
+aMask.BlendWith(blurMask);
 
-BitmapEx result(bitmap, mask);
+// The end result is the 

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

2020-05-28 Thread Mike Kaganski (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   21 +---
 vcl/source/outdev/outdev.cxx|   12 +++--
 2 files changed, 23 insertions(+), 10 deletions(-)

New commits:
commit 541e5a9e84c42fbf20158b01a4feaa0f226e9ed0
Author: Mike Kaganski 
AuthorDate: Thu May 14 14:42:24 2020 +0300
Commit: Mike Kaganski 
CommitDate: Fri May 29 06:23:26 2020 +0200

tdf#49247, tdf#101181: Fix effect bounds

This will avoid cutting rightmost and bottommost pixels from the effects,
caused by casting of range dimensions to integers.

Change-Id: Icad9c06c33bafae9531bc45559acecd3581fad89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95020
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 131e51f34913..32afe33e6147 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -993,8 +993,11 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const 
primitive2d::GlowPrimitiv
 // glow primitive.
 mpOutputDevice->Erase();
 process(rCandidate);
-Bitmap bitmap = mpOutputDevice->GetBitmap(Point(aRange.getMinX(), 
aRange.getMinY()),
-  Size(aRange.getWidth(), 
aRange.getHeight()));
+const tools::Rectangle 
aRect(static_cast(std::floor(aRange.getMinX())),
+ 
static_cast(std::floor(aRange.getMinY())),
+ 
static_cast(std::ceil(aRange.getMaxX())),
+ 
static_cast(std::ceil(aRange.getMaxY(;
+Bitmap bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), 
aRect.GetSize());
 
 AlphaMask mask = ProcessAndBlurAlphaMask(bitmap, fBlurRadius, 
fBlurRadius, nTransparency);
 
@@ -1007,7 +1010,7 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const 
primitive2d::GlowPrimitiv
 
 // back to old OutDev
 mpOutputDevice = pLastOutputDevice;
-mpOutputDevice->DrawBitmapEx(Point(aRange.getMinX(), 
aRange.getMinY()), result);
+mpOutputDevice->DrawBitmapEx(aRect.TopLeft(), result);
 }
 else
 SAL_WARN("drawinglayer", "Temporary buffered virtual device is not 
visible");
@@ -1036,8 +1039,11 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D(
 rCandidate.setMaskGeneration();
 process(rCandidate);
 rCandidate.setMaskGeneration(false);
-Bitmap bitmap = mpOutputDevice->GetBitmap(Point(aRange.getMinX(), 
aRange.getMinY()),
-  Size(aRange.getWidth(), 
aRange.getHeight()));
+const tools::Rectangle 
aRect(static_cast(std::floor(aRange.getMinX())),
+ 
static_cast(std::floor(aRange.getMinY())),
+ 
static_cast(std::ceil(aRange.getMaxX())),
+ 
static_cast(std::ceil(aRange.getMaxY(;
+Bitmap bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), 
aRect.GetSize());
 
 AlphaMask mask = ProcessAndBlurAlphaMask(bitmap, -fBlurRadius, 
fBlurRadius, 0);
 
@@ -1045,15 +1051,14 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D(
 
 mpOutputDevice->Erase();
 process(rCandidate);
-bitmap = mpOutputDevice->GetBitmap(Point(aRange.getMinX(), 
aRange.getMinY()),
-   Size(aRange.getWidth(), 
aRange.getHeight()));
+bitmap = mpOutputDevice->GetBitmap(aRect.TopLeft(), aRect.GetSize());
 
 // alpha mask will be scaled up automatically to match bitmap
 BitmapEx result(bitmap, mask);
 
 // back to old OutDev
 mpOutputDevice = pLastOutputDevice;
-mpOutputDevice->DrawBitmapEx(Point(aRange.getMinX(), 
aRange.getMinY()), result);
+mpOutputDevice->DrawBitmapEx(aRect.TopLeft(), result);
 }
 else
 SAL_WARN("drawinglayer", "Temporary buffered virtual device is not 
visible");
commit 946b01e2d4a41b06415f6371b7b52dca090e7b86
Author: Mike Kaganski 
AuthorDate: Thu May 14 14:42:24 2020 +0300
Commit: Mike Kaganski 
CommitDate: Fri May 29 06:23:16 2020 +0200

Consider mpAlphaVDev when processing metafile in OutputDevice::DrawOutDev

Change-Id: Ia9709bba6eb2a64781297ca260341693b0e39107
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95019
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 18f273b8185a..020a57a6a40c 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -415,8 +415,16 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const 
Size& rDestSize,
 
 if ( mpMetaFile )
 {
-const Bitmap aBmp( rOutDev.GetBitmap( rSrcPt, rSrcSize ) );
- 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/vcl vcl/source

2020-05-28 Thread Mike Kaganski (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   11 +++
 include/vcl/alpha.hxx   |1 
 vcl/source/gdi/alpha.cxx|   23 
 3 files changed, 29 insertions(+), 6 deletions(-)

New commits:
commit 6806616023242aded27b1fae8637d32c9626d472
Author: Mike Kaganski 
AuthorDate: Thu May 14 14:42:24 2020 +0300
Commit: Mike Kaganski 
CommitDate: Fri May 29 06:23:50 2020 +0200

Add AlphaMask::BlendWith method to blend 8-bit alpha masks

Required for subsequent soft edge effect improvement

Change-Id: I9351b827a83c5651100e73a6846c834f491b861d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95027
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index f87ac133970a..159c61243efa 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -56,6 +56,7 @@ public:
 voidErase( sal_uInt8 cTransparency );
 voidReplace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
 voidReplace( sal_uInt8 cSearchTransparency, sal_uInt8 
cReplaceTransparency );
+voidBlendWith(const Bitmap& rOther);
 
 BitmapReadAccess*  AcquireAlphaReadAccess() { return 
Bitmap::AcquireReadAccess(); }
 BitmapWriteAccess* AcquireAlphaWriteAccess() { return 
Bitmap::AcquireWriteAccess(); }
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index fde0e94583a9..1385f803be8d 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -138,6 +138,29 @@ void AlphaMask::Replace( sal_uInt8 cSearchTransparency, 
sal_uInt8 cReplaceTransp
 }
 }
 
+void AlphaMask::BlendWith(const Bitmap& rOther)
+{
+AlphaMask aOther(rOther); // to 8 bits
+Bitmap::ScopedReadAccess pOtherAcc(aOther);
+AlphaScopedWriteAccess pAcc(*this);
+if (pOtherAcc && pAcc && pOtherAcc->GetBitCount() == 8 && 
pAcc->GetBitCount() == 8)
+{
+const long nHeight = std::min(pOtherAcc->Height(), pAcc->Height());
+const long nWidth = std::min(pOtherAcc->Width(), pAcc->Width());
+for (long x = 0; x < nWidth; ++x)
+{
+for (long y = 0; y < nHeight; ++y)
+{
+// Use sal_uInt16 for following multiplication
+const sal_uInt16 nGrey1 = pOtherAcc->GetPixelIndex(y, x);
+const sal_uInt16 nGrey2 = pAcc->GetPixelIndex(y, x);
+const double fGrey = std::round(nGrey1 + nGrey2 - nGrey1 * 
nGrey2 / 255.0);
+pAcc->SetPixelIndex(y, x, static_cast(fGrey));
+}
+}
+}
+}
+
 void AlphaMask::ReleaseAccess( BitmapReadAccess* pAccess )
 {
 if( pAccess )
commit 2cfe93da835eb500c9a170d22fce19fbd1de9473
Author: Mike Kaganski 
AuthorDate: Thu May 28 12:48:28 2020 +0300
Commit: Mike Kaganski 
CommitDate: Fri May 29 06:23:37 2020 +0200

tdf#49247, tdf#101181: don't rely on automatic scaling of alpha mask

Scale it back explicitly in ProcessAndBlurAlphaMask

Change-Id: I8e8a58c117d8b59db40b416edadc559b47dc300a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95021
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 32afe33e6147..9e44ef292d34 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -917,18 +917,17 @@ void 
VclPixelProcessor2D::processMetaFilePrimitive2D(const primitive2d::BasePrim
 
 namespace
 {
-/* Returns 8-bit alpha mask created from passed mask. The result may be scaled 
down; it's
-   expected that it will be automatically scaled up back when applied to the 
bitmap.
+/* Returns 8-bit alpha mask created from passed mask.
 
Negative fErodeDilateRadius values mean erode, positive - dilate.
nTransparency defines minimal transparency level.
 */
-AlphaMask ProcessAndBlurAlphaMask(const Bitmap& rBWMask, double 
fErodeDilateRadius,
+AlphaMask ProcessAndBlurAlphaMask(const Bitmap& rMask, double 
fErodeDilateRadius,
   double fBlurRadius, sal_uInt8 nTransparency)
 {
 // Only completely white pixels on the initial mask must be considered for 
transparency. Any
 // other color must be treated as black. This creates 1-bit B bitmap.
-BitmapEx mask(rBWMask.CreateMask(COL_WHITE));
+BitmapEx mask(rMask.CreateMask(COL_WHITE));
 
 // Scaling down increases performance without noticeable quality loss. 
Additionally,
 // current blur implementation can only handle blur radius between 2 and 
254.
@@ -963,6 +962,8 @@ AlphaMask ProcessAndBlurAlphaMask(const Bitmap& rBWMask, 
double fErodeDilateRadi
 // calculate blurry effect
 BitmapFilter::Filter(mask, BitmapFilterStackBlur(fBlurRadius));
 
+mask.Scale(rMask.GetSizePixel());
+
 return 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source solenv/clang-format

2020-05-02 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 1557 +-
 drawinglayer/source/processor2d/vclprocessor2d.cxx  | 2305 
 solenv/clang-format/blacklist   |2 
 3 files changed, 1994 insertions(+), 1870 deletions(-)

New commits:
commit e1c79efa644bf1cabc0aee02cfc85f1781822fcc
Author: Tomaž Vajngerl 
AuthorDate: Wed Apr 29 17:50:06 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sat May 2 21:41:50 2020 +0200

remove vclpixelprocessor2d.cxx from clang-format blacklist

Change-Id: I03ad72d0754cb8c180f4eab0e8040c3dab533ef9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93321
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 654fa6e6168f..f09c6ad0fd76 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -65,826 +65,891 @@ using namespace com::sun::star;
 
 namespace drawinglayer::processor2d
 {
-struct VclPixelProcessor2D::Impl
-{
-AntialiasingFlags m_nOrigAntiAliasing;
+struct VclPixelProcessor2D::Impl
+{
+AntialiasingFlags m_nOrigAntiAliasing;
+
+explicit Impl(OutputDevice const& rOutDev)
+: m_nOrigAntiAliasing(rOutDev.GetAntialiasing())
+{
+}
+};
+
+VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& 
rViewInformation,
+ OutputDevice& rOutDev)
+: VclProcessor2D(rViewInformation, rOutDev)
+, m_pImpl(new Impl(rOutDev))
+{
+// prepare maCurrentTransformation matrix with viewTransformation to 
target directly to pixels
+maCurrentTransformation = rViewInformation.getObjectToViewTransformation();
+
+// prepare output directly to pixels
+mpOutputDevice->Push(PushFlags::MAPMODE);
+mpOutputDevice->SetMapMode();
+
+// react on AntiAliasing settings
+if (getOptionsDrawinglayer().IsAntiAliasing())
+{
+mpOutputDevice->SetAntialiasing(m_pImpl->m_nOrigAntiAliasing
+| AntialiasingFlags::EnableB2dDraw);
+}
+else
+{
+mpOutputDevice->SetAntialiasing(m_pImpl->m_nOrigAntiAliasing
+& ~AntialiasingFlags::EnableB2dDraw);
+}
+}
+
+VclPixelProcessor2D::~VclPixelProcessor2D()
+{
+// restore MapMode
+mpOutputDevice->Pop();
 
-explicit Impl(OutputDevice const& rOutDev)
-: m_nOrigAntiAliasing(rOutDev.GetAntialiasing())
-{ }
-};
+// restore AntiAliasing
+mpOutputDevice->SetAntialiasing(m_pImpl->m_nOrigAntiAliasing);
+}
 
-VclPixelProcessor2D::VclPixelProcessor2D(const 
geometry::ViewInformation2D& rViewInformation, OutputDevice& rOutDev)
-:   VclProcessor2D(rViewInformation, rOutDev)
-,   m_pImpl(new Impl(rOutDev))
-{
-// prepare maCurrentTransformation matrix with viewTransformation 
to target directly to pixels
-maCurrentTransformation = 
rViewInformation.getObjectToViewTransformation();
+void VclPixelProcessor2D::tryDrawPolyPolygonColorPrimitive2DDirect(
+const drawinglayer::primitive2d::PolyPolygonColorPrimitive2D& rSource, 
double fTransparency)
+{
+if (!rSource.getB2DPolyPolygon().count() || fTransparency < 0.0 || 
fTransparency >= 1.0)
+{
+// no geometry, done
+return;
+}
+
+const basegfx::BColor aPolygonColor(
+maBColorModifierStack.getModifiedColor(rSource.getBColor()));
+
+mpOutputDevice->SetFillColor(Color(aPolygonColor));
+mpOutputDevice->SetLineColor();
+mpOutputDevice->DrawTransparent(maCurrentTransformation, 
rSource.getB2DPolyPolygon(),
+fTransparency);
+}
+
+bool VclPixelProcessor2D::tryDrawPolygonHairlinePrimitive2DDirect(
+const drawinglayer::primitive2d::PolygonHairlinePrimitive2D& rSource, 
double fTransparency)
+{
+const basegfx::B2DPolygon& rLocalPolygon(rSource.getB2DPolygon());
 
-// prepare output directly to pixels
-mpOutputDevice->Push(PushFlags::MAPMODE);
-mpOutputDevice->SetMapMode();
+if (!rLocalPolygon.count() || fTransparency < 0.0 || fTransparency >= 1.0)
+{
+// no geometry, done
+return true;
+}
 
-// react on AntiAliasing settings
-if(getOptionsDrawinglayer().IsAntiAliasing())
-{
-mpOutputDevice->SetAntialiasing(
-   m_pImpl->m_nOrigAntiAliasing | 
AntialiasingFlags::EnableB2dDraw);
-}
-else
-{
-mpOutputDevice->SetAntialiasing(
-   m_pImpl->m_nOrigAntiAliasing & 
~AntialiasingFlags::EnableB2dDraw);
-}
-}
+const basegfx::BColor 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source solenv/clang-format

2020-04-14 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |6 
 drawinglayer/source/processor2d/vclpixelprocessor2d.hxx |  120 
 solenv/clang-format/blacklist   |1 
 3 files changed, 69 insertions(+), 58 deletions(-)

New commits:
commit 38c5cfa1da8f0a615e479a68f3bcb238395109a8
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 12 13:22:26 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 14 23:23:50 2020 +0200

fdo#43157: VclPixelProcessor2D replace OSL_ENSURE with SAL_WARN_IF

Change-Id: I4a6c46f9054f9a32d52f1f60f5f7547e62cf7a5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92223
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 972c08481040..9102230f4305 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -581,7 +581,7 @@ namespace drawinglayer::processor2d
 {
 // single transparent tools::PolyPolygon 
identified, use directly
 const 
primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = static_cast< const 
primitive2d::PolyPolygonColorPrimitive2D* >(pBasePrimitive);
-OSL_ENSURE(pPoPoColor, "OOps, PrimitiveID 
and PrimitiveType do not match (!)");
+SAL_WARN_IF(!pPoPoColor, "drawinglayer", 
"OOps, PrimitiveID and PrimitiveType do not match (!)");
 bDrawTransparentUsed = true;
 
tryDrawPolyPolygonColorPrimitive2DDirect(*pPoPoColor, 
rUniTransparenceCandidate.getTransparence());
 break;
@@ -590,7 +590,7 @@ namespace drawinglayer::processor2d
 {
 // single transparent 
PolygonHairlinePrimitive2D identified, use directly
 const 
primitive2d::PolygonHairlinePrimitive2D* pPoHair = static_cast< const 
primitive2d::PolygonHairlinePrimitive2D* >(pBasePrimitive);
-OSL_ENSURE(pPoHair, "OOps, PrimitiveID and 
PrimitiveType do not match (!)");
+SAL_WARN_IF(!pPoHair, "drawinglayer", 
"OOps, PrimitiveID and PrimitiveType do not match (!)");
 
 // do no tallow by default - problem is 
that self-overlapping parts of this geometry will
 // not be in an all-same transparency but 
will already alpha-cover themselves with blending.
@@ -604,7 +604,7 @@ namespace drawinglayer::processor2d
 {
 // single transparent 
PolygonStrokePrimitive2D identified, use directly
 const 
primitive2d::PolygonStrokePrimitive2D* pPoStroke = static_cast< const 
primitive2d::PolygonStrokePrimitive2D* >(pBasePrimitive);
-OSL_ENSURE(pPoStroke, "OOps, PrimitiveID 
and PrimitiveType do not match (!)");
+SAL_WARN_IF(!pPoStroke, "drawinglayer", 
"OOps, PrimitiveID and PrimitiveType do not match (!)");
 
 // do no tallow by default - problem is 
that self-overlapping parts of this geometry will
 // not be in an all-same transparency but 
will already alpha-cover themselves with blending.
commit b753515b0e6f24193d70dd64506df1b484e65423
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 12 13:17:28 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 14 23:23:32 2020 +0200

remove vclpixelprocessor2d.hxx from clang-format blacklist

Change-Id: I5fe33322ff0df5191f57f1364a2d32eefc889d68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/9
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index 1ee765ab1e51..5c834056c947 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -24,69 +24,81 @@
 
 #include 
 
-namespace drawinglayer::primitive2d {
-class PolyPolygonColorPrimitive2D;
-class PolygonHairlinePrimitive2D;
-class PolygonStrokePrimitive2D;
-class WrongSpellPrimitive2D;
-class TextSimplePortionPrimitive;
-class BitmapPrimitive2D;
-class PolyPolygonGradientPrimitive2D;
-class UnifiedTransparencePrimitive2D;
-class ControlPrimitive2D;
-class PolygonStrokePrimitive2D;
-class FillHatchPrimitive2D;
-class BackgroundColorPrimitive2D;
-class BorderLinePrimitive2D;
+namespace drawinglayer::primitive2d
+{
+class 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/drawinglayer solenv/clang-format

2020-02-11 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx  |  356 +++-
 include/drawinglayer/primitive2d/graphicprimitive2d.hxx |  114 ++---
 solenv/clang-format/blacklist   |2 
 3 files changed, 226 insertions(+), 246 deletions(-)

New commits:
commit 71395766532cace8cd981a77599b8ac74260ab57
Author: Tomaž Vajngerl 
AuthorDate: Fri Feb 7 21:37:57 2020 +0100
Commit: Tomaž Vajngerl 
CommitDate: Tue Feb 11 18:53:58 2020 +0100

clean-up namespaces in graphicprimitive2d.hxx

Change-Id: I98975660a54e21ec33007ca1f21e7fd39b92f257
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88242
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/drawinglayer/primitive2d/graphicprimitive2d.hxx 
b/include/drawinglayer/primitive2d/graphicprimitive2d.hxx
index 3bfe40ec53d7..e01d7fce676f 100644
--- a/include/drawinglayer/primitive2d/graphicprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/graphicprimitive2d.hxx
@@ -25,9 +25,7 @@
 #include 
 #include 
 
-namespace drawinglayer
-{
-namespace primitive2d
+namespace drawinglayer::primitive2d
 {
 /** GraphicPrimitive2D class
 
@@ -84,7 +82,6 @@ public:
 virtual sal_uInt32 getPrimitive2DID() const override;
 };
 
-} // end of namespace primitive2d
-} // end of namespace drawinglayer
+} // end of namespace drawinglayer::primitive2d
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 26ba295e5517dd85de5b972631b3a73beb8db7a0
Author: Tomaž Vajngerl 
AuthorDate: Fri Feb 7 21:08:00 2020 +0100
Commit: Tomaž Vajngerl 
CommitDate: Tue Feb 11 18:53:46 2020 +0100

remove graphicprimitive2d.{cxx,hxx} from clang-format blacklist

Change-Id: Ice9a6813743e4238d28d6007bb0092c69685a9fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88241
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 51625c60a491..f3793d4bcf73 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -30,202 +30,188 @@
 
 namespace drawinglayer::primitive2d
 {
-void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& ) const
+void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& 
rContainer,
+   const 
geometry::ViewInformation2D&) const
+{
+if (255 == getGraphicAttr().GetTransparency())
+{
+// content is invisible, done
+return;
+}
+
+// do not apply mirroring from GraphicAttr to the Metafile by calling
+// GetTransformedGraphic, this will try to mirror the Metafile using 
Scale()
+// at the Metafile. This again calls Scale at the single MetaFile actions,
+// but this implementation never worked. I reworked that implementations,
+// but for security reasons i will try not to use it.
+basegfx::B2DHomMatrix aTransform(getTransform());
+
+if (getGraphicAttr().IsMirrored())
+{
+// content needs mirroring
+const bool bHMirr(getGraphicAttr().GetMirrorFlags() & 
BmpMirrorFlags::Horizontal);
+const bool bVMirr(getGraphicAttr().GetMirrorFlags() & 
BmpMirrorFlags::Vertical);
+
+// mirror by applying negative scale to the unit primitive and
+// applying the object transformation on it.
+aTransform
+= basegfx::utils::createScaleB2DHomMatrix(bHMirr ? -1.0 : 1.0, 
bVMirr ? -1.0 : 1.0);
+aTransform.translate(bHMirr ? 1.0 : 0.0, bVMirr ? 1.0 : 0.0);
+aTransform = getTransform() * aTransform;
+}
+
+// Get transformed graphic. Suppress rotation and cropping, only filtering 
is needed
+// here (and may be replaced later on). Cropping is handled below as mask 
primitive (if set).
+// Also need to suppress mirroring, it is part of the transformation now 
(see above).
+// Also move transparency handling to embedding to a 
UnifiedTransparencePrimitive2D; do
+// that by remembering original transparency and applying that later if 
needed
+GraphicAttr aSuppressGraphicAttr(getGraphicAttr());
+
+aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
+aSuppressGraphicAttr.SetRotation(0);
+aSuppressGraphicAttr.SetMirrorFlags(BmpMirrorFlags::NONE);
+aSuppressGraphicAttr.SetTransparency(0);
+
+const GraphicObject& rGraphicObject = getGraphicObject();
+Graphic aTransformedGraphic(rGraphicObject.GetGraphic());
+const bool isBitmap(GraphicType::Bitmap == aTransformedGraphic.GetType()
+&& !aTransformedGraphic.getVectorGraphicData().get());
+const bool isAdjusted(getGraphicAttr().IsAdjusted());
+const bool isDrawMode(GraphicDrawMode::Standard != 
getGraphicAttr().GetDrawMode());
+
+if (isBitmap && (isAdjusted || isDrawMode))
+{
+// the pure primitive solution with the 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/vcl

2019-12-19 Thread Andrea Gelmini (via logerrit)
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |2 +-
 include/vcl/bitmapex.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8c4db130c9ab7729185040e84f2be3481645df9d
Author: Andrea Gelmini 
AuthorDate: Thu Dec 19 09:43:24 2019 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 19 10:25:47 2019 +0100

Fix typo

Change-Id: Id118bc8080b1b3435c6e0ac5a56ba95926c73e51
Reviewed-on: https://gerrit.libreoffice.org/85486
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 2f98362a9e4e..1070ff220b47 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -421,7 +421,7 @@ public:
 @param fMaximumArea
 A limitation for the maximum size of pixels to use for the result
 
-The traget size of the result bitmap is defined by transforming the 
given
+The target size of the result bitmap is defined by transforming the 
given
 rTargetRange with the given rTransformation; the area of the result is
 linearly scaled to not exceed the given fMaximumArea
 
commit c10da54fbc5e201f159f386e772bfd787b2e890d
Author: Andrea Gelmini 
AuthorDate: Thu Dec 19 09:43:21 2019 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 19 10:25:25 2019 +0100

Fix typo

Change-Id: If8c7f4476a948de40577f7c489e586870cb56edd
Reviewed-on: https://gerrit.libreoffice.org/85484
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 6fca733a9e40..ca607a0145f7 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -221,7 +221,7 @@ namespace drawinglayer
 {
 // mnNextFrameToPrepare is the target frame to create next 
(which implies that
 // mnNextFrameToPrepare-1 *is* currently in the VirtualDevice 
when
-// 0 != mnNextFrameToPrepare. nTarget is the traget frame.
+// 0 != mnNextFrameToPrepare. nTarget is the target frame.
 if (isValidData())
 {
 if (mnNextFrameToPrepare > nTarget)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source sdext/source

2019-12-04 Thread Martin Milata (via logerrit)
 drawinglayer/source/tools/emfpstringformat.cxx|2 +-
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |7 +++
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx |4 
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx|4 
 4 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 9065cd8d9a19864f6b618f2dc10daf577badd9ee
Author: Martin Milata 
AuthorDate: Wed Dec 4 02:37:40 2019 +0100
Commit: Michael Stahl 
CommitDate: Wed Dec 4 11:43:12 2019 +0100

Fix build with poppler-0.83

Change-Id: I7a3684932b8f9c403a3368b42fa4d8039c67f1a9
Reviewed-on: https://gerrit.libreoffice.org/84384
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 26048177e87d..e9c2a407c279 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -491,11 +491,18 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
 gfree(pBuf);
 }
 
+#if POPPLER_CHECK_VERSION(0, 83, 0)
+void PDFOutDev::printPath( const GfxPath* pPath )
+#else
 void PDFOutDev::printPath( GfxPath* pPath )
+#endif
 {
 int nSubPaths = pPath ? pPath->getNumSubpaths() : 0;
 for( int i=0; igetSubpath( i );
 const int nPoints = pSub->getNumPoints();
 
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index 02f6b59f6f15..2e7d2186f9a1 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -149,7 +149,11 @@ namespace pdfi
 
 int  parseFont( long long nNewId, GfxFont* pFont, GfxState* state ) 
const;
 void writeFontFile( GfxFont* gfxFont ) const;
+#if POPPLER_CHECK_VERSION(0, 83, 0)
+static void printPath( const GfxPath* pPath );
+#else
 static void printPath( GfxPath* pPath );
+#endif
 
 public:
 explicit PDFOutDev( PDFDoc* pDoc );
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index 42178b650cdd..b1a54bd09c5f 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -68,7 +68,11 @@ int main(int argc, char **argv)
 }
 
 // read config file
+#if POPPLER_CHECK_VERSION(0, 83, 0)
+globalParams = std::make_unique();
+#else
 globalParams = new GlobalParams();
+#endif
 globalParams->setErrQuiet(true);
 #if defined(_MSC_VER)
 globalParams->setupBaseFonts(nullptr);
commit 2c56d8ce717144c8bd9e5774b1b9bbcda6bc9d0e
Author: Andrea Gelmini 
AuthorDate: Wed Dec 4 10:11:05 2019 +0100
Commit: Julien Nabet 
CommitDate: Wed Dec 4 11:43:00 2019 +0100

Fix typo

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

diff --git a/drawinglayer/source/tools/emfpstringformat.cxx 
b/drawinglayer/source/tools/emfpstringformat.cxx
index f45a3406ac8a..5ff13b4c2d49 100644
--- a/drawinglayer/source/tools/emfpstringformat.cxx
+++ b/drawinglayer/source/tools/emfpstringformat.cxx
@@ -146,7 +146,7 @@ namespace emfplushelper
 case StringDigitSubstitution::StringDigitSubstitutionTraditional:
 return "StringDigitSubstitutionTraditional";
 default:
-assert(false && nSubst && "invalid string digit subsitution 
value");
+assert(false && nSubst && "invalid string digit substitution 
value");
 return "INVALID";
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source

2019-05-19 Thread Andrea Gelmini (via logerrit)
 drawinglayer/source/processor2d/vclprocessor2d.hxx |2 +-
 drawinglayer/source/tools/wmfemfhelper.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fd151f542bfef7709dcf54ccaa788cd92af7c898
Author: Andrea Gelmini 
AuthorDate: Tue May 14 21:25:53 2019 +
Commit: Julien Nabet 
CommitDate: Sun May 19 18:30:28 2019 +0200

Fix typo

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

diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx 
b/drawinglayer/source/tools/wmfemfhelper.cxx
index 5669202d40cd..aebeecdbb997 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -1099,7 +1099,7 @@ namespace wmfemfhelper
 }
 
 /** helper which takes complete care for creating the needed text 
primitives. It
-takes care of decorated stuff and all the geometry adaptions needed
+takes care of decorated stuff and all the geometry adaptations needed
  */
 static void processMetaTextAction(
 const Point& rTextStartPosition,
commit 6d01af061d71c0302e3a2ddd881f3096d8e3936e
Author: Andrea Gelmini 
AuthorDate: Tue May 14 21:25:54 2019 +
Commit: Julien Nabet 
CommitDate: Sun May 19 18:30:14 2019 +0200

Fix typo

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

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx 
b/drawinglayer/source/processor2d/vclprocessor2d.hxx
index 84e7c524c091..b06ddebc7231 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx
@@ -110,7 +110,7 @@ namespace drawinglayer
 void RenderSvgLinearAtomPrimitive2D(const 
primitive2d::SvgLinearAtomPrimitive2D& rCandidate);
 void RenderSvgRadialAtomPrimitive2D(const 
primitive2d::SvgRadialAtomPrimitive2D& rCandidate);
 
-// DrawMode adaption support
+// DrawMode adaptation support
 void adaptLineToFillDrawMode() const;
 void adaptTextToFillDrawMode() const;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source svtools/source

2018-08-13 Thread Libreoffice Gerrit user
 drawinglayer/source/tools/emfphelperdata.cxx |   13 +++--
 svtools/source/svhtml/parhtml.cxx|6 +-
 2 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 98cf7063dfda2e4958145c5b0f25d91200270864
Author: Caolán McNamara 
AuthorDate: Mon Aug 13 17:14:50 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 13 22:14:18 2018 +0200

ofz: Integer-overflow

Change-Id: I4f5e133195b46839da96952952ad119855dfbddf
Reviewed-on: https://gerrit.libreoffice.org/58948
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index 71aa5acd7620..fa31a1271d95 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2027,7 +2028,10 @@ bool HTMLParser::ParseMetaOptionsImpl(
 if (comphelper::string::getTokenCount(aContent, ';') == 2)
 {
 Date aDate(aContent.getToken(0, ';').toInt32());
-tools::Time aTime(aContent.getToken(1, ';').toInt64());
+auto nTime = aContent.getToken(1, ';').toInt64();
+if (nTime < 0)
+nTime = o3tl::saturating_toggle_sign(nTime);
+tools::Time aTime(nTime);
 DateTime aDateTime(aDate, aTime);
 uDT = aDateTime.GetUNODateTime();
 valid = true;
commit 364b559e2e090824d304e816827e12ba34539994
Author: Caolán McNamara 
AuthorDate: Mon Aug 13 17:22:43 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 13 22:14:04 2018 +0200

ofz: Null-deference

Change-Id: I339cfb54379b1c98a04747046ed599a23d49c220
Reviewed-on: https://gerrit.libreoffice.org/58949
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/drawinglayer/source/tools/emfphelperdata.cxx 
b/drawinglayer/source/tools/emfphelperdata.cxx
index ebbcc2f3f5a7..72674e6c4a1a 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1666,8 +1666,13 @@ namespace emfplushelper
 SAL_INFO("drawinglayer", "EMF+ SetClipPath combine 
mode: " << combineMode);
 SAL_INFO("drawinglayer", "EMF+\tpath in slot: " << 
(flags & 0xff));
 
-EMFPPath& path = 
*static_cast(maEMFPObjects[flags & 0xff].get());
-::basegfx::B2DPolyPolygon& 
clipPoly(path.GetPolygon(*this));
+EMFPPath *path = 
static_cast(maEMFPObjects[flags & 0xff].get());
+if (!path)
+{
+break;
+}
+
+::basegfx::B2DPolyPolygon& 
clipPoly(path->GetPolygon(*this));
 // clipPoly.transform(rState.mapModeTransform);
 
 HandleNewClipRegion( 
combineClip(mrPropertyHolders.Current().getClipPolyPolygon(), combineMode, 
clipPoly), mrTargetHolders, mrPropertyHolders);
@@ -1679,6 +1684,10 @@ namespace emfplushelper
 SAL_INFO("drawinglayer", "EMF+ SetClipRegion");
 SAL_INFO("drawinglayer", "EMF+\tregion in slot: " << 
(flags & 0xff) << " combine mode: " << combineMode);
 EMFPRegion *region = 
static_cast(maEMFPObjects[flags & 0xff].get());
+if (!region)
+{
+break;
+}
 
 
HandleNewClipRegion(combineClip(mrPropertyHolders.Current().getClipPolyPolygon(),
 combineMode, region->regionPolyPolygon), mrTargetHolders, mrPropertyHolders);
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/basegfx sd/Library_sd.mk sd/source solenv/clang-format

2018-07-16 Thread Libreoffice Gerrit user
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx   |2 
 drawinglayer/source/processor3d/zbufferprocessor3d.cxx |2 
 include/basegfx/raster/bpixelraster.hxx|   78 -
 include/basegfx/raster/bzpixelraster.hxx   |   60 ++--
 sd/Library_sd.mk   |1 
 sd/source/ui/framework/module/ResourceManager.cxx  |  235 -
 sd/source/ui/framework/module/ResourceManager.hxx  |   99 ---
 sd/source/ui/framework/module/SlideSorterModule.cxx|  169 +++-
 sd/source/ui/framework/module/SlideSorterModule.hxx|   51 +++
 solenv/clang-format/blacklist  |3 
 10 files changed, 254 insertions(+), 446 deletions(-)

New commits:
commit c2b0e016e246c6a70a7c41c1088cda6cf122e1b7
Author: Noel Grandin 
AuthorDate: Mon Jul 16 09:17:21 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 16 13:35:37 2018 +0200

loplugin:mergeclasses merge ResourceManager into SlideSorterModule

Change-Id: If78dc81e41180e7449b389e36223ee78d6ac91ec
Reviewed-on: https://gerrit.libreoffice.org/57486
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 7e165c3ec7a6..563f0d833ee8 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -247,7 +247,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/framework/module/ImpressModule \
sd/source/ui/framework/module/ModuleController \
sd/source/ui/framework/module/PresentationModule \
-   sd/source/ui/framework/module/ResourceManager \
sd/source/ui/framework/module/ShellStackGuard \
sd/source/ui/framework/module/SlideSorterModule \
sd/source/ui/framework/module/ToolBarModule \
diff --git a/sd/source/ui/framework/module/ResourceManager.cxx 
b/sd/source/ui/framework/module/ResourceManager.cxx
deleted file mode 100644
index fc8d0961f030..
--- a/sd/source/ui/framework/module/ResourceManager.cxx
+++ /dev/null
@@ -1,235 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "ResourceManager.hxx"
-
-#include 
-#include 
-#include 
-
-#include 
-
-using namespace css;
-using namespace css::uno;
-using namespace css::drawing::framework;
-
-using ::sd::framework::FrameworkHelper;
-
-namespace {
-static const sal_Int32 ResourceActivationRequestEvent = 0;
-static const sal_Int32 ResourceDeactivationRequestEvent = 1;
-}
-
-namespace sd { namespace framework {
-
-class ResourceManager::MainViewContainer
-: public ::std::set
-{
-public:
-MainViewContainer() {}
-};
-
-//= ResourceManager ===
-
-ResourceManager::ResourceManager (
-const Reference& rxController,
-const Reference& rxResourceId)
-: ResourceManagerInterfaceBase(MutexOwner::maMutex),
-  mxConfigurationController(),
-  mpActiveMainViewContainer(new MainViewContainer()),
-  mxResourceId(rxResourceId),
-  mxMainViewAnchorId(FrameworkHelper::CreateResourceId(
-  FrameworkHelper::msCenterPaneURL)),
-  msCurrentMainViewURL()
-{
-Reference xControllerManager (rxController, UNO_QUERY);
-if (xControllerManager.is())
-{
-mxConfigurationController = 
xControllerManager->getConfigurationController();
-
-if (mxConfigurationController.is())
-{
-uno::Reference const xComppnent(
-mxConfigurationController, UNO_QUERY_THROW);
-xComppnent->addEventListener(this);
-mxConfigurationController->addConfigurationChangeListener(
-this,
-FrameworkHelper::msResourceActivationRequestEvent,
-makeAny(ResourceActivationRequestEvent));
-mxConfigurationController->addConfigurationChangeListener(
-this,
-FrameworkHelper::msResourceDeactivationRequestEvent,
-makeAny(ResourceDeactivationRequestEvent));
-}
-}
-}
-
-ResourceManager::~ResourceManager()
-{
-}
-
-void ResourceManager::AddActiveMainView (
-const OUString& 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source svtools/source

2018-04-29 Thread Noel Grandin
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx |   14 +++---
 svtools/source/table/tablecontrol_impl.cxx   |9 -
 svtools/source/table/tablecontrol_impl.hxx   |4 ++--
 3 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit 6676d32077d74ec03dfe736c081e41b4b2059c5c
Author: Noel Grandin 
Date:   Tue Apr 24 15:23:22 2018 +0200

loplugin:useuniqueptr in Executor

Change-Id: I3b21b4438f5762aa9960a121ba5826f47d6e9c68
Reviewed-on: https://gerrit.libreoffice.org/53603
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx 
b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 46e25920c769..35024d9bc684 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -386,16 +386,16 @@ namespace drawinglayer
 class Executor : public comphelper::ThreadTask
 {
 private:
-processor3d::ZBufferProcessor3D*
mpZBufferProcessor3D;
+std::unique_ptr 
mpZBufferProcessor3D;
 const primitive3d::Primitive3DContainer&
mrChildren3D;
 
 public:
 explicit Executor(
 std::shared_ptr 
const & rTag,
-processor3d::ZBufferProcessor3D* 
pZBufferProcessor3D,
+
std::unique_ptr pZBufferProcessor3D,
 const primitive3d::Primitive3DContainer& 
rChildren3D)
 :   comphelper::ThreadTask(rTag),
-mpZBufferProcessor3D(pZBufferProcessor3D),
+
mpZBufferProcessor3D(std::move(pZBufferProcessor3D)),
 mrChildren3D(rChildren3D)
 {
 }
@@ -404,7 +404,7 @@ namespace drawinglayer
 {
 mpZBufferProcessor3D->process(mrChildren3D);
 mpZBufferProcessor3D->finish();
-delete mpZBufferProcessor3D;
+mpZBufferProcessor3D.reset();
 }
 };
 
@@ -413,7 +413,7 @@ namespace drawinglayer
 
 for(sal_Int32 a(0); a < nThreadCount; a++)
 {
-processor3d::ZBufferProcessor3D* 
pNewZBufferProcessor3D = new processor3d::ZBufferProcessor3D(
+std::unique_ptr 
pNewZBufferProcessor3D(new processor3d::ZBufferProcessor3D(
 aViewInformation3D,
 getSdrSceneAttribute(),
 getSdrLightingAttribute(),
@@ -423,8 +423,8 @@ namespace drawinglayer
 fFullViewSizeY,
 aBZPixelRaster,
 nLinesPerThread * a,
-a + 1 == nThreadCount ? 
aBZPixelRaster.getHeight() : nLinesPerThread * (a + 1));
-Executor* pExecutor = new Executor(aTag, 
pNewZBufferProcessor3D, getChildren3D());
+a + 1 == nThreadCount ? 
aBZPixelRaster.getHeight() : nLinesPerThread * (a + 1)));
+Executor* pExecutor = new Executor(aTag, 
std::move(pNewZBufferProcessor3D), getChildren3D());
 rThreadPool.pushTask(pExecutor);
 }
 
commit 9a2f5100711232da048f82c80f65913be32ba831
Author: Noel Grandin 
Date:   Tue Apr 24 15:12:19 2018 +0200

loplugin:useuniqueptr in TableControl_Impl

Change-Id: Ida89f2a72395e0a07d57100fda10fa0f739d9eef
Reviewed-on: https://gerrit.libreoffice.org/53602
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svtools/source/table/tablecontrol_impl.cxx 
b/svtools/source/table/tablecontrol_impl.cxx
index 8c493e12c787..99428e8b1317 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -230,14 +230,13 @@ namespace svt { namespace table
 ,m_pVScroll ( nullptr  )
 ,m_pHScroll ( nullptr  )
 ,m_pScrollCorner( nullptr  )
-,m_pSelEngine   (   )
 ,m_aSelectedRows(   )
 ,m_pTableFunctionSet( new TableFunctionSet( this  ) )
 ,m_nAnchor  ( -1   

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/drawinglayer svgio/source

2016-05-22 Thread Noel Grandin
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx   |   18 +--
 drawinglayer/source/primitive2d/textbreakuphelper.cxx|8 ++--
 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx |2 -
 include/drawinglayer/primitive2d/svggradientprimitive2d.hxx  |   16 -
 include/drawinglayer/primitive2d/textbreakuphelper.hxx   |   10 +++---
 svgio/source/svgreader/svggradientnode.cxx   |8 ++--
 6 files changed, 31 insertions(+), 31 deletions(-)

New commits:
commit bc9459f095c55609f4d90533c0f11f17922ebb34
Author: Noel Grandin 
Date:   Sun May 22 12:56:59 2016 +0200

Convert BreakupUnit to scoped enum

Change-Id: Icda4584c79a8af2c2e5fc5a29c498f7869641aa5
Reviewed-on: https://gerrit.libreoffice.org/25299
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/drawinglayer/source/primitive2d/textbreakuphelper.cxx 
b/drawinglayer/source/primitive2d/textbreakuphelper.cxx
index 49a2f11..91cde4f 100644
--- a/drawinglayer/source/primitive2d/textbreakuphelper.cxx
+++ b/drawinglayer/source/primitive2d/textbreakuphelper.cxx
@@ -152,7 +152,7 @@ namespace drawinglayer
 
pTextDecoratedPortionPrimitive2D->getUnderlineAbove(),
 
pTextDecoratedPortionPrimitive2D->getTextStrikeout(),
 
-// reset WordLineMode when BreakupUnit_word is 
executed; else copy original
+// reset WordLineMode when BreakupUnit::Word 
is executed; else copy original
 !bWordLineMode && 
pTextDecoratedPortionPrimitive2D->getWordLineMode(),
 
 
pTextDecoratedPortionPrimitive2D->getTextEmphasisMark(),
@@ -205,7 +205,7 @@ namespace drawinglayer
 
 switch(aBreakupUnit)
 {
-case BreakupUnit_character:
+case BreakupUnit::Character:
 {
 sal_Int32 nDone;
 sal_Int32 
nNextCellBreak(xBreakIterator->nextCharacters(rTxt, nTextPosition, rLocale, 
css::i18n::CharacterIteratorMode::SKIPCELL, 0, nDone));
@@ -224,7 +224,7 @@ namespace drawinglayer
 breakupPortion(aTempResult, nCurrent, a - nCurrent, 
false);
 break;
 }
-case BreakupUnit_word:
+case BreakupUnit::Word:
 {
 css::i18n::Boundary 
nNextWordBoundary(xBreakIterator->getWordBoundary(rTxt, nTextPosition, rLocale, 
css::i18n::WordType::ANY_WORD, true));
 sal_Int32 a(nTextPosition);
@@ -260,7 +260,7 @@ namespace drawinglayer
 }
 break;
 }
-case BreakupUnit_sentence:
+case BreakupUnit::Sentence:
 {
 sal_Int32 
nNextSentenceBreak(xBreakIterator->endOfSentence(rTxt, nTextPosition, rLocale));
 sal_Int32 a(nTextPosition);
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx 
b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index d8d2f9a..cefbbb8 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -161,7 +161,7 @@ namespace drawinglayer
 // support for single word mode; split to single word 
primitives
 // using TextBreakupHelper
 const TextBreakupHelper aTextBreakupHelper(*this);
-const Primitive2DContainer& 
aBroken(aTextBreakupHelper.getResult(BreakupUnit_word));
+const Primitive2DContainer& 
aBroken(aTextBreakupHelper.getResult(BreakupUnit::Word));
 
 if(!aBroken.empty())
 {
diff --git a/include/drawinglayer/primitive2d/textbreakuphelper.hxx 
b/include/drawinglayer/primitive2d/textbreakuphelper.hxx
index 702d5bf..73a57f7 100644
--- a/include/drawinglayer/primitive2d/textbreakuphelper.hxx
+++ b/include/drawinglayer/primitive2d/textbreakuphelper.hxx
@@ -30,11 +30,11 @@ namespace drawinglayer
 {
 namespace primitive2d
 {
-enum BreakupUnit
+enum class BreakupUnit
 {
-BreakupUnit_character,
-BreakupUnit_word,
-BreakupUnit_sentence
+Character,
+Word,
+Sentence
 };
 
 class DRAWINGLAYER_DLLPUBLIC TextBreakupHelper
@@ -69,7 +69,7 @@ namespace drawinglayer
 virtual ~TextBreakupHelper();
 
 /// get result
-const Primitive2DContainer& getResult(BreakupUnit aBreakupUnit = 
BreakupUnit_character) const;
+const Primitive2DContainer& getResult(BreakupUnit aBreakupUnit = 
BreakupUnit::Character) const;
   

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source vcl/headless

2015-11-27 Thread Caolán McNamara
 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |   33 +++--
 vcl/headless/svpgdi.cxx   |   50 +++---
 2 files changed, 41 insertions(+), 42 deletions(-)

New commits:
commit 26c32cfee9fc9a769adba19f455e4d6c13b6d89d
Author: Caolán McNamara 
Date:   Fri Nov 27 16:10:10 2015 +

Resolves: rhbz#1283426 using vdevs based on now dead physical devs is unsafe

This is the same problem that

commit 133e04fc1a870c0aad207e82eefeeeceaba5dc6d
Author: Caolán McNamara 
Date:   Wed Jun 17 09:23:32 2015 +0100

Resolves: tdf#91880 Invalidate graphics when the gtk window is destroyed

not just when the GtkSalFrame is dtored

tried to fix, but that just made it more unlikely to fail

Change-Id: Icba750c787adb6cd5c5ed0874ef07e6201c4cf25

diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx 
b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index e7ff5a1..fde5ba9 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -43,6 +43,11 @@ namespace
 // allocated/used buffers (remembered to allow deleting them in 
destructor)
 aBuffersmaUsedBuffers;
 
+// remember what outputdevice was the template passed to 
VirtualDevice::Create
+// so we can test if that OutputDevice was disposed before reusing a
+// virtualdevice because that isn't safe to do at least for Gtk2
+std::map< VclPtr, VclPtr > 
maDeviceTemplates;
+
 public:
 VDevBuffer();
 virtual ~VDevBuffer();
@@ -87,14 +92,14 @@ namespace
 
 sal_Int32 nBits = bMonoChrome ? 1 : rOutDev.GetBitCount();
 
+bool bOkay(false);
 if(!maFreeBuffers.empty())
 {
-bool bOkay(false);
 aBuffers::iterator aFound(maFreeBuffers.end());
 
 for(aBuffers::iterator a(maFreeBuffers.begin()); a != 
maFreeBuffers.end(); ++a)
 {
-OSL_ENSURE(*a, "Empty pointer in VDevBuffer (!)");
+assert(*a && "Empty pointer in VDevBuffer (!)");
 
 if (nBits == (*a)->GetBitCount())
 {
@@ -144,10 +149,25 @@ namespace
 {
 pRetval = *aFound;
 maFreeBuffers.erase(aFound);
+}
+}
 
-if(bOkay)
+if (pRetval)
+{
+// found a suitable cached virtual device, but the
+// outputdevice it was based on has been disposed,
+// drop it and create a new one instead as reusing
+// such devices is unsafe under at least Gtk2
+if (maDeviceTemplates[pRetval]->isDisposed())
+{
+maDeviceTemplates.erase(pRetval);
+pRetval = nullptr;
+}
+else
+{
+if (bOkay)
 {
-if(bClear)
+if (bClear)
 {
 pRetval->Erase(Rectangle(0, 0, rSizePixel.getWidth(), 
rSizePixel.getHeight()));
 }
@@ -163,6 +183,7 @@ namespace
 if(!pRetval)
 {
 pRetval = VclPtr::Create(rOutDev, bMonoChrome ? 
DeviceFormat::BITMASK : DeviceFormat::DEFAULT);
+maDeviceTemplates[pRetval] = 
 pRetval->SetOutputSizePixel(rSizePixel, bClear);
 }
 else
@@ -196,7 +217,9 @@ namespace
 
 while(!maFreeBuffers.empty())
 {
-(*(maFreeBuffers.end() - 1)).disposeAndClear();
+aBuffers::iterator aLastOne(maFreeBuffers.end() - 1);
+maDeviceTemplates.erase(*aLastOne);
+aLastOne->disposeAndClear();
 maFreeBuffers.pop_back();
 }
 }
commit 22a35a56b385b1a08d20eb609f35ab506cc8333e
Author: Caolán McNamara 
Date:   Thu Nov 26 11:18:40 2015 +

try to get this working on linux baseline

Change-Id: If17327385423d62eeb201e6754a7a45f0640c2f8

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 8783ab6..6ad1458 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -66,7 +66,7 @@ rDevice
 
 namespace
 {
-#if CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR < 10
+#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
 struct cairo_rectangle_int_t
 {
 double x;
@@ -83,7 +83,8 @@ namespace
 
 cairo_clip_extents(cr, , , , );
 extents.x = x1, extents.y = x2, extents.width = x2-x1, extents.height 
= y2-y1;
-#if CAIRO_VERSION_MAJOR > 1 || (CAIRO_VERSION_MAJOR == 1 && 
CAIRO_VERSION_MINOR >= 10)
+
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
 cairo_region_t *region = cairo_region_create_rectangle();
 
 cairo_fill_extents(cr, , , , );
@@ -104,7 +105,8 @@ namespace
 
 cairo_clip_extents(cr, , , , );
 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source framework/inc odk/examples offapi/com sal/osl sc/source sd/source svx/source sw/source xmloff/source

2015-03-03 Thread Julien Nabet
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx 
  |2 +-
 framework/inc/classes/filtercachedata.hxx  
  |2 +-
 
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
 |2 +-
 offapi/com/sun/star/awt/XMenu.idl  
  |4 ++--
 offapi/com/sun/star/awt/XPopupMenu.idl 
  |2 +-
 sal/osl/unx/uunxapi.cxx
  |2 +-
 sc/source/core/data/conditio.cxx   
  |2 +-
 sc/source/core/data/docpool.cxx
  |4 ++--
 sd/source/ui/slideshow/slideshowimpl.cxx   
  |2 +-
 sd/source/ui/unoidl/unomodel.cxx   
  |4 ++--
 svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx  
  |2 +-
 sw/source/core/graphic/ndgrf.cxx   
  |2 +-
 sw/source/core/inc/tabfrm.hxx  
  |2 +-
 xmloff/source/meta/xmlmetae.cxx
  |2 +-
 14 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit d35d893c3d256223efc59e5bbdacce08352fd901
Author: Julien Nabet serval2...@yahoo.fr
Date:   Tue Mar 3 23:27:39 2015 +0100

Typos

Change-Id: I0aef0c185457687aa0e40a4a1e8024d9e691093f

diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx 
b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index 42b087b..f56b4b9 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -475,7 +475,7 @@ namespace drawinglayer
 // can only happen when SpreadMethod is Spread_reflect 
or Spread_repeat,
 // else the start and end pads are already created and 
fPos == aUnitRange.getMaxX().
 // Its possible to express the repeated linear 
gradient by adding the
-// transformed central run. Crete it this way
+// transformed central run. Create it this way
 Primitive2DSequence 
aTargetColorEntries(Primitive2DVectorToPrimitive2DSequence(aTargetColor));
 Primitive2DSequence 
aTargetOpacityEntries(Primitive2DVectorToPrimitive2DSequence(aTargetOpacity));
 aTargetColor.clear();
diff --git a/framework/inc/classes/filtercachedata.hxx 
b/framework/inc/classes/filtercachedata.hxx
index 9f2ec18..7bb3d24 100644
--- a/framework/inc/classes/filtercachedata.hxx
+++ b/framework/inc/classes/filtercachedata.hxx
@@ -553,7 +553,7 @@ class DataContainer
 };
 
 
/*-
-@short  capsulate configuration access for fiter configuration
+@short  capsulate configuration access for filter configuration
 @descr  We use the ConfigItem mechanism to read/write values 
from/to configuration.
 This implementation could be used to handle standard AND 
additional filter configurations in the same way.
 We set a data container pointer for filling or reading ... 
this class use it temp.
diff --git 
a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
 
b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
index bf3cea5..715854a 100644
--- 
a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
+++ 
b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
@@ -60,7 +60,7 @@ import com.sun.star.document.XFilter;
 User can decide at runtime which functionality really should
 be used by selecting it in an extra filter property dialog.
 
-So we show how a filter works fro iport/export, use or create
+So we show how a filter works for import/export, use or create
 streams and how a filter can offer properties for filtering
 which can be edit by the user.
  -*/
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index a984816..5a2a326 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -295,7 +295,7 @@ int open_c(const char *cpPath, int oflag, int mode)
 // A new file was created. Check if it is outside the 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/drawinglayer

2014-05-29 Thread Tor Lillqvist
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx |1 +
 include/drawinglayer/geometry/viewinformation2d.hxx |2 +-
 include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx |2 +-
 include/drawinglayer/primitive2d/invertprimitive2d.hxx  |2 +-
 include/drawinglayer/primitive2d/maskprimitive2d.hxx|2 +-
 include/drawinglayer/primitive2d/objectinfoprimitive2d.hxx  |2 +-
 include/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx |2 +-
 include/drawinglayer/primitive2d/texteffectprimitive2d.hxx  |2 +-
 include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx   |4 ++--
 include/drawinglayer/primitive2d/textprimitive2d.hxx|2 +-
 include/drawinglayer/primitive2d/wrongspellprimitive2d.hxx  |2 +-
 include/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx |2 +-
 include/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx   |2 +-
 include/drawinglayer/processor2d/baseprocessor2d.hxx|2 +-
 14 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 1679baf6967fe4a80be5ce84a8e17bd5b27f5da1
Author: Tor Lillqvist t...@collabora.com
Date:   Thu May 29 14:27:55 2014 +0300

Comment seems incorrect

Change-Id: I7d81b9b616fc4b4b324d959282b6a71ce681fba5

diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx 
b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 836d72e..9ef1e55 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -2228,6 +2228,7 @@ namespace
 case META_MASK_ACTION :
 {
 /** CHECKED, WORKS WELL: Simply same as META_BMP_ACTION */
+/** Huh, no it isn't!? */
 const MetaMaskAction* pA = (const MetaMaskAction*)pAction;
 const BitmapEx aBitmapEx(createMaskBmpEx(pA-GetBitmap(), 
pA-GetColor()));
 
commit 3f0678bfc8011a33d7bdc790665648e39994c657
Author: Tor Lillqvist t...@collabora.com
Date:   Thu May 29 14:17:29 2014 +0300

Some spelling corrections

Change-Id: Ie77596a51a6a37e9f59a6ba14bdde7994efd29ad

diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx 
b/include/drawinglayer/geometry/viewinformation2d.hxx
index eca24c9..2358c75 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -135,7 +135,7 @@ namespace drawinglayer
 double getViewTime() const;
 const ::com::sun::star::uno::Reference 
::com::sun::star::drawing::XDrawPage  getVisualizedPage() const;
 
-/// On-demand prepared Object to View transformation and it's 
inerse for convenience
+/// On-demand prepared Object to View transformation and its 
inverse for convenience
 const basegfx::B2DHomMatrix getObjectToViewTransformation() const;
 const basegfx::B2DHomMatrix 
getInverseObjectToViewTransformation() const;
 
diff --git a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx 
b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
index 2df84d4..2b48c91 100644
--- a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
@@ -40,7 +40,7 @@ namespace drawinglayer
 a valid decomposition if a valid Viewport is given in the
 ViewInformation2D at decomposition time.
 
-It will try to buffer it's last decomposition using maLastViewport
+It will try to buffer its last decomposition using maLastViewport
 to detect changes in the get2DDecomposition call.
  */
 class DRAWINGLAYER_DLLPUBLIC BackgroundColorPrimitive2D : public 
BufferedDecompositionPrimitive2D
diff --git a/include/drawinglayer/primitive2d/invertprimitive2d.hxx 
b/include/drawinglayer/primitive2d/invertprimitive2d.hxx
index 0e9dbe0..1351cc3 100644
--- a/include/drawinglayer/primitive2d/invertprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/invertprimitive2d.hxx
@@ -34,7 +34,7 @@ namespace drawinglayer
 
 This is a helper class which encapsulates geometry that should be
 painted XOR, e.g. old cursor visualisations. It decomposes to
-it's content, so when not supporting it, the contained geometry
+its content, so when not supporting it, the contained geometry
 will be visualized normally.
 Unfortunately this is still needed, but hard to support on various
 systems. XOR painting needs read access to the target, so modern
diff --git a/include/drawinglayer/primitive2d/maskprimitive2d.hxx 
b/include/drawinglayer/primitive2d/maskprimitive2d.hxx
index e2111c7..1aae7c1 100644
--- a/include/drawinglayer/primitive2d/maskprimitive2d.hxx
+++ 

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

2014-04-29 Thread Caolán McNamara
 drawinglayer/source/processor2d/vclprocessor2d.cxx |6 --
 svx/source/svdraw/svdedtv2.cxx |6 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 3db00c554b38ee6c1b6e969768da53db4dc2f92a
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 29 10:11:28 2014 +0100

Resolves: fdo#62038 EPS not rendered in drawinglayer code paths

It attempts to see if the outputdevice can draw the true EPS
but if the outputdevice is in record-only mode it just stashs a
new eps metaaction, and this time with no fallback image, and
happily returns ok so the drawing layer ends up with a new
replacement eps metaction, except with no preview anymore.

Perhaps DrawEPS should return false here, but its safer this way

Change-Id: I0e0b16e4b2be00802a1af1f8147500d816a3c5de

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index b7c3bfe..d23e5b5 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -1353,12 +1353,14 @@ namespace drawinglayer
 
 if(!aRectangle.IsEmpty())
 {
+bool bWillReallyRender = 
mpOutputDevice-IsDeviceOutputNecessary();
 // try to paint EPS directly without fallback visualisation
-const bool bEPSPaintedDirectly(mpOutputDevice-DrawEPS(
+const bool bEPSPaintedDirectly = bWillReallyRender 
+mpOutputDevice-DrawEPS(
 aRectangle.TopLeft(),
 aRectangle.GetSize(),
 rEpsPrimitive2D.getGfxLink(),
-0));
+0);
 
 if(!bEPSPaintedDirectly)
 {
commit e34c437d2e98753159c9bd82516386143d707d93
Author: Armin Le Grand a...@apache.org
Date:   Mon Apr 28 16:57:14 2014 +

Resolves: #i124760# ensure that only the created object is selected

(cherry picked from commit b6189665e0143d68cf2fe225eca77bcf0454a107)

Conflicts:
svx/source/svdraw/svdedtv2.cxx

Change-Id: I4ebf95a5c42fd2348dbb79f99881217a74301197

diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 055e3f0..056947c 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1136,6 +1136,12 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
 pInsOL-InsertObject(pPath, nInsPos, aReason);
 if( bUndo )
 
AddUndo(GetModel()-GetSdrUndoFactory().CreateUndoNewObject(*pPath));
+
+// #i124760# To have a correct selection with only the new object 
it is necessary to
+// unmark all objects first. If not doing so, there may remain 
invalid pointers to objects
+//:Not needed for aw080 (!)
+UnmarkAllObj(pInsPV);
+
 MarkObj(pPath, pInsPV, false, true);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-26 Thread Tomaž Vajngerl
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   10 +++
 vcl/source/filter/wmf/winmtf.cxx|   22 +++-
 vcl/source/filter/wmf/winmtf.hxx|2 +
 3 files changed, 28 insertions(+), 6 deletions(-)

New commits:
commit 17ca93a6e592d3109e47c756fcfe8ac975acae5f
Author: Tomaž Vajngerl tomaz.vajng...@collabora.com
Date:   Sat Apr 26 19:20:22 2014 +0200

fdo#74336 need to transform dash length / dot length / distance

Dash length, dot length and distance also need to be world
transformed to be compatible with device metrics.

Change-Id: I57c04f5010006aaf8c1c32e0949cb39b7f2bc67d

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 7aa7337..7c4b01d 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -473,6 +473,20 @@ void WinMtfOutput::ImplMap( Font rFont )
 rFont.SetOrientation( 3600 - rFont.GetOrientation() );
 }
 
+sal_Int32 WinMtfOutput::ImplConvertWidth(const sal_Int32 aWidth)
+{
+Size aSize(aWidth, 0);
+return ImplMap(aSize).Width();
+}
+
+void WinMtfOutput::ImplMap(LineInfo rLineInfo)
+{
+rLineInfo.SetWidth(ImplConvertWidth(rLineInfo.GetWidth()));
+rLineInfo.SetDashLen(ImplConvertWidth(rLineInfo.GetDashLen()));
+rLineInfo.SetDotLen(ImplConvertWidth(rLineInfo.GetDotLen()));
+rLineInfo.SetDistance(ImplConvertWidth(rLineInfo.GetDistance()));
+}
+
 Polygon WinMtfOutput::ImplMap( Polygon rPolygon )
 {
 sal_uInt16 nPoints = rPolygon.GetSize();
@@ -682,9 +696,7 @@ void WinMtfOutput::CreateObject( GDIObjectType eType, void* 
pStyle )
 else if ( eType == GDI_PEN )
 {
 WinMtfLineStyle* pLineStyle = (WinMtfLineStyle*) pStyle;
-Size aSize(pLineStyle-aLineInfo.GetWidth(), 0);
-aSize = ImplMap(aSize);
-pLineStyle-aLineInfo.SetWidth(aSize.Width());
+ImplMap(pLineStyle-aLineInfo);
 }
 }
 sal_uInt32 nIndex;
@@ -716,9 +728,7 @@ void WinMtfOutput::CreateObject( sal_Int32 nIndex, 
GDIObjectType eType, void* pS
 else if ( eType == GDI_PEN )
 {
 WinMtfLineStyle* pLineStyle = (WinMtfLineStyle*) pStyle;
-Size aSize(pLineStyle-aLineInfo.GetWidth(), 0);
-aSize = ImplMap(aSize);
-pLineStyle-aLineInfo.SetWidth(aSize.Width());
+ImplMap(pLineStyle-aLineInfo);
 }
 }
 if ( (sal_uInt32)nIndex = vGDIObj.size() )
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 035686c..52b1848 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -619,6 +619,8 @@ class WinMtfOutput
 SizeImplMap( const Size rSz );
 Rectangle   ImplMap( const Rectangle rRectangle );
 voidImplMap( Font rFont );
+sal_Int32   ImplConvertWidth(const sal_Int32 aWidth);
+voidImplMap(LineInfo rLineInfo);
 PolygonImplMap( Polygon rPolygon );
 PolyPolygonImplMap( PolyPolygon rPolyPolygon );
 PolygonImplScale( Polygon rPolygon );
commit 6d0005d95f20a326fe308a7c59dd2801f0d0b241
Author: Tomaž Vajngerl tomaz.vajng...@collabora.com
Date:   Sat Apr 26 19:13:31 2014 +0200

fdo#74336 draw hairline if line width is small

RenderPolygonStrokePrimitive2D draws a simple hairline if the
line width is less than 1.0 (and less than 1.5 if no AA is used)
so in tryDrawPolygonStrokePrimitive2DDirect we need to reflect
this behaviour - otherwise the lines are drawn too small.

Change-Id: Icd3d8f35a00346b1d624b6df010f43ed21968d04

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 73d12f3..1a4db95 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -237,6 +237,16 @@ namespace drawinglayer
 fLineWidth = aLineWidth.getLength();
 }
 
+// draw simple hairline for small line widths
+// see also RenderPolygonStrokePrimitive2D which is used if this 
try fails
+bool bIsAntiAliasing = getOptionsDrawinglayer().IsAntiAliasing();
+if (   (basegfx::fTools::lessOrEqual(fLineWidth, 1.0)  
bIsAntiAliasing)
+|| (basegfx::fTools::lessOrEqual(fLineWidth, 1.5)  
!bIsAntiAliasing))
+{
+// draw simple hairline
+fLineWidth = 0.0;
+}
+
 bool bHasPoints(false);
 bool bTryWorked(false);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source sd/source vcl/source

2014-04-25 Thread Caolán McNamara
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx |4 
 sd/source/ui/view/drviewsa.cxx  |   92 
 vcl/source/gdi/font.cxx |6 -
 3 files changed, 50 insertions(+), 52 deletions(-)

New commits:
commit 21334f74a53197c32863fdf3d7e6f365f1b868b7
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Apr 25 16:30:09 2014 +0100

Revert give empty constructed default font a default height

and make a real copy of the TargetFont

the 0,0 font size appears to mean default size so it can
take the desktop env font size or some such, with a hard-coded
value then the various bold entries in the UI are huge

This reverts commit 121aac37673c1a8142db01e26e50be6de7b36987.

Change-Id: Iec1d3867403808370d89d6b5ad2fec60ffdcd881

diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx 
b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 46d4467..8a19cbe 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -2119,9 +2119,9 @@ namespace
 
 // for sub-Mteafile contents, do start with 
new, default render state
 // #i124686# ...but copy font, this is already 
set accordingly
-const Font rTargetFont = 
rPropertyHolders.Current().getFont();
+Font aTargetFont = 
rPropertyHolders.Current().getFont();
 rPropertyHolders.PushDefault();
-
rPropertyHolders.Current().setFont(rTargetFont);
+
rPropertyHolders.Current().setFont(aTargetFont);
 
 interpretMetafile(aGDIMetaFile, 
rTargetHolders, rPropertyHolders, rViewInformation);
 xSubContent = 
rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 60230e3..489304e 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -63,12 +63,6 @@ Impl_Font::Impl_Font() :
 mbVertical  = false;
 mbTransparent   = true;
 mbConfigLookup  = false;
-
-// #i124686# the Size is defaulted to (0,0) when default constructed,
-// this is not useful for a default font. Init it to a useful default
-// so that the Font::Font() constructor which uses a 'naked' static
-// Impl_Font instance (aStaticImplFont) creates a useful default font
-maSize = Size(0, 16);
 }
 
 Impl_Font::Impl_Font( const Impl_Font rImplFont )
commit 6643b783b4d8c298eae716a36a1776692498f00b
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Apr 25 12:03:50 2014 +0100

Related: rhbz#109 GetSdrPageView can return NULL

Change-Id: I560bf74235728fb39156c32b47dd40f181dada16

diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 5cc9d32..8e1e09d 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -656,55 +656,59 @@ void DrawViewShell::GetStatusBarState(SfxItemSet rSet)
 }
 }
 
-Point aPos = GetActiveWindow()-PixelToLogic(maMousePos);
-mpDrawView-GetSdrPageView()-LogicToPagePos(aPos);
-Fraction aUIScale(GetDoc()-GetUIScale());
-aPos.X() = Fraction(aPos.X()) / aUIScale;
-aPos.Y() = Fraction(aPos.Y()) / aUIScale;
-
-// position- and size items
-if ( mpDrawView-IsAction() )
+SdrPageView* pPageView = mpDrawView-GetSdrPageView();
+if (pPageView)
 {
-Rectangle aRect;
-mpDrawView-TakeActionRect( aRect );
-
-if ( aRect.IsEmpty() )
-rSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
-else
-{
-mpDrawView-GetSdrPageView()-LogicToPagePos(aRect);
-aPos = aRect.TopLeft();
-aPos.X() = Fraction(aPos.X()) / aUIScale;
-aPos.Y() = Fraction(aPos.Y()) / aUIScale;
-rSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos) );
-Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - 
aRect.Top() );
-aSize.Height() = Fraction(aSize.Height()) / aUIScale;
-aSize.Width()  = Fraction(aSize.Width())  / aUIScale;
-rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
-}
-}
-else
-{
-if ( mpDrawView-AreObjectsMarked() )
+Point aPos = GetActiveWindow()-PixelToLogic(maMousePos);
+pPageView-LogicToPagePos(aPos);
+Fraction aUIScale(GetDoc()-GetUIScale());
+aPos.X() = Fraction(aPos.X()) / aUIScale;
+aPos.Y() = Fraction(aPos.Y()) / aUIScale;
+
+// position- and size items
+if ( mpDrawView-IsAction() )
 {
-Rectangle aRect = mpDrawView-GetAllMarkedRect();
-mpDrawView-GetSdrPageView()-LogicToPagePos(aRect);
-
-// Show the position 

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

2014-04-24 Thread Armin Le Grand
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx |7 ++-
 vcl/source/gdi/font.cxx |6 ++
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 7cf38082fd797b316d0f8b3e8227244362755efd
Author: Armin Le Grand a...@apache.org
Date:   Wed Apr 23 16:20:16 2014 +

Resolves: #i124686# reuse already set font for interpreting...

the MetaFile action META_TEXTRECT_ACTION correctly

(cherry picked from commit 7ce0a0a7680255159beae7726ec63d539ef0c7f9)

Change-Id: If802a58ae0fb38292d5a875d85448cc2c3967066

diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx 
b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index ab098ad..46d4467 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -2116,8 +2116,13 @@ namespace
 drawinglayer::primitive2d::Primitive2DSequence 
xSubContent;
 {
 rTargetHolders.Push();
-// #i# for sub-Mteafile contents, do start 
with new, default render state
+
+// for sub-Mteafile contents, do start with 
new, default render state
+// #i124686# ...but copy font, this is already 
set accordingly
+const Font rTargetFont = 
rPropertyHolders.Current().getFont();
 rPropertyHolders.PushDefault();
+
rPropertyHolders.Current().setFont(rTargetFont);
+
 interpretMetafile(aGDIMetaFile, 
rTargetHolders, rPropertyHolders, rViewInformation);
 xSubContent = 
rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
 rPropertyHolders.Pop();
commit 121aac37673c1a8142db01e26e50be6de7b36987
Author: Armin Le Grand a...@apache.org
Date:   Wed Apr 23 16:19:30 2014 +

Related: #i124686# give empty constructed default font a default height

(cherry picked from commit 4a7c54e07713f02a5658471e4aa9163de53f7460)

Change-Id: Iaff17eb95d1ad1e1b9bca4388b03703899d9a0db

diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 489304e..60230e3 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -63,6 +63,12 @@ Impl_Font::Impl_Font() :
 mbVertical  = false;
 mbTransparent   = true;
 mbConfigLookup  = false;
+
+// #i124686# the Size is defaulted to (0,0) when default constructed,
+// this is not useful for a default font. Init it to a useful default
+// so that the Font::Font() constructor which uses a 'naked' static
+// Impl_Font instance (aStaticImplFont) creates a useful default font
+maSize = Size(0, 16);
 }
 
 Impl_Font::Impl_Font( const Impl_Font rImplFont )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/drawinglayer include/svx starmath/inc svx/source

2014-03-19 Thread Jan Holesovsky
 drawinglayer/source/primitive2d/openglprimitive2d.cxx  |   32 ++--
 include/drawinglayer/primitive2d/openglprimitive2d.hxx |   33 
 include/svx/sdr/contact/viewcontactofopengl.hxx|   28 +++---
 starmath/inc/node.hxx  |3 -
 svx/source/sdr/contact/viewcontactofopengl.cxx |   34 +++--
 5 files changed, 57 insertions(+), 73 deletions(-)

New commits:
commit 24da9e2538dc8f80fb6ac6d498992f9093495b22
Author: Jan Holesovsky ke...@collabora.com
Date:   Wed Mar 19 11:11:15 2014 +0100

Use sane indentation in new files.

Change-Id: Ida89284c00946d3972c4e45a5453ccfdff99713f

diff --git a/drawinglayer/source/primitive2d/openglprimitive2d.cxx 
b/drawinglayer/source/primitive2d/openglprimitive2d.cxx
index 48724df..3ed333b 100644
--- a/drawinglayer/source/primitive2d/openglprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/openglprimitive2d.cxx
@@ -10,29 +10,23 @@
 #include drawinglayer/primitive2d/openglprimitive2d.hxx
 #include svx/sdr/primitive2d/svx_primitivetypes2d.hxx
 
+using namespace drawinglayer::primitive2d;
 
-namespace drawinglayer
+OpenGLPrimitive2D::OpenGLPrimitive2D(const Point rPos)
+: m_aPos(rPos)
 {
-namespace primitive2d
-{
-
-OpenGLPrimitive2D::OpenGLPrimitive2D(const Point rPos)
-: m_aPos(rPos)
-{
-}
-
-bool OpenGLPrimitive2D::operator==( const BasePrimitive2D rPrimitive 
) const
-{
-if(BasePrimitive2D::operator==(rPrimitive))
-{
-const OpenGLPrimitive2D rCompare = static_cast const 
OpenGLPrimitive2D (rPrimitive);
-return m_aPos == rCompare.getPos();
-}
-return false;
-}
+}
 
-ImplPrimitive2DIDBlock(OpenGLPrimitive2D, 
PRIMITIVE2D_ID_OPENGLPRIMITIVE2D)
+bool OpenGLPrimitive2D::operator==( const BasePrimitive2D rPrimitive ) const
+{
+if(BasePrimitive2D::operator==(rPrimitive))
+{
+const OpenGLPrimitive2D rCompare = static_cast const 
OpenGLPrimitive2D (rPrimitive);
+return m_aPos == rCompare.getPos();
 }
+return false;
 }
 
+ImplPrimitive2DIDBlock(OpenGLPrimitive2D, PRIMITIVE2D_ID_OPENGLPRIMITIVE2D)
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/openglprimitive2d.hxx 
b/include/drawinglayer/primitive2d/openglprimitive2d.hxx
index c251dcb..832a657 100644
--- a/include/drawinglayer/primitive2d/openglprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/openglprimitive2d.hxx
@@ -13,29 +13,28 @@
 #include tools/gen.hxx
 #include drawinglayer/primitive2d/baseprimitive2d.hxx
 
-namespace drawinglayer
-{
-namespace primitive2d
-{
+namespace drawinglayer {
+namespace primitive2d {
 
-class DRAWINGLAYER_DLLPUBLIC OpenGLPrimitive2D : public BasePrimitive2D
-{
-public:
-explicit OpenGLPrimitive2D(const Point rPos);
+/// Primitive to hold data necessary for openGL objects
+class DRAWINGLAYER_DLLPUBLIC OpenGLPrimitive2D : public BasePrimitive2D
+{
+public:
+explicit OpenGLPrimitive2D(const Point rPos);
 
-const Point getPos() const { return m_aPos; }
+const Point getPos() const { return m_aPos; }
 
-virtual bool operator==( const BasePrimitive2D rPrimitive ) const;
+virtual bool operator==( const BasePrimitive2D rPrimitive ) const;
 
-/// provide unique ID
-DeclPrimitive2DIDBlock()
+/// provide unique ID
+DeclPrimitive2DIDBlock()
 
-private:
-Point m_aPos;
-};
+private:
+Point m_aPos;
+};
 
-}
-}
+} // namespace primitive2d
+} // namespace drawinglayer
 
 #endif
 
diff --git a/include/svx/sdr/contact/viewcontactofopengl.hxx 
b/include/svx/sdr/contact/viewcontactofopengl.hxx
index ad96b0c..e5fae8b 100644
--- a/include/svx/sdr/contact/viewcontactofopengl.hxx
+++ b/include/svx/sdr/contact/viewcontactofopengl.hxx
@@ -14,21 +14,21 @@
 
 class SdrOpenGLObj;
 
-namespace sdr
+namespace sdr {
+namespace contact {
+
+class ViewContactOfOpenGL : public ViewContactOfSdrObj
 {
-namespace contact
-{
-class ViewContactOfOpenGL : public ViewContactOfSdrObj
-{
-public:
-explicit ViewContactOfOpenGL(SdrOpenGLObj rOpenGLObj);
-virtual ~ViewContactOfOpenGL();
-
-protected:
-virtual drawinglayer::primitive2d::Primitive2DSequence 
createViewIndependentPrimitive2DSequence() const;
-};
-}
-}
+public:
+explicit ViewContactOfOpenGL(SdrOpenGLObj rOpenGLObj);
+virtual ~ViewContactOfOpenGL();
+
+protected:
+virtual drawinglayer::primitive2d::Primitive2DSequence 
createViewIndependentPrimitive2DSequence() const;
+};
+
+} // namespace contact
+} // namespace sdr
 
 #endif
 
diff --git a/svx/source/sdr/contact/viewcontactofopengl.cxx 
b/svx/source/sdr/contact/viewcontactofopengl.cxx
index 34630ec..054fb99 100644
--- 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source sc/source unusedcode.easy

2013-09-05 Thread Thomas Arnhold
 drawinglayer/source/attribute/fontattribute.cxx|5 -
 drawinglayer/source/attribute/materialattribute3d.cxx  |5 -
 drawinglayer/source/attribute/sdrlightattribute3d.cxx  |5 -
 drawinglayer/source/attribute/sdrobjectattribute3d.cxx |5 -
 drawinglayer/source/geometry/viewinformation2d.cxx |5 -
 sc/source/ui/sidebar/CellLineStyleValueSet.hxx |1 -
 unusedcode.easy|5 -
 7 files changed, 31 deletions(-)

New commits:
commit 7329d9447611242637c8852deec82208cba6ec55
Author: Thomas Arnhold tho...@arnhold.org
Date:   Thu Sep 5 08:25:39 2013 +0200

WaE: -Wunused-private-field

Change-Id: I9f1671d6d8a0b2b7d4c26cb2240a88ab6e74abe5

diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx 
b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
index 711213c..9f66ce2 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
@@ -32,7 +32,6 @@ private:
 sal_uInt16  nSelItem;
 OUStringmaStrUnit[CELL_LINE_STYLE_ENTRIES];
 Image   imgCus;
-boolbCusEnable;
 public:
 CellLineStyleValueSet( Window* pParent, const ResId rResId);
 virtual ~CellLineStyleValueSet();
commit e03225451752ddbe9427d318d1d38c2cc1fbb764
Author: Thomas Arnhold tho...@arnhold.org
Date:   Thu Sep 5 08:00:32 2013 +0200

clean up after my cow wrapper changes

Change-Id: I42fcce936750888388e80db24b529b7543f9f4bf

diff --git a/drawinglayer/source/attribute/fontattribute.cxx 
b/drawinglayer/source/attribute/fontattribute.cxx
index 9f824ed..3a38068 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -145,11 +145,6 @@ namespace drawinglayer
 {
 }
 
-bool FontAttribute::isDefault() const
-{
-return mpFontAttribute.same_object(theGlobalDefault::get());
-}
-
 FontAttribute FontAttribute::operator=(const FontAttribute 
rCandidate)
 {
 mpFontAttribute = rCandidate.mpFontAttribute;
diff --git a/drawinglayer/source/attribute/materialattribute3d.cxx 
b/drawinglayer/source/attribute/materialattribute3d.cxx
index e0a920a..724211c 100644
--- a/drawinglayer/source/attribute/materialattribute3d.cxx
+++ b/drawinglayer/source/attribute/materialattribute3d.cxx
@@ -111,11 +111,6 @@ namespace drawinglayer
 {
 }
 
-bool MaterialAttribute3D::isDefault() const
-{
-return mpMaterialAttribute3D.same_object(theGlobalDefault::get());
-}
-
 MaterialAttribute3D MaterialAttribute3D::operator=(const 
MaterialAttribute3D rCandidate)
 {
 mpMaterialAttribute3D = rCandidate.mpMaterialAttribute3D;
diff --git a/drawinglayer/source/attribute/sdrlightattribute3d.cxx 
b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
index 8b900fb..cc4f2f1 100644
--- a/drawinglayer/source/attribute/sdrlightattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
@@ -92,11 +92,6 @@ namespace drawinglayer
 {
 }
 
-bool Sdr3DLightAttribute::isDefault() const
-{
-return mpSdr3DLightAttribute.same_object(theGlobalDefault::get());
-}
-
 Sdr3DLightAttribute Sdr3DLightAttribute::operator=(const 
Sdr3DLightAttribute rCandidate)
 {
 mpSdr3DLightAttribute = rCandidate.mpSdr3DLightAttribute;
diff --git a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx 
b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
index 77926c5..7ecac3e 100644
--- a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
@@ -148,11 +148,6 @@ namespace drawinglayer
 {
 }
 
-bool Sdr3DObjectAttribute::isDefault() const
-{
-return mpSdr3DObjectAttribute.same_object(theGlobalDefault::get());
-}
-
 Sdr3DObjectAttribute Sdr3DObjectAttribute::operator=(const 
Sdr3DObjectAttribute rCandidate)
 {
 mpSdr3DObjectAttribute = rCandidate.mpSdr3DObjectAttribute;
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx 
b/drawinglayer/source/geometry/viewinformation2d.cxx
index 8d7bc4c..b362c01 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -447,11 +447,6 @@ namespace drawinglayer
 {
 }
 
-bool ViewInformation2D::isDefault() const
-{
-return mpViewInformation2D.same_object(theGlobalDefault::get());
-}
-
 ViewInformation2D ViewInformation2D::operator=(const 
ViewInformation2D rCandidate)
 {
 mpViewInformation2D = rCandidate.mpViewInformation2D;
diff --git a/unusedcode.easy b/unusedcode.easy
index 06a14a0..5b13ff3 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -117,12 +117,7 @@ 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source dtrans/source

2013-07-16 Thread Herbert Dürr
 drawinglayer/source/processor2d/vclprocessor2d.cxx |3 ++-
 dtrans/source/win32/dtobj/FetcList.cxx |7 ---
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 199ddc1e5da21a7b012d6a75258b13182b600dd6
Author: Herbert Dürr h...@apache.org
Date:   Tue Jul 16 13:30:18 2013 +

#i122752# check iterator in each iteration of 
CFormatEtcContainer::nextFormatEtc()'s loop

Don't trust nextFormatEtc()'s aNum argument not to mislead the iterator 
beyond
the container bounds. The comparable loop in 
CFormatEtcContainer::skipFormatEtc()
already checks the iterator against the container end in each iteration.

(cherry picked from commit a609daa146c5588c6a35c2c145e9573c625ec123)

diff --git a/dtrans/source/win32/dtobj/FetcList.cxx 
b/dtrans/source/win32/dtobj/FetcList.cxx
index b728850..561f894 100644
--- a/dtrans/source/win32/dtobj/FetcList.cxx
+++ b/dtrans/source/win32/dtobj/FetcList.cxx
@@ -131,10 +131,11 @@ sal_uInt32 SAL_CALL CFormatEtcContainer::nextFormatEtc( 
LPFORMATETC lpFetc,
 
 sal_uInt32 nFetched = 0;
 
-if ( m_EnumIterator != m_FormatMap.end( ) )
+for ( sal_uInt32 i = 0; i  aNum; i++, nFetched++, lpFetc++, 
++m_EnumIterator )
 {
-for ( sal_uInt32 i = 0; i  aNum; i++, nFetched++, lpFetc++, 
++m_EnumIterator )
-CopyFormatEtc( lpFetc, *m_EnumIterator );
+if ( m_EnumIterator == m_FormatMap.end() )
+break;
+CopyFormatEtc( lpFetc, *m_EnumIterator );
 }
 
 return nFetched;
commit 7f5faa7f64338b11eda4b033ed9d4cba9833573b
Author: Armin Le Grand a...@apache.org
Date:   Tue Jul 16 12:51:14 2013 +

Resolves: #i122758# Initialize Mask with non-transparent

(cherry picked from commit db4a17f202e69447fd22c246843a6cda3e52)

Change-Id: I4851c544b23d2857a0f13cff3ede987ebb813cef

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 86c51b2..5027cb1 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -451,7 +451,8 @@ namespace drawinglayer
 #if defined(MACOSX)
 const AlphaMask aMaskBmp( aContent.GetSizePixel());
 #else
-const Bitmap aMaskBmp( aContent.GetSizePixel(), 1);
+Bitmap aMaskBmp( aContent.GetSizePixel(), 1);
+aMaskBmp.Erase(Color(COL_BLACK)); // #122758# Initialize to 
non-transparent
 #endif
 aBitmapEx = BitmapEx(aContent, aMaskBmp);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/drawinglayer include/svtools include/svx svtools/source svx/source

2013-06-17 Thread Armin Le Grand
 drawinglayer/source/primitive2d/cropprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx  |   58 +---
 include/drawinglayer/primitive2d/graphicprimitive2d.hxx |3 
 include/svtools/grfmgr.hxx  |   11 
 include/svx/svdhdl.hxx  |   36 ++
 svtools/source/graphic/grfmgr.cxx   |  107 ++--
 svx/source/svdraw/svdhdl.cxx|  203 +++-
 svx/source/svdraw/svdmrkv.cxx   |   51 
 svx/source/unodraw/UnoGraphicExporter.cxx   |3 
 9 files changed, 416 insertions(+), 58 deletions(-)

New commits:
commit 3a8dbb63197c5b9298015cbd5b15e607ec9a3705
Author: Armin Le Grand a...@apache.org
Date:   Fri May 17 16:29:11 2013 +

Resolves: #i74211# Correct crop of bitmap data when...

logical size and MapMode do not match real pixel size

(cherry picked from commit a24965371f7e881671182bc51432c08cbf667b56)

Conflicts:
svtools/inc/svtools/grfmgr.hxx
svtools/source/graphic/grfmgr.cxx
svx/inc/svx/svdhdl.hxx
svx/inc/svx/svdograf.hxx
svx/source/svdraw/svdhdl.cxx

Change-Id: Icfb9091b55e50081e8daf697c9f00f5b5a10531a

diff --git a/drawinglayer/source/primitive2d/cropprimitive2d.cxx 
b/drawinglayer/source/primitive2d/cropprimitive2d.cxx
index 8ce933a..042710c 100644
--- a/drawinglayer/source/primitive2d/cropprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/cropprimitive2d.cxx
@@ -85,7 +85,7 @@ namespace drawinglayer
 // with getSmallValue here, the original which uses 
rtl::math::approxEqual
 // is too correct here. Maybe this changes with enhanced 
precision in aw080
 // to the better so that this can be reduced to the more 
precise call again
-if(basegfx::fTools::equal(fRotate, F_PI, 0.1))
+if(basegfx::fTools::equal(fabs(fRotate), F_PI, 0.1))
 {
 aScale.setX(aScale.getX() * -1.0);
 aScale.setY(aScale.getY() * -1.0);
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 778245ff..df69a36 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -85,47 +85,25 @@ namespace drawinglayer
 {
 // calculate scalings between real image size and 
logic object size. This
 // is necessary since the crop values are relative to 
original bitmap size
-double fFactorX(1.0);
-double fFactorY(1.0);
-
-{
-const MapMode aMapMode100thmm(MAP_100TH_MM);
-Size aBitmapSize(rGraphicObject.GetPrefSize());
-
-// #i95968# better support PrefMapMode; special 
for MAP_PIXEL was missing
-if(MAP_PIXEL == 
rGraphicObject.GetPrefMapMode().GetMapUnit())
-{
-aBitmapSize = 
Application::GetDefaultDevice()-PixelToLogic(aBitmapSize, aMapMode100thmm);
-}
-else
-{
-aBitmapSize = 
Application::GetDefaultDevice()-LogicToLogic(aBitmapSize, 
rGraphicObject.GetPrefMapMode(), aMapMode100thmm);
-}
-
-const double fDivX(aBitmapSize.Width() - 
getGraphicAttr().GetLeftCrop() - getGraphicAttr().GetRightCrop());
-const double fDivY(aBitmapSize.Height() - 
getGraphicAttr().GetTopCrop() - getGraphicAttr().GetBottomCrop());
-const basegfx::B2DVector aScale(aTransform * 
basegfx::B2DVector(1.0, 1.0));
-
-if(!basegfx::fTools::equalZero(fDivX))
-{
-fFactorX = fabs(aScale.getX()) / fDivX;
-}
-
-if(!basegfx::fTools::equalZero(fDivY))
-{
-fFactorY = fabs(aScale.getY()) / fDivY;
-}
-}
+const basegfx::B2DVector aObjectScale(aTransform * 
basegfx::B2DVector(1.0, 1.0));
+const basegfx::B2DVector aCropScaleFactor(
+rGraphicObject.calculateCropScaling(
+aObjectScale.getX(),
+aObjectScale.getY(),
+getGraphicAttr().GetLeftCrop(),
+getGraphicAttr().GetTopCrop(),
+getGraphicAttr().GetRightCrop(),
+  

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source

2013-05-20 Thread Armin Le Grand
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |  182 -
 1 file changed, 119 insertions(+), 63 deletions(-)

New commits:
commit fc91501f9f0a24ccfa69c2b4baf070aac9e2d0f0
Author: Armin Le Grand a...@apache.org
Date:   Tue Oct 23 10:49:25 2012 +

Resolves: #i121185# corrected handling of gradients in rotated metafiles

(cherry picked from commit 498926039ce717631eda046b1aa256efd24dfdf6)

Conflicts:
drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx

Change-Id: Ib1a96888d0990f6f9aa573e308736d40b694a613

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 706020b..0bcb413 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1537,78 +1537,108 @@ namespace drawinglayer
 }
 case PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D :
 {
-const primitive2d::PolyPolygonGradientPrimitive2D 
rGradientCandidate = static_cast const 
primitive2d::PolyPolygonGradientPrimitive2D (rCandidate);
-basegfx::B2DPolyPolygon 
aLocalPolyPolygon(rGradientCandidate.getB2DPolyPolygon());
+basegfx::B2DVector aScale, aTranslate;
+double fRotate, fShearX;
 
-// #i112245# Metafiles use tools Polygon and are not able 
to have more than 65535 points
-// per polygon. Split polygon until there are less than 
that
-while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
-;
+maCurrentTransformation.decompose(aScale, aTranslate, 
fRotate, fShearX);
 
-// for support of MetaCommentActions of the form 
XGRAD_SEQ_BEGIN, XGRAD_SEQ_END
-// it is safest to use the VCL OutputDevice::DrawGradient 
method which creates those.
-// re-create a VCL-gradient from FillGradientPrimitive2D 
and the needed tools PolyPolygon
-Gradient aVCLGradient;
-impConvertFillGradientAttributeToVCLGradient(aVCLGradient, 
rGradientCandidate.getFillGradient(), false);
-aLocalPolyPolygon.transform(maCurrentTransformation);
+if(!basegfx::fTools::equalZero(fRotate) || 
!basegfx::fTools::equalZero(fShearX))
+{
+// #121185# When rotation or shear is used, a VCL 
Gradient cannot be used directly.
+// This is because VCL Gradient mechanism does *not* 
support to rotate the gradient
+// with objects and this case is not expressable in a 
Metafile (and cannot be added
+// since the FileFormats used, e.g. *.wmf, do not 
support it either).
+// Such cases happen when a graphic object uses a 
Metafile as graphic information or
+// a fill style definition uses a Metafile. In this 
cases the graphic content is
+// rotated with the graphic or filled object; this is 
not supported by the target
+// format of this conversion renderer - Metafiles.
+// To solve this, not a Gradient is written, but the 
decomposition of this object
+// is written to the Metafile. This is the 
PolyPolygons building the gradient fill.
+// These will need more space and time, but the result 
will be as if the Gradient
+// was rotated with the object.
+// This mechanism is used by all exporters still not 
using Primtives (e.g. Print,
+// Slideshow, Export rto PDF, export to Picture, ...) 
but relying on Metafile
+// transfers. One more reason to *change* these to 
primitives.
+// BTW: One more example how useful the principles of 
primitives are; the decomposition
+// is by definition a simpler, maybe more expensive 
representation of the same content.
+
process(rCandidate.get2DDecomposition(getViewInformation2D()));
+}
+else
+{
+const primitive2d::PolyPolygonGradientPrimitive2D 
rGradientCandidate = static_cast const 
primitive2d::PolyPolygonGradientPrimitive2D (rCandidate);
+basegfx::B2DPolyPolygon 
aLocalPolyPolygon(rGradientCandidate.getB2DPolyPolygon());
 
-// #i82145# ATM VCL printing of gradients using curved 
shapes does not work,
-// i submitted the bug with the given ID to THB. When that 
task is fixed it is
-// necessary to again remove this subdivision since it 
decreases possible
- 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source include/vcl vcl/source

2013-05-02 Thread Caolán McNamara
 drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx |  322 +++--
 include/vcl/textview.hxx   |4 
 vcl/source/edit/textview.cxx   |9 
 3 files changed, 197 insertions(+), 138 deletions(-)

New commits:
commit 92e5232dcbda1696a0e7c05defb3b6a00f4abdd7
Author: Caolán McNamara caol...@redhat.com
Date:   Thu May 2 09:55:04 2013 +0100

double lock drawinglayer statics

move related statics into classes and the make safe static singleton 
instances
of those clases.

We still have to have the additional mutex (now per singleton) on the
methods that return the buffered data, as it may be modified per
call

Change-Id: I5873ae8271f48a0ebf4b584c1734688b77cd1d42

diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx 
b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 495c06f..266738a 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include boost/noncopyable.hpp
 #include drawinglayer/primitive3d/polygontubeprimitive3d.hxx
 #include drawinglayer/attribute/materialattribute3d.hxx
 #include basegfx/matrix/b3dhommatrix.hxx
@@ -25,6 +26,7 @@
 #include basegfx/polygon/b3dpolypolygontools.hxx
 #include drawinglayer/primitive3d/transformprimitive3d.hxx
 #include drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
+#include rtl/instance.hxx
 
 //
 
@@ -34,190 +36,254 @@ namespace drawinglayer
 {
 namespace // anonymous namespace
 {
-Primitive3DSequence getLineTubeSegments(
-sal_uInt32 nSegments,
-const attribute::MaterialAttribute3D rMaterial)
+class TubeBuffer : boost::noncopyable
 {
-// static data for buffered tube primitives
-static Primitive3DSequence aLineTubeList;
-static sal_uInt32 nLineTubeSegments(0L);
-static attribute::MaterialAttribute3D aLineMaterial;
-static ::osl::Mutex aMutex;
-
-// may exclusively change static data, use mutex
-::osl::MutexGuard aGuard(aMutex);
-
-if(nSegments != nLineTubeSegments || !(rMaterial == 
aLineMaterial))
+private:
+// data for buffered tube primitives
+Primitive3DSequence m_aLineTubeList;
+sal_uInt32 m_nLineTubeSegments;
+attribute::MaterialAttribute3D m_aLineMaterial;
+::osl::Mutex m_aMutex;
+public:
+TubeBuffer()
+: m_nLineTubeSegments(0L)
 {
-nLineTubeSegments = nSegments;
-aLineMaterial = rMaterial;
-aLineTubeList = Primitive3DSequence();
 }
 
-if(!aLineTubeList.hasElements()  0L != nLineTubeSegments)
+Primitive3DSequence getLineTubeSegments(
+sal_uInt32 nSegments,
+const attribute::MaterialAttribute3D rMaterial)
 {
-const basegfx::B3DPoint aLeft(0.0, 0.0, 0.0);
-const basegfx::B3DPoint aRight(1.0, 0.0, 0.0);
-basegfx::B3DPoint aLastLeft(0.0, 1.0, 0.0);
-basegfx::B3DPoint aLastRight(1.0, 1.0, 0.0);
-basegfx::B3DHomMatrix aRot;
-aRot.rotate(F_2PI / (double)nLineTubeSegments, 0.0, 0.0);
-aLineTubeList.realloc(nLineTubeSegments);
-
-for(sal_uInt32 a(0L); a  nLineTubeSegments; a++)
+// may exclusively change cached data, use mutex
+::osl::MutexGuard aGuard(m_aMutex);
+
+if (nSegments != m_nLineTubeSegments || !(rMaterial == 
m_aLineMaterial))
 {
-const basegfx::B3DPoint aNextLeft(aRot * aLastLeft);
-const basegfx::B3DPoint aNextRight(aRot * aLastRight);
-basegfx::B3DPolygon aNewPolygon;
+m_nLineTubeSegments = nSegments;
+m_aLineMaterial = rMaterial;
+m_aLineTubeList = Primitive3DSequence();
+}
 
-aNewPolygon.append(aNextLeft);
-aNewPolygon.setNormal(0L, basegfx::B3DVector(aNextLeft 
- aLeft));
+if (!m_aLineTubeList.hasElements()  m_nLineTubeSegments 
!= 0)
+{
+const basegfx::B3DPoint aLeft(0.0, 0.0, 0.0);
+const basegfx::B3DPoint aRight(1.0, 0.0, 0.0);
+basegfx::B3DPoint aLastLeft(0.0, 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source vcl/inc vcl/source

2013-03-25 Thread Michael Meeks
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |   16 -
 drawinglayer/source/processor2d/vclprocessor2d.cxx |2 -
 vcl/inc/vcl/graphictools.hxx   |2 +
 vcl/source/gdi/graphictools.cxx|   15 
 vcl/source/gdi/metaact.cxx |5 
 5 files changed, 30 insertions(+), 10 deletions(-)

New commits:
commit fd335d180b1d549e884b9692ba1a4e51a014dcd5
Author: Michael Meeks michael.me...@suse.com
Date:   Mon Mar 25 21:34:51 2013 +

fdo#61789 - improve SvtGraphicStroke / metafile scaling

diff --git a/vcl/inc/vcl/graphictools.hxx b/vcl/inc/vcl/graphictools.hxx
index c8713fd..3600f1a 100644
--- a/vcl/inc/vcl/graphictools.hxx
+++ b/vcl/inc/vcl/graphictools.hxx
@@ -142,6 +142,8 @@ public:
 // mutators
 /// Set path to stroke
 voidsetPath ( const Polygon );
+/// Affine scaling in both X and Y dimensions
+voidscale   ( double fScaleX, double fScaleY );
 
 private:
 // friends
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index 4961389..da1cbac 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -115,6 +115,21 @@ void SvtGraphicStroke::setPath( const Polygon rPoly )
 maPath = rPoly;
 }
 
+void SvtGraphicStroke::scale( double fXScale, double fYScale )
+{
+// Clearly scaling stroke-width for fat lines is rather a problem
+maPath.Scale( fXScale, fYScale );
+
+double fScale = sqrt (fabs (fXScale * fYScale) ); // clearly not ideal.
+fprintf( stderr,  HIT A SCALING ! by %g %g %g\n,
+ (double) fXScale, (double) fYScale, (double) fScale );
+mfStrokeWidth *= fScale;
+mfMiterLimit *= fScale;
+
+maStartArrow.Scale( fXScale, fYScale );
+maEndArrow.Scale( fXScale, fYScale );
+}
+
 SvStream operator( SvStream rOStm, const SvtGraphicStroke rClass )
 {
 VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index b63ca2d..c9c5e08 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -4066,10 +4066,7 @@ void MetaCommentAction::Scale( double fXScale, double 
fYScale )
 {
 SvtGraphicStroke aStroke;
 aMemStm  aStroke;
-Polygon aPath;
-aStroke.getPath( aPath );
-aPath.Scale( fXScale, fYScale );
-aStroke.setPath( aPath );
+aStroke.scale( fXScale, fYScale );
 aDest  aStroke;
 }
 else
commit 432b6ab482d6fcef05514ab17e4bc762ee552139
Author: Michael Meeks michael.me...@suse.com
Date:   Mon Mar 25 21:33:00 2013 +

fdo#61789 - move metafile line width scaling somewhere more sensible.

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index f9d583d..9663384 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -444,6 +444,15 @@ namespace drawinglayer
 // pre-fill fLineWidth
 fLineWidth = pLineAttribute-getWidth();
 
+// #i113922# the LineWidth is duplicated in the 
MetaPolylineAction,
+// and also inside the SvtGraphicStroke and needs 
transforming into
+// the same space as its co-ordinates here cf. fdo#61789
+// This is a partial fix. When a object transformation is 
used which
+// e.g. contains a scaleX != scaleY, an unproportional 
scaling will happen.
+const basegfx::B2DVector 
aDiscreteUnit(maCurrentTransformation *
+   
basegfx::B2DVector(pLineAttribute-getWidth(), 0.0 ));
+fLineWidth = aDiscreteUnit.getLength();
+
 // pre-fill fMiterLength
 fMiterLength = fLineWidth;
 
@@ -1233,11 +1242,8 @@ namespace drawinglayer
 mpOutputDevice-SetFillColor();
 
aHairLinePolyPolygon.transform(maCurrentTransformation);
 
-// #i113922# LineWidth needs to be transformed, too
-const basegfx::B2DVector 
aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(rLine.getWidth(), 
0.0));
-const double 
fDiscreteLineWidth(aDiscreteUnit.getLength());
-
-LineInfo aLineInfo(LINE_SOLID, 
basegfx::fround(fDiscreteLineWidth));
+// use the transformed line width from the stroke 
info.
+LineInfo aLineInfo(LINE_SOLID, 
basegfx::fround(pSvtGraphicStroke-getStrokeWidth()));
 

[Libreoffice-commits] core.git: 2 commits - drawinglayer/source vcl/win

2013-03-07 Thread Herbert Dürr
 drawinglayer/source/processor3d/zbufferprocessor3d.cxx |8 
 vcl/win/source/gdi/salgdi3.cxx |   12 
 2 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 736a63b25f5744b245edc31061b4105a5e8465e0
Author: Herbert Dürr h...@apache.org
Date:   Fri Jun 15 08:30:03 2012 +

Resolves: #i119997# fix a memory leak by WinGlyphFallbackSubstitution

Patch by: Chao Huang
Found by: Chao Huang
Review by: hdu

Conflicts:
vcl/win/source/gdi/salgdi3.cxx

Change-Id: I6cde84b54a42fd8951d68280fac9dccd2b2e5c4a

diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index a410028..3df9f64 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -589,23 +589,27 @@ bool WinGlyphFallbackSubstititution::FindFontSubstitute( 
FontSelectPattern rFon
 }
 
 // last level fallback, check each font type face one by one
-const ImplGetDevFontList* pTestFontList = pDevFontList-GetDevFontList();
+ImplGetDevFontList* pTestFontList = pDevFontList-GetDevFontList();
 // limit the count of fonts to be checked to prevent hangs
 static const int MAX_GFBFONT_COUNT = 600;
 int nTestFontCount = pTestFontList-Count();
 if( nTestFontCount  MAX_GFBFONT_COUNT )
 nTestFontCount = MAX_GFBFONT_COUNT;
 
+bool bFound = false;
 for( int i = 0; i  nTestFontCount; ++i )
 {
 const PhysicalFontFace* pFace = pTestFontList-Get( i );
-if( !HasMissingChars( pFace, rMissingChars ) )
+bFound = HasMissingChars( pFace, rMissingChars );
+if( !bFound )
 continue;
 rFontSelData.maSearchName = pFace-GetFamilyName();
-return true;
+break;
 }
 
-return false;
+delete pTestFontList;
+
+return bFound;
 }
 
 // ===
commit 2c85769d94a8caaa62be83ce6c94ad31b57f8723
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Mar 7 12:54:21 2013 +

make sure Release is called if one of two Acquires failed

checking the body of ReleaseAccess in vcl its safe to pass
NULL to them, so keep it simple

Change-Id: I5f057f9c79f0787d670869af4114c989e7f1562a

diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx 
b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 5bdb354..31c96f8 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -56,7 +56,7 @@ namespace
 BitmapWriteAccess* pContent = aContent.AcquireWriteAccess();
 BitmapWriteAccess* pAlpha = aAlpha.AcquireWriteAccess();
 
-if(pContent  pAlpha)
+if (pContent  pAlpha)
 {
 if(mnAntiAlialize)
 {
@@ -117,11 +117,11 @@ namespace
 }
 }
 }
-
-aContent.ReleaseAccess(pContent);
-aAlpha.ReleaseAccess(pAlpha);
 }
 
+aAlpha.ReleaseAccess(pAlpha);
+aContent.ReleaseAccess(pContent);
+
 aRetval = BitmapEx(aContent, aAlpha);
 
 // #i101811# set PrefMapMode and PrefSize at newly created Bitmap
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits