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

2023-12-06 Thread Caolán McNamara (via logerrit)
 svx/source/svdraw/svdoedge.cxx |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 5ef9770158a3f9579429f64409c5897304ea9111
Author: Caolán McNamara 
AuthorDate: Tue Dec 5 12:42:57 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 6 11:42:22 2023 +0100

cid#1558795 Dereference after null check

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

diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index d3f2560790db..19c498948dcd 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1511,7 +1511,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 if (eKind != SdrEdgeKind::Bezier || nPointCount <= 2)
 return aXP1;
 
-if (pInfo->m_bUseOOXMLCurve) // Routing method OOXML
+if (pInfo && pInfo->m_bUseOOXMLCurve) // Routing method OOXML
 {
 // The additional points needed are located on the segments of the 
path of the
 // corresponding bentConnector as calculated above.
commit c0b938e279fc36e6da129304b075361de39fa8bd
Author: Caolán McNamara 
AuthorDate: Tue Dec 5 12:42:20 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 6 11:42:14 2023 +0100

replace bInfo with direct pInfo check

its a little less obscure

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

diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 3f1905efe85b..d3f2560790db 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -892,8 +892,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 bool bUnt2=nAngle2==27000;
 bool bHor2=bLks2 || bRts2;
 bool bVer2=bObn2 || bUnt2;
-bool bInfo=pInfo!=nullptr;
-if (bInfo) {
+if (pInfo) {
 pInfo->m_nAngle1=nAngle1;
 pInfo->m_nAngle2=nAngle2;
 pInfo->m_nObj1Lines=1;
@@ -935,7 +934,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 
nQ+=std::abs(aXP[3].X()-aXP[2].X())+std::abs(aXP[3].Y()-aXP[2].Y());
 *pnQuality=nQ;
 }
-if (bInfo) {
+if (pInfo) {
 pInfo->m_nObj1Lines=2;
 pInfo->m_nObj2Lines=2;
 if (bHor1) {
@@ -1274,7 +1273,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 XPolygon aXP2(ImpCalcObjToCenter(aPt2,nAngle2,aBewareRect2,aMeeting));
 sal_uInt16 nXP1Cnt=aXP1.GetPointCount();
 sal_uInt16 nXP2Cnt=aXP2.GetPointCount();
-if (bInfo) {
+if (pInfo) {
 pInfo->m_nObj1Lines=nXP1Cnt; if (nXP1Cnt>1) pInfo->m_nObj1Lines--;
 pInfo->m_nObj2Lines=nXP2Cnt; if (nXP2Cnt>1) pInfo->m_nObj2Lines--;
 }
@@ -1290,7 +1289,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 }
 if (bInsMeetingPoint) {
 aXP1.Insert(XPOLY_APPEND,aMeeting,PolyFlags::Normal);
-if (bInfo) {
+if (pInfo) {
 // Inserting a MeetingPoint adds 2 new lines,
 // either might become the center line.
 if (pInfo->m_nObj1Lines==pInfo->m_nObj2Lines) {
@@ -1306,7 +1305,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 }
 }
 }
-} else if (bInfo && aEP1!=aEP2 && nXP1Cnt+nXP2Cnt>=4) {
+} else if (pInfo && aEP1!=aEP2 && nXP1Cnt+nXP2Cnt>=4) {
 // By connecting both ends, another line is added, this becomes the 
center line.
 pInfo->m_nMiddleLine=nXP1Cnt-1;
 }
@@ -1318,7 +1317,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 }
 sal_uInt16 nPointCount=aXP1.GetPointCount();
 char cForm;
-if (bInfo || pnQuality!=nullptr) {
+if (pInfo || pnQuality!=nullptr) {
 if (nPointCount==2) cForm='I';
 else if (nPointCount==3) cForm='L';
 else if (nPointCount==4) { // Z or U
@@ -1342,7 +1341,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 } else cForm='4'; // else is case 3 with 5 lines
 } else cForm='?';
 // more shapes:
-if (bInfo) {
+if (pInfo) {
 if (cForm=='I' || cForm=='L' || cForm=='Z' || cForm=='U') {
 pInfo->m_nObj1Lines=1;
 pInfo->m_nObj2Lines=1;
@@ -1456,7 +1455,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 if (bOverflow || nQual==0x) nQual=0xFFFE;
 *pnQuality=nQual;
 }
-if (bInfo) { // now apply line offsets to aXP1
+if (pInfo) { // now apply line offsets to aXP1

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

2023-12-01 Thread Andrea Gelmini (via logerrit)
 svx/source/svdraw/svdoedge.cxx  |2 +-
 writerfilter/source/dmapper/PropertyMap.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 18a505f97370359d627abfcacec18dbdfe3eea22
Author: Andrea Gelmini 
AuthorDate: Fri Dec 1 12:11:33 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 1 17:05:11 2023 +0100

Fix typo

Change-Id: Ie5cb165cce88c44004ff37692bfb3c0438c26ccb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160209
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 33b6a6b82a1a..3f1905efe85b 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1523,7 +1523,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 };
 
 // We change the path going from end to start. Thus inserting points 
does not affect the index
-// of the preciding points.
+// of the preceding points.
 // The end point has index nPointCount-1 and is a normal point and 
kept.
 // Insert new control point in the middle of last segments.
 Point aControl = SegmentPoint(nPointCount - 1, 0.5);
commit 469342aed05c21568476128d9f60248db5ff8dd3
Author: Andrea Gelmini 
AuthorDate: Fri Dec 1 12:11:01 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 1 17:04:57 2023 +0100

Fix typo

Change-Id: I1998241849f0f9fa99d1b111f218cdab7e6074fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160208
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/writerfilter/source/dmapper/PropertyMap.hxx 
b/writerfilter/source/dmapper/PropertyMap.hxx
index 4e6510dd7670..d6ecfb2e71d7 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -210,7 +210,7 @@ enum class PageType
 RIGHT
 };
 
-/** Which page part we are refering to.
+/** Which page part we are referring to.
  * This is mainly introduced to avoid having cryptic bools as input 
parameter.*/
 enum class PagePartType
 {


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit be262b04ff0e7b85c508975914d77086878155ef
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:15:39 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:04:07 2023 +0100

Fix typo

Change-Id: I786d7873f1aa4921bae81cbbecca01959db3866b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159824
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 4332329994cc..2d86e99073c2 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -894,7 +894,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 }
 
 // if the current outline is longer then the text 
to fit in,
-// then we have to divide the bonus space betweeen 
the
+// then we have to divide the bonus space between 
the
 // before-/after- text area.
 // fAdjust means how much space we put before the 
text.
 if (fCurWidth > rParagraph.aBoundRect.GetWidth())
commit c8403d2b83f30a977f1a0eaabeddeeb2d7ac7059
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:18:48 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:03:54 2023 +0100

Fix typo

Change-Id: Ic297e251d58cc29c00c6dcc1add85b52bafa190c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159831
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index a51e93588582..4332329994cc 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -931,7 +931,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 // if fAdjust<0, then it means, the text 
was longer, as
 // the current outline, so we will skip 
the text scaling, and
 // the text horizontal alignment adjustment
-// so the text will be rendered just as 
long as the cureve is.
+// so the text will be rendered just as 
long as the curve is.
 if (fAdjust >= 0)
 {
 fM1 = (fM1 * fParaRectWidth + fAdjust) 
/ fCurWidth;


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 34636bb5f6c6d2b31515451d42aac841a14bd7aa
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:20:55 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:01:31 2023 +0100

Fix typo

Change-Id: Id83a613432117cbf7f20eb9dd0cfa8eaf60b103d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159834
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index d2071da34c8a..ba7b2890f905 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -863,7 +863,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 double fAdjust;
 double fCurWidth;
 
-// distance between the original an the current 
curve
+// distance between the original and the current 
curve
 double fCurvesDist = 
rTextArea.aBoundRect.GetHeight() / 2.0
  + rTextArea.aBoundRect.Top()
  - 
rParagraph.aBoundRect.Center().Y();
commit e763acfa9b643595794a9afd2ac196fe0497990e
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:17:17 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:01:16 2023 +0100

Fix typo

Change-Id: Id451921ddcefb71f9c46a11e5150fa1b864d4281
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159829
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 0bbf501835aa..d2071da34c8a 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -795,7 +795,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 nAdjust = 1; // 1 half of the possible
 break;
 case SDRTEXTHORZADJUST_BLOCK:
-nAdjust = -1; // don't know what it is, so dont 
even align
+nAdjust = -1; // don't know what it is, so don't 
even align
 break;
 case SDRTEXTHORZADJUST_LEFT:
 nAdjust = 0; // no need to move


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

2023-11-19 Thread Julien Nabet (via logerrit)
 svx/source/diagram/datamodel.cxx   |   14 +-
 svx/source/dialog/charmap.cxx  |5 ++---
 svx/source/sdr/animation/scheduler.cxx |2 +-
 svx/source/svdraw/svdhdl.cxx   |4 +---
 svx/source/svdraw/svdmark.cxx  |4 +---
 svx/source/unodraw/unoshcol.cxx|2 +-
 svx/source/unodraw/unoshtxt.cxx|2 +-
 svx/source/unogallery/unogaltheme.cxx  |2 +-
 xmloff/source/draw/shapeexport.cxx |4 +---
 9 files changed, 14 insertions(+), 25 deletions(-)

New commits:
commit 39aff36a842ae4df59c283dbba7f2ebfcf5d66fd
Author: Julien Nabet 
AuthorDate: Sun Nov 19 21:51:04 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Nov 20 07:39:56 2023 +0100

c++20: use std::erase(_if) instead of std::remove(_if)+erase (xmloff)

Change-Id: Idb65092e79a9afc6195bce0dbd5b3861d83a01be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159711
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index e2035da6cc4c..cbb027829713 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1046,9 +1046,7 @@ void FixZOrder(uno::Reference const& 
xShapes,
 layers[nLayer].nMax = i;
 }
 }
-layers.erase(std::remove_if(layers.begin(), layers.end(),
-[](Layer const& rLayer) { return rLayer.shapes.empty(); }),
-layers.end());
+std::erase_if(layers, [](Layer const& rLayer) { return 
rLayer.shapes.empty(); });
 bool isSorted(true);
 for (size_t i = 1; i < layers.size(); ++i)
 {
commit 15ef2909b88ef97b84615837e8bdb448481d61c1
Author: Julien Nabet 
AuthorDate: Sun Nov 19 20:57:35 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Nov 20 07:39:42 2023 +0100

c++20: use std::erase(_if) instead of std::remove(_if)+erase (svx)

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

diff --git a/svx/source/diagram/datamodel.cxx b/svx/source/diagram/datamodel.cxx
index 42677954bada..0cf0541cd2a1 100644
--- a/svx/source/diagram/datamodel.cxx
+++ b/svx/source/diagram/datamodel.cxx
@@ -125,18 +125,16 @@ bool DiagramData::removeNode(const OUString& rNodeId)
 aIdsToRemove.insert(aCxn.msPresId);
 
 // remove connections
-maConnections.erase(std::remove_if(maConnections.begin(), 
maConnections.end(),
+std::erase_if(maConnections,
[aIdsToRemove](const Connection& rCxn) {
return 
aIdsToRemove.count(rCxn.msSourceId) || aIdsToRemove.count(rCxn.msDestId);
-   }),
-maConnections.end());
+   });
 
 // remove data and presentation nodes
-maPoints.erase(std::remove_if(maPoints.begin(), maPoints.end(),
+std::erase_if(maPoints,
   [aIdsToRemove](const Point& rPoint) {
   return 
aIdsToRemove.count(rPoint.msModelId);
-  }),
-   maPoints.end());
+  });
 
 // TODO: fix source/dest order
 return true;
@@ -221,9 +219,7 @@ std::vector> 
DiagramData::getChildren(const OUStri
 }
 
 // HACK: empty items shouldn't appear there
-aChildren.erase(std::remove_if(aChildren.begin(), aChildren.end(),
-   [](const std::pair& 
aItem) { return aItem.first.isEmpty(); }),
-aChildren.end());
+std::erase_if(aChildren, [](const std::pair& aItem) { 
return aItem.first.isEmpty(); });
 
 return aChildren;
 }
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index b8e10ad4e048..be2d991977b5 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -1946,14 +1946,13 @@ void SubsetMap::ApplyCharMap( const FontCharMapRef& 
rxFontCharMap )
 return;
 
 // remove subsets that are not matched in any range
-maSubsets.erase(std::remove_if(maSubsets.begin(), maSubsets.end(),
+std::erase_if(maSubsets,
 [](const Subset& rSubset) {
 sal_uInt32 cMin = rSubset.GetRangeMin();
 sal_uInt32 cMax = rSubset.GetRangeMax();
 int nCount = rxFontCharMap->CountCharsInRange( cMin, cMax );
 return nCount <= 0;
-}),
-maSubsets.end());
+});
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/animation/scheduler.cxx 
b/svx/source/sdr/animation/scheduler.cxx
index d4451c099a65..02017d915d97 100644
--- a/svx/source/sdr/animation/scheduler.cxx
+++ b/svx/source/sdr/animation/scheduler.cxx
@@ -154,7 +154,7 @@ namespace sdr::animation
 {
 if(!mvEvents.empty())

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

2023-10-31 Thread Noel Grandin (via logerrit)
 svx/source/sdr/properties/captionproperties.cxx |3 ---
 svx/source/sdr/properties/circleproperties.cxx  |3 ---
 svx/source/sdr/properties/graphicproperties.cxx |3 ---
 svx/source/sdr/properties/measureproperties.cxx |3 ---
 svx/source/sdr/properties/textproperties.cxx|3 ---
 svx/source/table/cell.cxx   |1 +
 6 files changed, 1 insertion(+), 15 deletions(-)

New commits:
commit 4b1acf7d1a0a2515a5f781b702c22c6233caecc8
Author: Noel Grandin 
AuthorDate: Tue Oct 31 15:28:30 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 31 20:20:52 2023 +0100

no need to call GetObjectItemSet inside ForceDefaultAttributes

ForceDefaultAttributes is only called after an itemset has been created

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

diff --git a/svx/source/sdr/properties/captionproperties.cxx 
b/svx/source/sdr/properties/captionproperties.cxx
index 31bb62268521..3de1da6d65b9 100644
--- a/svx/source/sdr/properties/captionproperties.cxx
+++ b/svx/source/sdr/properties/captionproperties.cxx
@@ -89,9 +89,6 @@ namespace sdr::properties
 // call parent
 RectangleProperties::ForceDefaultAttributes();
 
-// force ItemSet
-GetObjectItemSet();
-
 // this was set by TextProperties::ForceDefaultAttributes(),
 // reset to default
 if 
(static_cast(GetSdrObject()).GetSpecialTextBoxShadow())
diff --git a/svx/source/sdr/properties/circleproperties.cxx 
b/svx/source/sdr/properties/circleproperties.cxx
index 6f589f67548f..643c297eb043 100644
--- a/svx/source/sdr/properties/circleproperties.cxx
+++ b/svx/source/sdr/properties/circleproperties.cxx
@@ -98,9 +98,6 @@ namespace sdr::properties
 
 if(eKind != SdrCircKind::Full)
 {
-// force ItemSet
-GetObjectItemSet();
-
 moItemSet->Put(SdrCircKindItem(eKind));
 
 if(rObj.GetStartAngle())
diff --git a/svx/source/sdr/properties/graphicproperties.cxx 
b/svx/source/sdr/properties/graphicproperties.cxx
index 3346c5d80048..a43ee5bd9fbb 100644
--- a/svx/source/sdr/properties/graphicproperties.cxx
+++ b/svx/source/sdr/properties/graphicproperties.cxx
@@ -132,9 +132,6 @@ namespace sdr::properties
 // call parent
 RectangleProperties::ForceDefaultAttributes();
 
-// force ItemSet
-GetObjectItemSet();
-
 moItemSet->Put( SdrGrafLuminanceItem( 0 ) );
 moItemSet->Put( SdrGrafContrastItem( 0 ) );
 moItemSet->Put( SdrGrafRedItem( 0 ) );
diff --git a/svx/source/sdr/properties/measureproperties.cxx 
b/svx/source/sdr/properties/measureproperties.cxx
index 44cdae798899..a6f4b7fd7c81 100644
--- a/svx/source/sdr/properties/measureproperties.cxx
+++ b/svx/source/sdr/properties/measureproperties.cxx
@@ -105,9 +105,6 @@ namespace sdr::properties
 // call parent
 TextProperties::ForceDefaultAttributes();
 
-// force ItemSet
-GetObjectItemSet();
-
 //#71958# by default, the show units Bool-Item is set as hard
 // attribute to sal_True to avoid confusion when copying 
SdrMeasureObj's
 // from one application to another
diff --git a/svx/source/sdr/properties/textproperties.cxx 
b/svx/source/sdr/properties/textproperties.cxx
index b2bb7b746ab9..55b366bdc03b 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -374,9 +374,6 @@ namespace sdr::properties
 
 bool bTextFrame(rObj.IsTextFrame());
 
-// force ItemSet
-GetObjectItemSet();
-
 if(bTextFrame)
 {
 moItemSet->Put(XLineStyleItem(drawing::LineStyle_NONE));
commit ba85e9f54809dd2c7eb817ead90f9fac0add6e06
Author: Noel Grandin 
AuthorDate: Tue Oct 31 15:08:44 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 31 20:20:43 2023 +0100

add comment to CellProperties::ForceDefaultAttributes

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

diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 98e46842e414..c617129f3fd2 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -181,6 +181,7 @@ SdrText* CellTextProvider::getText(sal_Int32 nIndex) const
 
 void CellProperties::ForceDefaultAttributes()
 {
+// deliberately do not run superclass ForceDefaultAttributes, we 
don't want any default attributes
 }
 
 void CellProperties::ItemSetChanged(std::span< const SfxPoolItem* 
const > aChangedItems, sal_uInt16 nDeletedWhich)


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

2023-09-02 Thread Noel Grandin (via logerrit)
 svx/source/table/accessiblecell.cxx   |4 ++--
 svx/source/table/accessiblecell.hxx   |2 +-
 svx/source/table/accessibletableshape.cxx |   13 ++---
 3 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 7d02c59170a0ec1b9ef726554795d06f5e3ea05c
Author: Noel Grandin 
AuthorDate: Sat Sep 2 15:00:09 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 2 18:27:55 2023 +0200

use more concrete type in AccessibleCell

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

diff --git a/svx/source/table/accessiblecell.cxx 
b/svx/source/table/accessiblecell.cxx
index 7ac5e1f414d3..19bb8961c8a7 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -50,14 +50,14 @@ using namespace ::com::sun::star::container;
 
 namespace accessibility {
 
-AccessibleCell::AccessibleCell( const css::uno::Reference< 
css::accessibility::XAccessible>& rxParent, sdr::table::CellRef xCell, 
sal_Int32 nIndex, const AccessibleShapeTreeInfo& rShapeTreeInfo )
+AccessibleCell::AccessibleCell( const rtl::Reference< AccessibleTableShape>& 
rxParent, sdr::table::CellRef xCell, sal_Int32 nIndex, const 
AccessibleShapeTreeInfo& rShapeTreeInfo )
 : AccessibleCellBase( rxParent, AccessibleRole::TABLE_CELL )
 , maShapeTreeInfo( rShapeTreeInfo )
 , mnIndexInParent( nIndex )
 , mxCell(std::move( xCell ))
 {
 //Init the pAccTable var
-pAccTable = dynamic_cast  (rxParent.get());
+pAccTable = rxParent.get();
 }
 
 
diff --git a/svx/source/table/accessiblecell.hxx 
b/svx/source/table/accessiblecell.hxx
index 38a28b9e333d..39c45da3d890 100644
--- a/svx/source/table/accessiblecell.hxx
+++ b/svx/source/table/accessiblecell.hxx
@@ -47,7 +47,7 @@ class AccessibleCell : public AccessibleCellBase
  , public IAccessibleViewForwarderListener
 {
 public:
-AccessibleCell( const css::uno::Reference< 
css::accessibility::XAccessible>& rxParent, sdr::table::CellRef xCell, 
sal_Int32 nIndex, const AccessibleShapeTreeInfo& rShapeTreeInfo);
+AccessibleCell( const rtl::Reference& rxParent, 
sdr::table::CellRef xCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo& 
rShapeTreeInfo);
 virtual ~AccessibleCell() override;
 AccessibleCell(const AccessibleCell&) = delete;
 AccessibleCell& operator=(const AccessibleCell&) = delete;
commit 151eb21f7a5e14df0d3367466b150afd2571bddd
Author: Noel Grandin 
AuthorDate: Sat Sep 2 14:57:53 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 2 18:27:46 2023 +0200

use more concrete type in AccessibleTableShapeImpl

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

diff --git a/svx/source/table/accessibletableshape.cxx 
b/svx/source/table/accessibletableshape.cxx
index cc3a8e90b7f3..f1cedcd3a0ca 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -62,7 +62,7 @@ class AccessibleTableShapeImpl : public cppu::WeakImplHelper< 
XModifyListener >
 public:
 explicit AccessibleTableShapeImpl( AccessibleShapeTreeInfo& rShapeTreeInfo 
);
 
-void init( const Reference< XAccessible>& xAccessible, const Reference< 
XTable >& xTable );
+void init( const rtl::Reference< AccessibleTableShape>& xAccessible, const 
Reference< XTable >& xTable );
 void dispose();
 
 /// @throws IndexOutOfBoundsException
@@ -80,7 +80,7 @@ public:
 AccessibleShapeTreeInfo& mrShapeTreeInfo;
 Reference< XTable > mxTable;
 AccessibleCellMap maChildMap;
-Reference< XAccessible> mxAccessible;
+rtl::Reference< AccessibleTableShape> mxAccessible;
 sal_Int32 mRowCount, mColCount;
 //get the cached AccessibleCell from XCell
 rtl::Reference< AccessibleCell > getAccessibleCell (const Reference< XCell 
>& xCell);
@@ -98,7 +98,7 @@ AccessibleTableShapeImpl::AccessibleTableShapeImpl( 
AccessibleShapeTreeInfo& rSh
 }
 
 
-void AccessibleTableShapeImpl::init( const Reference< XAccessible>& 
xAccessible, const Reference< XTable >& xTable )
+void AccessibleTableShapeImpl::init( const 
rtl::Reference& xAccessible, const Reference< XTable >& 
xTable )
 {
 mxAccessible = xAccessible;
 mxTable = xTable;
@@ -109,7 +109,7 @@ void AccessibleTableShapeImpl::init( const Reference< 
XAccessible>& xAccessible,
 mxTable->addModifyListener( xListener );
 //register the listener with table model
 Reference< css::view::XSelectionSupplier > xSelSupplier(xTable, 
UNO_QUERY);
-Reference< css::view::XSelectionChangeListener > xSelListener( 
xAccessible, UNO_QUERY );
+Reference< css::view::XSelectionChangeListener > xSelListener( 
xAccessible );
 if (xSelSupplier.is())
 xSelSupplier->addSelectionChangeListener(xSelListener);
 

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

2023-08-31 Thread Noel Grandin (via logerrit)
 svx/source/accessibility/charmapacc.cxx   |8 +-
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx |   43 +-
 svx/source/dialog/charmap.cxx |9 +-
 svx/source/inc/charmapacc.hxx |4 -
 svx/source/inc/svxpixelctlaccessiblecontext.hxx   |4 -
 5 files changed, 32 insertions(+), 36 deletions(-)

New commits:
commit 1fb467ae240de07bc381385ec0589a6e99ca7042
Author: Noel Grandin 
AuthorDate: Thu Aug 31 08:46:39 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 31 15:10:56 2023 +0200

use concrete type for SvxShowCharSetAcc::m_aChildren

avoid some unnecessary casting

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

diff --git a/svx/source/accessibility/charmapacc.cxx 
b/svx/source/accessibility/charmapacc.cxx
index 61cf9ca853e1..b5a0544d75b5 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -56,7 +56,7 @@ SvxShowCharSetItem::~SvxShowCharSetItem()
 }
 }
 
-uno::Reference< css::accessibility::XAccessible > 
SvxShowCharSetItem::GetAccessible()
+rtl::Reference SvxShowCharSetItem::GetAccessible()
 {
 if( !m_xItem.is() )
 {
@@ -84,8 +84,8 @@ SvxShowCharSetAcc::~SvxShowCharSetAcc()
 void SAL_CALL SvxShowCharSetAcc::disposing()
 {
 OAccessibleSelectionHelper::disposing();
-for (auto& rChild : m_aChildren)
-::comphelper::disposeComponent(rChild);
+for (auto& rxChild : m_aChildren)
+rxChild->dispose();
 
 m_aChildren.clear();
 m_pParent = nullptr;
@@ -146,7 +146,7 @@ uno::Reference< css::accessibility::XAccessible > SAL_CALL 
SvxShowCharSetAcc::ge
 {
 OExternalLockGuard aGuard( this );
 
-uno::Reference< css::accessibility::XAccessible >xRet;
+rtl::Reference< SvxShowCharSetItemAcc >  xRet;
 SvxShowCharSetItem* pItem = m_pParent->ImplGetItem( static_cast< 
sal_uInt16 >( i ) );
 
 if( !pItem )
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 18a31b5f7a74..a9806505d8c8 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -767,11 +767,14 @@ void SvxShowCharSet::SelectIndex(int nNewIndex, bool 
bFocus)
 if( m_xAccessible.is() )
 {
 svx::SvxShowCharSetItem* pItem = ImplGetItem(nSelectedIndex);
+rtl::Reference xItemAcc = 
pItem->GetAccessible();
 // Don't fire the focus event.
 if ( bFocus )
-m_xAccessible->fireEvent( 
AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(), 
Any(pItem->GetAccessible()) ); // this call assures that m_pItem is set
+m_xAccessible->fireEvent( 
AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(),
+Any(uno::Reference(xItemAcc)) ); 
// this call assures that m_pItem is set
 else
-m_xAccessible->fireEvent( 
AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS, Any(), 
Any(pItem->GetAccessible()) ); // this call assures that m_pItem is set
+m_xAccessible->fireEvent( 
AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS, Any(),
+Any(uno::Reference(xItemAcc)) ); 
// this call assures that m_pItem is set
 
 assert(pItem->m_xItem.is() && "No accessible created!");
 Any aOldAny, aNewAny;
@@ -826,7 +829,7 @@ IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl, 
weld::ScrolledWindow&, void)
 int nLast = LastInView();
 for ( ; nLast != nSelectedIndex; ++nLast)
 {
-aOldAny <<= ImplGetItem(nLast)->GetAccessible();
+aOldAny <<= 
uno::Reference(ImplGetItem(nLast)->GetAccessible());
 m_xAccessible ->fireEvent( AccessibleEventId::CHILD, aOldAny, 
aNewAny );
 }
 }
diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx
index c909756c22d1..43ab846d5b6f 100644
--- a/svx/source/inc/charmapacc.hxx
+++ b/svx/source/inc/charmapacc.hxx
@@ -52,7 +52,7 @@ namespace svx
 SvxShowCharSetItem( SvxShowCharSet& rParent, SvxShowCharSetAcc* 
_pParent, sal_uInt16 _nPos );
 ~SvxShowCharSetItem();
 
-css::uno::Reference< css::accessibility::XAccessible > GetAccessible();
+rtl::Reference< SvxShowCharSetItemAcc > GetAccessible();
 };
 
 
@@ -66,7 +66,7 @@ namespace svx
 css::accessibility::XAccessible,
 css::accessibility::XAccessibleTable>
 {
-::std::vector< css::uno::Reference< css::accessibility::XAccessible > 
> m_aChildren;
+::std::vector< rtl::Reference< SvxShowCharSetItemAcc > > m_aChildren;
 SvxShowCharSet* m_pParent; // the vcl control
 virtual void SAL_CALL disposing() override;
 public:

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

2023-08-18 Thread Michael Weghorn (via logerrit)
 svx/source/dialog/frmsel.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 912374164f16a4157f04c74994e15f8658b37f03
Author: Michael Weghorn 
AuthorDate: Fri Aug 18 20:02:17 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Aug 18 22:20:45 2023 +0200

svx: Use FRAMEBORDERTYPE_COUNT instead of magic number

... just as is used for `maAllBorders` below.

Change-Id: I0741a039cc0ee9ad01055414f471dab45f420ed6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155849
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 55e73043044b..1fde68ed7c0d 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -238,7 +238,7 @@ FrameSelectorImpl::FrameSelectorImpl( FrameSelector& 
rFrameSel ) :
 mbAutoSelect( true ),
 mbHCMode( false )
 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
-,maChildVec( 8 )
+,maChildVec(FRAMEBORDERTYPE_COUNT)
 #endif
 {
 maAllBorders.resize( FRAMEBORDERTYPE_COUNT, nullptr );
commit 79cc574270582d03408286544d99227881f13bb8
Author: Michael Weghorn 
AuthorDate: Fri Aug 18 18:00:17 2023 +0200
Commit: Michael Weghorn 
CommitDate: Fri Aug 18 22:20:37 2023 +0200

related tdf#156683 a11y: Dispose FrameSelectorImpl a11y children

Don't just invalidate, but also dispose the a11y children
in `FrameSelectorImpl::~FrameSelectorImpl`.

This fixes a crash on exit that's reproducible with
the gtk3 VCL plugin e.g. like this (maybe some
steps aren't even needed):

1) start LO Writer with the gtk3 VCL plugin
2) right-click, select "Character" > "Character"
   in context menu
3) switch to "Font Effects" tab
4) press space key with focus in the font color combobox
   to open the popup
5) use Tab key to get to the view of colors
6) move around with arrow keys a bit
7) close the dialog and Writer

Reverse-continuing to `atk_object_wrapper_dispose`
(frame #10 in the below backtrace) in rr
showed the involved a11y object:

uno::Reference to (svx::a11y::AccFrameSelectorChild *) 0x5557832b9150

Backtrace (somewhat similar to the one in tdf#156683):

#0  0x76b15cd6 in 
comphelper::OInterfaceContainerHelper4::disposeAndClear(std::unique_lock&,
 com::sun::star::lang::EventObject const&)
(this=0x7fffca88, rGuard=..., rEvt=...) at 
.../include/comphelper/interfacecontainer4.hxx:397
#1  0x76b13c6f in 
comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, 
com::sun::star::uno::Reference const&)
(_nClient=1058, _rxEventSource=uno::Reference to 
(svx::a11y::AccFrameSelectorChild *) 0x5cecfdf0) at 
.../comphelper/source/misc/accessibleeventnotifier.cxx:204
#2  0x76b1028a in 
comphelper::OCommonAccessibleComponent::disposing() (this=0x5cecfdf0) at 
.../comphelper/source/misc/accessiblecomponenthelper.cxx:61
#3  0x76674aeb in cppu::WeakComponentImplHelperBase::dispose() 
(this=0x5cecfdf0) at .../cppuhelper/source/implbase.cxx:104
#4  0x72ddf0e0 in 
cppu::PartialWeakComponentImplHelper::dispose() 
(this=0x5cecfdf0)
at .../include/cppuhelper/compbase.hxx:90
#5  0x76674834 in cppu::WeakComponentImplHelperBase::release() 
(this=0x5cecfdf0) at .../cppuhelper/source/implbase.cxx:79
#6  0x72ddf642 in 
cppu::PartialWeakComponentImplHelper::release() 
(this=0x5cecfdf0)
at .../include/cppuhelper/compbase.hxx:86
#7  0x72ddf378 in 
cppu::ImplInheritanceHelper::release() 
(this=0x5cecfdf0)
at .../include/cppuhelper/implbase.hxx:171
#8  0x72ddf0a0 in 
cppu::ImplInheritanceHelper::release() (this=0x5cecfdf0)
at .../include/cppuhelper/implbase.hxx:171
#9  0x7fffe3f29535 in 
com::sun::star::uno::Reference::clear()
 (this=0x5d40a010) at .../include/com/sun/star/uno/Reference.hxx:231
#10 0x7fffe3f288de in atk_object_wrapper_dispose(AtkObjectWrapper*) 
(wrapper=0x5d409fa0) at .../vcl/unx/gtk3/a11y/atkwrapper.cxx:1078
#11 0x7fffe3f27527 in atk_object_wrapper_finalize(GObject*) 
(obj=0x5d409fa0) at .../vcl/unx/gtk3/a11y/atkwrapper.cxx:674
#12 0x7138c48c in g_object_unref () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x7fffe3f003f7 in AtkListener::~AtkListener() 
(this=0x5ce6ecb0, __in_chrg=) at 
.../vcl/unx/gtk3/a11y/atklistener.cxx:57
#14 0x7fffe3f0042e in AtkListener::~AtkListener() 
(this=0x5ce6ecb0, __in_chrg=) at 
.../vcl/unx/gtk3/a11y/atklistener.cxx:58
#15 0x76756838 in cppu::OWeakObject::release() 
(this=0x5ce6ecb0) at .../cppuhelper/source/weak.cxx:230
#16 0x7fffe3f0a7de in 
cppu::WeakImplHelper::release()
 (this=0x5ce6ecb0) at 

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

2023-04-27 Thread Caolán McNamara (via logerrit)
 svx/source/form/fmshimp.cxx |5 ++
 sw/inc/iodetect.hxx |1 
 sw/source/filter/xml/xmlimp.cxx |   83 
 vcl/workben/fftester.cxx|   10 
 4 files changed, 99 insertions(+)

New commits:
commit bcccaf2322a7bd6ac4204ff48f623517a273922a
Author: Caolán McNamara 
AuthorDate: Thu Apr 27 09:30:05 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 27 21:16:15 2023 +0200

add something for fodt to pdf

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

diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index c81d84742403..cc8f6693d630 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -115,6 +115,7 @@ public:
 };
 
 extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportFODT(SvStream 
);
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestPDFExportFODT(SvStream 
);
 
 #endif
 
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index eaf3a6bec72e..49066780635b 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -23,8 +23,10 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -60,8 +62,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1767,6 +1773,83 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool 
TestImportFODT(SvStream )
 return ret;
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream )
+{
+Reference xDesktop = 
css::frame::Desktop::create(comphelper::getProcessComponentContext());
+Reference xTargetFrame = xDesktop->findFrame("_blank", 
0);
+
+Reference 
xContext(comphelper::getProcessComponentContext());
+Reference 
xModel(xContext->getServiceManager()->createInstanceWithContext(
+"com.sun.star.text.TextDocument", xContext), UNO_QUERY_THROW);
+
+Reference xModelLoad(xModel, UNO_QUERY_THROW);
+xModelLoad->initNew();
+
+css::uno::Reference 
xController(xModel->createDefaultViewController(xTargetFrame), UNO_SET_THROW);
+
+utl::ConnectFrameControllerModel(xTargetFrame, xController, xModel);
+
+uno::Reference 
xMultiServiceFactory(comphelper::getProcessServiceFactory());
+uno::Reference xStream(new 
utl::OSeekableInputStreamWrapper(rStream));
+uno::Reference 
xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"),
 uno::UNO_SET_THROW);
+
+css::uno::Sequence aUserData
+{
+"com.sun.star.comp.filter.OdfFlatXml",
+"",
+"com.sun.star.comp.Writer.XMLOasisImporter",
+"com.sun.star.comp.Writer.XMLOasisExporter",
+"",
+"",
+"true"
+};
+uno::Sequence 
aAdaptorArgs(comphelper::InitPropertySequence(
+{
+{ "UserData", uno::Any(aUserData) },
+}));
+css::uno::Sequence aOuterArgs{ uno::Any(aAdaptorArgs) };
+
+uno::Reference xInit(xInterface, 
uno::UNO_QUERY_THROW);
+xInit->initialize(aOuterArgs);
+
+uno::Reference xImporter(xInterface, 
uno::UNO_QUERY_THROW);
+uno::Sequence aArgs(comphelper::InitPropertySequence(
+{
+{ "InputStream", uno::Any(xStream) },
+{ "URL", uno::Any(OUString("private:stream")) },
+}));
+xImporter->setTargetDocument(xModel);
+
+uno::Reference xFODTFilter(xInterface, 
uno::UNO_QUERY_THROW);
+bool ret = xFODTFilter->filter(aArgs);
+
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+
+utl::TempFileNamed aTempFile;
+aTempFile.EnableKillingFile();
+
+uno::Reference xPDFFilter(
+
xMultiServiceFactory->createInstance("com.sun.star.document.PDFFilter"), 
uno::UNO_QUERY);
+uno::Reference xExporter(xPDFFilter, uno::UNO_QUERY);
+xExporter->setSourceDocument(xModel);
+
+SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE);
+uno::Reference xOutputStream(new 
utl::OStreamWrapper(aOutputStream));
+
+uno::Sequence 
aDescriptor(comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("writer_pdf_Export")) },
+{ "OutputStream", uno::Any(xOutputStream) }
+}));
+xPDFFilter->filter(aDescriptor);
+aOutputStream.Close();
+
+css::uno::Reference xClose(xModel, 
css::uno::UNO_QUERY);
+xClose->close(false);
+
+return ret;
+}
+
 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream )
 {
 SwGlobals::ensure();
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index c396b28f1ede..44fb5338f808 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -322,6 +322,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 SvFileStream aFileStream(out, StreamMode::READ);
 ret = static_cast((*pfnImport)(aFileStream));
 }
+else if 

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

2023-03-30 Thread Caolán McNamara (via logerrit)
 svx/source/svdraw/svdotext.cxx |   14 ++-
 vcl/source/gdi/metaact.cxx |   51 +
 2 files changed, 30 insertions(+), 35 deletions(-)

New commits:
commit 4ceb287c6d42940adf887f36c4f88abae44e0022
Author: Caolán McNamara 
AuthorDate: Thu Mar 30 21:16:43 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Mar 30 22:02:31 2023 +

cid#1524600 Logically dead code

since:

commit 628275acb1b9652e65b8c5c013549dce5ad6f5bf
Date:   Thu Mar 23 11:24:30 2023 +0900

tdf#90407 Change the auto-fit alg. to match better with OOXML

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

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 65f1dab7db65..52bf41312eed 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1290,17 +1290,9 @@ void SdrTextObj::ImpAutoFitText(SdrOutliner& rOutliner, 
const Size& rTextSize,
 {
 const Size aCurrTextSize = rOutliner.CalcTextSizeNTP();
 double fFactor = 1.0;
-if( bIsVerticalWriting )
-{
-if (aCurrTextSize.Width() != 0)
-{
-fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
-}
-}
-else if (aCurrTextSize.Height() != 0)
-{
-fFactor = double(rTextSize.Height())/aCurrTextSize.Height();
-}
+if (aCurrTextSize.Width() != 0)
+fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
+
 // fFactor scales in both x and y directions
 // - this is fine for bulleted words
 // - but it scales too much for a long paragraph
commit 5af55a4b4ce86c61cb227822c016f0d51e03c009
Author: Caolán McNamara 
AuthorDate: Thu Mar 30 21:10:40 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Mar 30 22:02:23 2023 +

ofz#57483 Out-of-memory

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

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 2b8f0809b9fa..d410dfe35181 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -463,8 +463,35 @@ MetaPolyLineAction::MetaPolyLineAction( tools::Polygon 
aPoly, LineInfo aLineInfo
 maPoly  (std::move( aPoly ))
 {}
 
+static bool AllowDim(tools::Long nDim)
+{
+static bool bFuzzing = utl::ConfigManager::IsFuzzing();
+if (bFuzzing)
+{
+if (nDim > 0x2000 || nDim < -0x2000)
+{
+SAL_WARN("vcl", "skipping huge dimension: " << nDim);
+return false;
+}
+}
+return true;
+}
+
+static bool AllowPoint(const Point& rPoint)
+{
+return AllowDim(rPoint.X()) && AllowDim(rPoint.Y());
+}
+
+static bool AllowRect(const tools::Rectangle& rRect)
+{
+return AllowPoint(rRect.TopLeft()) && AllowPoint(rRect.BottomRight());
+}
+
 void MetaPolyLineAction::Execute( OutputDevice* pOut )
 {
+if (!AllowRect(pOut->LogicToPixel(maPoly.GetBoundRect(
+return;
+
 if( maLineInfo.IsDefault() )
 pOut->DrawPolyLine( maPoly );
 else
@@ -570,30 +597,6 @@ MetaTextAction::MetaTextAction( const Point& rPt, OUString 
aStr,
 mnLen   ( nLen )
 {}
 
-static bool AllowDim(tools::Long nDim)
-{
-static bool bFuzzing = utl::ConfigManager::IsFuzzing();
-if (bFuzzing)
-{
-if (nDim > 0x2000 || nDim < -0x2000)
-{
-SAL_WARN("vcl", "skipping huge dimension: " << nDim);
-return false;
-}
-}
-return true;
-}
-
-static bool AllowPoint(const Point& rPoint)
-{
-return AllowDim(rPoint.X()) && AllowDim(rPoint.Y());
-}
-
-static bool AllowRect(const tools::Rectangle& rRect)
-{
-return AllowPoint(rRect.TopLeft()) && AllowPoint(rRect.BottomRight());
-}
-
 void MetaTextAction::Execute( OutputDevice* pOut )
 {
 if (!AllowDim(pOut->LogicToPixel(maPt).Y()))


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

2023-03-23 Thread Caolán McNamara (via logerrit)
 svx/source/form/datanavi.cxx |   74 ---
 svx/source/inc/datanavi.hxx  |9 -
 2 files changed, 57 insertions(+), 26 deletions(-)

New commits:
commit b2beab144096c1f4f33ce0d9cacedbb80cc83594
Author: Caolán McNamara 
AuthorDate: Thu Mar 23 11:25:10 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 23 14:11:57 2023 +

tdf#154322 select the first entry of the current page by default

rather than default to nothing selected, if we switch pages and then
back to page 1 this will be selected anyway, so start off that way

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

diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 5d3242e84683..635e55cdf2ab 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -189,6 +189,15 @@ namespace svxform
 m_xItemList->clear();
 }
 
+void XFormsPage::SelectFirstEntry()
+{
+if (m_xItemList->get_iter_first(*m_xScratchIter))
+{
+m_xItemList->select(*m_xScratchIter);
+ItemSelectHdl(*m_xItemList);
+}
+}
+
 XFormsPage::XFormsPage(weld::Container* pPage, DataNavigatorWindow* 
_pNaviWin, DataGroupType _eGroup)
 : BuilderPage(pPage, nullptr, "svx/ui/xformspage.ui", "XFormsPage")
 , m_pParent(pPage)
@@ -1316,6 +1325,10 @@ namespace svxform
 
 // load xforms models of the current document
 LoadModels();
+
+// tdf#154322 select the first entry of the current page by default
+if (XFormsPage* pPage = GetPage(sPageId))
+pPage->SelectFirstEntry();
 }
 
 DataNavigatorWindow::~DataNavigatorWindow()
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index b165b9a94531..fe26bd27b407 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -237,6 +237,7 @@ namespace svxform
 
 bool DoMenuAction(std::string_view rMenuID);
 void EnableMenuItems();
+void SelectFirstEntry();
 
 const OUString&  GetInstanceName() const { return m_sInstanceName; 
}
 const OUString&  GetInstanceURL() const { return m_sInstanceURL; }
commit 0cdd0a6603626d7da9c331771c77b8a719f0592a
Author: Caolán McNamara 
AuthorDate: Thu Mar 23 10:47:32 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 23 14:11:48 2023 +

Resolves: tdf#154322 if entries are disabled while menu is active, update it

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

diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 992195e05778..5d3242e84683 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -147,32 +147,36 @@ namespace svxform
 }
 
 std::unique_ptr 
xBuilder(Application::CreateBuilder(m_xItemList.get(), 
"svx/ui/formdatamenu.ui"));
-std::unique_ptr xMenu(xBuilder->weld_menu("menu"));
+m_xMenu = xBuilder->weld_menu("menu");
+m_aRemovedMenuEntries.clear();
 
 if (DGTInstance == m_eGroup)
-xMenu->remove("additem");
+m_aRemovedMenuEntries.insert("additem");
 else
 {
-xMenu->remove("addelement");
-xMenu->remove("addattribute");
+m_aRemovedMenuEntries.insert("addelement");
+m_aRemovedMenuEntries.insert("addattribute");
 
 if (DGTSubmission == m_eGroup)
 {
-xMenu->set_label("additem", 
SvxResId(RID_STR_DATANAV_ADD_SUBMISSION));
-xMenu->set_label("edit", 
SvxResId(RID_STR_DATANAV_EDIT_SUBMISSION));
-xMenu->set_label("delete", 
SvxResId(RID_STR_DATANAV_REMOVE_SUBMISSION));
+m_xMenu->set_label("additem", 
SvxResId(RID_STR_DATANAV_ADD_SUBMISSION));
+m_xMenu->set_label("edit", 
SvxResId(RID_STR_DATANAV_EDIT_SUBMISSION));
+m_xMenu->set_label("delete", 
SvxResId(RID_STR_DATANAV_REMOVE_SUBMISSION));
 }
 else
 {
-xMenu->set_label("additem", 
SvxResId(RID_STR_DATANAV_ADD_BINDING));
-xMenu->set_label("edit", 
SvxResId(RID_STR_DATANAV_EDIT_BINDING));
-xMenu->set_label("delete", 
SvxResId(RID_STR_DATANAV_REMOVE_BINDING));
+m_xMenu->set_label("additem", 
SvxResId(RID_STR_DATANAV_ADD_BINDING));
+m_xMenu->set_label("edit", 
SvxResId(RID_STR_DATANAV_EDIT_BINDING));
+m_xMenu->set_label("delete", 
SvxResId(RID_STR_DATANAV_REMOVE_BINDING));
 }
 }
-EnableMenuItems(xMenu.get());
-OString sCommand = 

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

2023-03-15 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/fontworkgallery.cxx |2 +-
 sw/source/core/crsr/crsrsh.cxx  |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 7c66d037b09238709d78206431cf487443633787
Author: Caolán McNamara 
AuthorDate: Wed Mar 15 12:55:39 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 15 16:28:19 2023 +

cid#1522014 Dereference null return value

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

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 132a3cd7c9db..298801ace223 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -638,7 +638,7 @@ typename SwCursorShell::StartsWith 
SwCursorShell::StartsWith_()
 }
 nNode = rNodes.GetEndOfContent();
 pContentNode = SwNodes::GoPrevious();
-if (pContentNode->GetTextNode()->IsHidden())
+if (pContentNode && pContentNode->GetTextNode()->IsHidden())
 {
 return StartsWith::HiddenPara;
 }
@@ -2798,7 +2798,7 @@ bool SwCursorShell::IsEndOfDoc() const
 if( !pCNd )
 pCNd = SwNodes::GoPrevious(  );
 
-return aIdx == m_pCurrentCursor->GetPoint()->GetNode() &&
+return aIdx == m_pCurrentCursor->GetPoint()->GetNode() && pCNd &&
 pCNd->Len() == m_pCurrentCursor->GetPoint()->GetContentIndex();
 }
 
commit a84a15eadc4ff5b14287f548170f4a9d81ee
Author: Caolán McNamara 
AuthorDate: Wed Mar 15 12:52:06 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 15 16:28:11 2023 +

cid#1521990 silence Unchecked return value

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

diff --git a/svx/source/tbxctrls/fontworkgallery.cxx 
b/svx/source/tbxctrls/fontworkgallery.cxx
index da1df7a8fd96..b08698c03921 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -129,7 +129,7 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 
nThemeId)
 maIdToTitleMap.clear();
 
 std::vector aTitles;
-GalleryExplorer::FillObjListTitle(nThemeId, aTitles);
+(void)GalleryExplorer::FillObjListTitle(nThemeId, aTitles);
 assert(aTitles.size() == nFavCount);
 
 for( size_t nFavorite = 1; nFavorite <= nFavCount; nFavorite++ )


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

2022-12-14 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/rubydialog.cxx |8 ++--
 svx/source/stbctrls/pszctrl.cxx  |2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit e5d68c4a4ad953d4d7d99103ee2181be38cd025b
Author: Caolán McNamara 
AuthorDate: Wed Dec 14 14:28:50 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 14 19:38:59 2022 +

Resolves: tdf#152495 crash on dismissing ruby dialog with ESC

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

diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index 4059e8d35c8c..3fefb5e74641 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -83,6 +83,7 @@ class SvxRubyData_Impl : public 
cppu::WeakImplHelper aRubyValues;
 Reference xController;
 bool bHasSelectionChanged;
+bool bDisposing;
 
 public:
 SvxRubyData_Impl();
@@ -98,6 +99,7 @@ public:
 return xModel;
 }
 bool HasSelectionChanged() const { return bHasSelectionChanged; }
+bool IsDisposing() const { return bDisposing; }
 Reference const& GetRubySelection()
 {
 xSelection.set(xController, UNO_QUERY);
@@ -120,6 +122,7 @@ public:
 
 SvxRubyData_Impl::SvxRubyData_Impl()
 : bHasSelectionChanged(false)
+, bDisposing(false)
 {
 }
 
@@ -161,6 +164,7 @@ void SvxRubyData_Impl::disposing(const EventObject&)
 {
 }
 xController = nullptr;
+bDisposing = true;
 }
 
 void SvxRubyData_Impl::AssertOneEntry()
@@ -269,9 +273,9 @@ void SvxRubyDialog::Close()
 void SvxRubyDialog::Activate()
 {
 SfxModelessDialogController::Activate();
-if (!m_xContentArea)
+if (m_pImpl->IsDisposing())
 {
-// tdf#141967 if Activate is called during tear down bail early
+// tdf#141967/tdf#152495 if Activate is called during tear down bail 
early
 return;
 }
 //get selection from current view frame
commit 040867fce9a992b34813dab3a4d7ab93ebccbe11
Author: Caolán McNamara 
AuthorDate: Wed Dec 14 12:42:01 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 14 19:38:51 2022 +

table cel->table cell

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

diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index 129ac67eb085..5eddc1981727 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -323,7 +323,7 @@ void 
SvxPosSizeStatusBarControl::StateChangedAtStatusBarControl( sal_uInt16 nSID
 }
 else if ( auto pStringItem = dynamic_cast( pState) )
 {
-// show string (table cel or different)
+// show string (table cell or different)
 pImpl->aStr = pStringItem->GetValue();
 pImpl->bTable = true;
 pImpl->bPos = false;


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

2022-12-14 Thread Noel Grandin (via logerrit)
 svx/source/tbxctrls/tbunocontroller.cxx|   31 ---
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |  217 ++---
 sw/source/core/unocore/unostyle.cxx|   28 --
 sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx |   50 
 sw/source/uibase/inc/unotxvw.hxx   |   33 +--
 sw/source/uibase/inc/workctrl.hxx  |8 
 sw/source/uibase/ribbar/workctrl.cxx   |   53 -
 sw/source/uibase/uno/unotxvw.cxx   |   97 -
 8 files changed, 54 insertions(+), 463 deletions(-)

New commits:
commit 705594fc805012b5bf6167d7f9fee63bb1b90a1b
Author: Noel Grandin 
AuthorDate: Wed Dec 14 16:14:02 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 14 18:24:45 2022 +

loplugin:implinheritancehelper in sw

use more ImplInheritanceHelper to reduce boilerplate

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

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 54292da78c9c..cd2097cc3db5 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -630,23 +630,18 @@ public:
 void PutItemToSet(const SvxSetItem* pSetItem, const SfxItemPropertySet& 
rPropSet, const SfxItemPropertyMapEntry& rEntry, const uno::Any& rVal, 
SwStyleBase_Impl& rBaseImpl);
 };
 
+typedef cppu::ImplInheritanceHelper< SwXStyle, css::document::XEventsSupplier> 
SwXFrameStyle_Base;
 class SwXFrameStyle
-: public SwXStyle
-, public css::document::XEventsSupplier
+: public SwXFrameStyle_Base
 , public sw::ICoreFrameStyle
 {
 public:
 SwXFrameStyle(SfxStyleSheetBasePool& rPool,
 SwDoc*  pDoc,
 const OUString& rStyleName) :
-SwXStyle(, SfxStyleFamily::Frame, pDoc, rStyleName){}
+SwXFrameStyle_Base(, SfxStyleFamily::Frame, pDoc, rStyleName){}
 explicit SwXFrameStyle(SwDoc *pDoc);
 
-virtual void SAL_CALL acquire(  ) noexcept override {SwXStyle::acquire();}
-virtual void SAL_CALL release(  ) noexcept override {SwXStyle::release();}
-
-virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
-virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType 
) override;
 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL 
getEvents(  ) override;
 
 //ICoreStyle
@@ -3343,7 +3338,7 @@ void SwXPageStyle::setPropertyValue(const OUString& 
rPropertyName, const uno::An
 }
 
 SwXFrameStyle::SwXFrameStyle(SwDoc *pDoc)
-: SwXStyle(pDoc, SfxStyleFamily::Frame, false)
+: SwXFrameStyle_Base(pDoc, SfxStyleFamily::Frame, false)
 { }
 
 void SwXFrameStyle::SetItem(sal_uInt16 eAtr, const SfxPoolItem& rItem)
@@ -3369,21 +3364,6 @@ const SfxPoolItem* SwXFrameStyle::GetItem(sal_uInt16 
eAtr)
 return >GetItemSet().Get(eAtr);
 }
 
-uno::Sequence SwXFrameStyle::getTypes()
-{
-return cppu::OTypeCollection(
-cppu::UnoType::get(),
-SwXStyle::getTypes()
-).getTypes();
-}
-
-uno::Any SwXFrameStyle::queryInterface(const uno::Type& rType)
-{
-if(rType == cppu::UnoType::get())
-return uno::Any(uno::Reference(this));
-return SwXStyle::queryInterface(rType);
-}
-
 uno::Reference SwXFrameStyle::getEvents()
 {
 return new SwFrameStyleEventDescriptor(*this);
diff --git a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx 
b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
index a97974f57f34..1603d11b2608 100644
--- a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
+++ b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
@@ -97,7 +97,8 @@ IMPL_LINK(CurrentEdit, KeyInputHdl, const KeyEvent&, rKEvt, 
bool)
 }
 
 /// Controller for .uno:MailMergeCurrentEntry toolbar checkbox: creates the 
checkbox & handles the value.
-class MMCurrentEntryController : public svt::ToolboxController, public 
lang::XServiceInfo
+typedef cppu::ImplInheritanceHelper< ::svt::ToolboxController, 
css::lang::XServiceInfo> MMCurrentEntryController_Base;
+class MMCurrentEntryController : public MMCurrentEntryController_Base
 {
 VclPtr m_xCurrentEdit;
 
@@ -105,31 +106,11 @@ class MMCurrentEntryController : public 
svt::ToolboxController, public lang::XSe
 
 public:
 explicit MMCurrentEntryController(const 
uno::Reference& rContext)
-: svt::ToolboxController(rContext, uno::Reference(), 
".uno:MailMergeCurrentEntry")
+: MMCurrentEntryController_Base(rContext, 
uno::Reference(), ".uno:MailMergeCurrentEntry")
 , m_xCurrentEdit(nullptr)
 {
 }
 
-// XInterface
-virtual uno::Any SAL_CALL queryInterface(const uno::Type& aType) override
-{
-uno::Any a(ToolboxController::queryInterface(aType));
-if (a.hasValue())
-return a;
-
-return ::cppu::queryInterface(aType, 

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

2022-11-05 Thread Caolán McNamara (via logerrit)
 svx/source/unodraw/unoshtxt.cxx |2 +-
 vcl/source/outdev/hatch.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d90bf6f8c19d7c43ec83656a3a6f85a81aee573c
Author: Caolán McNamara 
AuthorDate: Sat Nov 5 16:03:59 2022 +
Commit: Caolán McNamara 
CommitDate: Sat Nov 5 22:13:55 2022 +0100

ofz#53028 Integer-overflow

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

diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx
index 10930bbcb424..3b92f6df5de9 100644
--- a/vcl/source/outdev/hatch.cxx
+++ b/vcl/source/outdev/hatch.cxx
@@ -327,14 +327,14 @@ void OutputDevice::CalcHatchValues( const 
tools::Rectangle& rRect, tools::Long n
 rPt1 = rRect.TopLeft();
 rPt2 = Point( rRect.Left() - nXOff, rRect.Bottom() );
 rEndPt1 = Point( rRect.Right() + nXOff, rRect.Top() );
-nPX = FRound( aRef.X() - ( ( rPt1.Y() - aRef.Y() ) / fTan ) );
+nPX = FRound( aRef.X() - ( (static_cast(rPt1.Y()) - 
aRef.Y()) / fTan ) );
 }
 else
 {
 rPt1 = rRect.BottomLeft();
 rPt2 = Point( rRect.Left() - nXOff, rRect.Top() );
 rEndPt1 = Point( rRect.Right() + nXOff, rRect.Bottom() );
-nPX = FRound( aRef.X() + ( ( rPt1.Y() - aRef.Y() ) / fTan ) );
+nPX = FRound( aRef.X() + ( (static_cast(rPt1.Y()) - 
aRef.Y()) / fTan ) );
 }
 
 if( nPX <= rPt1.X() )
commit 12e468a6066894e7ff01d622343d23fccbceeb09
Author: Caolán McNamara 
AuthorDate: Sat Nov 5 15:09:07 2022 +
Commit: Caolán McNamara 
CommitDate: Sat Nov 5 22:13:43 2022 +0100

cid#1516651 Dereference after null check

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

diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index b1ca3ff0c65e..168212aaa159 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -551,7 +551,7 @@ SvxTextForwarder* 
SvxTextEditSourceImpl::GetBackgroundTextForwarder()
 mpOutliner->SetText( *pOutlinerParaObject );
 
 // put text to object and set EmptyPresObj to FALSE
-if( mpText && bOwnParaObj && mpObject->IsEmptyPresObj() && 
pTextObj->IsReallyEdited() )
+if (mpText && bOwnParaObj && mpObject->IsEmptyPresObj() && 
pTextObj && pTextObj->IsReallyEdited())
 {
 mpObject->SetEmptyPresObj( false );
 static_cast< SdrTextObj* >( 
mpObject)->NbcSetOutlinerParaObjectForText( pOutlinerParaObject, mpText );


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

2022-08-22 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx   |3 +++
 unotools/source/i18n/localedatawrapper.cxx |   20 +++-
 2 files changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 37494dc5457f5feb44465d2eb508a5f77fec74cd
Author: Caolán McNamara 
AuthorDate: Mon Aug 22 14:44:43 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 22 20:30:32 2022 +0200

I see this empty entry for the separator in the styles dropdown

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

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 610bb630e55e..db147949c306 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1575,6 +1575,9 @@ void 
SvxStyleBox_Base::CalcOptimalExtraUserWidth(vcl::RenderContext& rRenderCont
 {
 OUString sStyleName(get_text(i));
 
+if (sStyleName.isEmpty())
+continue;
+
 rRenderContext.Push(vcl::PushFlags::FILLCOLOR | vcl::PushFlags::FONT | 
vcl::PushFlags::TEXTCOLOR);
 SetupEntry(rRenderContext, i, tools::Rectangle(0, 0, RECT_MAX, 
ITEM_HEIGHT), sStyleName, true);
 auto aScriptChanges = CheckScript(sStyleName);
commit b759f6720b50487200740a6202e21774897b44b2
Author: Eike Rathke 
AuthorDate: Mon Aug 22 16:16:08 2022 +0200
Commit: Eike Rathke 
CommitDate: Mon Aug 22 20:30:20 2022 +0200

Resolves: tdf#150288 Do not prepend the locale's full date acceptance 
pattern

... if it wasn't present as first, but take the date acceptance
patterns as specified by the user.

Change-Id: Ife2fd39731bac0e0b121f22392f22b48ffc9c978
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138694
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 54aa49f44877..9e6fe8990979 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1550,19 +1550,13 @@ void LocaleDataWrapper::loadDateAcceptancePatterns(
 }
 }
 
-// Never overwrite the locale's full date pattern! The first.
-if (std::as_const(aDateAcceptancePatterns)[0] == rPatterns[0])
-aDateAcceptancePatterns = comphelper::containerToSequence(rPatterns);  
  // sane
-else
-{
-// Copy existing full date pattern and append the sequence passed.
-/* TODO: could check for duplicates and shrink target sequence */
-Sequence< OUString > aTmp( rPatterns.size() + 1 );
-auto it = aTmp.getArray();
-*it = std::as_const(aDateAcceptancePatterns)[0];
-std::copy(rPatterns.begin(), rPatterns.end(), std::next(it));
-aDateAcceptancePatterns = aTmp;
-}
+// Earlier versions checked for presence of the full date pattern with
+// aDateAcceptancePatterns[0] == rPatterns[0] and prepended that if not.
+// This lead to confusion if the patterns were intentionally specified
+// without, giving entirely a different DMY order, see tdf#150288.
+// Not checking this and accepting the given patterns as is may result in
+// the user shooting themself in the foot, but we can't have both.
+aDateAcceptancePatterns = comphelper::containerToSequence(rPatterns);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-07-20 Thread Caolán McNamara (via logerrit)
 svx/source/customshapes/EnhancedCustomShape3d.cxx |6 --
 vcl/source/filter/itiff/itiff.cxx |   19 ---
 2 files changed, 16 insertions(+), 9 deletions(-)

New commits:
commit f37395de7177b7724c7b7d03e5b52e8da90c44d2
Author: Caolán McNamara 
AuthorDate: Wed Jul 20 09:18:12 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 20 18:05:19 2022 +0200

ofz#48366 Timeout

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

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index c607930e6007..3d21a66dc0af 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -125,6 +125,8 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 
 Animation aAnimation;
 
+const bool bFuzzing = utl::ConfigManager::IsFuzzing();
+
 do
 {
 uint32_t w, h;
@@ -157,7 +159,7 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 break;
 }
 
-if (utl::ConfigManager::IsFuzzing())
+if (bFuzzing)
 {
 const uint64_t MAX_SIZE = 2;
 if (TIFFTileSize64(tif) > MAX_SIZE || nPixelsRequired > MAX_SIZE)
@@ -234,13 +236,16 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 
 BitmapEx aBitmapEx(bitmap, bitmapAlpha);
 
-switch (nOrientation)
+if (!bFuzzing)
 {
-case ORIENTATION_LEFTBOT:
-aBitmapEx.Rotate(2700_deg10, COL_BLACK);
-break;
-default:
-break;
+switch (nOrientation)
+{
+case ORIENTATION_LEFTBOT:
+aBitmapEx.Rotate(2700_deg10, COL_BLACK);
+break;
+default:
+break;
+}
 }
 
 AnimationBitmap aAnimationBitmap(aBitmapEx, Point(0, 0), 
aBitmapEx.GetSizePixel(),
commit 779fc912b21102b6aed4109dc6b5d3f5937d2b4d
Author: Caolán McNamara 
AuthorDate: Wed Jul 20 11:11:16 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 20 18:05:03 2022 +0200

ofz#49200 Timeout

disable slow path for fuzzing

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

diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 731f8208d2f6..04d685c62122 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -56,7 +57,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 using namespace com::sun::star;
 using namespace com::sun::star::uno;
@@ -350,6 +351,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
 basegfx::B2DPolyPolygon aTotalPolyPoly;
 SdrObjListIter aIter( *pShape2d, SdrIterMode::DeepNoGroups );
 const bool bMultipleSubObjects(aIter.Count() > 1);
+const bool bFuzzing(utl::ConfigManager::IsFuzzing());
 
 while( aIter.IsMore() )
 {
@@ -394,7 +396,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
 }
 }
 
-if(bNeedToConvertToContour)
+if (bNeedToConvertToContour && !bFuzzing)
 {
 SdrObject* pNewObj = 
pNext->ConvertToContourObj(const_cast< SdrObject* >(pNext));
 SdrPathObj* pNewPathObj = dynamic_cast< SdrPathObj* 
>(pNewObj);


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

2022-02-20 Thread Szymon Kłos (via logerrit)
 svx/source/inc/StylesPreviewWindow.hxx  |   24 ++--
 svx/source/tbxctrls/StylesPreviewWindow.cxx |   20 +++-
 vcl/jsdialog/enabled.cxx|4 ++--
 3 files changed, 39 insertions(+), 9 deletions(-)

New commits:
commit 522bde9470bbb321813fa5f1ca8e3c2ebb1bb5cc
Author: Szymon Kłos 
AuthorDate: Tue Dec 14 18:21:39 2021 +0100
Commit: Szymon Kłos 
CommitDate: Mon Feb 21 05:31:53 2022 +0100

Update styles previews in Idle

This helps with performance when we do series of actions
updating styles. In that case we will only request update.
When we will reach idle state we will do it only one time.
What removes unnecessary updates in the meantime.

Change-Id: I9fc59992833a6cf98c42571c1189b3c5d49ba5a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126840
Reviewed-by: Luboš Luňák 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130232
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/svx/source/inc/StylesPreviewWindow.hxx 
b/svx/source/inc/StylesPreviewWindow.hxx
index 73c688fc9498..21f46a5e81b9 100644
--- a/svx/source/inc/StylesPreviewWindow.hxx
+++ b/svx/source/inc/StylesPreviewWindow.hxx
@@ -74,8 +74,25 @@ private:
   const tools::Rectangle& aContentRect, 
const Color& aColor);
 };
 
+class StylesListUpdateTask : public Idle
+{
+StylesPreviewWindow_Base& m_rStylesList;
+
+public:
+StylesListUpdateTask(StylesPreviewWindow_Base& rStylesList)
+: Idle("StylesListUpdateTask")
+, m_rStylesList(rStylesList)
+{
+SetPriority(TaskPriority::HIGH_IDLE);
+}
+
+virtual void Invoke() override;
+};
+
 class StylesPreviewWindow_Base
 {
+friend class StylesListUpdateTask;
+
 protected:
 static constexpr unsigned STYLES_COUNT = 6;
 
@@ -83,6 +100,8 @@ protected:
 
 std::unique_ptr m_xStylesView;
 
+StylesListUpdateTask m_aUpdateTask;
+
 rtl::Reference m_xStatusListener;
 std::unique_ptr m_pStylePoolChangeListener;
 
@@ -102,10 +121,11 @@ public:
 ~StylesPreviewWindow_Base();
 
 void Select(const OUString& rStyleName);
-void UpdateStylesList();
+void RequestStylesListUpdate();
 
 private:
-void Update();
+void UpdateStylesList();
+void UpdateSelection();
 bool Command(const CommandEvent& rEvent);
 };
 
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx 
b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index 228e322be50a..2c27c2fb834f 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -100,7 +100,7 @@ StylePoolChangeListener::~StylePoolChangeListener()
 
 void StylePoolChangeListener::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& 
/*rHint*/)
 {
-m_pPreviewControl->UpdateStylesList();
+m_pPreviewControl->RequestStylesListUpdate();
 }
 
 StyleItemController::StyleItemController(const std::pair& 
aStyleName)
@@ -358,6 +358,7 @@ StylesPreviewWindow_Base::StylesPreviewWindow_Base(
 const css::uno::Reference& 
xDispatchProvider)
 : m_xDispatchProvider(xDispatchProvider)
 , m_xStylesView(xBuilder.weld_icon_view("stylesview"))
+, m_aUpdateTask(*this)
 , m_aDefaultStyles(std::move(aDefaultStyles))
 {
 m_xStylesView->connect_selection_changed(LINK(this, 
StylesPreviewWindow_Base, Selected));
@@ -368,8 +369,7 @@ StylesPreviewWindow_Base::StylesPreviewWindow_Base(
 
 m_pStylePoolChangeListener.reset(new StylePoolChangeListener(this));
 
-UpdateStylesList();
-Update();
+RequestStylesListUpdate();
 }
 
 IMPL_LINK(StylesPreviewWindow_Base, Selected, weld::IconView&, rIconView, void)
@@ -405,6 +405,8 @@ StylesPreviewWindow_Base::~StylesPreviewWindow_Base()
 {
 m_xStatusListener->UnBind();
 
+m_aUpdateTask.Stop();
+
 try
 {
 m_xStatusListener->dispose();
@@ -420,10 +422,10 @@ void StylesPreviewWindow_Base::Select(const OUString& 
rStyleName)
 {
 m_sSelectedStyle = rStyleName;
 
-Update();
+UpdateSelection();
 }
 
-void StylesPreviewWindow_Base::Update()
+void StylesPreviewWindow_Base::UpdateSelection()
 {
 for (std::vector>::size_type i = 0; i < 
m_aAllStyles.size(); ++i)
 {
@@ -435,6 +437,14 @@ void StylesPreviewWindow_Base::Update()
 }
 }
 
+void StylesPreviewWindow_Base::RequestStylesListUpdate() { 
m_aUpdateTask.Start(); }
+
+void StylesListUpdateTask::Invoke()
+{
+m_rStylesList.UpdateStylesList();
+m_rStylesList.UpdateSelection();
+}
+
 void StylesPreviewWindow_Base::UpdateStylesList()
 {
 m_aAllStyles = m_aDefaultStyles;
commit 3ab1a849ba54410d14e2c988ae010f2c31dd4dce
Author: Gökay ŞATIR 
AuthorDate: Tue Nov 2 12:38:26 2021 +0300
Commit: Szymon Kłos 
CommitDate: Mon Feb 21 05:31:39 2022 +0100

Use JSDialogBuilder for "Find and Replace" dialog.

Signed-off-by: Gökay ŞATIR 
Change-Id: I31307601f067c9b303854899258139678ddbba57
Reviewed-on: 

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

2021-12-06 Thread Caolán McNamara (via logerrit)
 svx/source/sdr/contact/viewcontactofgraphic.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 2340639df07755a1d67fb59b52a9ece65f279f4a
Author: Caolán McNamara 
AuthorDate: Sun Dec 5 16:53:22 2021 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 5 20:10:32 2021 +0100

cid#1494630 #4 rearrange to demo Logically dead code

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

diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx 
b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index aeebfabdc442..dd4afd9ba64e 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -326,8 +326,7 @@ namespace sdr::contact
 // accordingly. The created bitmapPrimitive WILL use the rotation, 
too.
 if (bRota180)
 {
-const sal_uInt16 nMirrorCase(bMirrored ? 3 : 4);
-bHMirr = 4 == nMirrorCase;
+bHMirr = !bMirrored;
 
 // if bRota180 which is used for vertical mirroring, the 
graphic will already be rotated
 // by 180 degrees. To correct, switch off VMirror and invert 
HMirroring.
@@ -335,8 +334,7 @@ namespace sdr::contact
 }
 else
 {
-const sal_uInt16 nMirrorCase(bMirrored ? 2 : 1);
-bHMirr = 2 == nMirrorCase;
+bHMirr = bMirrored;
 }
 
 if (bHMirr)
commit 50b8dacd0b53b694e14b2982968e3eebd0d5cbb6
Author: Caolán McNamara 
AuthorDate: Sun Dec 5 16:50:33 2021 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 5 20:10:18 2021 +0100

cid#1494630 Logically dead code

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

diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx 
b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index d2e21ed0d487..aeebfabdc442 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -319,7 +319,6 @@ namespace sdr::contact
 const bool bMirrored(GetGrafObject().IsMirrored());
 
 bool bHMirr;
-bool bVMirr;
 
 // set mirror flags at LocalGrafInfo. Take into account that the 
geometry in
 // aObjectRange is already changed and rotated when bRota180 is 
used. To rebuild
@@ -333,18 +332,16 @@ namespace sdr::contact
 // if bRota180 which is used for vertical mirroring, the 
graphic will already be rotated
 // by 180 degrees. To correct, switch off VMirror and invert 
HMirroring.
 bHMirr = !bHMirr;
-bVMirr = false;
 }
 else
 {
 const sal_uInt16 nMirrorCase(bMirrored ? 2 : 1);
 bHMirr = 2 == nMirrorCase;
-bVMirr = false;
 }
 
-if(bHMirr || bVMirr)
+if (bHMirr)
 {
-aLocalGrafInfo.SetMirrorFlags((bHMirr ? 
BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE)|(bVMirr ? 
BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE));
+aLocalGrafInfo.SetMirrorFlags(BmpMirrorFlags::Horizontal);
 }
 
 // fill object matrix


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

2021-12-06 Thread Caolán McNamara (via logerrit)
 svx/source/sdr/contact/viewcontactofgraphic.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 0f976bdb7b7735b4364ae6f3a84a950ab07822bb
Author: Caolán McNamara 
AuthorDate: Sun Dec 5 16:49:04 2021 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 5 20:09:47 2021 +0100

cid#1494630 #3 rearrange to demo Logically dead code

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

diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx 
b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 4e1aa179b976..d2e21ed0d487 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -328,7 +328,7 @@ namespace sdr::contact
 if (bRota180)
 {
 const sal_uInt16 nMirrorCase(bMirrored ? 3 : 4);
-bHMirr = ((2 == nMirrorCase ) || (4 == nMirrorCase));
+bHMirr = 4 == nMirrorCase;
 
 // if bRota180 which is used for vertical mirroring, the 
graphic will already be rotated
 // by 180 degrees. To correct, switch off VMirror and invert 
HMirroring.
@@ -338,8 +338,8 @@ namespace sdr::contact
 else
 {
 const sal_uInt16 nMirrorCase(bMirrored ? 2 : 1);
-bHMirr = ((2 == nMirrorCase ) || (4 == nMirrorCase));
-bVMirr = ((3 == nMirrorCase ) || (4 == nMirrorCase));
+bHMirr = 2 == nMirrorCase;
+bVMirr = false;
 }
 
 if(bHMirr || bVMirr)
commit b8e36ff21c50985d56ec499211302586bc451891
Author: Caolán McNamara 
AuthorDate: Sun Dec 5 16:47:55 2021 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 5 20:09:33 2021 +0100

cid#1494630 #2 rearrange to demo Logically dead code

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

diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx 
b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index c22095e2c016..4e1aa179b976 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -327,9 +327,8 @@ namespace sdr::contact
 // accordingly. The created bitmapPrimitive WILL use the rotation, 
too.
 if (bRota180)
 {
-const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : 
(bMirrored ? 2 : 1));
+const sal_uInt16 nMirrorCase(bMirrored ? 3 : 4);
 bHMirr = ((2 == nMirrorCase ) || (4 == nMirrorCase));
-bVMirr = ((3 == nMirrorCase ) || (4 == nMirrorCase));
 
 // if bRota180 which is used for vertical mirroring, the 
graphic will already be rotated
 // by 180 degrees. To correct, switch off VMirror and invert 
HMirroring.
@@ -338,7 +337,7 @@ namespace sdr::contact
 }
 else
 {
-const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : 
(bMirrored ? 2 : 1));
+const sal_uInt16 nMirrorCase(bMirrored ? 2 : 1);
 bHMirr = ((2 == nMirrorCase ) || (4 == nMirrorCase));
 bVMirr = ((3 == nMirrorCase ) || (4 == nMirrorCase));
 }


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

2021-10-31 Thread Mike Kaganski (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx  |5 
 svx/source/core/graphichelper.cxx |   19 -
 svx/source/customshapes/EnhancedCustomShape2d.cxx |5 
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx |3 
 svx/source/dialog/charmap.cxx |   12 -
 svx/source/dialog/compressgraphicdialog.cxx   |   13 -
 svx/source/dialog/docrecovery.cxx |   77 
 svx/source/dialog/rubydialog.cxx  |5 
 svx/source/dialog/signaturelinehelper.cxx |6 
 svx/source/form/databaselocationinput.cxx |3 
 svx/source/form/fmshimp.cxx   |3 
 svx/source/form/fmtextcontrolshell.cxx|6 
 svx/source/form/formcontroller.cxx|8 
 svx/source/form/tbxform.cxx   |7 
 svx/source/gallery2/galbrws1.cxx  |7 
 svx/source/gallery2/galbrws2.cxx  |   51 ++---
 svx/source/gallery2/galmisc.cxx   |7 
 svx/source/items/clipfmtitem.cxx  |6 
 svx/source/items/customshapeitem.cxx  |   22 +-
 svx/source/items/galleryitem.cxx  |   24 +-
 svx/source/items/viewlayoutitem.cxx   |   13 -
 svx/source/items/zoomslideritem.cxx   |   19 +
 svx/source/mnuctrls/clipboardctl.cxx  |7 
 svx/source/sdr/overlay/overlaymanager.cxx |7 
 svx/source/smarttags/SmartTagMgr.cxx  |   15 -
 svx/source/stbctrls/pszctrl.cxx   |   10 -
 svx/source/stbctrls/selctrl.cxx   |9 
 svx/source/stbctrls/xmlsecctrl.cxx|   10 -
 svx/source/stbctrls/zoomctrl.cxx  |   19 -
 svx/source/stbctrls/zoomsliderctrl.cxx|8 
 svx/source/svdraw/svdlayer.cxx|8 
 svx/source/svdraw/svdoashp.cxx|  168 -
 svx/source/svdraw/svdoole2.cxx|6 
 svx/source/tbxctrls/PaletteManager.cxx|   13 -
 svx/source/tbxctrls/StylesPreviewWindow.cxx   |   21 --
 svx/source/tbxctrls/colrctrl.cxx  |   10 -
 svx/source/tbxctrls/extrusioncontrols.cxx |   41 +---
 svx/source/tbxctrls/fontworkgallery.cxx   |   21 --
 svx/source/tbxctrls/formatpaintbrushctrl.cxx  |6 
 svx/source/tbxctrls/grafctrl.cxx  |   12 -
 svx/source/tbxctrls/itemwin.cxx   |5 
 svx/source/tbxctrls/layctrl.cxx   |   17 -
 svx/source/tbxctrls/lboxctrl.cxx  |6 
 svx/source/tbxctrls/linectrl.cxx  |   22 --
 svx/source/tbxctrls/tbcontrl.cxx  |   57 ++---
 svx/source/tbxctrls/tbunocontroller.cxx   |6 
 svx/source/unodraw/UnoGraphicExporter.cxx |   10 -
 svx/source/unodraw/unomod.cxx |   52 ++---
 svx/source/unodraw/unoshap4.cxx   |   11 -
 svx/source/unogallery/unogalthemeprovider.cxx |3 
 svx/source/xml/xmleohlp.cxx   |   12 -
 svx/source/xml/xmlexport.cxx  |7 
 svx/source/xoutdev/xattr.cxx  |   32 +--
 svx/source/xoutdev/xattrbmp.cxx   |   12 -
 sw/qa/extras/odfexport/odfexport.cxx  |6 
 sw/qa/extras/odfimport/odfimport.cxx  |  172 --
 sw/qa/extras/rtfimport/rtfimport.cxx  |4 
 sw/qa/extras/unowriter/unowriter.cxx  |9 
 sw/qa/uibase/uiview/uiview.cxx|4 
 sw/qa/unit/swmodeltestbase.cxx|   11 -
 sw/source/core/access/accpara.cxx |5 
 sw/source/core/crsr/findtxt.cxx   |6 
 sw/source/core/doc/DocumentStatisticsManager.cxx  |   33 +--
 sw/source/core/doc/doc.cxx|3 
 sw/source/core/docnode/retrieveinputstream.cxx|   11 -
 sw/source/core/ole/ndole.cxx  |6 
 sw/source/core/swg/SwXMLTextBlocks1.cxx   |7 
 sw/source/core/unocore/unochart.cxx   |   23 +-
 sw/source/core/unocore/unocoll.cxx|8 
 sw/source/core/unocore/unocrsrhelper.cxx  |5 
 sw/source/core/unocore/unoobj.cxx |   11 -
 sw/source/core/unocore/unoparagraph.cxx   |5 
 sw/source/core/unocore/unoport.cxx|5 
 sw/source/core/unocore/unostyle.cxx   |   25 +-
 sw/source/core/view/printdata.cxx |   45 +---
 sw/source/filter/ww8/ww8par.cxx   |3 
 sw/source/filter/ww8/ww8par3.cxx  |3 
 sw/source/filter/ww8/ww8toolbar.cxx  

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

2021-08-18 Thread Szymon Kłos (via logerrit)
 svx/source/sidebar/effect/EffectPropertyPanel.cxx |2 +-
 svx/uiconfig/ui/sidebareffect.ui  |4 ++--
 vcl/jsdialog/jsdialogbuilder.cxx  |1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 0b538d1ca8893c0faff55e1e20e62f070fd411d6
Author: Szymon Kłos 
AuthorDate: Fri Jul 9 16:38:57 2021 +0200
Commit: Szymon Kłos 
CommitDate: Wed Aug 18 10:38:39 2021 +0200

jsdialog: dont use popular id for glow color

to avoid confusing it on updates

Change-Id: I2b19dc41a17e070ac1c8869d478c3b0b09a54223
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118692
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120614
Tested-by: Szymon Kłos 

diff --git a/svx/source/sidebar/effect/EffectPropertyPanel.cxx 
b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
index 78424ccc2175..77e2dac11229 100644
--- a/svx/source/sidebar/effect/EffectPropertyPanel.cxx
+++ b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
@@ -36,7 +36,7 @@ EffectPropertyPanel::EffectPropertyPanel(weld::Widget* 
pParent, SfxBindings* pBi
   m_xBuilder->weld_metric_spin_button("LB_GLOW_TRANSPARENCY", 
FieldUnit::PERCENT))
 , mxFTRadiusSoftEdge(m_xBuilder->weld_label("radiussoftedge"))
 , mxFTRadiusGlow(m_xBuilder->weld_label("radiusglow"))
-, mxFTColor(m_xBuilder->weld_label("color"))
+, mxFTColor(m_xBuilder->weld_label("glowcolorlabel"))
 , 
mxSoftEdgeRadius(m_xBuilder->weld_metric_spin_button("SB_SOFTEDGE_RADIUS", 
FieldUnit::POINT))
 {
 Initialize();
diff --git a/svx/uiconfig/ui/sidebareffect.ui b/svx/uiconfig/ui/sidebareffect.ui
index 6a18fdcb5b7c..0c0ee28da606 100644
--- a/svx/uiconfig/ui/sidebareffect.ui
+++ b/svx/uiconfig/ui/sidebareffect.ui
@@ -73,7 +73,7 @@
   
 
 
-  
+  
 True
 False
 Color:
@@ -227,7 +227,7 @@
   
 
   
-  
+  
   
   
 
commit c2d32db5b1c401bf8412713a4416491337831f39
Author: Szymon Kłos 
AuthorDate: Wed Jul 7 12:19:12 2021 +0200
Commit: Szymon Kłos 
CommitDate: Wed Aug 18 10:38:28 2021 +0200

jsdialog: send type for popup messages

Change-Id: Ic0f189645dc9a1164cbbc528b3a5d30d72ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118552
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120613
Tested-by: Szymon Kłos 

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index a376faed407d..6f63067b6186 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -251,6 +251,7 @@ JSDialogNotifyIdle::generateClosePopupMessage(OUString 
sWindowId) const
 return aJsonWriter;
 
 aJsonWriter->put("jsontype", "dialog");
+aJsonWriter->put("type", "modalpopup");
 aJsonWriter->put("action", "close");
 aJsonWriter->put("id", sWindowId);
 


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

2021-05-30 Thread Noel Grandin (via logerrit)
 svx/source/fmcomp/gridctrl.cxx   |   15 ++-
 sw/source/filter/ww8/ww8par.cxx  |   18 +-
 sw/source/filter/ww8/ww8par.hxx  |2 +-
 sw/source/filter/ww8/ww8scan.cxx |2 +-
 sw/source/filter/ww8/ww8scan.hxx |2 +-
 sw/source/filter/xml/xmltbli.cxx |   20 ++--
 sw/source/filter/xml/xmltbli.hxx |2 +-
 7 files changed, 29 insertions(+), 32 deletions(-)

New commits:
commit 4e9e9b796bf597a7ceedb608e3fbb0c1480b0633
Author: Noel Grandin 
AuthorDate: Sat May 29 13:47:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun May 30 09:09:12 2021 +0200

don't check isDisposed inside dispose()

my fault, from a recent commit. besides defeating the dispose(), it
should also be checked from the call sites.

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

diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index d631d87eef58..ab8f128a7b29 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -751,16 +751,13 @@ DbGridControl::~DbGridControl()
 
 void DbGridControl::dispose()
 {
-if (!isDisposed())
-{
-RemoveColumns();
+RemoveColumns();
 
-m_bWantDestruction = true;
-osl::MutexGuard aGuard(m_aDestructionSafety);
-if (m_pFieldListeners)
-DisconnectFromFields();
-m_pCursorDisposeListener.reset();
-}
+m_bWantDestruction = true;
+osl::MutexGuard aGuard(m_aDestructionSafety);
+if (m_pFieldListeners)
+DisconnectFromFields();
+m_pCursorDisposeListener.reset();
 
 if (m_nDeleteEvent)
 Application::RemoveUserEvent(m_nDeleteEvent);
commit 1d641424d2591c3e221d0bd6a203f46e5c4352fe
Author: Noel Grandin 
AuthorDate: Fri May 28 15:19:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun May 30 09:08:57 2021 +0200

std::unique_ptr->std::optional

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index a86e6f5b2687..9f8b38e6dd46 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5366,7 +5366,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 m_xSBase.reset();
 m_xWDop.reset();
 m_xFonts.reset();
-m_pAtnNames.reset();
+m_xAtnNames.reset();
 m_xSprmParser.reset();
 m_xProgress.reset();
 
@@ -6090,10 +6090,10 @@ void SwWW8ImplReader::SetOutlineStyles()
 
 const OUString* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
 {
-if (!m_pAtnNames && m_xWwFib->m_lcbGrpStAtnOwners)
+if (!m_xAtnNames && m_xWwFib->m_lcbGrpStAtnOwners)
 {
 // Determine authors: can be found in the TableStream
-m_pAtnNames.reset(new std::vector);
+m_xAtnNames.emplace();
 SvStream& rStrm = *m_pTableStream;
 
 tools::Long nOldPos = rStrm.Tell();
@@ -6104,23 +6104,23 @@ const OUString* 
SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
 {
 if( m_bVer67 )
 {
-m_pAtnNames->push_back(read_uInt8_PascalString(rStrm,
+m_xAtnNames->push_back(read_uInt8_PascalString(rStrm,
 RTL_TEXTENCODING_MS_1252));
-nRead += m_pAtnNames->rbegin()->getLength() + 1; // Length + 
sal_uInt8 count
+nRead += m_xAtnNames->rbegin()->getLength() + 1; // Length + 
sal_uInt8 count
 }
 else
 {
-m_pAtnNames->push_back(read_uInt16_PascalString(rStrm));
+m_xAtnNames->push_back(read_uInt16_PascalString(rStrm));
 // Unicode: double the length + sal_uInt16 count
-nRead += (m_pAtnNames->rbegin()->getLength() + 1)*2;
+nRead += (m_xAtnNames->rbegin()->getLength() + 1)*2;
 }
 }
 rStrm.Seek( nOldPos );
 }
 
 const OUString *pRet = nullptr;
-if (m_pAtnNames && nIdx < m_pAtnNames->size())
-pRet = &((*m_pAtnNames)[nIdx]);
+if (m_xAtnNames && nIdx < m_xAtnNames->size())
+pRet = &((*m_xAtnNames)[nIdx]);
 return pRet;
 }
 
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 575841ffbeee..d2ad5f67b6c7 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1263,7 +1263,7 @@ private:
 
 std::unique_ptr m_xMSDffManager;
 
-std::unique_ptr> m_pAtnNames;
+std::optional> m_xAtnNames;
 
 std::unique_ptr m_pSmartTagData;
 
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8f24ccac97c8..ae7309c4ca23 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -5074,7 +5074,7 @@ 

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

2021-04-19 Thread merttumer (via logerrit)
 svx/source/sdr/contact/objectcontactofpageview.cxx |3 +-
 svx/source/svdraw/svdmrkv.cxx  |   25 -
 2 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 836afbb007e7f34e3587de34fdf1fbb2371fd60b
Author: merttumer 
AuthorDate: Thu Mar 11 09:52:00 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:32:58 2021 +0200

Hide GluePoints in LOK

Change-Id: Ibf6bba4cdc69bd8479ccc08b5d9695253ef81890
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112314
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114028
Tested-by: Jenkins

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx 
b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 364b0d90bfea..41717d276381 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -340,7 +340,8 @@ namespace sdr::contact
 // Get info about the need to visualize GluePoints
 bool ObjectContactOfPageView::AreGluePointsVisible() const
 {
-return GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
+bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+return !bTiledRendering && 
GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
 }
 
 // check if text animation is allowed.
commit fa8991840e122303bf9fa43d36864dd29529b0d2
Author: merttumer 
AuthorDate: Thu Mar 25 12:44:17 2021 +0300
Commit: Mert Tumer 
CommitDate: Tue Apr 20 04:32:43 2021 +0200

lok: Send gridOffset of the shape

In core, the gridOffset is calculated based on the LogicRect's TopLeft 
coordinate
In online, we have the SnapRect and we calculate it based on its TopLeft 
coordinate
SnapRect's TopLeft and LogicRect's TopLeft match when there is no rotation
but the rotation is not applied to the LogicRect. Therefore,
what we calculate in online does not match in case of the rotated shape.
Here we can send the correct gridOffset in the selection callback.
whether the shape is rotated or not, we will always have the correct 
gridOffset
Note that the gridOffset is always calculated from the first selected obj

Change-Id: Icc62a94879367f9b55ad05887945393452021777
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113078
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114027
Tested-by: Jenkins

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 5f1d65ef185b..f42214daf8ad 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -692,6 +692,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 tools::Rectangle aSelection(rRect);
 bool bIsChart = false;
 Point addLogicOffset(0, 0);
+bool convertMapMode = false;
 if (!rRect.IsEmpty())
 {
 sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
@@ -721,7 +722,10 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 if (OutputDevice* pOutputDevice = 
mpMarkedPV->GetView().GetFirstOutputDevice())
 {
 if (pOutputDevice->GetMapMode().GetMapUnit() == 
MapUnit::Map100thMM)
+{
 aSelection = OutputDevice::LogicToLogic(aSelection, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+convertMapMode = true;
+}
 }
 }
 
@@ -757,6 +761,26 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 aExtraInfo.append("\",\"type\":");
 aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
 
+// In core, the gridOffset is calculated based on the LogicRect's 
TopLeft coordinate
+// In online, we have the SnapRect and we calculate it based on 
its TopLeft coordinate
+// SnapRect's TopLeft and LogicRect's TopLeft match unless there 
is rotation
+// but the rotation is not applied to the LogicRect. Therefore,
+// what we calculate in online does not match with the core in 
case of the rotation.
+// Here we can send the correct gridOffset in the selection 
callback, this way
+// whether the shape is rotated or not, we will always have the 
correct gridOffset
+// Note that the gridOffset is calculated from the first selected 
obj
+basegfx::B2DVector aGridOffset(0.0, 0.0);
+if(getPossibleGridOffsetForSdrObject(aGridOffset, 
GetMarkedObjectByIndex(0), GetSdrPageView()))
+{
+Point p(aGridOffset.getX(), aGridOffset.getY());
+if (convertMapMode)
+p = 

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

2021-03-08 Thread Michael Stahl (via logerrit)
 svx/source/unodraw/unopage.cxx   |5 +
 sw/inc/dcontact.hxx  |4 ++--
 sw/qa/extras/mailmerge/mailmerge.cxx |2 +-
 sw/source/core/draw/dcontact.cxx |   27 ---
 sw/source/core/inc/flyfrm.hxx|2 +-
 sw/source/core/layout/fly.cxx|6 +++---
 6 files changed, 36 insertions(+), 10 deletions(-)

New commits:
commit 3bc8f90e9693f710f12632f69b9348c1c833c906
Author: Michael Stahl 
AuthorDate: Fri Mar 5 21:06:28 2021 +0100
Commit: Miklos Vajna 
CommitDate: Mon Mar 8 12:21:42 2021 +0100

(related: tdf#133487) sw: fix ordering of virtual SdrObjects for textboxes

Calling XShapes3::sort() on export of the testTdf130314 fails because of
2 consecutive textboxes; the function requires a textbox to immediately
follow its shape in the list (i.e. textbox has OrdNum of shape + 1).

This is because for shapes in header/footer, one virtual SdrVirtObj is
created per page where the header/footer is shown, and the
SwFlyDrawContact::GetOrdNumForNewRef() does not take textbox ordering
into account.

It's not clear if the assumption that the shape's SdrVirtObj is created
before the textbox's always holds, but let's try this for now.

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

diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 3346b3a00443..52893220dde9 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -179,13 +179,13 @@ private:
 
 SwFlyDrawObjPtr mpMasterObj;
 void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
-sal_uInt32 GetOrdNumForNewRef(const SwFlyFrame* pFly);
+sal_uInt32 GetOrdNumForNewRef(const SwFlyFrame* pFly, SwFrame const& 
rAnchorFrame);
 
 public:
 
 /// Creates DrawObject and registers it with the Model.
 SwFlyDrawContact(SwFlyFrameFormat* pToRegisterIn, SdrModel& rTargetModel);
-static SwVirtFlyDrawObj* CreateNewRef(SwFlyFrame* pFly, SwFlyFrameFormat* 
pFormat);
+static SwVirtFlyDrawObj* CreateNewRef(SwFlyFrame* pFly, SwFlyFrameFormat* 
pFormat, SwFrame const& rAnchorFrame);
 virtual ~SwFlyDrawContact() override;
 
 virtual const SwAnchoredObject* GetAnchoredObj( const SdrObject* _pSdrObj 
) const override;
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx 
b/sw/qa/extras/mailmerge/mailmerge.cxx
index 83cbee5580ac..67fb47fe6996 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -396,7 +396,7 @@ DECLARE_FILE_MAILMERGE_TEST(testMissingDefaultLineColor, 
"missing-default-line-c
 executeMailMerge();
 // The document was created by LO version which didn't write out the 
default value for line color
 // (see XMLGraphicsDefaultStyle::SetDefaults()).
-uno::Reference xPropertySet(getShape(4), 
uno::UNO_QUERY);
+uno::Reference xPropertySet(getShape(5), 
uno::UNO_QUERY);
 // Lines do not have a line color.
 CPPUNIT_ASSERT( !xPropertySet->getPropertySetInfo()->hasPropertyByName( 
"LineColor" ));
 SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get());
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index d1250d5305de..11687c41d0d5 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -478,8 +478,28 @@ SwFlyDrawContact::~SwFlyDrawContact()
 }
 }
 
-sal_uInt32 SwFlyDrawContact::GetOrdNumForNewRef(const SwFlyFrame* pFly)
+sal_uInt32 SwFlyDrawContact::GetOrdNumForNewRef(const SwFlyFrame* pFly,
+SwFrame const& rAnchorFrame)
 {
+// maintain invariant that a shape's textbox immediately follows the shape
+// also for the multiple SdrVirtObj created for shapes in header/footer
+if (SwFrameFormat const*const pDrawFormat =
+SwTextBoxHelper::getOtherTextBoxFormat(GetFormat(), RES_FLYFRMFMT))
+{
+// assume that the draw SdrVirtObj is always created before the 
flyframe one
+if (SwSortedObjs const*const pObjs = rAnchorFrame.GetDrawObjs())
+{
+for (SwAnchoredObject const*const pAnchoredObj : *pObjs)
+{
+if (>GetFrameFormat() == pDrawFormat)
+{
+return pAnchoredObj->GetDrawObj()->GetOrdNum() + 1;
+}
+}
+}
+// if called from AppendObjs(), this is a problem; if called from 
lcl_SetFlyFrameAttr() it's not
+SAL_INFO("sw", "GetOrdNumForNewRef: cannot find SdrObject for text 
box's shape");
+}
 // search for another Writer fly frame registered at same frame format
 SwIterator aIter(*GetFormat());
 const SwFlyFrame* pFlyFrame(nullptr);
@@ -501,7 +521,8 @@ sal_uInt32 SwFlyDrawContact::GetOrdNumForNewRef(const 
SwFlyFrame* pFly)
 return GetMaster()->GetOrdNumDirect();
 }
 
-SwVirtFlyDrawObj* SwFlyDrawContact::CreateNewRef(SwFlyFrame* pFly, 

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

2021-02-14 Thread Noel (via logerrit)
 svx/source/accessibility/AccessibleTextHelper.cxx |4 -
 svx/source/accessibility/GraphCtlAccessibleContext.cxx|2 
 svx/source/accessibility/charmapacc.cxx   |2 
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx |2 
 svx/source/accessibility/svxrectctaccessiblecontext.cxx   |2 
 svx/source/dialog/charmap.cxx |2 
 svx/source/dialog/dlgctrl.cxx |4 -
 svx/source/dialog/frmsel.cxx  |4 -
 svx/source/dialog/graphctl.cxx|2 
 svx/source/dialog/weldeditview.cxx|2 
 svx/source/form/fmcontrollayout.cxx   |6 -
 svx/source/form/fmdocumentclassification.cxx  |2 
 svx/source/form/fmobj.cxx |2 
 svx/source/form/fmscriptingenv.cxx|4 -
 svx/source/form/fmshimp.cxx   |4 -
 svx/source/form/fmsrcimp.cxx  |6 -
 svx/source/form/fmundo.cxx|   15 ++--
 svx/source/form/fmview.cxx|4 -
 svx/source/form/fmvwimp.cxx   |2 
 svx/source/form/formcontroller.cxx|6 -
 svx/source/form/navigatortree.cxx |4 -
 svx/source/form/navigatortreemodel.cxx|   14 ++--
 svx/source/form/tabwin.cxx|2 
 svx/source/gallery2/galbrws2.cxx  |2 
 svx/source/items/drawitem.cxx |2 
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx  |   10 +--
 svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx  |2 
 svx/source/svdraw/svdoole2.cxx|   20 ++
 svx/source/table/accessibletableshape.cxx |9 +-
 svx/source/table/cell.cxx |3 
 svx/source/table/cellrange.cxx|2 
 svx/source/table/propertyset.cxx  |2 
 svx/source/table/svdotable.cxx|8 +-
 svx/source/table/tablecolumns.cxx |2 
 svx/source/table/tablemodel.cxx   |6 -
 svx/source/tbxctrls/colrctrl.cxx  |2 
 svx/source/xml/xmlgrhlp.cxx   |6 -
 svx/source/xml/xmlxtimp.cxx   |   12 +--
 sw/qa/core/frmedt/frmedt.cxx  |2 
 sw/qa/extras/uiwriter/uiwriter.cxx|2 
 sw/qa/extras/uiwriter/uiwriter2.cxx   |2 
 sw/qa/extras/uiwriter/uiwriter3.cxx   |   44 +++---
 sw/qa/extras/unowriter/unowriter.cxx  |2 
 sw/qa/uibase/dochdl/dochdl.cxx|2 
 sw/qa/unit/swmodeltestbase.cxx|2 
 sw/source/core/access/acccontext.cxx  |2 
 sw/source/core/access/accmap.cxx  |6 -
 sw/source/core/fields/docufld.cxx |2 
 sw/source/core/ole/ndole.cxx  |6 -
 sw/source/core/unocore/unofield.cxx   |2 
 sw/source/core/unocore/unotbl.cxx |6 -
 sw/source/filter/ww8/docxattributeoutput.cxx  |6 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx   |2 
 sw/source/filter/xml/xmlexp.cxx   |4 -
 sw/source/filter/xml/xmlfmt.cxx   |4 -
 sw/source/filter/xml/xmlimp.cxx   |5 -
 sw/source/filter/xml/xmlitem.cxx  |2 
 sw/source/filter/xml/xmltbli.cxx  |2 
 sw/source/ui/dbui/dbtablepreviewdialog.cxx|2 
 sw/source/ui/vba/vbadocument.cxx  |2 
 sw/source/uibase/app/docshdrw.cxx |2 
 sw/source/uibase/dbui/dbmgr.cxx   |8 +-
 sw/source/uibase/docvw/srcedtw.cxx|4 -
 63 files changed, 151 insertions(+), 157 deletions(-)

New commits:
commit 948c29710a0bb168ec07e3aca510fa6860f2da52
Author: Noel 
AuthorDate: Fri Feb 12 15:36:24 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 15 08:38:42 2021 +0100

loplugin:referencecasting in svx

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

diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx 
b/svx/source/accessibility/AccessibleTextHelper.cxx
index f11ce49b3beb..f8ff9013e929 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ 

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

2020-10-12 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/weldeditview.cxx |5 +
 vcl/unx/gtk3/gtk3gtksalmenu.cxx|   13 +
 2 files changed, 18 insertions(+)

New commits:
commit 3a5808f5e43f5e190b3f1c759563a951b5bb0d08
Author: Caolán McNamara 
AuthorDate: Mon Oct 12 10:48:49 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 12 15:28:59 2020 +0200

CaptureMouse on mouse-down and ReleaseMouse on mouse-up

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

diff --git a/svx/source/dialog/weldeditview.cxx 
b/svx/source/dialog/weldeditview.cxx
index 9d79d78c961c..e7d90fab15b8 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -132,6 +132,9 @@ bool WeldEditView::MouseMove(const MouseEvent& rMEvt)
 
 bool WeldEditView::MouseButtonDown(const MouseEvent& rMEvt)
 {
+if (!IsMouseCaptured())
+CaptureMouse();
+
 if (!HasFocus())
 {
 GrabFocus();
@@ -143,6 +146,8 @@ bool WeldEditView::MouseButtonDown(const MouseEvent& rMEvt)
 
 bool WeldEditView::MouseButtonUp(const MouseEvent& rMEvt)
 {
+if (IsMouseCaptured())
+ReleaseMouse();
 return m_xEditView && m_xEditView->MouseButtonUp(rMEvt);
 }
 
commit f3692a9260f6f51be89f460ec9cb3bd517952b95
Author: Caolán McNamara 
AuthorDate: Mon Oct 12 10:12:56 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 12 15:28:35 2020 +0200

similar to tdf#120764 dismiss tooltips on showing popup menu

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

diff --git a/vcl/unx/gtk3/gtk3gtksalmenu.cxx b/vcl/unx/gtk3/gtk3gtksalmenu.cxx
index 94e2134e151a..9c02cf50e329 100644
--- a/vcl/unx/gtk3/gtk3gtksalmenu.cxx
+++ b/vcl/unx/gtk3/gtk3gtksalmenu.cxx
@@ -433,6 +433,16 @@ bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, 
const tools::Rectangl
 GMainLoop* pLoop = g_main_loop_new(nullptr, true);
 g_signal_connect_swapped(G_OBJECT(pWidget), "deactivate", 
G_CALLBACK(g_main_loop_quit), pLoop);
 
+
+// tdf#120764 It isn't allowed under wayland to have two visible popups 
that share
+// the same top level parent. The problem is that since gtk 3.24 tooltips 
are also
+// implemented as popups, which means that we cannot show any popup if 
there is a
+// visible tooltip.
+// hide any current tooltip
+mpFrame->HideTooltip();
+// don't allow any more to appear until menu is dismissed
+mpFrame->BlockTooltip();
+
 #if GTK_CHECK_VERSION(3,22,0)
 if (gtk_check_version(3, 22, 0) == nullptr)
 {
@@ -509,6 +519,9 @@ bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, 
const tools::Rectangl
 g_object_unref(mpActionGroup);
 ClearActionGroupAndMenuModel();
 
+// undo tooltip blocking
+mpFrame->UnblockTooltip();
+
 mpFrame = nullptr;
 
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-18 Thread Szymon Kłos (via logerrit)
 svx/source/inc/StylesPreviewToolBoxControl.hxx  |2 -
 svx/source/inc/StylesPreviewWindow.hxx  |   18 +
 svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx |   10 -
 svx/source/tbxctrls/StylesPreviewWindow.cxx |   39 +++-
 sw/source/core/doc/DocumentStylePoolManager.cxx |   11 +
 sw/source/core/edit/edfcol.cxx  |   13 ++
 6 files changed, 65 insertions(+), 28 deletions(-)

New commits:
commit 10aac52bafc8a0430d1da3fe8f45832c64d6bf34
Author: Szymon Kłos 
AuthorDate: Mon Aug 31 13:05:31 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Sep 18 13:30:17 2020 +0200

Styles preview widget language independent

Use both english / universal and translated names
to identify a style.

Change-Id: Ibd8b23e678e8bea5773d1da97adf5201377b4453
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101832
Tested-by: Jenkins CollaboraOffice 
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102963
Tested-by: Jenkins

diff --git a/svx/source/inc/StylesPreviewToolBoxControl.hxx 
b/svx/source/inc/StylesPreviewToolBoxControl.hxx
index 7e2bd85da67e..c7ac3f9953b6 100644
--- a/svx/source/inc/StylesPreviewToolBoxControl.hxx
+++ b/svx/source/inc/StylesPreviewToolBoxControl.hxx
@@ -35,7 +35,7 @@ class StylesPreviewToolBoxControl final
 
 css::uno::Reference m_xDispatchProvider;
 
-std::vector m_aDefaultStyles;
+std::vector> m_aDefaultStyles;
 
 public:
 StylesPreviewToolBoxControl();
diff --git a/svx/source/inc/StylesPreviewWindow.hxx 
b/svx/source/inc/StylesPreviewWindow.hxx
index 5ae857210c6f..26ba93d7be79 100644
--- a/svx/source/inc/StylesPreviewWindow.hxx
+++ b/svx/source/inc/StylesPreviewWindow.hxx
@@ -44,19 +44,19 @@ class StyleItemController : public 
weld::CustomWidgetController
 static constexpr unsigned LEFT_MARGIN = 8;
 
 SfxStyleFamily m_eStyleFamily;
-OUString m_aStyleName;
+std::pair m_aStyleName;
 bool m_bSelected;
 css::uno::Reference m_xDispatchProvider;
 
 public:
-StyleItemController(const OUString& aStyleName,
+StyleItemController(const std::pair& aStyleName,
 css::uno::Reference& 
xDispatchProvider);
 
 void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& 
rRect) override;
 
 bool MouseButtonDown(const MouseEvent&) override;
 
-void SetStyle(const OUString& sStyleName);
+void SetStyle(const std::pair& sStyleName);
 
 void Select(bool bSelect);
 
@@ -83,8 +83,8 @@ protected:
 std::unique_ptr m_xUp;
 std::unique_ptr m_xDown;
 
-std::vector m_aDefaultStyles;
-std::vector m_aAllStyles;
+std::vector> m_aDefaultStyles;
+std::vector> m_aAllStyles;
 
 unsigned m_nStyleIterator;
 OUString m_sSelectedStyle;
@@ -93,7 +93,8 @@ protected:
 DECL_LINK(GoDown, const OString&, void);
 
 public:
-StylesPreviewWindow_Base(weld::Builder& xBuilder, std::vector& 
aDefaultStyles,
+StylesPreviewWindow_Base(weld::Builder& xBuilder,
+ std::vector>& 
aDefaultStyles,
  
css::uno::Reference& xDispatchProvider);
 ~StylesPreviewWindow_Base();
 
@@ -103,13 +104,14 @@ private:
 void Update();
 void UpdateStylesList();
 void MakeCurrentStyleVisible();
-OUString GetVisibleStyle(unsigned nPosition);
+std::pair GetVisibleStyle(unsigned nPosition);
 };
 
 class StylesPreviewWindow_Impl : public InterimItemWindow, public 
StylesPreviewWindow_Base
 {
 public:
-StylesPreviewWindow_Impl(vcl::Window* pParent, std::vector& 
aDefaultStyles,
+StylesPreviewWindow_Impl(vcl::Window* pParent,
+ std::vector>& 
aDefaultStyles,
  
css::uno::Reference& xDispatchProvider);
 ~StylesPreviewWindow_Impl();
 
diff --git a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx 
b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
index 7e4a0167b908..9b78a0e7aaf0 100644
--- a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
+++ b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
@@ -79,7 +79,10 @@ void StylesPreviewToolBoxControl::InitializeStyles(
 OUString sName;
 xStyle->getPropertyValue("DisplayName") >>= sName;
 if (!sName.isEmpty())
-m_aDefaultStyles.push_back(sName);
+m_aDefaultStyles.push_back(std::pair(aStyle, sName));
+}
+catch (const css::container::NoSuchElementException&)
+{
 }
 catch (const css::uno::Exception&)
 {
@@ -103,7 +106,10 @@ void StylesPreviewToolBoxControl::InitializeStyles(
 OUString sName;
 xStyle->getPropertyValue("DisplayName") >>= sName;
 if (!sName.isEmpty())
-   

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

2020-08-31 Thread Andrea Gelmini (via logerrit)
 svx/source/form/navigatortree.cxx   |8 
 test/source/sheet/xcellrangeformula.cxx |6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit de81349e69ea229843a23cce1117f69f14862f6b
Author: Andrea Gelmini 
AuthorDate: Fri Aug 28 12:17:11 2020 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 31 14:51:48 2020 +0200

Fix typo in code

It passed "make check" on Linux

Change-Id: Iecaab4ab9f7d8e05930685aaf5a2eb2770abbd1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101601
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/form/navigatortree.cxx 
b/svx/source/form/navigatortree.cxx
index c84ec322bc80..de01cc9763a6 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -803,11 +803,11 @@ namespace svxform
 //  means moving the control)
 
 // collect the ancestors of the drop target (speeds up 3)
-SvLBoxEntrySortedArray arrDropAnchestors;
+SvLBoxEntrySortedArray arrDropAncestors;
 std::unique_ptr 
xLoop(m_xTreeView->make_iterator(_pTargetEntry));
 do
 {
-arrDropAnchestors.emplace(m_xTreeView->make_iterator(xLoop.get()));
+arrDropAncestors.emplace(m_xTreeView->make_iterator(xLoop.get()));
 }
 while (m_xTreeView->iter_parent(*xLoop));
 
@@ -835,12 +835,12 @@ namespace svxform
 // test for 3)
 if (IsFormEntry(*rCurrent))
 {
-auto aIter = std::find_if(arrDropAnchestors.begin(), 
arrDropAnchestors.end(),
+auto aIter = std::find_if(arrDropAncestors.begin(), 
arrDropAncestors.end(),
   [this, ](const auto& rElem) 
{
 return 
m_xTreeView->iter_compare(*rElem, *rCurrent) == 0;
   });
 
-if ( aIter != arrDropAnchestors.end() )
+if ( aIter != arrDropAncestors.end() )
 return DND_ACTION_NONE;
 }
 else if (IsFormComponentEntry(*rCurrent))
commit 19cf1b4fcfb9d9d17587e4224c3c3818952cd69c
Author: Andrea Gelmini 
AuthorDate: Mon Aug 31 12:39:14 2020 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 31 14:51:10 2020 +0200

Fix typo in code

It passed "make check" on Linux

Change-Id: Ia1fbd635d7d13c69c9b8911eadaa86ee5f7aadb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101707
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/test/source/sheet/xcellrangeformula.cxx 
b/test/source/sheet/xcellrangeformula.cxx
index 6de60149938f..8a2eeb220ba2 100644
--- a/test/source/sheet/xcellrangeformula.cxx
+++ b/test/source/sheet/xcellrangeformula.cxx
@@ -24,7 +24,7 @@ void XCellRangeFormula::testGetSetFormulaArray()
 {
 uno::Reference xCRF(init(), UNO_QUERY_THROW);
 
-uno::Sequence> aFormulaArrayOrginal = 
xCRF->getFormulaArray();
+uno::Sequence> aFormulaArrayOriginal = 
xCRF->getFormulaArray();
 uno::Sequence> aFormulaArrayNew = 
xCRF->getFormulaArray();
 aFormulaArrayNew[0][0] = "NewValue";
 
@@ -32,8 +32,8 @@ void XCellRangeFormula::testGetSetFormulaArray()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get new FormulaArray", 
OUString("NewValue"),
  xCRF->getFormulaArray()[0][0]);
 
-xCRF->setFormulaArray(aFormulaArrayOrginal);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set new FormulaArray", 
aFormulaArrayOrginal[0][0],
+xCRF->setFormulaArray(aFormulaArrayOriginal);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set new FormulaArray", 
aFormulaArrayOriginal[0][0],
  xCRF->getFormulaArray()[0][0]);
 }
 } // namespace apitest
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-06 Thread Noel Grandin (via logerrit)
 svx/source/core/extedit.cxx |   30 
 svx/source/customshapes/EnhancedCustomShape2d.cxx   |  320 ++--
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |   72 -
 svx/source/engine3d/dragmt3d.cxx|  596 
 svx/source/engine3d/e3dsceneupdater.cxx |  141 +-
 svx/source/engine3d/helperhittest3d.cxx |  138 +-
 svx/source/engine3d/lathe3d.cxx |   28 
 svx/source/engine3d/obj3d.cxx   |   56 
 svx/source/engine3d/scene3d.cxx |   28 
 svx/source/engine3d/view3d.cxx  |  646 -
 svx/source/fmcomp/fmgridcl.cxx  |  219 +--
 svx/source/fmcomp/fmgridif.cxx  |  362 ++---
 svx/source/fmcomp/gridcell.cxx  |  128 -
 svx/source/fmcomp/gridctrl.cxx  |  406 +++---
 svx/source/form/datanavi.cxx|  292 ++--
 svx/source/form/filtnav.cxx |   24 
 svx/source/form/fmPropBrw.cxx   |   86 -
 svx/source/form/fmexch.cxx  |   24 
 svx/source/form/fmshimp.cxx |  248 +--
 svx/source/form/fmsrcimp.cxx|   34 
 svx/source/form/fmundo.cxx  |  369 ++---
 svx/source/form/fmview.cxx  |   52 
 svx/source/form/fmvwimp.cxx |  214 +--
 svx/source/form/formcontroller.cxx  |  150 +-
 svx/source/form/navigatortree.cxx   |  104 -
 svx/source/form/navigatortreemodel.cxx  |   22 
 svx/source/gallery2/codec.cxx   |  100 -
 svx/source/gallery2/galbrws1.cxx|   70 -
 svx/source/gallery2/galbrws2.cxx|  298 ++--
 svx/source/gallery2/galctrl.cxx |   20 
 svx/source/gallery2/gallery1.cxx|   26 
 svx/source/gallery2/galmisc.cxx |   26 
 svx/source/gallery2/galobj.cxx  |   22 
 svx/source/items/customshapeitem.cxx|   54 
 svx/source/items/numfmtsh.cxx   |   94 -
 svx/source/sidebar/ContextChangeEventMultiplexer.cxx|   34 
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx   |   58 
 svx/source/sidebar/inspector/InspectorTextPanel.cxx |   30 
 svx/source/sidebar/line/LinePropertyPanelBase.cxx   |   94 -
 svx/source/sidebar/nbdtmg.cxx   |   38 
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |   24 
 svx/source/smarttags/SmartTagMgr.cxx|  100 -
 svx/source/svdraw/charthelper.cxx   |   36 
 svx/source/svdraw/clonelist.cxx |   22 
 svx/source/svdraw/sdrpagewindow.cxx |   22 
 svx/source/svdraw/svdcrtv.cxx   |  251 +--
 svx/source/svdraw/svddrgmt.cxx  |  964 +++---
 svx/source/svdraw/svddrgv.cxx   |  164 +-
 svx/source/svdraw/svdedtv.cxx   |  432 +++---
 svx/source/svdraw/svdedtv1.cxx  |   92 -
 svx/source/svdraw/svdedtv2.cxx  |  982 +++---
 svx/source/svdraw/svdedxv.cxx   |  737 +--
 svx/source/svdraw/svdfmtf.cxx   |  538 
 svx/source/svdraw/svdglev.cxx   |   29 
 svx/source/svdraw/svdglue.cxx   |   28 
 svx/source/svdraw/svdhdl.cxx| 1071 +++-
 svx/source/svdraw/svdlayer.cxx  |   28 
 svx/source/svdraw/svdmark.cxx   |  204 +--
 svx/source/svdraw/svdmodel.cxx  |  116 -
 svx/source/svdraw/svdmrkv.cxx   |  202 +--
 svx/source/svdraw/svdoashp.cxx  |  590 
 svx/source/svdraw/svdobj.cxx|  277 ++--
 svx/source/svdraw/svdocirc.cxx  |   94 -
 svx/source/svdraw/svdoedge.cxx  |  141 +-
 svx/source/svdraw/svdograf.cxx  |   62 
 svx/source/svdraw/svdogrp.cxx   |  134 +-
 svx/source/svdraw/svdomeas.cxx  |   82 -
 svx/source/svdraw/svdomedia.cxx |   62 
 svx/source/svdraw/svdoole2.cxx  |  620 -
 svx/source/svdraw/svdopage.cxx  |   26 
 svx/source/svdraw/svdopath.cxx  |   34 
 svx/source/svdraw/svdorect.cxx  |   30 
 svx/source/svdraw/svdotext.cxx  |   94 -
 svx/source/svdraw/svdotextdecomposition.cxx |  182 +-
 

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

2019-07-16 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/ctredlin.cxx |1 +
 sw/source/ui/fldui/flddinf.cxx |4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 9f3a68efcdf53b1ec2ca8736943f00aeae6e642d
Author: Caolán McNamara 
AuthorDate: Mon Jul 15 21:57:32 2019 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jul 16 09:29:27 2019 +0200

cid#1448424 silence Uninitialized pointer field

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

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index f912a6fc7f9c..18c7cd44e1fb 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -79,6 +79,7 @@ 
SvxRedlinTable::SvxRedlinTable(std::unique_ptr xWriterControl,
 Application::GetSettings().GetUILanguageTag().getLocale()))
 , xWriterTreeView(std::move(xWriterControl))
 , xCalcTreeView(std::move(xCalcControl))
+, pTreeView(nullptr)
 , nDatePos(WRITER_DATE)
 , bAuthor(false)
 , bDate(false)
commit 50119846cc9cb32705dd3a7f95bb4c7b3505
Author: Caolán McNamara 
AuthorDate: Mon Jul 15 21:53:56 2019 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jul 16 09:29:16 2019 +0200

cid#1448306 silence Unchecked return value

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

diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 8780fa60c9e9..3c29bd911a43 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -216,9 +216,9 @@ void SwFieldDokInfPage::Reset(const SfxItemSet* )
 IMPL_LINK_NOARG(SwFieldDokInfPage, TypeHdl, weld::TreeView&, void)
 {
 // current ListBoxPos
-if (!m_xTypeTLB->get_selected(m_xSelEntry.get()))
+if (!m_xTypeTLB->get_selected(m_xSelEntry.get()) &&
+m_xTypeTLB->get_iter_first(*m_xSelEntry))
 {
-m_xTypeTLB->get_iter_first(*m_xSelEntry);
 m_xTypeTLB->select(*m_xSelEntry);
 }
 FillSelectionLB(m_xTypeTLB->get_id(*m_xSelEntry).toUInt32());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-08 Thread Noel Grandin (via logerrit)
 svx/source/tbxctrls/fontworkgallery.cxx|4 ++--
 ucb/source/ucp/webdav-neon/NeonSession.cxx |3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit f7e4a52411255b61e8fcc4172e67c9f86cf25e36
Author: Noel Grandin 
AuthorDate: Mon Jul 8 11:12:02 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 8 12:54:09 2019 +0200

fix loop variable type

it's not a std::vector, it's a std::vector

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

diff --git a/svx/source/tbxctrls/fontworkgallery.cxx 
b/svx/source/tbxctrls/fontworkgallery.cxx
index aa832961b0b8..7d9c5b974438 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -146,7 +146,7 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 
nThemeId)
 aThumbSize.AdjustWidth( -12 );
 aThumbSize.AdjustHeight( -12 );
 
-std::vector< Bitmap * >::size_type nFavCount = 
maFavoritesHorizontal.size();
+auto nFavCount = maFavoritesHorizontal.size();
 
 // ValueSet favorites
 if( nFavCount > (nColCount * nLineCount) )
@@ -158,7 +158,7 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 
nThemeId)
 
 maCtlFavorites.Clear();
 
-for( std::vector::size_type nFavorite = 1; nFavorite <= 
nFavCount; nFavorite++ )
+for( size_t nFavorite = 1; nFavorite <= nFavCount; nFavorite++ )
 {
 OUString aStr(SvxResId(RID_SVXFLOAT3D_FAVORITE));
 aStr += " ";
commit ed920b71b846a25472bc290e1613b0b6dd76f5f4
Author: Mike Kaganski 
AuthorDate: Mon Jul 8 09:14:31 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Jul 8 12:53:57 2019 +0200

Simplify lastChanceToSendRefreshRequest calculation

Change-Id: I5c716f641e3d45572f4de01b52316377a21655af
Reviewed-on: https://gerrit.libreoffice.org/75192
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx 
b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index a075268806c8..7ee9c56d4807 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1526,8 +1526,7 @@ namespace
 sal_Int32 calltime = aEnd.Seconds - rStart.Seconds;
 if ( calltime <= timeout )
 {
-lastChanceToSendRefreshRequest
-= aEnd.Seconds + timeout - calltime;
+lastChanceToSendRefreshRequest = rStart.Seconds + timeout;
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-11 Thread Noel Grandin (via logerrit)
 svx/source/dialog/dialcontrol.cxx |5 +++--
 svx/source/svdraw/svdogrp.cxx |   27 ++-
 svx/source/svdraw/svdopath.cxx|8 
 sw/source/uibase/uiview/view.cxx  |   12 
 4 files changed, 37 insertions(+), 15 deletions(-)

New commits:
commit f8d29fea9915a5fe66e4ba24cbd3b248929b51b7
Author: Noel Grandin 
AuthorDate: Fri May 10 15:47:53 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat May 11 09:09:52 2019 +0200

handle empty tools::Rectangle in svx

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

diff --git a/svx/source/dialog/dialcontrol.cxx 
b/svx/source/dialog/dialcontrol.cxx
index 547949ce5e2e..598caafc8201 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -212,8 +212,9 @@ void DialControlBmp::DrawBackground()
 
 SetLineColor();
 SetFillColor( GetBackgroundColor() );
-DrawEllipse( tools::Rectangle( maRect.Left() + DIAL_OUTER_WIDTH, 
maRect.Top() + DIAL_OUTER_WIDTH,
-maRect.Right() - DIAL_OUTER_WIDTH, maRect.Bottom() - DIAL_OUTER_WIDTH 
) );
+tools::Rectangle aEllipseRect = maRect;
+aEllipseRect.shrink(DIAL_OUTER_WIDTH);
+DrawEllipse( aEllipseRect );
 }
 
 
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 61bca73c9a37..c50ba9524908 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -501,17 +501,26 @@ void SdrObjGroup::SetSnapRect(const tools::Rectangle& 
rRect)
 {
 tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) 
aBoundRect0=GetLastBoundRect();
 tools::Rectangle aOld(GetSnapRect());
-long nMulX=rRect.Right()-rRect.Left();
-long nDivX=aOld.Right()-aOld.Left();
-long nMulY=rRect.Bottom()-rRect.Top();
-long nDivY=aOld.Bottom()-aOld.Top();
-if (nDivX==0) { nMulX=1; nDivX=1; }
-if (nDivY==0) { nMulY=1; nDivY=1; }
-if (nMulX!=nDivX || nMulY!=nDivY) {
-Fraction aX(nMulX,nDivX);
-Fraction aY(nMulY,nDivY);
+if (aOld.IsEmpty())
+{
+Fraction aX(1,1);
+Fraction aY(1,1);
 Resize(aOld.TopLeft(),aX,aY);
 }
+else
+{
+long nMulX=rRect.Right()-rRect.Left();
+long nDivX=aOld.Right()-aOld.Left();
+long nMulY=rRect.Bottom()-rRect.Top();
+long nDivY=aOld.Bottom()-aOld.Top();
+if (nDivX==0) { nMulX=1; nDivX=1; }
+if (nDivY==0) { nMulY=1; nDivY=1; }
+if (nMulX!=nDivX || nMulY!=nDivY) {
+Fraction aX(nMulX,nDivX);
+Fraction aY(nMulY,nDivY);
+Resize(aOld.TopLeft(),aX,aY);
+}
+}
 if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
 Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
 }
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 4c3d0f2040b9..12a7b2c1af39 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2362,6 +2362,14 @@ void SdrPathObj::RecalcSnapRect()
 void SdrPathObj::NbcSetSnapRect(const tools::Rectangle& rRect)
 {
 tools::Rectangle aOld(GetSnapRect());
+if (aOld.IsEmpty())
+{
+Fraction aX(1,1);
+Fraction aY(1,1);
+NbcResize(aOld.TopLeft(), aX, aY);
+NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top()));
+return;
+}
 
 // Take empty into account when calculating scale factors
 long nMulX = rRect.IsWidthEmpty() ? 0 : rRect.Right()  - rRect.Left();
commit 08b79ade4f2e2fa98487696591123f71a7521dff
Author: Noel Grandin 
AuthorDate: Fri May 10 15:47:05 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat May 11 09:09:39 2019 +0200

handle empty tools::Rectangle in sw

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

diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index c48a59c22841..67fce780a56a 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1527,13 +1527,17 @@ void SwView::WriteUserDataSequence ( uno::Sequence < 
beans::PropertyValue >& rSe
 
 aVector.push_back(comphelper::makePropertyValue("ViewTop", 
convertTwipToMm100 ( rRect.Top() )));
 
-aVector.push_back(comphelper::makePropertyValue("VisibleLeft", 
convertTwipToMm100 ( rVis.Left() )));
+auto visibleLeft = convertTwipToMm100 ( rVis.Left() );
+aVector.push_back(comphelper::makePropertyValue("VisibleLeft", 
visibleLeft));
 
-aVector.push_back(comphelper::makePropertyValue("VisibleTop", 
convertTwipToMm100 ( rVis.Top() )));
+auto visibleTop = convertTwipToMm100 ( rVis.Top() );
+aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop));
 
-aVector.push_back(comphelper::makePropertyValue("VisibleRight", 
convertTwipToMm100 ( 

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

2019-04-29 Thread Noel Grandin (via logerrit)
 svx/source/unodraw/unoprov.cxx  |   31 
 xmloff/inc/txtfldi.hxx  |2 -
 xmloff/source/chart/XMLSymbolImageContext.cxx   |2 -
 xmloff/source/draw/XMLImageMapContext.cxx   |2 -
 xmloff/source/style/DashStyle.cxx   |2 -
 xmloff/source/style/GradientStyle.cxx   |2 -
 xmloff/source/style/HatchStyle.cxx  |4 +-
 xmloff/source/style/ImageStyle.cxx  |2 -
 xmloff/source/style/TransGradientStyle.cxx  |2 -
 xmloff/source/style/XMLBackgroundImageContext.cxx   |   28 ++
 xmloff/source/style/xmltabi.cxx |2 -
 xmloff/source/text/XMLFootnoteImportContext.cxx |2 -
 xmloff/source/text/XMLIndexSourceBaseContext.cxx|2 -
 xmloff/source/text/XMLLineNumberingImportContext.cxx|2 -
 xmloff/source/text/XMLSectionImportContext.cxx  |2 -
 xmloff/source/text/XMLSectionSourceDDEImportContext.cxx |2 -
 xmloff/source/text/XMLSectionSourceImportContext.cxx|2 -
 xmloff/source/text/txtdropi.cxx |2 -
 xmloff/source/text/txtfldi.cxx  |4 +-
 xmloff/source/xforms/xformsapi.cxx  |4 +-
 20 files changed, 56 insertions(+), 45 deletions(-)

New commits:
commit b1e36f4d264f1d8d8df4558ba0c781ccb93a4244
Author: Noel Grandin 
AuthorDate: Sun Apr 28 12:38:01 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Apr 29 08:31:21 2019 +0200

tdf#63640 FILEOPEN/FILESAVE: particular .odt loads/saves very slow, part4

cache the XMLTokenMap data in static const vars, so we only need to
initialise them once

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

diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 44540e4df500..794ddef20ea5 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -945,8 +945,6 @@ protected:
 /** import dde field declaration container () */
 class XMLDdeFieldDeclsImportContext : public SvXMLImportContext
 {
-SvXMLTokenMap const aTokenMap;
-
 public:
 
 XMLDdeFieldDeclsImportContext(SvXMLImport& rImport,
diff --git a/xmloff/source/chart/XMLSymbolImageContext.cxx 
b/xmloff/source/chart/XMLSymbolImageContext.cxx
index 4e9fae4a9df5..5fce5f613f05 100644
--- a/xmloff/source/chart/XMLSymbolImageContext.cxx
+++ b/xmloff/source/chart/XMLSymbolImageContext.cxx
@@ -61,7 +61,7 @@ XMLSymbolImageContext::~XMLSymbolImageContext()
 
 void XMLSymbolImageContext::StartElement( const uno::Reference< 
xml::sax::XAttributeList >& xAttrList )
 {
-SvXMLTokenMap aTokenMap( aSymbolImageAttrTokenMap );
+static const SvXMLTokenMap aTokenMap( aSymbolImageAttrTokenMap );
 OUString aLocalName;
 
 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
diff --git a/xmloff/source/draw/XMLImageMapContext.cxx 
b/xmloff/source/draw/XMLImageMapContext.cxx
index b7386c24f0d7..c7126b055865 100644
--- a/xmloff/source/draw/XMLImageMapContext.cxx
+++ b/xmloff/source/draw/XMLImageMapContext.cxx
@@ -173,7 +173,7 @@ XMLImageMapObjectContext::XMLImageMapObjectContext(
 void XMLImageMapObjectContext::StartElement(
 const Reference& xAttrList )
 {
-SvXMLTokenMap aMap(aImageMapObjectTokenMap);
+static const SvXMLTokenMap aMap(aImageMapObjectTokenMap);
 
 sal_Int16 nLength = xAttrList->getLength();
 for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
diff --git a/xmloff/source/style/DashStyle.cxx 
b/xmloff/source/style/DashStyle.cxx
index d940a143dd65..353591ba963c 100644
--- a/xmloff/source/style/DashStyle.cxx
+++ b/xmloff/source/style/DashStyle.cxx
@@ -104,7 +104,7 @@ void XMLDashStyleImport::importXML(
 SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
 SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
 
-SvXMLTokenMap aTokenMap( aDashStyleAttrTokenMap );
+static const SvXMLTokenMap aTokenMap( aDashStyleAttrTokenMap );
 
 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
 for( sal_Int16 i=0; i < nAttrCount; i++ )
diff --git a/xmloff/source/style/GradientStyle.cxx 
b/xmloff/source/style/GradientStyle.cxx
index 8feb95d56c8f..ed3d5dad1323 100644
--- a/xmloff/source/style/GradientStyle.cxx
+++ b/xmloff/source/style/GradientStyle.cxx
@@ -111,7 +111,7 @@ void XMLGradientStyleImport::importXML(
 aGradient.Angle = 0;
 aGradient.Border = 0;
 
-SvXMLTokenMap aTokenMap( aGradientAttrTokenMap );
+static const SvXMLTokenMap aTokenMap( aGradientAttrTokenMap );
 SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap();
 
 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
diff --git a/xmloff/source/style/HatchStyle.cxx 
b/xmloff/source/style/HatchStyle.cxx
index 

[Libreoffice-commits] core.git: 2 commits - svx/source svx/uiconfig sw/inc sw/source sw/uiconfig

2018-10-17 Thread Libreoffice Gerrit user
 svx/source/dialog/docrecovery.cxx|   94 ++-
 svx/source/inc/docrecovery.hxx   |   86 +++-
 svx/uiconfig/ui/docrecoverybrokendialog.ui   |   63 ++
 sw/inc/swabstdlg.hxx |2 
 sw/source/ui/dialog/swdlgfact.cxx|   14 ++--
 sw/source/ui/dialog/swdlgfact.hxx|   13 ++-
 sw/source/ui/envelp/mailmrge.cxx |   14 
 sw/source/uibase/inc/mailmrge.hxx|9 +-
 sw/source/uibase/uiview/view2.cxx|2 
 sw/uiconfig/swriter/ui/mergeconnectdialog.ui |   18 ++---
 10 files changed, 161 insertions(+), 154 deletions(-)

New commits:
commit 6c8c47429936c30ebb760253fa4078c1e410eea5
Author: Caolán McNamara 
AuthorDate: Wed Oct 17 09:52:29 2018 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 17 14:08:07 2018 +0200

weld SwMailMergeFieldConnectionsDlg

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

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 8478b77b990f..fdd6a431544f 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -460,7 +460,7 @@ public:
 sal_Int32 nCommandType,
 const css::uno::Reference< 
css::sdbc::XConnection>& xConnection ) = 0;
 virtual VclPtr   
CreateMailMergeCreateFromDlg(vcl::Window* pParent) = 0;
-virtual VclPtr 
CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) = 0;
+virtual VclPtr 
CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) = 0;
 virtual VclPtr  
CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr ) = 0;
 virtual VclPtr   
CreateOutlineTabDialog(weld::Window* pParent,
 const SfxItemSet* pSwItemSet,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index e8eb7119af93..6dca63b32f43 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -214,7 +214,12 @@ short AbstractJavaEditDialog_Impl::Execute()
 
 IMPL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl);
+
+short AbstractMailMergeFieldConnectionsDlg_Impl::Execute()
+{
+return m_xDlg->run();
+}
+
 IMPL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractEditRegionDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl);
@@ -637,7 +642,7 @@ bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() 
const
 
 bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() 
const
 {
-return pDlg->IsUseExistingConnections();
+return m_xDlg->IsUseExistingConnections();
 }
 
 CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const
@@ -1040,10 +1045,9 @@ VclPtr 
SwAbstractDialogFactory_Impl::CreateMailM
 return VclPtr::Create(pDlg);
 }
 
-VclPtr 
SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(vcl::Window* 
pParent)
+VclPtr 
SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(weld::Window* 
pParent)
 {
-VclPtr pDlg = 
VclPtr::Create( pParent );
-return VclPtr::Create( pDlg );
+return 
VclPtr::Create(o3tl::make_unique(pParent));
 }
 
 VclPtr 
SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(weld::Window* pParent, 
SwTOXMgr )
diff --git a/sw/source/ui/dialog/swdlgfact.hxx 
b/sw/source/ui/dialog/swdlgfact.hxx
index 6471d1864c4c..07953242d358 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -508,8 +508,15 @@ class AbstractMailMergeCreateFromDlg_Impl : public 
AbstractMailMergeCreateFromDl
 class SwMailMergeFieldConnectionsDlg;
 class AbstractMailMergeFieldConnectionsDlg_Impl : public 
AbstractMailMergeFieldConnectionsDlg
 {
-
DECL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl,SwMailMergeFieldConnectionsDlg)
-virtual boolIsUseExistingConnections() const override ;
+protected:
+std::unique_ptr m_xDlg;
+public:
+explicit 
AbstractMailMergeFieldConnectionsDlg_Impl(std::unique_ptr
 p)
+: m_xDlg(std::move(p))
+{
+}
+virtual short Execute() override;
+virtual bool IsUseExistingConnections() const override ;
 };
 
 class SwMultiTOXTabDialog;
@@ -670,7 +677,7 @@ public:
 sal_Int32 nCommandType,
 const css::uno::Reference< 
css::sdbc::XConnection>& xConnection ) override;
 virtual VclPtr 
CreateMailMergeCreateFromDlg(vcl::Window* pParent) override;
-virtual VclPtr 
CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) override;
+virtual VclPtr 
CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) override;
 

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

2018-08-21 Thread Libreoffice Gerrit user
 svx/source/fmcomp/gridcell.cxx |   75 ++---
 svx/source/inc/gridcell.hxx|   18 +++---
 xmlscript/source/xml_helper/xml_impctx.cxx |   23 
 3 files changed, 59 insertions(+), 57 deletions(-)

New commits:
commit 7469e078dc3a7a891bd7f5c44a693e4421d3bcdd
Author: Noel Grandin 
AuthorDate: Mon Aug 20 11:21:55 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 21 12:10:16 2018 +0200

loplugin:useuniqueptr in FmXGridCell

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

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index edd41b7c6568..59a559a33aff 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -179,26 +179,26 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, 
const Reference< css::bea
 }
 }
 
-DbCellControl* pCellControl = nullptr;
+std::unique_ptr pCellControl;
 if (m_rParent.IsFilterMode())
 {
-pCellControl = new DbFilterField(m_rParent.getContext(),*this);
+pCellControl.reset(new DbFilterField(m_rParent.getContext(),*this));
 }
 else
 {
 
 switch (nTypeId)
 {
-case TYPE_CHECKBOX: pCellControl = new DbCheckBox(*this);   break;
-case TYPE_COMBOBOX: pCellControl = new DbComboBox(*this); break;
-case TYPE_CURRENCYFIELD: pCellControl = new 
DbCurrencyField(*this); break;
-case TYPE_DATEFIELD: pCellControl = new DbDateField(*this); break;
-case TYPE_LISTBOX: pCellControl = new DbListBox(*this); break;
-case TYPE_NUMERICFIELD: pCellControl = new DbNumericField(*this); 
break;
-case TYPE_PATTERNFIELD: pCellControl = new DbPatternField( *this, 
m_rParent.getContext() ); break;
-case TYPE_TEXTFIELD: pCellControl = new DbTextField(*this); break;
-case TYPE_TIMEFIELD: pCellControl = new DbTimeField(*this); break;
-case TYPE_FORMATTEDFIELD: pCellControl = new 
DbFormattedField(*this); break;
+case TYPE_CHECKBOX: pCellControl.reset(new DbCheckBox(*this));   
break;
+case TYPE_COMBOBOX: pCellControl.reset(new DbComboBox(*this)); 
break;
+case TYPE_CURRENCYFIELD: pCellControl.reset(new 
DbCurrencyField(*this)); break;
+case TYPE_DATEFIELD: pCellControl.reset(new DbDateField(*this)); 
break;
+case TYPE_LISTBOX: pCellControl.reset(new DbListBox(*this)); break;
+case TYPE_NUMERICFIELD: pCellControl.reset(new 
DbNumericField(*this)); break;
+case TYPE_PATTERNFIELD: pCellControl.reset(new DbPatternField( 
*this, m_rParent.getContext() )); break;
+case TYPE_TEXTFIELD: pCellControl.reset(new DbTextField(*this)); 
break;
+case TYPE_TIMEFIELD: pCellControl.reset(new DbTimeField(*this)); 
break;
+case TYPE_FORMATTEDFIELD: pCellControl.reset(new 
DbFormattedField(*this)); break;
 default:
 OSL_FAIL("DbGridColumn::CreateControl: Unknown Column");
 return;
@@ -213,17 +213,18 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, 
const Reference< css::bea
 pCellControl->Init( m_rParent.GetDataWindow(), xCur );
 
 // now create the control wrapper
+auto pTempCellControl = pCellControl.get();
 if (m_rParent.IsFilterMode())
-m_pCell = new FmXFilterCell(this, 
static_cast(pCellControl));
+m_pCell = new FmXFilterCell(this, 
std::unique_ptr(static_cast(pCellControl.release(;
 else
 {
 switch (nTypeId)
 {
-case TYPE_CHECKBOX: m_pCell = new FmXCheckBoxCell( this, 
*pCellControl );  break;
-case TYPE_LISTBOX: m_pCell = new FmXListBoxCell( this, 
*pCellControl );break;
-case TYPE_COMBOBOX: m_pCell = new FmXComboBoxCell( this, 
*pCellControl );break;
+case TYPE_CHECKBOX: m_pCell = new FmXCheckBoxCell( this, 
std::move(pCellControl) );  break;
+case TYPE_LISTBOX: m_pCell = new FmXListBoxCell( this, 
std::move(pCellControl) );break;
+case TYPE_COMBOBOX: m_pCell = new FmXComboBoxCell( this, 
std::move(pCellControl) );break;
 default:
-m_pCell = new FmXEditCell( this, *pCellControl );
+m_pCell = new FmXEditCell( this, std::move(pCellControl) );
 }
 }
 m_pCell->init();
@@ -233,7 +234,7 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, 
const Reference< css::bea
 // only if we use have a bound field, we use a controller for displaying 
the
 // window in the grid
 if (m_xField.is())
-m_xController = pCellControl->CreateController();
+m_xController = pTempCellControl->CreateController();
 }
 
 
@@ -3122,10 +3123,10 @@ IMPL_LINK_NOARG(DbFilterField, OnClick, 
VclPtr, void)
 }
 
 

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

2018-07-18 Thread Libreoffice Gerrit user
 svx/source/sdr/properties/properties.cxx |   13 +++--
 sw/source/core/inc/scriptinfo.hxx|7 ---
 sw/source/core/text/porlay.cxx   |   25 ++---
 3 files changed, 21 insertions(+), 24 deletions(-)

New commits:
commit 7d2668517b68f9a7f056a993e53b4dd80838a4f9
Author: Armin Le Grand 
AuthorDate: Tue Jul 17 18:39:23 2018 +0200
Commit: Armin Le Grand 
CommitDate: Wed Jul 18 10:46:43 2018 +0200

tdf#118139 Set Default StyleSheet only when available

Change-Id: Id8643895add3181c41737249326bb49e1a2c2493
Reviewed-on: https://gerrit.libreoffice.org/57582
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/svx/source/sdr/properties/properties.cxx 
b/svx/source/sdr/properties/properties.cxx
index bdaaec8d..61929a9b498a 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -43,8 +43,17 @@ namespace sdr
 
 void BaseProperties::applyDefaultStyleSheetFromSdrModel()
 {
-// do not delete hard attributes when setting dsefault Style
-
SetStyleSheet(GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet(), 
true);
+SfxStyleSheet* 
pDefaultStyleSheet(GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet());
+
+// tdf#118139 Only do this when StyleSheet really differs. It may 
e.g.
+// be the case that nullptr == pDefaultStyleSheet and there is 
none set yet,
+// so indeed no need to set it (needed for some strange old 
MSWord2003
+// documents with CustomShape-'Group' and added Text-Frames, see 
task description)
+if(pDefaultStyleSheet != GetStyleSheet())
+{
+// do not delete hard attributes when setting dsefault Style
+SetStyleSheet(pDefaultStyleSheet, true);
+}
 }
 
 const SdrObject& BaseProperties::GetSdrObject() const
commit f3df554636b32160cab6d9e6e42cd32550a6a0c7
Author: Takeshi Abe 
AuthorDate: Wed Jul 18 15:46:47 2018 +0900
Commit: Noel Grandin 
CommitDate: Wed Jul 18 10:46:37 2018 +0200

sw: Change m_KashidaInvalid to std::unordered_set

... for clarifying what is supposed to do, and doing it more
efficiently.
Actually this assumes that m_KashidaInvalid has no duplicate
entries, which I think is humble and sane.

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

diff --git a/sw/source/core/inc/scriptinfo.hxx 
b/sw/source/core/inc/scriptinfo.hxx
index e3b532783439..7f81a8d0e99f 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -63,7 +64,7 @@ private:
 std::vector m_DirectionChanges;
 std::deque m_Kashida;
 /// indexes into m_Kashida
-std::deque m_KashidaInvalid;
+std::unordered_set m_KashidaInvalid;
 std::deque m_NoKashidaLine;
 std::deque m_NoKashidaLineEnd;
 std::deque m_HiddenChg;
@@ -84,9 +85,9 @@ private:
 sal_uInt8 m_nDefaultDir;
 
 void UpdateBidiInfo( const OUString& rText );
-
 bool IsKashidaValid(size_t nKashPos) const;
-void MarkKashidaInvalid(size_t nKashPos);
+// returns true if nKashPos is newly marked invalid
+bool MarkKashidaInvalid(size_t nKashPos);
 void ClearKashidaInvalid(size_t nKashPos);
 bool MarkOrClearKashidaInvalid(TextFrameIndex nStt, TextFrameIndex nLen,
 bool bMark, sal_Int32 nMarkCount);
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index a5391aa817a6..e6b2ea0ee5a1 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1795,7 +1795,7 @@ long SwScriptInfo::Compress(long* pKernArray, 
TextFrameIndex nIdx, TextFrameInde
 // Note on calling KashidaJustify():
 // Kashida positions may be marked as invalid. Therefore KashidaJustify may 
return the clean
 // total number of kashida positions, or the number of kashida positions after 
some positions
-// have been dropped, depending on the state of the m_KashidaInvalid array.
+// have been dropped, depending on the state of the m_KashidaInvalid set.
 
 sal_Int32 SwScriptInfo::KashidaJustify( long* pKernArray,
 long* pScrArray,
@@ -1921,24 +1921,12 @@ bool SwScriptInfo::IsArabicText(const OUString& rText,
 
 bool SwScriptInfo::IsKashidaValid(size_t const nKashPos) const
 {
-for (size_t i : m_KashidaInvalid)
-{
-if ( i == nKashPos )
-return false;
-}
-return true;
+return m_KashidaInvalid.find(nKashPos) == m_KashidaInvalid.end();
 }
 
 void SwScriptInfo::ClearKashidaInvalid(size_t const nKashPos)
 {
-for (size_t i = 0; i < m_KashidaInvalid.size(); ++i)
-{
-if (m_KashidaInvalid [ i ] == nKashPos)
-{
- 

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

2018-06-11 Thread Noel Grandin
 svx/source/form/filtnav.cxx|4 +--
 svx/source/form/fmexpl.cxx |   37 +
 svx/source/form/navigatortree.cxx  |4 +--
 svx/source/form/navigatortreemodel.cxx |4 +--
 svx/source/inc/filtnav.hxx |4 +--
 svx/source/inc/fmexpl.hxx  |   14 ++--
 6 files changed, 30 insertions(+), 37 deletions(-)

New commits:
commit eec9f6c8b928de38dd9e683f46bfab00f3243048
Author: Noel Grandin 
Date:   Mon Jun 4 15:01:43 2018 +0200

loplugin:useuniqueptr in FmEntryDataList

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

diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index 0ad2377088bb..8fec9e0f5798 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -132,41 +132,34 @@ FmEntryDataList::~FmEntryDataList()
 }
 
 
-FmEntryData* FmEntryDataList::remove( FmEntryData* pItem )
+void FmEntryDataList::remove( FmEntryData* pItem )
 {
-FmEntryDataBaseList::const_iterator aEnd = maEntryDataList.end();
-for ( FmEntryDataBaseList::iterator it = maEntryDataList.begin();
-  it != aEnd;
-  ++it
-)
+auto aEnd = maEntryDataList.end();
+for ( auto it = maEntryDataList.begin(); it != aEnd; ++it )
 {
-if ( *it == pItem )
+if ( it->get() == pItem )
 {
 maEntryDataList.erase( it );
-break;
+return;
 }
 }
-return pItem;
+assert(false);
 }
 
 
-void FmEntryDataList::insert( FmEntryData* pItem, size_t Index )
+void FmEntryDataList::insert( std::unique_ptr pItem, size_t Index 
)
 {
 if ( Index < maEntryDataList.size() )
 {
-FmEntryDataBaseList::iterator it = maEntryDataList.begin();
-::std::advance( it, Index );
-maEntryDataList.insert( it, pItem );
+maEntryDataList.insert( maEntryDataList.begin() + Index, 
std::move(pItem) );
 }
 else
-maEntryDataList.push_back( pItem );
+maEntryDataList.push_back( std::move(pItem) );
 }
 
 
 void FmEntryDataList::clear()
 {
-for (FmEntryData* p : maEntryDataList)
-delete p;
 maEntryDataList.clear();
 }
 
@@ -207,8 +200,8 @@ FmEntryData::FmEntryData( const FmEntryData& rEntryData )
 for( size_t i = 0; i < nEntryCount; i++ )
 {
 pChildData = rEntryData.GetChildList()->at( i );
-FmEntryData* pNewChildData = pChildData->Clone();
-pChildList->insert( pNewChildData, size_t(-1) );
+std::unique_ptr pNewChildData = pChildData->Clone();
+pChildList->insert( std::move(pNewChildData), size_t(-1) );
 }
 
 m_xNormalizedIFace = rEntryData.m_xNormalizedIFace;
@@ -276,9 +269,9 @@ FmFormData::FmFormData( const FmFormData& rFormData )
 }
 
 
-FmEntryData* FmFormData::Clone()
+std::unique_ptr FmFormData::Clone()
 {
-return new FmFormData( *this );
+return std::unique_ptr(new FmFormData( *this ));
 }
 
 
@@ -325,9 +318,9 @@ FmControlData::FmControlData( const FmControlData& 
rControlData )
 }
 
 
-FmEntryData* FmControlData::Clone()
+std::unique_ptr FmControlData::Clone()
 {
-return new FmControlData( *this );
+return std::unique_ptr(new FmControlData( *this ));
 }
 
 
diff --git a/svx/source/form/navigatortree.cxx 
b/svx/source/form/navigatortree.cxx
index 6d114087ac73..8f8101410bf5 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -1127,9 +1127,9 @@ namespace svxform
 
 // give parent the new child
 if (pTargetData)
-pTargetData->GetChildList()->insert( pCurrentUserData, nIndex 
);
+pTargetData->GetChildList()->insert( 
std::unique_ptr(pCurrentUserData), nIndex );
 else
-GetNavModel()->GetRootList()->insert( pCurrentUserData, nIndex 
);
+GetNavModel()->GetRootList()->insert( 
std::unique_ptr(pCurrentUserData), nIndex );
 
 // announce to myself and reselect
 SvTreeListEntry* pNew = Insert( pCurrentUserData, nIndex );
diff --git a/svx/source/form/navigatortreemodel.cxx 
b/svx/source/form/navigatortreemodel.cxx
index 01136bf189b0..9ae59cf81908 100644
--- a/svx/source/form/navigatortreemodel.cxx
+++ b/svx/source/form/navigatortreemodel.cxx
@@ -333,9 +333,9 @@ namespace svxform
 }
 
 if (pFolder)
-pFolder->GetChildList()->insert( pEntry, nRelPos );
+pFolder->GetChildList()->insert( 
std::unique_ptr(pEntry), nRelPos );
 else
-GetRootList()->insert( pEntry, nRelPos );
+GetRootList()->insert( std::unique_ptr(pEntry), 
nRelPos );
 
 
 // notify UI
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index f681edc26ffb..024b38edb775 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -167,7 +167,7 @@ public:
 

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

2018-06-05 Thread Caolán McNamara
 svx/source/dialog/charmap.cxx |3 +-
 vcl/unx/gtk3/gtk3gtkframe.cxx |   44 --
 2 files changed, 40 insertions(+), 7 deletions(-)

New commits:
commit dbd804bac6db541d60b3a101852580b87bd4e33e
Author: Caolán McNamara 
Date:   Tue Jun 5 14:57:19 2018 +0100

tdf#117981 translate embedded video window mouse events to parent 
coordinates

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

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 3595e0bf20c7..38cb6b8c087a 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2586,11 +2586,28 @@ void GtkSalFrame::closePopup()
 
pSVData->maWinData.mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | 
FloatWinPopupEndFlags::CloseAll);
 }
 
+namespace
+{
+//tdf#117981 translate embedded video window mouse events to parent 
coordinates
+void translate_coords(GdkWindow* pSourceWindow, GtkWidget* pTargetWidget, 
int& rEventX, int& rEventY)
+{
+gpointer user_data=nullptr;
+gdk_window_get_user_data(pSourceWindow, _data);
+GtkWidget* pRealEventWidget = static_cast(user_data);
+if (pRealEventWidget)
+{
+gtk_widget_translate_coordinates(pRealEventWidget, pTargetWidget, 
rEventX, rEventY, , );
+}
+}
+}
+
 gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, 
gpointer frame )
 {
 UpdateLastInputEventTime(pEvent->time);
 
 GtkSalFrame* pThis = static_cast(frame);
+GtkWidget* pEventWidget = pThis->getMouseEventWidget();
+bool bDifferentEventWindow = pEvent->window != 
widget_get_window(pEventWidget);
 
 SalMouseEvent aEvent;
 SalEvent nEventType = SalEvent::NONE;
@@ -2619,7 +2636,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, 
GdkEventButton* pEvent, gpointer
 {
 //rhbz#1505379 if the window that got the event isn't our one, or 
there's none
 //of our windows under the mouse then close this popup window
-if (pEvent->window != widget_get_window(pThis->getMouseEventWidget()) 
||
+if (bDifferentEventWindow ||
 gdk_device_get_window_at_position(pEvent->device, nullptr, 
nullptr) == nullptr)
 {
 if (pEvent->type == GDK_BUTTON_PRESS)
@@ -2629,10 +2646,16 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, 
GdkEventButton* pEvent, gpointer
 }
 }
 
+int nEventX = pEvent->x;
+int nEventY = pEvent->y;
+
+if (bDifferentEventWindow)
+translate_coords(pEvent->window, pEventWidget, nEventX, nEventY);
+
 if (!aDel.isDeleted())
 {
-int frame_x = static_cast(pEvent->x_root - pEvent->x);
-int frame_y = static_cast(pEvent->y_root - pEvent->y);
+int frame_x = static_cast(pEvent->x_root - nEventX);
+int frame_y = static_cast(pEvent->y_root - nEventY);
 if (pThis->m_bGeometryIsProvisional || frame_x != pThis->maGeometry.nX 
|| frame_y != pThis->maGeometry.nY)
 {
 pThis->m_bGeometryIsProvisional = false;
@@ -2843,18 +2866,27 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, 
GdkEventMotion* pEvent, gpointer
 UpdateLastInputEventTime(pEvent->time);
 
 GtkSalFrame* pThis = static_cast(frame);
+GtkWidget* pEventWidget = pThis->getMouseEventWidget();
+bool bDifferentEventWindow = pEvent->window != 
widget_get_window(pEventWidget);
 
 //If a menu, e.g. font name dropdown, is open, then under wayland moving 
the
 //mouse in the top left corner of the toplevel window in a
 //0,0,float-width,float-height area generates motion events which are
 //delivered to the dropdown
-if (pThis->isFloatGrabWindow() && pEvent->window != 
widget_get_window(pThis->getMouseEventWidget()))
+if (pThis->isFloatGrabWindow() && bDifferentEventWindow)
 return true;
 
 vcl::DeletionListener aDel( pThis );
 
-int frame_x = static_cast(pEvent->x_root - pEvent->x);
-int frame_y = static_cast(pEvent->y_root - pEvent->y);
+int nEventX = pEvent->x;
+int nEventY = pEvent->y;
+
+if (bDifferentEventWindow)
+translate_coords(pEvent->window, pEventWidget, nEventX, nEventY);
+
+int frame_x = static_cast(pEvent->x_root - nEventX);
+int frame_y = static_cast(pEvent->y_root - nEventY);
+
 if (pThis->m_bGeometryIsProvisional || frame_x != pThis->maGeometry.nX || 
frame_y != pThis->maGeometry.nY)
 {
 pThis->m_bGeometryIsProvisional = false;
commit e0cf2c1e4ea94211f59d2ff87bb132754bb74048
Author: Caolán McNamara 
Date:   Tue Jun 5 16:49:11 2018 +0100

Resolves: tdf#116876 don't reselect index on resize if it wouldn't change

selecting the index sets it as active and updates the previews, so if its an
inactive index and resize happens, leave it as inactive but selected


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

2018-05-06 Thread Caolán McNamara
 svx/source/accessibility/svxrectctaccessiblecontext.cxx |8 
 vcl/source/image/ImplImageTree.cxx  |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ec3eac9cfeafca69c61ef7b50687a897087f1835
Author: Caolán McNamara 
Date:   Sun May 6 14:59:25 2018 +0100

coverity#1435442 silence Unchecked return value

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

diff --git a/vcl/source/image/ImplImageTree.cxx 
b/vcl/source/image/ImplImageTree.cxx
index 274c4e60f8d2..d48cd3044b07 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -604,7 +604,7 @@ bool ImplImageTree::checkPathAccess()
 
 css::uno::Reference const & 
ImplImageTree::getNameAccess()
 {
-checkPathAccess();
+(void)checkPathAccess();
 return getCurrentIconSet().maNameAccess;
 }
 
commit f0886f4e7654078bd053c8d400b682171aff850b
Author: Caolán McNamara 
Date:   Sun May 6 14:55:44 2018 +0100

coverity#1435443 Arguments in wrong order

and

coverity#1435439 Arguments in wrong order
coverity#1435437 Arguments in wrong order

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

diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx 
b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index e6c0959d20d3..62ae619a6c00 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -851,7 +851,7 @@ void RectCtlAccessibleContext::FireChildFocus( RectPoint 
eButton )
 Any aOld;
 Any aNew;
 aNew <<= AccessibleStateType::FOCUSED;
-NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aNew, 
aOld);
+NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOld, 
aNew);
 }
 }
 else
@@ -1545,11 +1545,11 @@ void RectCtlChildAccessibleContext::setStateChecked( 
bool bChecked )
 
 //Send the STATE_CHANGED(Focused) event to accessible
 rMod <<= AccessibleStateType::FOCUSED;
-NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aNew, aOld);
+NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOld, aNew);
 
 rMod <<= AccessibleStateType::CHECKED;
 
-NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aNew, aOld);
+NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOld, aNew);
 }
 }
 
@@ -1558,7 +1558,7 @@ void RectCtlChildAccessibleContext::FireFocusEvent()
 Any aOld;
 Any aNew;
 aNew <<= AccessibleStateType::FOCUSED;
-NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aNew, aOld);
+NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOld, aNew);
 }
 
 IMPLEMENT_FORWARD_XINTERFACE2( RectCtlChildAccessibleContext, 
OAccessibleComponentHelper, OAccessibleHelper_Base_3 )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-10 Thread Tomaž Vajngerl
 svx/source/unodraw/unoshap2.cxx|   32 +++-
 sw/source/filter/xml/xmltexte.cxx  |4 ++--
 sw/source/filter/xml/xmltexte.hxx  |3 ++-
 xmloff/source/draw/shapeexport.cxx |4 +++-
 4 files changed, 22 insertions(+), 21 deletions(-)

New commits:
commit 91ab5a07708892c3df6940aeb643d50bfd43e285
Author: Tomaž Vajngerl 
Date:   Sun Mar 11 01:53:13 2018 +0900

use XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE define

Change-Id: I6d37cc1e745b797a1c727a988177916291b650be
Reviewed-on: https://gerrit.libreoffice.org/51049
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sw/source/filter/xml/xmltexte.cxx 
b/sw/source/filter/xml/xmltexte.cxx
index 2324d667cb39..27205f248222 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -79,7 +79,6 @@ SwXMLTextParagraphExport::SwXMLTextParagraphExport(
  SvXMLAutoStylePoolP& _rAutoStylePool ) :
 XMLTextParagraphExport( rExp, _rAutoStylePool ),
 sEmbeddedObjectProtocol( "vnd.sun.star.EmbeddedObject:" ),
-sGraphicObjectProtocol( "vnd.sun.star.GraphicObject:" ),
 aAppletClassId( SO3_APPLET_CLASSID ),
 aPluginClassId( SO3_PLUGIN_CLASSID ),
 aIFrameClassId( SO3_IFRAME_CLASSID )
@@ -562,7 +561,8 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
 }
 if( SV_EMBEDDED_OUTPLACE==nType || SV_EMBEDDED_OWN==nType )
 {
-OUString sURL( sGraphicObjectProtocol + 
rOLEObj.GetCurrentPersistName() );
+OUString sURL(XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE);
+sURL += rOLEObj.GetCurrentPersistName();
 if( !(rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED) )
 {
 sURL = GetExport().AddEmbeddedObject( sURL );
diff --git a/sw/source/filter/xml/xmltexte.hxx 
b/sw/source/filter/xml/xmltexte.hxx
index 9ff9581d5070..38d0d2bdd02e 100644
--- a/sw/source/filter/xml/xmltexte.hxx
+++ b/sw/source/filter/xml/xmltexte.hxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 
+#define XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE "vnd.sun.star.GraphicObject:"
+
 class SwXMLExport;
 class SvXMLAutoStylePoolP;
 class SwNoTextNode;
@@ -33,7 +35,6 @@ namespace com { namespace sun { namespace star { namespace 
style {
 class SwXMLTextParagraphExport : public XMLTextParagraphExport
 {
 const OUString sEmbeddedObjectProtocol;
-const OUString sGraphicObjectProtocol;
 
 const SvGlobalName aAppletClassId;
 const SvGlobalName aPluginClassId;
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index e028f56e846e..6a6613e486d4 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -128,6 +128,8 @@ using namespace ::com::sun::star;
 using namespace ::xmloff::EnhancedCustomShapeToken;
 using namespace ::xmloff::token;
 
+#define XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE "vnd.sun.star.GraphicObject:"
+
 namespace {
 
 bool supportsText(XmlShapeType eShapeType)
@@ -2954,7 +2956,7 @@ void XMLShapeExport::ImpExportOLE2Shape(
 }
 if( !bIsEmptyPresObj )
 {
-OUString sURL(  "vnd.sun.star.GraphicObject:"  );
+OUString sURL(XML_EMBEDDEDOBJECTGRAPHIC_URL_BASE);
 sURL += sPersistName;
 if( !bExportEmbedded )
 {
commit cfb90793b42ff57281d1cdd8b0c609652664ffe9
Author: Tomaž Vajngerl 
Date:   Sun Mar 11 01:11:22 2018 +0900

svx: convert XBitmap directly to XGraphic

Change-Id: If2bd8419d9073625f0392f59f671d70193bf990c
Reviewed-on: https://gerrit.libreoffice.org/51048
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index bf8b7b706c0d..453e6a254cfb 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1308,25 +1308,24 @@ bool SvxGraphicObject::setPropertyValueImpl( const 
OUString& rName, const SfxIte
 bOk = true;
 }
 }
-else if( (rValue.getValueType() == cppu::UnoType::get()) 
|| (rValue.getValueType() == cppu::UnoType::get()))
+else if (rValue.getValueType() == 
cppu::UnoType::get())
 {
-Reference< graphic::XGraphic> xGraphic( rValue, UNO_QUERY );
-if( xGraphic.is() )
+auto xGraphic = rValue.get();
+if (xGraphic.is())
 {
 
static_cast(mpObj.get())->SetGraphic(Graphic(xGraphic));
 bOk = true;
 }
-else
+}
+else if (rValue.getValueType() == cppu::UnoType::get())
+{
+auto xBitmap = rValue.get();
+if (xBitmap.is())
 {
-// pack bitmap in the object
-Reference< awt::XBitmap > xBmp( rValue, UNO_QUERY );
-if( xBmp.is() )
-{
-

[Libreoffice-commits] core.git: 2 commits - svx/source sw/CppunitTest_sw_uibase_unit.mk sw/inc sw/Module_sw.mk sw/qa sw/source

2017-12-20 Thread Miklos Vajna
 svx/source/dialog/fntctrl.cxx|   34 ++
 sw/CppunitTest_sw_uibase_unit.mk |   31 +++
 sw/Module_sw.mk  |4 +++
 sw/inc/dbmgr.hxx |   17 +++
 sw/qa/unit/uibase.cxx|   44 +++
 sw/source/uibase/dbui/dbmgr.cxx  |   18 +--
 6 files changed, 118 insertions(+), 30 deletions(-)

New commits:
commit 226804c8f7d2306562380283edfd919a88863807
Author: Miklos Vajna 
Date:   Tue Dec 19 21:22:02 2017 +0100

svx: CleanAndCheckEmpty() can be in the anonymous namespace

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

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index f41889f3b766..39e07301 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -122,6 +122,22 @@ void setFont(const SvxFont& rNewFont, SvxFont& rImplFont)
 rImplFont.SetAlignment(ALIGN_BASELINE);
 }
 
+/*
+ * removes line feeds and carriage returns from string
+ * returns if param is empty
+ */
+bool CleanAndCheckEmpty(OUString& rText)
+{
+bool bEmpty = true;
+for (sal_Int32 i = 0; i < rText.getLength(); ++i)
+{
+if (0xa == rText[i] || 0xd == rText[i])
+rText = rText.replaceAt(i, 1, " ");
+else
+bEmpty = false;
+}
+return bEmpty;
+}
 } // end anonymous namespace
 
 class FontPrevWin_Impl
@@ -612,24 +628,6 @@ void SvxFontPrevWindow::UseResourceText()
 pImpl->mbUseResText = true;
 }
 
-/*
- * removes line feeds and carriage returns from string
- * returns if param is empty
- */
-bool CleanAndCheckEmpty(OUString& rText)
-{
-bool bEmpty = true;
-for (sal_Int32 i = 0; i < rText.getLength(); ++i)
-{
-if (0xa == rText[i] || 0xd == rText[i])
-rText = rText.replaceAt(i, 1, " ");
-else
-bEmpty = false;
-}
-return bEmpty;
-}
-
-
 void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
 ApplySettings(rRenderContext);
commit 28ddaf520da56701508acc258cf1d90f26134d28
Author: Miklos Vajna 
Date:   Tue Dec 19 21:21:32 2017 +0100

tdf#98168 sw: add mail merge from xlsx testcase

Commit 83b43ef2223b66484e0e90e7b614886e06f955b5 (sw mail merge: add
support for the new 'writer' connectivity driver, 2017-07-18) fixed
this, with:

> If we are at it, also accept xlsx next to xls.

But there was no test for that part.

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

diff --git a/sw/CppunitTest_sw_uibase_unit.mk b/sw/CppunitTest_sw_uibase_unit.mk
new file mode 100644
index ..03a780a156ce
--- /dev/null
+++ b/sw/CppunitTest_sw_uibase_unit.mk
@@ -0,0 +1,31 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_uibase_unit))
+
+$(eval $(call gb_CppunitTest_use_external,sw_uibase_unit,boost_headers))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sw_uibase_unit))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_uibase_unit, \
+sw/qa/unit/uibase \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_uibase_unit, \
+   sal \
+   sw \
+   tl \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_uibase_unit,\
+-I$(SRCDIR)/sw/inc \
+$$(INCLUDE) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 472eac81ad93..4ef524d1fd94 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -48,6 +48,10 @@ $(eval $(call gb_Module_add_targets,sw,\
 
 endif
 
+$(eval $(call gb_Module_add_check_targets,sw,\
+CppunitTest_sw_uibase_unit \
+))
+
 $(eval $(call gb_Module_add_slowcheck_targets,sw,\
$(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \
CppunitTest_sw_uwriter) \
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index 098e1a26f7f7..932d3c165eed 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -473,6 +473,23 @@ public:
 void RevokeNotUsedConnections();
 };
 
+namespace sw
+{
+enum class DBConnURIType
+{
+UNKNOWN = 0,
+ODB,
+CALC,
+DBASE,
+FLAT,
+MSJET,
+MSACE,
+WRITER
+};
+
+DBConnURIType SW_DLLPUBLIC GetDBunoType(const INetURLObject );
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/unit/uibase.cxx 

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

2017-12-19 Thread Caolán McNamara
 svx/source/form/filtnav.cxx   |   14 +++---
 vcl/source/window/builder.cxx |7 ---
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 386a73e0b76032b4992829bfdf9965854351b230
Author: Caolán McNamara 
Date:   Mon Dec 18 10:03:48 2017 +

remove a CONTAINER_APPEND use

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

diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 8a280a0a4a1a..37a91bf0d4e3 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -198,14 +198,14 @@ public:
 
 class FmFilterInsertedHint : public FmFilterHint
 {
-sal_uLong m_nPos;   // Position relative to the parent of the data
+size_t m_nPos;   // Position relative to the parent of the data
 
 public:
-FmFilterInsertedHint(FmFilterData* pData, sal_uLong nRelPos)
+FmFilterInsertedHint(FmFilterData* pData, size_t nRelPos)
 :FmFilterHint(pData)
 ,m_nPos(nRelPos){}
 
-sal_uLong GetPos() const { return m_nPos; }
+size_t GetPos() const { return m_nPos; }
 };
 
 class FmFilterRemovedHint : public FmFilterHint
@@ -710,18 +710,18 @@ void FmFilterModel::AppendFilterItems( FmFormItem& 
_rFormItem )
 }
 }
 
-
 void FmFilterModel::Insert(const ::std::vector::iterator& rPos, 
FmFilterData* pData)
 {
+size_t nPos;
 ::std::vector& rItems = pData->GetParent()->GetChildren();
-sal_uLong nPos = rPos == rItems.end() ? CONTAINER_APPEND : rPos - 
rItems.begin();
-if (nPos == CONTAINER_APPEND)
+if (rPos == rItems.end())
 {
+nPos = rItems.size();
 rItems.push_back(pData);
-nPos = rItems.size() - 1;
 }
 else
 {
+nPos = rPos - rItems.begin();
 rItems.insert(rPos, pData);
 }
 
commit 5f103b6f03bf9de16c0cc8d33a9a7082f05563f3
Author: Caolán McNamara 
Date:   Mon Dec 18 10:41:12 2017 +

coverity#1426313 Unchecked return value

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 624e15f76ab4..536f07cd1b6a 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1636,14 +1636,15 @@ VclPtr VclBuilder::makeObject(vcl::Window 
*pParent, const OString &
 sModuleBuf.append("mergedlo");
 sModuleBuf.append(SAL_DLLEXTENSION);
 OUString sMergedModule = sModuleBuf.makeStringAndClear();
-pModule->loadRelative(, sMergedModule);
+bool ok = pModule->loadRelative(, sMergedModule);
 if (!pModule->getFunctionSymbol(sFunction))
 {
-pModule->loadRelative(, sModule);
+ok = pModule->loadRelative(, sModule);
 }
 #else
-pModule->loadRelative(, sModule);
+bool ok = pModule->loadRelative(, sModule);
 #endif
+assert(ok || "bad module name in .ui"); (void)ok;
 aI = m_aModuleMap.insert(std::make_pair(sModule, 
std::unique_ptr(pModule))).first;
 }
 customMakeWidget pFunction = 
reinterpret_cast(aI->second->getFunctionSymbol(sFunction));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-15 Thread Caolán McNamara
 svx/source/dialog/ClassificationDialog.cxx |1 +
 sw/qa/extras/tiledrendering/tiledrendering.cxx |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c2602c5f0eb6555dc5cbcfc74a02c0e3b0347e37
Author: Caolán McNamara 
Date:   Wed Nov 15 09:14:12 2017 +

coverity#1421163 Unchecked dynamic_cast

and

coverity#1421165 Unchecked dynamic_cast

Change-Id: Iabd9560d41ec3ddbdb7a560b7839024b7749f917

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index b55e775d0ba7..91f5f2235901 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1828,12 +1828,13 @@ void SwTiledRenderingTest::testAllTrackedChanges()
 
 // view #1
 SwView* pView1 = dynamic_cast(SfxViewShell::Current());
+CPPUNIT_ASSERT(pView1);
 SwWrtShell* pWrtShell1 = pView1->GetWrtShellPtr();
 
 // view #2
 SfxLokHelper::createView();
 SwView* pView2 = dynamic_cast(SfxViewShell::Current());
-CPPUNIT_ASSERT(pView1 != pView2);
+CPPUNIT_ASSERT(pView2 && pView1 != pView2);
 SwWrtShell* pWrtShell2 = pView2->GetWrtShellPtr();
 // Insert text and reject all
 {
commit 44844b60847af68b8b1b91137eb6af4b65979697
Author: Caolán McNamara 
Date:   Wed Nov 15 09:09:51 2017 +

coverity#1421071 Uninitializer scalar field

Change-Id: I6b52c62574013ba24297c2cbd7bfceea0e29

diff --git a/svx/source/dialog/ClassificationDialog.cxx 
b/svx/source/dialog/ClassificationDialog.cxx
index 34b5d1504344..0bb8e7892d4e 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -166,6 +166,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* 
pParent, const bool bPer
 , maInternationalHelper(SfxObjectShell::Current()->getDocProperties(), 
/*bUseLocalizedPolicy*/ false)
 , m_bPerParagraph(bPerParagraph)
 , m_aParagraphSignHandler(rParagraphSignHandler)
+, m_nCurrentSelectedCategory(-1)
 {
 get(m_pOkButton, "ok");
 get(m_pEditWindow, "classificationEditWindow");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-20 Thread Caolán McNamara
 svx/source/svdraw/svdmark.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 35bb22c1a834b306c910cb065bc006818c9fa9b3
Author: Caolán McNamara 
Date:   Mon Feb 20 14:52:52 2017 +

Resolves: tdf#106105 duplicate marks not merged when they are at the start

i.e. initial mark isn't compared which goes on to crash under some 
circumstances

regression from...

commit aa11e7bae89fe691f914abb27d1c4a03d27a7ee5
Date:   Tue Aug 14 16:31:53 2012 +0200

Convert maList in SdrMarkList from Container to std::vector

Change-Id: Ib3e9b02aad91c14971656af171d48154507da127

diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 9d63bfb..7a76fd4 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -179,8 +179,9 @@ void SdrMarkList::ImpForceSort()
 if(maList.size() > 1)
 {
 SdrMark* pAkt = maList.back();
-for (size_t i = maList.size() - 2; i; --i)
+for (size_t count = maList.size() - 1; count; --count)
 {
+size_t i = count - 1;
 SdrMark* pCmp = maList[i];
 if(pAkt->GetMarkedSdrObj() == pCmp->GetMarkedSdrObj() && 
pAkt->GetMarkedSdrObj())
 {
commit 329a6985a4ab94a3f899053dc84422af848bd47c
Author: Caolán McNamara 
Date:   Mon Feb 20 14:00:34 2017 +

no need for return at end

Change-Id: I3fb2cc8d5d1c8853dc35b176030fc5d3292e4756

diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 66e5f6e..9d63bfb 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -323,8 +323,6 @@ void SdrMarkList::InsertEntry(const SdrMark& rMark, bool 
bChkSort)
 }
 }
 }
-
-return;
 }
 
 void SdrMarkList::DeleteMark(size_t nNum)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-07 Thread Maxim Monastirsky
 svx/source/tbxctrls/tbcontrl.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 4d4d25ee6fb5d52a690e52252d1749ddd8d7a6f3
Author: Maxim Monastirsky 
Date:   Tue Feb 7 19:52:11 2017 +0200

Always use split button for .uno:CharBackColor

Change-Id: I4dd01ec8692fff77a94d6fa698e438581f6dbf37

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index efedc30..7854060 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2778,6 +2778,7 @@ SvxColorToolBoxControl::SvxColorToolBoxControl(
 SAL_FALLTHROUGH;
 
 case SID_ATTR_CHAR_COLOR:
+case SID_ATTR_CHAR_BACK_COLOR:
 m_bSplitButton = true;
 break;
 
commit 5350dfca60c90845df9143bc25002dfc45c3d49f
Author: Maxim Monastirsky 
Date:   Tue Feb 7 19:41:34 2017 +0200

tdf#105631 Notebookbar doesn't use wide buttons

So we want non-split behavior only in SidebarToolBox,
not in the derived NotebookbarToolBox.

Change-Id: I064bbe59b97da301a13889ad78a31227cfd693ee

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index c8862ca..efedc30 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 
 #include 
@@ -2767,7 +2768,7 @@ SvxColorToolBoxControl::SvxColorToolBoxControl(
 sal_uInt16 nId,
 ToolBox& rTbx ):
 ImplInheritanceHelper( nSlotId, nId, rTbx ),
-m_bSplitButton(dynamic_cast< sfx2::sidebar::SidebarToolBox* >() == 
nullptr),
+m_bSplitButton(typeid(rTbx) != typeid(sfx2::sidebar::SidebarToolBox)),
 m_aColorSelectFunction(PaletteManager::DispatchColorCommand)
 {
 switch( nSlotId )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Noel Grandin
 svx/source/form/fmexch.cxx  |   21 +
 svx/source/form/fmmodel.cxx |   40 +---
 svx/source/inc/filtnav.hxx  |2 +-
 svx/source/inc/fmexch.hxx   |   17 +
 4 files changed, 36 insertions(+), 44 deletions(-)

New commits:
commit 10d0c60947da520779040af25b0c558564b71aff
Author: Noel Grandin 
Date:   Mon Jan 23 08:48:02 2017 +0200

use rtl::Reference in FmFormModelImplData

instead of manual acquire/release

Change-Id: I925b45bcc2f09e09330ae8c79f3f40b81ae120ed

diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx
index 3c7b1b4..22c9e20 100644
--- a/svx/source/form/fmmodel.cxx
+++ b/svx/source/form/fmmodel.cxx
@@ -37,15 +37,14 @@ using namespace svxform;
 
 struct FmFormModelImplData
 {
-FmXUndoEnvironment* pUndoEnv;
+rtl::Reference  mxUndoEnv;
 boolbOpenInDesignIsDefaulted;
 boolbMovingPage;
 ::boost::optional< sal_Bool >
 aControlsUseRefDevice;
 
 FmFormModelImplData()
-:pUndoEnv( nullptr )
-,bOpenInDesignIsDefaulted( true )
+:bOpenInDesignIsDefaulted( true )
 ,bMovingPage( false )
 ,aControlsUseRefDevice()
 {
@@ -60,8 +59,7 @@ FmFormModel::FmFormModel(SfxItemPool* pPool, SfxObjectShell* 
pPers)
 , m_bAutoControlFocus(false)
 {
 m_pImpl.reset( new FmFormModelImplData );
-m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
-m_pImpl->pUndoEnv->acquire();
+m_pImpl->mxUndoEnv = new FmXUndoEnvironment(*this);
 }
 
 FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* pPool, 
SfxObjectShell* pPers)
@@ -72,8 +70,7 @@ FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* 
pPool, SfxObjectShe
 , m_bAutoControlFocus(false)
 {
 m_pImpl.reset( new FmFormModelImplData );
-m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
-m_pImpl->pUndoEnv->acquire();
+m_pImpl->mxUndoEnv = new FmXUndoEnvironment(*this);
 }
 
 FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* pPool, 
SfxObjectShell* pPers,
@@ -85,20 +82,17 @@ FmFormModel::FmFormModel(const OUString& rPath, 
SfxItemPool* pPool, SfxObjectShe
 , m_bAutoControlFocus(false)
 {
 m_pImpl.reset( new FmFormModelImplData );
-m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
-m_pImpl->pUndoEnv->acquire();
+m_pImpl->mxUndoEnv = new FmXUndoEnvironment(*this);
 }
 
 FmFormModel::~FmFormModel()
 {
-if (m_pObjShell && m_pImpl->pUndoEnv->IsListening(*m_pObjShell))
+if (m_pObjShell && m_pImpl->mxUndoEnv->IsListening(*m_pObjShell))
 SetObjectShell(nullptr);
 
 ClearUndoBuffer();
 // minimale grenze fuer undos
 SetMaxUndoActionCount(1);
-
-m_pImpl->pUndoEnv->release();
 }
 
 SdrPage* FmFormModel::AllocPage(bool bMasterPage)
@@ -109,7 +103,7 @@ SdrPage* FmFormModel::AllocPage(bool bMasterPage)
 void FmFormModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
 {
 // hack solange Methode intern
-if (m_pObjShell && !m_pImpl->pUndoEnv->IsListening( *m_pObjShell ))
+if (m_pObjShell && !m_pImpl->mxUndoEnv->IsListening( *m_pObjShell ))
 SetObjectShell(m_pObjShell);
 
 SdrModel::InsertPage( pPage, nPos );
@@ -134,7 +128,7 @@ SdrPage* FmFormModel::RemovePage(sal_uInt16 nPgNum)
 {
 Reference< XNameContainer > xForms( pToBeRemovedPage->GetForms( false 
), css::uno::UNO_QUERY );
 if ( xForms.is() )
-m_pImpl->pUndoEnv->RemoveForms( xForms );
+m_pImpl->mxUndoEnv->RemoveForms( xForms );
 }
 
 FmFormPage* pRemovedPage = 
static_cast(SdrModel::RemovePage(nPgNum));
@@ -145,7 +139,7 @@ SdrPage* FmFormModel::RemovePage(sal_uInt16 nPgNum)
 void FmFormModel::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos)
 {
 // hack solange Methode intern
-if (m_pObjShell && !m_pImpl->pUndoEnv->IsListening( *m_pObjShell ))
+if (m_pObjShell && !m_pImpl->mxUndoEnv->IsListening( *m_pObjShell ))
 SetObjectShell(m_pObjShell);
 
 SdrModel::InsertMasterPage(pPage, nPos);
@@ -159,7 +153,7 @@ SdrPage* FmFormModel::RemoveMasterPage(sal_uInt16 nPgNum)
 {
 Reference< XNameContainer > xForms( pPage->GetForms( false ), 
css::uno::UNO_QUERY );
 if ( xForms.is() )
-m_pImpl->pUndoEnv->RemoveForms( xForms );
+m_pImpl->mxUndoEnv->RemoveForms( xForms );
 }
 
 return pPage;
@@ -222,27 +216,27 @@ void FmFormModel::SetObjectShell( SfxObjectShell* pShell )
 
 if (m_pObjShell)
 {
-m_pImpl->pUndoEnv->EndListening( *this );
-m_pImpl->pUndoEnv->EndListening( *m_pObjShell );
+m_pImpl->mxUndoEnv->EndListening( *this );
+m_pImpl->mxUndoEnv->EndListening( *m_pObjShell );
 }
 
 m_pObjShell = pShell;
 
 if (m_pObjShell)
 {
-m_pImpl->pUndoEnv->SetReadOnly( m_pObjShell->IsReadOnly() || 
m_pObjShell->IsReadOnlyUI(), FmXUndoEnvironment::Accessor() );
+   

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

2017-01-14 Thread Caolán McNamara
 svx/source/svdraw/svdedxv.cxx |4 ++--
 vcl/source/control/field2.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d7e28300057645362ce32909c077b107f0a5c270
Author: Caolán McNamara 
Date:   Sat Jan 14 11:18:18 2017 +

coverity#1398583 Dereference after null check

and

coverity#1398580 Dereference after null check

Change-Id: Ib02a05d97c2ee2824eb1e8ad7fa97022fd573879

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 1fe56c8..9b4faf0 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1484,7 +1484,7 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& 
rMEvt, vcl::Window* pWin)
 else if (pTextEditWin!=nullptr) 
aPt=pTextEditWin->PixelToLogic(aPt);
 bPostIt=IsTextEditHit(aPt);
 }
-if (bPostIt) {
+if (bPostIt && pWin) {
 Point aPixPos(rMEvt.GetPosPixel());
 Rectangle 
aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
 if (aPixPos.X()LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
 if (aPixPos.X()aR.Right ()) aPixPos.X()=aR.Right ();
commit 9a9a3e8954c9e0adda76539b158e7ca8af1bd9b0
Author: Caolán McNamara 
Date:   Sat Jan 14 11:14:46 2017 +

coverity#735343 Unchecked return value

Change-Id: I18c605511094ad48557a24a89a391d8361a001a7

diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 2cb03cf..a2c740b 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1687,7 +1687,7 @@ void DateFormatter::Reformat()
 if ( !aStr.isEmpty() )
 {
 ImplSetText( aStr );
-ImplDateGetValue( aStr, maLastDate, GetExtDateFormat(true), 
ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings() );
+(void)ImplDateGetValue(aStr, maLastDate, GetExtDateFormat(true), 
ImplGetLocaleDataWrapper(), GetCalendarWrapper(), GetFieldSettings());
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-22 Thread Tor Lillqvist
 svx/source/tbxctrls/PaletteManager.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit aa522981e6a0953e157fa13ec5193147653d317b
Author: Tor Lillqvist 
Date:   Wed Nov 23 00:21:37 2016 +0200

Clear the color set before setting it up

Change-Id: I4c4e30be172e8fcb2b6d966f06540b9b1b62b9ad

diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index d08a2f3..7342b25 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -1096,6 +1096,7 @@ public:
 
 virtual void LoadColorSet( SvxColorValueSet& rColorSet ) override
 {
+rColorSet.Clear();
 for (size_t i = 0; i < SAL_N_ELEMENTS(aLibreColors); i++)
 {
 rColorSet.InsertItem(i, aLibreColors[i].mColor, 
OUString::createFromAscii(aLibreColors[i].mName));
commit 75fb3f79c3ba5e94740cea947527477bba50b358
Author: Tor Lillqvist 
Date:   Wed Nov 23 00:20:37 2016 +0200

Avoid OUString construction at library load time

Change-Id: Ie56cea732ade971aa276411e7552d4eefe47621a

diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index 27ef209..d08a2f3 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -35,7 +35,11 @@
 
 #include "palettes.hxx"
 
-static NamedColor aLibreColors[] =
+static const struct
+{
+Color mColor;
+const char* mName;
+} aLibreColors[] =
 {
 { Color(0x1b, 0x1b, 0x1b), "HLC 000 10 00" },
 { Color(0x30, 0x30, 0x30), "HLC 000 20 00" },
@@ -1094,7 +1098,7 @@ public:
 {
 for (size_t i = 0; i < SAL_N_ELEMENTS(aLibreColors); i++)
 {
-rColorSet.InsertItem(i, aLibreColors[i].first, 
aLibreColors[i].second);
+rColorSet.InsertItem(i, aLibreColors[i].mColor, 
OUString::createFromAscii(aLibreColors[i].mName));
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-10-21 Thread Maxim Monastirsky
 svx/source/tbxctrls/linectrl.cxx |2 +-
 svx/uiconfig/ui/sidebarline.ui   |   13 +
 2 files changed, 2 insertions(+), 13 deletions(-)

New commits:
commit 78cdc474893902395cee98bced32bf214c78ed7f
Author: Maxim Monastirsky 
Date:   Fri Oct 21 11:03:55 2016 +0300

Arrow style dropdown was applying the wrong line ends

Regression of:

commit 2b68e03348b3b4009e8bb2af7979de36bd3450c5
Date:   Mon Aug 15 09:19:35 2016 +0200

tdf#100782 have XPropertyList hold unique_ptr

Change-Id: Ib2bb4c25f93de45823aba43aa7c04075283d4097

diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 5d5a2f5..98d3ffb 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -322,7 +322,7 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, 
void)
 }
 else // end of line
 {
-const XLineEndEntry* pEntry = pLineEndList->GetLineEnd( (nId - 1) / 2 
);
+const XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nId / 2 - 2 );
 pLineEndItem.reset(new XLineEndItem(pEntry->GetName(), 
pEntry->GetLineEnd()));
 }
 
commit 199a449e2a045e30f1f742ae6f38bf71ecb168c1
Author: Maxim Monastirsky 
Date:   Fri Oct 21 10:25:39 2016 +0300

Silence warning

warn:vcl.layout:32414:1:vcl/source/window/builder.cxx:3100:
unknown class

Change-Id: I8019f8568b33f5a67c0acedb962d991cc1c93a1a

diff --git a/svx/uiconfig/ui/sidebarline.ui b/svx/uiconfig/ui/sidebarline.ui
index 43af15e..9e0e01d 100644
--- a/svx/uiconfig/ui/sidebarline.ui
+++ b/svx/uiconfig/ui/sidebarline.ui
@@ -2,7 +2,7 @@
 
 
   
-  
+  
   
 100
 10
@@ -288,12 +288,6 @@
 Corner Style
   
 
-
-  
-  
-  
-  
-
   
   
 0
@@ -334,11 +328,6 @@
 Cap Style
   
 
-
-  
-  
-  
-
   
   
 1
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-09-13 Thread Tor Lillqvist
 svx/source/sdr/contact/objectcontactofpageview.cxx |5 +
 sw/source/core/edit/edws.cxx   |2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 6e18d56c77b705bafa0754e057a8048afa70dad8
Author: Tor Lillqvist 
Date:   Tue Sep 13 16:43:36 2016 +0300

Remove totally bogus comment

Was initially in German with glorious ASCII graphics, but equally
bogus.

Change-Id: I9f7286049ed6a0ec7c1511dd3da018e5f6442b15

diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 6c9ac86..8cb0c59 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -145,8 +145,6 @@ bool SwEditShell::HasOtherCnt() const
 return false;
 }
 
-// access control functions for file name handling
-
 SwActContext::SwActContext(SwEditShell *pShell)
 : m_rShell(*pShell)
 {
commit 647360d9489c0589467aad18008ddb347d1ebf85
Author: Tor Lillqvist 
Date:   Tue Sep 13 12:14:20 2016 +0300

Add comment wondering whether a #if makes sense

Change-Id: Ib6e6ab79632325dd3d592265a9ee859b1bc2c3ca

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx 
b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 2497750e..efeaad6 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -259,6 +259,11 @@ namespace sdr
 // and may use the MapMode from the Target OutDev in the 
DisplayInfo
 xPrimitiveSequence = 
rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo);
 #else
+// Hmm, !HAVE_FEATURE_DESKTOP && !ANDROID means iOS,
+// right? But does it make sense to use a different code
+// path for iOS than for Android; both use tiled rendering
+// etc now.
+
 // HACK: this only works when we are drawing sdr shapes via
 // drawinglayer; but it can happen that the hierarchy contains
 // more than just the shapes, and then it fails.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-21 Thread Stephan Bergmann
 svx/source/tbxctrls/tbcontrl.cxx |2 +-
 vcl/inc/unx/gtk/gtksalmenu.hxx   |4 ++--
 vcl/unx/gtk/gtksalmenu.cxx   |   10 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit ed9af64644daad7abe6c839b02a89f5c2ef2ae80
Author: Stephan Bergmann 
Date:   Mon Mar 21 17:04:46 2016 +0100

Just use plain bool here

Change-Id: I82c19f2f0e0ef88497db54f426c91af2aee0bc99

diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 7435e37..95789a0 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -92,8 +92,8 @@ public:
   sal_uInt16 nId,
   const gchar* aCommand,
   MenuItemBits nBits,
-  gboolean bChecked,
-  gboolean bIsSubmenu );
+  bool bChecked,
+  bool bIsSubmenu );
 voidNativeSetEnableItem( gchar* aCommand, gboolean 
bEnable );
 voidNativeCheckItem( unsigned nSection, unsigned 
nItemPos, MenuItemBits bits, gboolean bCheck );
 voidNativeSetAccelerator( unsigned nSection, 
unsigned nItemPos, const vcl::KeyCode& rKeyCode, const OUString& rKeyName );
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 2b64f3f..6c904ce 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -286,7 +286,7 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool 
bRemoveDisabledEntries)
 
 if ( g_strcmp0( aNativeCommand, "" ) != 0 && pSalMenuItem->mpSubMenu 
== nullptr )
 {
-NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, 
itemBits, bChecked, FALSE );
+NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, 
itemBits, bChecked, false );
 NativeCheckItem( nSection, nItemPos, itemBits, bChecked );
 NativeSetEnableItem( aNativeCommand, bEnabled );
 
@@ -297,7 +297,7 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool 
bRemoveDisabledEntries)
 
 if ( pSubmenu && pSubmenu->GetMenu() )
 {
-bool bNonMenuChangedToMenu = NativeSetItemCommand( nSection, 
nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE );
+bool bNonMenuChangedToMenu = NativeSetItemCommand( nSection, 
nItemPos, nId, aNativeCommand, itemBits, false, true );
 pNewCommandList = g_list_append( pNewCommandList, g_strdup( 
aNativeCommand ) );
 
 GLOMenu* pSubMenuModel = 
g_lo_menu_get_submenu_from_item_in_section( pLOMenu, nSection, nItemPos );
@@ -803,8 +803,8 @@ bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
sal_uInt16 nId,
const gchar* aCommand,
MenuItemBits nBits,
-   gboolean bChecked,
-   gboolean bIsSubmenu )
+   bool bChecked,
+   bool bIsSubmenu )
 {
 bool bSubMenuAddedOrRemoved = false;
 
@@ -847,7 +847,7 @@ bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
 
 if ( aCurrentCommand == nullptr || g_strcmp0( aCurrentCommand, aCommand ) 
!= 0 )
 {
-gboolean bOldHasSubmenu = 
g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nItemPos) != 
nullptr;
+bool bOldHasSubmenu = 
g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nItemPos) != 
nullptr;
 bSubMenuAddedOrRemoved = bOldHasSubmenu != bIsSubmenu;
 if (bSubMenuAddedOrRemoved)
 {
commit a375d0c539ac8ccd23a96c8e615a246aa3f374a7
Author: Stephan Bergmann 
Date:   Mon Mar 21 17:04:28 2016 +0100

Redundant explicit cast to void*

Change-Id: Ife89d8362031534169c5e70ff09e20c916cd61f8

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 96e79d5..50a55a8 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1919,7 +1919,7 @@ SvxCurrencyList_Impl::SvxCurrencyList_Impl(
 {
 m_pCurrencyLb->InsertEntry (*i);
 OUString *pFormatStr = _aFormatEntries[nPos];
-m_pCurrencyLb->SetEntryData( nPos, static_cast( pFormatStr ) );
+m_pCurrencyLb->SetEntryData( nPos, pFormatStr );
 if( *pFormatStr == m_rSelectedFormat )
 nSelectedPos = nPos;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-01 Thread Stephan Bergmann
 svx/source/dialog/crashreportdlg.cxx |2 +-
 svx/source/dialog/crashreportdlg.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8ab503a871bf884187381f75cfd15808c340e5c5
Author: Stephan Bergmann 
Date:   Tue Mar 1 09:29:18 2016 +0100

loplugin:sallogareas

Change-Id: I2cd994a4f497a59f33e6ed3a23388565fd7b88c2

diff --git a/svx/source/dialog/crashreportdlg.cxx 
b/svx/source/dialog/crashreportdlg.cxx
index 23f0bbe..091432f 100644
--- a/svx/source/dialog/crashreportdlg.cxx
+++ b/svx/source/dialog/crashreportdlg.cxx
@@ -57,7 +57,7 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, 
void)
 std::string ini_path = CrashReporter::getIniFileName();
 OString aCommand = getLibDir().copy(7) + "/minidump_upload " + 
ini_path.c_str();
 int retVal = std::system(aCommand.getStr());
-SAL_WARN_IF(retVal != 0, "crashreport", "Failed to upload minidump. 
Error Code: " << retVal);
+SAL_WARN_IF(retVal != 0, "svx.dialog", "Failed to upload minidump. 
Error Code: " << retVal);
 // TODO: moggi: return the id for the user to look it up
 Close();
 }
commit 33e7228678813f20dd46d8218d0595ce03e022f1
Author: Stephan Bergmann 
Date:   Tue Mar 1 09:28:32 2016 +0100

loplugin:override

Change-Id: Ib051a2468b219aeae9eedef6d6930ea67815ab6e

diff --git a/svx/source/dialog/crashreportdlg.hxx 
b/svx/source/dialog/crashreportdlg.hxx
index e6041f8..a7f22e2 100644
--- a/svx/source/dialog/crashreportdlg.hxx
+++ b/svx/source/dialog/crashreportdlg.hxx
@@ -19,7 +19,7 @@ public:
 
 CrashReportDialog(vcl::Window* pParent);
 
-~CrashReportDialog();
+virtual ~CrashReportDialog();
 
 virtual void dispose() override;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-01-17 Thread Justin Luth
 svx/source/accessibility/AccessibleShape.cxx |2 ++
 sw/source/core/text/itrpaint.cxx |   19 ++-
 sw/source/core/text/porlin.hxx   |1 +
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 3b14cdf7386f41395d1b089c3b9dde7d4429cf38
Author: Justin Luth 
Date:   Tue Dec 29 16:15:56 2015 +0300

tdf#96685 - set initial focus of accessible editeng objects

signalIMDeleteSurrounding searches for the focused accessible object.
Since newly created accessible objects were not inheriting
the focus setting of their peer, the search returned nothing
until some event triggered the focus to be adjusted.

Change-Id: I92f980b4bbe741d8ce9196165eff51059c807a2b
Reviewed-on: https://gerrit.libreoffice.org/21002
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index 67f8800..a352e2b 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -179,6 +179,8 @@ void AccessibleShape::Init()
 // non-empty text -> use full-fledged edit source right 
away
 mpText = new AccessibleTextHelper( 
o3tl::make_unique(*pSdrObject, nullptr, *pView, *pWindow) );
 }
+if( pWindow->HasFocus() )
+mpText->SetFocus();
 
 if( bOwnParaObj )
 delete pOutlinerParaObject;
commit d1bd4465be649a4078c3a2f85a64c8a6300dd65d
Author: Justin Luth 
Date:   Wed Oct 28 11:12:17 2015 +0300

tdf#93637 TAB_OVER_MARGIN support for a few more cases

Extending nMaxRight when TAB_OVER_MARGIN compatibility is set and
the right tabstop goes beyond the right margin fixes PDF output
as well as certain cases of screen display.

Change-Id: Ida4b4f399f06670d9bdefdc21978adf19a81d53a
Reviewed-on: https://gerrit.libreoffice.org/19635
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 79d3c5d..c5eba01 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -37,6 +37,7 @@
 #include 
 
 #include 
+#include 
 
 #include "flyfrms.hxx"
 #include "viewsh.hxx"
@@ -161,8 +162,24 @@ void SwTextPainter::DrawTextLine( const SwRect , 
SwSaveClip ,
 SwLinePortion *pPor = bEndPor ? m_pCurr->GetFirstPortion() : 
CalcPaintOfst( rPaint );
 
 // Optimization!
-const SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
+SwTwips nMaxRight = std::min( rPaint.Right(), Right() );
 const SwTwips nTmpLeft = GetInfo().X();
+//compatibility setting: allow tabstop text to exceed right margin
+if( 
GetInfo().GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_OVER_MARGIN)
 )
+{
+SwLinePortion* pPorIter = pPor;
+while( pPorIter )
+{
+if( pPorIter->IsTabRightPortion() )
+{
+   const SwTabRightPortion *pRightTabPor = 
static_cast(pPorIter);
+   const SwTwips nTabPos = nTmpLeft + pRightTabPor->GetTabPos();
+if( nMaxRight < nTabPos )
+nMaxRight = std::min( rPaint.Right(), nTabPos );
+}
+pPorIter = pPorIter->GetPortion();
+}
+}
 if( !bEndPor && nTmpLeft >= nMaxRight )
 return;
 
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 486827d..cf46070 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -125,6 +125,7 @@ public:
 inline bool IsErgoSumPortion() const { return nWhichPor == POR_ERGOSUM; }
 inline bool IsQuoVadisPortion() const { return nWhichPor == POR_QUOVADIS; }
 inline bool IsTabLeftPortion() const { return nWhichPor == POR_TABLEFT; }
+inline bool IsTabRightPortion() const { return nWhichPor == POR_TABRIGHT; }
 inline bool IsFootnoteNumPortion() const { return nWhichPor == POR_FTNNUM; 
}
 inline bool IsFootnotePortion() const { return nWhichPor == POR_FTN; }
 inline bool IsDropPortion() const { return nWhichPor == POR_DROP; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-01-13 Thread Noel Grandin
 svx/source/customshapes/EnhancedCustomShape2d.cxx |6 -
 sw/source/filter/html/htmlcss1.cxx|   33 +++---
 sw/source/filter/html/parcss1.cxx |8 --
 sw/source/filter/html/parcss1.hxx |   10 +--
 sw/source/filter/html/svxcss1.cxx |9 --
 sw/source/filter/html/svxcss1.hxx |4 -
 sw/source/filter/html/swcss1.hxx  |2 
 sw/source/filter/html/swhtml.hxx  |2 
 sw/source/filter/html/wrthtml.hxx |4 -
 sw/source/filter/ww8/escher.hxx   |2 
 sw/source/filter/ww8/rtfsdrexport.cxx |4 -
 sw/source/filter/ww8/rtfsdrexport.hxx |2 
 sw/source/filter/ww8/wrtw8esh.cxx |   16 +---
 sw/source/filter/ww8/wrtw8nds.cxx |4 -
 sw/source/filter/ww8/wrtw8sty.cxx |3 
 sw/source/filter/ww8/wrtww8.cxx   |   18 ++---
 sw/source/filter/ww8/wrtww8.hxx   |   15 ++--
 sw/source/filter/ww8/ww8graf.cxx  |3 
 sw/source/filter/ww8/ww8graf.hxx  |2 
 sw/source/filter/ww8/ww8graf2.cxx |4 -
 sw/source/filter/ww8/ww8par.cxx   |   17 ++---
 sw/source/filter/ww8/ww8par.hxx   |8 +-
 sw/source/filter/ww8/ww8par2.cxx  |   18 ++---
 sw/source/filter/ww8/ww8par3.cxx  |   11 +--
 sw/source/filter/ww8/ww8scan.cxx  |   39 +++
 sw/source/filter/ww8/ww8scan.hxx  |   18 ++---
 sw/source/ui/fldui/fldpage.cxx|7 --
 sw/source/ui/fldui/fldpage.hxx|2 
 sw/source/ui/fldui/fldvar.cxx |4 -
 sw/source/ui/fldui/fldvar.hxx |2 
 sw/source/ui/frmdlg/frmpage.cxx   |4 -
 sw/source/ui/vba/vbaborders.cxx   |5 -
 sw/source/uibase/config/caption.cxx   |8 --
 sw/source/uibase/dochdl/gloshdl.cxx   |7 --
 sw/source/uibase/dochdl/swdtflvr.cxx  |6 -
 sw/source/uibase/docvw/edtwin.cxx |   20 +-
 sw/source/uibase/fldui/fldmgr.cxx |5 -
 sw/source/uibase/frmdlg/frmmgr.cxx|3 
 sw/source/uibase/inc/caption.hxx  |3 
 sw/source/uibase/inc/conttree.hxx |2 
 sw/source/uibase/inc/dbinsdlg.hxx |2 
 sw/source/uibase/inc/edtwin.hxx   |2 
 sw/source/uibase/inc/fldmgr.hxx   |2 
 sw/source/uibase/inc/frmmgr.hxx   |2 
 sw/source/uibase/inc/frmpage.hxx  |2 
 sw/source/uibase/inc/gloshdl.hxx  |4 -
 sw/source/uibase/inc/gloslst.hxx  |2 
 sw/source/uibase/inc/olmenu.hxx   |2 
 sw/source/uibase/inc/pview.hxx|2 
 sw/source/uibase/inc/redlndlg.hxx |2 
 sw/source/uibase/inc/srcview.hxx  |2 
 sw/source/uibase/inc/swdtflvr.hxx |2 
 sw/source/uibase/inc/toxmgr.hxx   |1 
 sw/source/uibase/inc/wrtsh.hxx|   72 +++---
 sw/source/uibase/index/toxmgr.cxx |8 --
 sw/source/uibase/lingu/olmenu.cxx |3 
 sw/source/uibase/uiview/pview.cxx |3 
 sw/source/uibase/uiview/srcview.cxx   |3 
 sw/source/uibase/utlui/content.cxx|3 
 sw/source/uibase/utlui/gloslst.cxx|3 
 sw/source/uibase/wrtsh/delete.cxx |   34 +++---
 sw/source/uibase/wrtsh/move.cxx   |   39 +--
 sw/source/uibase/wrtsh/select.cxx |   27 ++--
 sw/source/uibase/wrtsh/wrtsh3.cxx |   11 +--
 xmloff/source/style/TransGradientStyle.cxx|4 -
 65 files changed, 220 insertions(+), 357 deletions(-)

New commits:
commit c2460312ffcc430f97bea6fb1101be2e736fe002
Author: Noel Grandin 
Date:   Wed Jan 13 13:44:16 2016 +0200

-Werror=unused-but-set-variable

Change-Id: I61a07db63cc8a6bad159ca455f92d604c5e78edc

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 7fd344a..de8b9d4 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -536,12 +536,6 @@ bool 
EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
 
 void EnhancedCustomShape2d::ApplyShapeAttributes( const 
SdrCustomShapeGeometryItem& rGeometryItem )
 {
-const sal_Int32* pDefData = nullptr;
-const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eSpType );
-if ( pDefCustomShape )
-pDefData = pDefCustomShape->pDefData;
-
-
 // AdjustmentValues
 const Any* pAny = 

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

2016-01-09 Thread Michael Meeks
 svx/source/sdr/overlay/overlayselection.cxx |9 --
 vcl/inc/openglgdiimpl.hxx   |7 +
 vcl/opengl/gdiimpl.cxx  |   45 
 vcl/workben/vcldemo.cxx |  102 ++--
 4 files changed, 103 insertions(+), 60 deletions(-)

New commits:
commit c71de1458cebcd45b65cef3a182bf1092dc8ad80
Author: Michael Meeks 
Date:   Fri Jan 8 22:33:11 2016 +

tdf#96919 - vcl opengl: implement missing XOR mode.

Also revert "tdf#96257: Silly work-around to produce same result ..."
from commit ec8bc265050d86a749140c353360a78cce4e3fce.

XOR rendering (it turns out) behaves oddly, and not for all operations.

Change-Id: Ie07d988bbf7fed10fb5625ac547a01a306b05319
Reviewed-on: https://gerrit.libreoffice.org/21282
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 941df12..bab9366 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -107,16 +107,7 @@ namespace sdr
 if(bInvert)
 {
 // force color to white for invert to get a full invert
-#ifdef WNT
-// tdf#96257: For likely separate reasons, neither the 
non-OpenGL nor the OpenGL
-// code path produces what we actually want here (a line 
drawn in 'invert' mode
-// if white is used, as happens on X11). In the non-OpenGL 
case we get a black
-// line, in the OpenGL case a white one. So let's use grey 
and at least get the
-// same on both.
-aRGBColor = basegfx::BColor(0.5, 0.5, 0.5);
-#else
 aRGBColor = basegfx::BColor(1.0, 1.0, 1.0);
-#endif
 }
 
 for(sal_uInt32 a(0);a < nCount; a++)
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 4883d0f..df2e914 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -80,6 +80,8 @@ protected:
 bool mbUseScissor;
 bool mbUseStencil;
 
+bool mbXORMode;
+
 /**
  * All rendering happens to this off-screen texture. For
  * non-virtual devices, ie. windows - we will blit it and
@@ -152,8 +154,11 @@ public:
  */
 bool IsOffscreen() const { return mpProvider == nullptr || 
mpProvider->IsOffScreen(); }
 
+/// Oddly not all operations obey the XOR option.
+enum XOROption { IGNORE_XOR, IMPLEMENT_XOR };
+
 // operations to do before painting
-void PreDraw();
+void PreDraw(XOROption eOpt = IGNORE_XOR);
 
 // operations to do after painting
 void PostDraw();
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 791bf09..e00352f 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -68,6 +68,7 @@ OpenGLSalGraphicsImpl::OpenGLSalGraphicsImpl(SalGraphics& 
rParent, SalGeometryPr
 , mpFlush(new OpenGLFlushIdle(this))
 , mbUseScissor(false)
 , mbUseStencil(false)
+, mbXORMode(false)
 , mnLineColor(SALCOLOR_NONE)
 , mnFillColor(SALCOLOR_NONE)
 #ifdef DBG_UTIL
@@ -176,7 +177,7 @@ void OpenGLSalGraphicsImpl::DeInit()
 mpContext.clear();
 }
 
-void OpenGLSalGraphicsImpl::PreDraw()
+void OpenGLSalGraphicsImpl::PreDraw(XOROption eOpt)
 {
 OpenGLZone::enter();
 
@@ -196,13 +197,27 @@ void OpenGLSalGraphicsImpl::PreDraw()
 
 glViewport( 0, 0, GetWidth(), GetHeight() );
 CHECK_GL_ERROR();
-ImplInitClipRegion();
 
+ImplInitClipRegion();
 CHECK_GL_ERROR();
+
+if (eOpt == IMPLEMENT_XOR && mbXORMode)
+{
+glEnable(GL_COLOR_LOGIC_OP);
+CHECK_GL_ERROR();
+
+glLogicOp(GL_XOR);
+}
 }
 
 void OpenGLSalGraphicsImpl::PostDraw()
 {
+if (mbXORMode)
+{
+glDisable(GL_COLOR_LOGIC_OP);
+CHECK_GL_ERROR();
+}
+
 if( mbUseScissor )
 {
 glDisable( GL_SCISSOR_TEST );
@@ -404,8 +419,9 @@ void OpenGLSalGraphicsImpl::SetFillColor( SalColor 
nSalColor )
 }
 
 // enable/disable XOR drawing
-void OpenGLSalGraphicsImpl::SetXORMode( bool /*bSet*/, bool /*bInvertOnly*/ )
+void OpenGLSalGraphicsImpl::SetXORMode( bool bSet, bool )
 {
+mbXORMode = bSet;
 }
 
 // set line color for raster operations
@@ -503,6 +519,7 @@ bool OpenGLSalGraphicsImpl::UseSolid( SalColor nColor, 
sal_uInt8 nTransparency )
 #endif
 mProgramSolidColor = nColor;
 mProgramSolidTransparency = nTransparency / 100.0;
+
 return true;
 }
 
@@ -1331,7 +1348,7 @@ void OpenGLSalGraphicsImpl::drawPixel( long nX, long nY )
 VCL_GL_INFO( "::drawPixel" );
 if( mnLineColor != SALCOLOR_NONE )
 {
-PreDraw();
+PreDraw( XOROption::IMPLEMENT_XOR );
 if( UseSolid( mnLineColor ) )
 DrawPoint( nX, nY );
 PostDraw();
@@ -1343,7 +1360,7 

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

2016-01-01 Thread Bjoern Michaelsen
 svx/source/accessibility/AccessibleControlShape.cxx |   31 ++--
 sw/source/core/unocore/unostyle.cxx |2 -
 2 files changed, 17 insertions(+), 16 deletions(-)

New commits:
commit c1258abe50f1508ea0f628ff963bc1914ab86b67
Author: Bjoern Michaelsen 
Date:   Sat Jan 2 02:02:21 2016 +0100

tdf#96365: ensure holding SolarMutex before triggering core code

(likely a bad sign that this compilation unit, defines lots of UNO
interfaces without ever using a SolarMutexGuard)

Change-Id: I2cca810f8e4e1684c75d9185d701024f692403a4

diff --git a/svx/source/accessibility/AccessibleControlShape.cxx 
b/svx/source/accessibility/AccessibleControlShape.cxx
index 03e6a2c..ab768d7 100644
--- a/svx/source/accessibility/AccessibleControlShape.cxx
+++ b/svx/source/accessibility/AccessibleControlShape.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include "svx/svdstr.hrc"
+#include 
 #include 
 
 using namespace ::accessibility;
@@ -466,24 +467,24 @@ void SAL_CALL AccessibleControlShape::notifyEvent( const 
AccessibleEventObject&
 }
 }
 
-void SAL_CALL AccessibleControlShape::modeChanged( const ModeChangeEvent& 
_rSource ) throw (RuntimeException, std::exception)
+void SAL_CALL AccessibleControlShape::modeChanged(const ModeChangeEvent& 
rSource) throw (RuntimeException, std::exception)
 {
 // did it come from our inner context (the real one, not it's proxy!)?
-OSL_TRACE ("AccessibleControlShape::modeChanged");
-Reference< XControl > xSource( _rSource.Source, UNO_QUERY );// for 
faster compare
-if ( xSource.get() == m_xUnoControl.get() )
-{
-// If our "pseudo-aggregated" inner context does not live anymore,
-// we don't want to live, too.  This is accomplished by asking our
-// parent to replace this object with a new one.  Disposing this
-// object and sending notifications about the replacement are in
-// the responsibility of our parent.
-OSL_VERIFY( mpParent->ReplaceChild ( this, mxShape, mnIndex, 
maShapeTreeInfo ) );
+SAL_INFO("sw.uno", "AccessibleControlShape::modeChanged");
+Reference xSource(rSource.Source, UNO_QUERY); // for faster 
compare
+if(xSource.get() != m_xUnoControl.get())
+{
+SAL_WARN("sw.uno", "AccessibleControlShape::modeChanged: where did 
this come from?");
+return;
 }
-#if OSL_DEBUG_LEVEL > 0
-else
-OSL_FAIL( "AccessibleControlShape::modeChanged: where did this come 
from?" );
-#endif
+SolarMutexGuard g;
+// If our "pseudo-aggregated" inner context does not live anymore,
+// we don't want to live, too.  This is accomplished by asking our
+// parent to replace this object with a new one.  Disposing this
+// object and sending notifications about the replacement are in
+// the responsibility of our parent.
+const bool bReplaced = mpParent->ReplaceChild(this, mxShape, mnIndex, 
maShapeTreeInfo);
+SAL_WARN_IF(!bReplaced, "sw.uno", "AccessibleControlShape::modeChanged: 
replacing ourselves away did fail");
 }
 
 void SAL_CALL AccessibleControlShape::disposing (const EventObject& _rSource) 
throw (RuntimeException, std::exception)
commit 3ae3af4a989758a0772881b1a2a6c1a68ee67dda
Author: Bjoern Michaelsen 
Date:   Sat Jan 2 01:35:53 2016 +0100

fix indent

Change-Id: I79623024b008b60a33935942986e8a98fccc3d8d

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 8caa0dd..0bfb6b8 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -937,7 +937,7 @@ static const std::vector* 
lcl_GetStyleFamilyEntries()
 { SFX_STYLE_FAMILY_PARA,   PROPERTY_MAP_PARA_STYLE,  
nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL,  "ParagraphStyles", 
STR_STYLE_FAMILY_PARAGRAPH, _GetCountOrName,   
_CreateStyle,   
_TranslateIndex   },
 { SFX_STYLE_FAMILY_PAGE,   PROPERTY_MAP_PAGE_STYLE,  
nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, "PageStyles",  
STR_STYLE_FAMILY_PAGE,  _GetCountOrName,   
_CreateStyle,   
_TranslateIndexRange  },
 { SFX_STYLE_FAMILY_FRAME,  PROPERTY_MAP_FRAME_STYLE, 
nsSwGetPoolIdFromName::GET_POOLID_FRMFMT,   "FrameStyles", 
STR_STYLE_FAMILY_FRAME, _GetCountOrName,  
_CreateStyle,  
_TranslateIndexRange },
-{ SFX_STYLE_FAMILY_PSEUDO, PROPERTY_MAP_NUM_STYLE, 
nsSwGetPoolIdFromName::GET_POOLID_NUMRULE,  "NumberingStyles", 
STR_STYLE_FAMILY_NUMBERING, _GetCountOrName, 
_CreateStyle, 
_TranslateIndexRange   }
+{ SFX_STYLE_FAMILY_PSEUDO, PROPERTY_MAP_NUM_STYLE,   
nsSwGetPoolIdFromName::GET_POOLID_NUMRULE,  "NumberingStyles", 
STR_STYLE_FAMILY_NUMBERING, _GetCountOrName, 
_CreateStyle, 
_TranslateIndexRange   }

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

2015-11-25 Thread Andrzej Hunt
 svx/source/tbxctrls/tbcontrl.cxx|6 +++---
 unotools/source/config/eventcfg.cxx |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1abd8d9e00497940c45ed70154ecb10dd806fe7b
Author: Andrzej Hunt 
Date:   Sat Nov 21 08:15:32 2015 -0800

Convert to range based for

(This was also used for testing loplugin:rangedforcopy)

Change-Id: I246994feb7bf66d337b76e3f02d7fea2cb13d42a

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ce7d877..ae696ae 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2025,7 +2025,7 @@ struct SvxStyleToolBoxControl::Impl
 Reference xParaStyles;
 
xStylesSupplier->getStyleFamilies()->getByName("ParagraphStyles") >>=
 xParaStyles;
-static const sal_Char* aWriterStyles[] =
+static const std::vector aWriterStyles =
 {
 "Text body",
 "Quotations",
@@ -2035,12 +2035,12 @@ struct SvxStyleToolBoxControl::Impl
 "Heading 2",
 "Heading 3"
 };
-for( sal_uInt32 nStyle = 0; nStyle < sizeof( aWriterStyles ) / 
sizeof( sal_Char*); ++nStyle )
+for( const OUString& aStyle: aWriterStyles )
 {
 try
 {
 Reference< beans::XPropertySet > xStyle;
-xParaStyles->getByName( OUString::createFromAscii( 
aWriterStyles[nStyle] )) >>= xStyle;
+xParaStyles->getByName( aStyle ) >>= xStyle;
 OUString sName;
 xStyle->getPropertyValue("DisplayName") >>= sName;
 if( !sName.isEmpty() )
commit 96ee91aea6710dcc1797d677f8faef453ba919b2
Author: Andrzej Hunt 
Date:   Wed Nov 25 12:04:17 2015 -0800

add const in ranged for

Change-Id: I0f55705e101e39e9e6e5286f21cad8ccb96e7fad

diff --git a/unotools/source/config/eventcfg.cxx 
b/unotools/source/config/eventcfg.cxx
index eda8048..06e7a9f 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -112,7 +112,7 @@ GlobalEventConfig_Impl::GlobalEventConfig_Impl()
 :   ConfigItem( ROOTNODE_EVENTS, ConfigItemMode::ImmediateUpdate )
 {
 // the supported event names
-for (GlobalEventId id : o3tl::enumrange())
+for (const GlobalEventId id : o3tl::enumrange())
 m_supportedEvents[id] = OUString::createFromAscii( 
pEventAsciiNames[id] );
 
 initBindingInfo();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-10-23 Thread Caolán McNamara
 svx/source/svdraw/svdpntv.cxx|   44 +--
 vcl/qa/afl-eventtesting/eventtesting.impress.crash-3 |binary
 2 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 364eaba8ef183d61a07f07efe58c2a6a485d6b0e
Author: Caolán McNamara 
Date:   Fri Oct 23 11:51:47 2015 +0100

fix indent and simplify returns, no logic change

aka, beat up on its corpse a bit

Change-Id: Ia5b8d227083e8f4c1582bf13260e92331740aa82

diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 542af57..86ff0db 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -259,27 +259,29 @@ void SdrPaintView::Notify(SfxBroadcaster& rBC, const 
SfxHint& rHint)
 return;
 }
 
+const SdrHint* pSdrHint = dynamic_cast();
+if (!pSdrHint)
+return;
+
+SdrHintKind eKind = pSdrHint->GetKind();
+if (eKind==HINT_OBJCHG || eKind==HINT_OBJINSERTED || 
eKind==HINT_OBJREMOVED)
 {
-const SdrHint* pSdrHint = dynamic_cast();
-if (pSdrHint) {
-SdrHintKind eKind=pSdrHint->GetKind();
-if (eKind==HINT_OBJCHG || eKind==HINT_OBJINSERTED || 
eKind==HINT_OBJREMOVED) {
-bool bObjChg=!mbSomeObjChgdFlag; // if true, evaluate for 
ComeBack timer
-if (bObjChg) {
-mbSomeObjChgdFlag=true;
-maComeBackIdle.Start();
-}
-}
-if (eKind==HINT_PAGEORDERCHG) {
-const SdrPage* pPg=pSdrHint->GetPage();
+bool bObjChg = !mbSomeObjChgdFlag; // if true, evaluate for ComeBack 
timer
+if (bObjChg)
+{
+mbSomeObjChgdFlag=true;
+maComeBackIdle.Start();
+}
+}
 
-if(pPg && !pPg->IsInserted())
-{
-if(mpPageView && mpPageView->GetPage() == pPg)
-{
-HideSdrPage();
-}
-}
+if (eKind==HINT_PAGEORDERCHG)
+{
+const SdrPage* pPg=pSdrHint->GetPage();
+if (pPg && !pPg->IsInserted())
+{
+if(mpPageView && mpPageView->GetPage() == pPg)
+{
+HideSdrPage();
 }
 }
 }
@@ -291,8 +293,6 @@ void SdrPaintView::ConfigurationChanged( 
::utl::ConfigurationBroadcaster* , sal_
 InvalidateAllWin();
 }
 
-
-
 IMPL_LINK_NOARG_TYPED(SdrPaintView, ImpComeBackHdl, Idle *, void)
 {
 if (mbSomeObjChgdFlag) {
commit f8b975995c5d0dc6a9fc8febba0667fe24542ad2
Author: Caolán McNamara 
Date:   Fri Oct 23 11:38:43 2015 +0100

afl-eventtesting: crash on undoing insert new page in impress

this is an intermittent crash in the real world but under event testing we 
can
see that the PaintView is informed that the page has been deleted, but 
doesn't
clear its use of the page if it so happens that there was earlier 
modification
events that caused the fire-modification-timer to be launched

If there happens to be no such events then the page is correctly cleared

If the timer is active, then the page is not cleared, but eventually the
timer will fire and access the deleted page and fall over and die

minimal change for backporting ease, follow ups now

Change-Id: I090ad62cc175545902574c93dec7082225d97ab7

diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 9ca6864..542af57 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -259,12 +259,12 @@ void SdrPaintView::Notify(SfxBroadcaster& rBC, const 
SfxHint& rHint)
 return;
 }
 
-bool bObjChg=!mbSomeObjChgdFlag; // if true, evaluate for ComeBack timer
-if (bObjChg) {
+{
 const SdrHint* pSdrHint = dynamic_cast();
 if (pSdrHint) {
 SdrHintKind eKind=pSdrHint->GetKind();
 if (eKind==HINT_OBJCHG || eKind==HINT_OBJINSERTED || 
eKind==HINT_OBJREMOVED) {
+bool bObjChg=!mbSomeObjChgdFlag; // if true, evaluate for 
ComeBack timer
 if (bObjChg) {
 mbSomeObjChgdFlag=true;
 maComeBackIdle.Start();
diff --git a/vcl/qa/afl-eventtesting/eventtesting.impress.crash-3 
b/vcl/qa/afl-eventtesting/eventtesting.impress.crash-3
new file mode 100644
index 000..e6639ba
Binary files /dev/null and 
b/vcl/qa/afl-eventtesting/eventtesting.impress.crash-3 differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-22 Thread Lionel Elie Mamane
 svx/source/fmcomp/gridcell.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 6c2f0c1001b0586b3092e80d63866ae018f09eb8
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Wed Jul 22 16:26:31 2015 +0200

ListBox in grid: properly set selection on change from model

In particular when changing row.

1) Teach DbCellControl about SelectedItems as known value property.

2) Fix DbListBox::updateFromModel to actually use the SelectedItems
   it reads from the model, as opposed to throwing it away.

Change-Id: I7074c13b3d271bf2362aa059378aa857682a040b

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index fe76271..8208231 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -572,6 +572,7 @@ DbCellControl::DbCellControl( DbGridColumn _rColumn, bool 
/*_bText*/ )
 implDoPropertyListening( FM_PROP_STATE, false );
 implDoPropertyListening( FM_PROP_TEXT, false );
 implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, false );
+implDoPropertyListening( FM_PROP_SELECT_SEQ, false );
 
 // be listener at the bound field as well
 try
@@ -676,6 +677,7 @@ void DbCellControl::_propertyChanged(const 
PropertyChangeEvent _rEvent) throw(R
 ||  _rEvent.PropertyName == FM_PROP_STATE
 ||  _rEvent.PropertyName == FM_PROP_TEXT
 ||  _rEvent.PropertyName == FM_PROP_EFFECTIVE_VALUE
+||  _rEvent.PropertyName == FM_PROP_SELECT_SEQ
 )
 {   // it was one of the known value properties
 if ( !isValuePropertyLocked() )
@@ -2645,7 +2647,7 @@ void DbListBox::updateFromModel( Reference XPropertySet 
 _rxModel )
 OSL_ENSURE( _rxModel.is()  m_pWindow, DbListBox::updateFromModel: 
invalid call! );
 
 Sequence sal_Int16  aSelection;
-_rxModel-getPropertyValue( FM_PROP_SELECT_SEQ );
+_rxModel-getPropertyValue( FM_PROP_SELECT_SEQ ) = aSelection;
 
 sal_Int16 nSelection = -1;
 if ( aSelection.getLength()  0 )
commit 3b9e66fdcade5a222a9dc99ad74627473b1fd4e7
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Wed Jul 22 16:25:28 2015 +0200

tdf#92725 FormattedField: when model value is NULL, force empty display 
string

as opposed to implicitly keeping whatever unrelated string was there before.

Change-Id: Ifaf1b41e951e97f209ecb617b32ec4f7522b1d08

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 9a5a28d..fe76271 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1576,7 +1576,7 @@ void DbFormattedField::updateFromModel( Reference 
XPropertySet  _rxModel )
 
 OUString sText;
 Any aValue = _rxModel-getPropertyValue( FM_PROP_EFFECTIVE_VALUE );
-if ( aValue = sText )
+if ( !aValue.hasValue() || (aValue = sText) )
 {   // our effective value is transferred as string
 pFormattedWindow-SetTextFormatted( sText );
 pFormattedWindow-SetSelection( Selection( SELECTION_MAX, 
SELECTION_MIN ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-01 Thread Miklos Vajna
 svx/source/svdraw/sdrpaintwindow.cxx |4 ++--
 vcl/source/window/window.cxx |3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 25ade7450ce41a46094d63123eabdf32bd68c918
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jul 1 10:55:37 2015 +0200

SdrPaintWindow: no own buffer for rendercontext-enabled vcl::Windows

The buffered overlay manager paints using a timer, which is problematic
if the given vcl::Window already supports double-buffering itself, so
always use direct (to the rendercontext) painting in that case.

Change-Id: I93144c02814fd511f333224ab058374c7da369f0

diff --git a/svx/source/svdraw/sdrpaintwindow.cxx 
b/svx/source/svdraw/sdrpaintwindow.cxx
index b735127..c583558 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -201,8 +201,9 @@ void SdrPaintWindow::impCreateOverlayManager()
 // is it a window?
 if(OUTDEV_WINDOW == GetOutputDevice().GetOutDevType())
 {
+vcl::Window* pWindow = 
dynamic_castvcl::Window*(GetOutputDevice());
 // decide which OverlayManager to use
-if(GetPaintView().IsBufferedOverlayAllowed()  mbUseBuffer)
+if(GetPaintView().IsBufferedOverlayAllowed()  mbUseBuffer  
!pWindow-SupportsDoubleBuffering())
 {
 // buffered OverlayManager, buffers its background and 
refreshes from there
 // for pure overlay changes (no system redraw). The 3rd 
parameter specifies
@@ -225,7 +226,6 @@ void SdrPaintWindow::impCreateOverlayManager()
 // Request a repaint so that the buffered overlay manager fills
 // its buffer properly.  This is a workaround for missing buffer
 // updates.
-vcl::Window* pWindow = 
dynamic_castvcl::Window*(GetOutputDevice());
 if (pWindow != NULL)
 pWindow-Invalidate();
 
commit 7df3879d3f6222b840724ae748bdf8bf6a7af9f1
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jul 1 10:44:43 2015 +0200

vcl::Window::SupportsDoubleBuffering: respect 
VCL_DOUBLEBUFFERING_FORCE_ENABLE

Double buffering default is false, then can be enabled on a per-widget
basis, finally this can be overriden at runtime by the
VCL_DOUBLEBUFFERING_FORCE_ENABLE environment variable (so that
everything is painted using double buffering).

Let SupportsDoubleBuffering() also respect this variable, so code
calling SupportsDoubleBuffering() can react to the runtime override,
too.

Change-Id: Ic9a1c00a801f6976069d7cfc47c3fa491ebc1ff0

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 316bb0c..10d9e39 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3936,7 +3936,8 @@ vcl::RenderSettings Window::GetRenderSettings()
 
 bool Window::SupportsDoubleBuffering() const
 {
-return mpWindowImpl-mbDoubleBuffering;
+static bool bDoubleBuffering = getenv(VCL_DOUBLEBUFFERING_FORCE_ENABLE);
+return mpWindowImpl-mbDoubleBuffering || bDoubleBuffering;
 }
 
 void Window::SetDoubleBuffering(bool bDoubleBuffering)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-06-04 Thread Katarina Behrens
 svx/source/tbxctrls/tbcontrl.cxx |  101 ---
 1 file changed, 63 insertions(+), 38 deletions(-)

New commits:
commit 42f4a65103a1a6d281ea201392aae97213421ff4
Author: Katarina Behrens katarina.behr...@cib.de
Date:   Thu Jun 4 12:11:42 2015 +0200

tdf#91840: Default to transparent text background

(+ label the button)

Change-Id: Icc6a0c5e3e715bcfe1392496bef2514fd1bdb62b

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 9db5611..2e668f2 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1230,6 +1230,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString 
   rCommand,
 {
 case SID_ATTR_CHAR_COLOR_BACKGROUND:
 case SID_BACKGROUND_COLOR:
+case SID_ATTR_CHAR_BACK_COLOR:
 {
 mpButtonAutoColor-SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
 mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) 
);
@@ -1380,6 +1381,7 @@ IMPL_LINK_NOARG(SvxColorWindow_Impl, AutoColorClickHdl)
 {
 case SID_ATTR_CHAR_COLOR_BACKGROUND:
 case SID_BACKGROUND_COLOR:
+case SID_ATTR_CHAR_BACK_COLOR:
 {
 aColor = COL_TRANSPARENT;
 break;
commit 0deb0326b32cdb2b90b620b3403128196c2d4d74
Author: Katarina Behrens katarina.behr...@cib.de
Date:   Thu Jun 4 12:07:24 2015 +0200

Use switch-case instead of overly long 'if (a || b || ...)'

they were growing a bit out of control

Change-Id: I80441179b4d4aacc57c469fc8f3a3937866ceae8

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 25847fa..9db5611 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1226,43 +1226,54 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const 
OUStringrCommand,
 mpColorSet-SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK 
| WB_NO_DIRECTSELECT | WB_TABSTOP) );
 mpRecentColorSet-SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | 
WB_3DLOOK | WB_NO_DIRECTSELECT | WB_TABSTOP) );
 
-if ( SID_ATTR_CHAR_COLOR_BACKGROUND == theSlotId || SID_BACKGROUND_COLOR 
== theSlotId )
+switch ( theSlotId )
 {
-mpButtonAutoColor-SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
-mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) );
-}
-else if ( SID_ATTR_CHAR_COLOR == theSlotId || SID_ATTR_CHAR_COLOR2 == 
theSlotId || SID_EXTRUSION_3D_COLOR == theSlotId )
-{
-SfxPoolItem* pDummy;
-
-Reference XDispatchProvider  aDisp( GetFrame()-getController(), 
UNO_QUERY );
-SfxQueryStatus aQueryStatus( aDisp,
- SID_ATTR_AUTO_COLOR_INVALID,
- OUString( .uno:AutoColorInvalid ));
-SfxItemState eState = aQueryStatus.QueryState( pDummy );
-if( (SfxItemState::DEFAULT  eState) || ( SID_EXTRUSION_3D_COLOR == 
theSlotId ) )
+case SID_ATTR_CHAR_COLOR_BACKGROUND:
+case SID_BACKGROUND_COLOR:
 {
-mpButtonAutoColor-SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) );
-mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ) 
);
+mpButtonAutoColor-SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
+mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) 
);
+break;
+}
+case SID_ATTR_CHAR_COLOR:
+case SID_ATTR_CHAR_COLOR2:
+case SID_EXTRUSION_3D_COLOR:
+{
+SfxPoolItem* pDummy;
+
+Reference XDispatchProvider  aDisp( GetFrame()-getController(), 
UNO_QUERY );
+SfxQueryStatus aQueryStatus( aDisp,
+ SID_ATTR_AUTO_COLOR_INVALID,
+ OUString( .uno:AutoColorInvalid ));
+SfxItemState eState = aQueryStatus.QueryState( pDummy );
+if( (SfxItemState::DEFAULT  eState) || ( SID_EXTRUSION_3D_COLOR 
== theSlotId ) )
+{
+mpButtonAutoColor-SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) 
);
+mpColorSet-SetAccessibleName( SVX_RESSTR( 
RID_SVXSTR_TEXTCOLOR ) );
+}
+break;
+}
+case SID_FRAME_LINECOLOR:
+{
+mpButtonAutoColor-Hide();
+mpAutomaticSeparator-Hide();
+mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR 
) );
+break;
+}
+case SID_ATTR_LINE_COLOR:
+{
+mpButtonAutoColor-Hide();
+mpAutomaticSeparator-Hide();
+mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_LINECOLOR ) 
);
+break;
+}
+case SID_ATTR_FILL_COLOR:
+{
+mpButtonAutoColor-Hide();
+mpAutomaticSeparator-Hide();
+mpColorSet-SetAccessibleName( SVX_RESSTR( 

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

2015-06-03 Thread Caolán McNamara
 svx/source/sdr/attribute/sdrtextattribute.cxx |   13 ++---
 sw/source/core/layout/layact.cxx  |1 +
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 9eb16c85d6af4b73de9a75716c3ff34f929f26b2
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 3 14:15:03 2015 +0100

don't crash on layout of ooo55381-1.sxw

The pLay here is getting joined and thus deleted in a stack of
FormatLayoutTabs so set it as unjoinable for the duration that
we expect pLay to remain valid

Change-Id: Iedfaf710022ad19c0f415cee84f70c74dd7dbd96

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index fa4c289..c06706e 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1393,6 +1393,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool 
bAddRect )
 if ( pLay-IsFootnoteFrm() ) // no LayFrms as Lower
 return bChanged;
 
+FlowFrmJoinLockGuard aJoinGuard(pLay);
 SwFrm *pLow = pLay-Lower();
 bool bTabChanged = false;
 while ( pLow  pLow-GetUpper() == pLay )
commit 768a2d61c3b0a71fef0d9d732ae83938fe24633e
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jun 2 20:37:04 2015 +0100

coverity#1302605 Resource leak in object

Change-Id: I574714c2d587ac22fcc812ffe8217f151ac40cb6

diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx 
b/svx/source/sdr/attribute/sdrtextattribute.cxx
index 45b55fb..ddd1ce1 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -38,7 +38,7 @@ namespace drawinglayer
 // all-text attributes. The SdrText itself and a copy
 // of the OPO
 const SdrText*  mpSdrText;
-const OutlinerParaObject*   mpOutlinerParaObject;
+std::shared_ptrOutlinerParaObject mxOutlinerParaObject;
 
 // Set when it's a FormText; contains all FormText attributes
 SdrFormTextAttributemaSdrFormTextAttribute;
@@ -88,7 +88,7 @@ namespace drawinglayer
 bool bFixedCellHeight,
 bool bWrongSpell)
 :   mpSdrText(pSdrText),
-mpOutlinerParaObject(new 
OutlinerParaObject(rOutlinerParaObject)),
+mxOutlinerParaObject(new 
OutlinerParaObject(rOutlinerParaObject)),
 maSdrFormTextAttribute(),
 maTextLeftDistance(aTextLeftDistance),
 maTextUpperDistance(aTextUpperDistance),
@@ -125,7 +125,6 @@ namespace drawinglayer
 
 ImpSdrTextAttribute()
 :   mpSdrText(0),
-mpOutlinerParaObject(0),
 maSdrFormTextAttribute(),
 maTextLeftDistance(0),
 maTextUpperDistance(0),
@@ -155,8 +154,8 @@ namespace drawinglayer
 
 const OutlinerParaObject getOutlinerParaObject() const
 {
-assert(mpOutlinerParaObject  Access to OutlinerParaObject 
of default version of ImpSdrTextAttribute (!));
-return *mpOutlinerParaObject;
+assert(mxOutlinerParaObject  Access to OutlinerParaObject 
of default version of ImpSdrTextAttribute (!));
+return *mxOutlinerParaObject;
 }
 
 bool isContour() const { return mbContour; }
@@ -180,9 +179,9 @@ namespace drawinglayer
 // compare operator
 bool operator==(const ImpSdrTextAttribute rCandidate) const
 {
-if(mpOutlinerParaObject != rCandidate.mpOutlinerParaObject)
+if (mxOutlinerParaObject.get() != 
rCandidate.mxOutlinerParaObject.get())
 {
-if(mpOutlinerParaObject  rCandidate.mpOutlinerParaObject)
+if (mxOutlinerParaObject  
rCandidate.mxOutlinerParaObject)
 {
 // compares OPO and it's contents, but traditionally 
not the RedLining
 // which is not seen as model, but as temporary 
information
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-26 Thread Caolán McNamara
 svx/source/sidebar/line/LineWidthControl.cxx |4 ++--
 vcl/source/window/window.cxx |   22 +++---
 2 files changed, 9 insertions(+), 17 deletions(-)

New commits:
commit 2efb9d3c9841397cca3a66714504ee25d2120bd2
Author: Caolán McNamara caol...@redhat.com
Date:   Tue May 26 16:59:15 2015 +0100

Related: tdf#91542 line box width cannot be changed

Change-Id: Ibbeefcff785ee76a1a7ce46d98c1006fc8fe46fc

diff --git a/svx/source/sidebar/line/LineWidthControl.cxx 
b/svx/source/sidebar/line/LineWidthControl.cxx
index 6723f6b..2ee411c 100644
--- a/svx/source/sidebar/line/LineWidthControl.cxx
+++ b/svx/source/sidebar/line/LineWidthControl.cxx
@@ -263,7 +263,7 @@ void LineWidthControl::SetWidthSelect( long lValue, bool 
bValuable, SfxMapUnit e
 
 IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl)
 {
-if (pControl == maVSWidth)
+if (pControl == maVSWidth.get())
 {
 sal_uInt16 iPos = maVSWidth-GetSelectItemId();
 if (iPos = 1  iPos = 8)
@@ -308,7 +308,7 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl)
 
 IMPL_LINK(LineWidthControl, MFModifyHdl, void *, pControl)
 {
-if(pControl == maMFWidth)
+if (pControl == maMFWidth.get())
 {
 if(maVSWidth-GetSelItem())
 {
commit 662906ea642c8332428487f0766fb7394fdfd35c
Author: Caolán McNamara caol...@redhat.com
Date:   Tue May 26 16:36:24 2015 +0100

if foo delete foo - delete foo

Change-Id: I62c02f8ad69ddbb1cca5b8f0e4c5673d792cb08b

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 297572e..a51e2d6 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -529,25 +529,17 @@ void Window::dispose()
 // cleanup Extra Window Data, TODO: add and use ImplWinData destructor
 if ( mpWindowImpl-mpWinData )
 {
-if ( mpWindowImpl-mpWinData-mpExtOldText )
-delete mpWindowImpl-mpWinData-mpExtOldText;
-if ( mpWindowImpl-mpWinData-mpExtOldAttrAry )
-delete mpWindowImpl-mpWinData-mpExtOldAttrAry;
-if ( mpWindowImpl-mpWinData-mpCursorRect )
-delete mpWindowImpl-mpWinData-mpCursorRect;
-if ( mpWindowImpl-mpWinData-mpCompositionCharRects)
-delete[] mpWindowImpl-mpWinData-mpCompositionCharRects;
-if ( mpWindowImpl-mpWinData-mpFocusRect )
-delete mpWindowImpl-mpWinData-mpFocusRect;
-if ( mpWindowImpl-mpWinData-mpTrackRect )
-delete mpWindowImpl-mpWinData-mpTrackRect;
-
+delete mpWindowImpl-mpWinData-mpExtOldText;
+delete mpWindowImpl-mpWinData-mpExtOldAttrAry;
+delete mpWindowImpl-mpWinData-mpCursorRect;
+delete[] mpWindowImpl-mpWinData-mpCompositionCharRects;
+delete mpWindowImpl-mpWinData-mpFocusRect;
+delete mpWindowImpl-mpWinData-mpTrackRect;
 delete mpWindowImpl-mpWinData;
 }
 
 // cleanup overlap related window data
-if ( mpWindowImpl-mpOverlapData )
-delete mpWindowImpl-mpOverlapData;
+delete mpWindowImpl-mpOverlapData;
 
 // remove BorderWindow or Frame window data
 mpWindowImpl-mpBorderWindow.disposeAndClear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-04-21 Thread Caolán McNamara
 svx/source/tbxctrls/tbcontrl.cxx |   66 +--
 1 file changed, 37 insertions(+), 29 deletions(-)

New commits:
commit e29e3f47e687689c824d71718ae2ccaa4846ac51
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 21 15:00:34 2015 +0100

break out text drawing bit as UserDrawEntry

Change-Id: Icb1bcfb5f9f7475f67c9c001efdad2aa7e0d0834

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 19ea1e7..031aabc2 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -158,6 +158,7 @@ private:
 
 voidReleaseFocus();
 Color   TestColorsVisible(const Color FontCol, const Color 
BackCol);
+voidUserDrawEntry(const UserDrawEvent rUDEvt, const OUString 
rStyleName);
 DECL_LINK( MenuSelectHdl, Menu * );
 };
 
@@ -546,6 +547,38 @@ void SvxStyleBox_Impl::StateChanged( StateChangedType 
nStateChange )
 }
 }
 
+void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent rUDEvt, const 
OUString rStyleName)
+{
+OutputDevice *pDevice = rUDEvt.GetDevice();
+
+// IMG_TXT_DISTANCE in ilstbox.hxx is 6, then 1 is added as
+// nBorder, and we are adding 1 in order to look better when
+// italics is present
+const int nLeftDistance = 8;
+
+Rectangle aTextRect;
+pDevice-GetTextBoundRect(aTextRect, rStyleName);
+
+Point aPos( rUDEvt.GetRect().TopLeft() );
+aPos.X() += nLeftDistance;
+if ( aTextRect.Bottom()  rUDEvt.GetRect().GetHeight() )
+{
+// the text does not fit, adjust the font size
+double ratio = static_cast double ( rUDEvt.GetRect().GetHeight() ) / 
aTextRect.Bottom();
+vcl::Font aFont(pDevice-GetFont());
+Size aPixelSize(aFont.GetSize());
+aPixelSize.Width() *= ratio;
+aPixelSize.Height() *= ratio;
+aFont.SetSize(aPixelSize);
+pDevice-SetFont(aFont);
+}
+else
+aPos.Y() += ( rUDEvt.GetRect().GetHeight() - aTextRect.Bottom() ) / 2;
+
+pDevice-DrawText(aPos, rStyleName);
+}
+
+
 void SvxStyleBox_Impl::UserDraw( const UserDrawEvent rUDEvt )
 {
 sal_uInt16 nItem = rUDEvt.GetItemId();
@@ -716,29 +749,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent 
rUDEvt )
 }
 }
 
-// IMG_TXT_DISTANCE in ilstbox.hxx is 6, then 1 is added as
-// nBorder, and we are adding 1 in order to look better when
-// italics is present
-const int nLeftDistance = 8;
-
-Rectangle aTextRect;
-pDevice-GetTextBoundRect( aTextRect, aStyleName );
-
-Point aPos( rUDEvt.GetRect().TopLeft() );
-aPos.X() += nLeftDistance;
-if ( aTextRect.Bottom()  rUDEvt.GetRect().GetHeight() )
-{
-// the text does not fit, adjust the font size
-double ratio = static_cast double ( 
rUDEvt.GetRect().GetHeight() ) / aTextRect.Bottom();
-aPixelSize.Width() *= ratio;
-aPixelSize.Height() *= ratio;
-aFont.SetSize( aPixelSize );
-pDevice-SetFont( aFont );
-}
-else
-aPos.Y() += ( rUDEvt.GetRect().GetHeight() - 
aTextRect.Bottom() ) / 2;
-
-pDevice-DrawText( aPos, aStyleName );
+UserDrawEntry(rUDEvt, aStyleName);
 
 pDevice-Pop();
 
commit 7cf22a0a3202da296c1d1a3dafe6e1e5e1d7405d
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 21 14:39:57 2015 +0100

fix indent

Change-Id: I2628ac3fbabe9f33c41c7f3612eae608fb854ae3

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ea648c8..19ea1e7 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -643,8 +643,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent 
rUDEvt )
 
 // setup the device  draw
 vcl::Font aOldFont( pDevice-GetFont() );
-Color aOldColor( pDevice-GetTextColor() );
-Color aOldFillColor( pDevice-GetFillColor() );
+pDevice-Push(PushFlags::FILLCOLOR | PushFlags::FONT | 
PushFlags::TEXTCOLOR);
 
 Color aFontCol = COL_AUTO, aBackCol = COL_AUTO;
 
@@ -682,7 +681,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent 
rUDEvt )
 break;
 
 //TODO Draw the other background styles: gradient, 
hatching and bitmap
-   }
+}
 
 // when the font and background color are too similar, adjust 
the Font-Color
 if( (aFontCol != COL_AUTO) || (aBackCol != COL_AUTO) )
@@ -741,9 +740,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent 
rUDEvt )
 
 pDevice-DrawText( aPos, aStyleName );
 
-pDevice-SetFillColor( aOldFillColor 

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

2015-04-21 Thread Caolán McNamara
 svx/source/tbxctrls/tbcontrl.cxx |  118 +++
 1 file changed, 83 insertions(+), 35 deletions(-)

New commits:
commit 856e9b5fe2293bef9c45219391aca664d4a0dd20
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 21 16:28:51 2015 +0100

Resolves: tdf#76825 styles drop down menu is too narrow

Change-Id: I3d1ba1da40990df2427f0d380a85d5e704f37038

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 9a67b1b..b2b6c7a 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -123,7 +123,7 @@ public:
 virtual ~SvxStyleBox_Impl();
 
 voidSetFamily( SfxStyleFamily eNewFamily );
-inline bool IsVisible() { return bVisible; }
+boolIsVisible() const { return bVisible; }
 
 virtual boolPreNotify( NotifyEvent rNEvt ) SAL_OVERRIDE;
 virtual boolNotify( NotifyEvent rNEvt ) SAL_OVERRIDE;
@@ -132,10 +132,12 @@ public:
 
 virtual voidUserDraw( const UserDrawEvent rUDEvt ) SAL_OVERRIDE;
 
-inline void SetVisibilityListener( const Link aVisListener ) { 
aVisibilityListener = aVisListener; }
+voidSetVisibilityListener( const Link aVisListener ) { 
aVisibilityListener = aVisListener; }
 
 voidSetDefaultStyle( const OUString rDefault ) { 
sDefaultStyle = rDefault; }
 
+voidCalcOptimalExtraUserWidth();
+
 protected:
 virtual voidSelect() SAL_OVERRIDE;
 
@@ -158,8 +160,9 @@ private:
 
 voidReleaseFocus();
 Color   TestColorsVisible(const Color FontCol, const Color 
BackCol);
-voidSetupEntry(sal_uInt16 nItem, const Rectangle rRect, 
OutputDevice *pDevice, const OUString rStyleName, bool bIsNotSelected);
 voidUserDrawEntry(const UserDrawEvent rUDEvt, const OUString 
rStyleName);
+voidSetupEntry(sal_uInt16 nItem, const Rectangle rRect, 
OutputDevice *pDevice, const OUString rStyleName, bool bIsNotSelected);
+boolAdjustFontForItemHeight(OutputDevice* pDevice, Rectangle 
rTextRect, long nHeight);
 DECL_LINK( MenuSelectHdl, Menu * );
 };
 
@@ -297,6 +300,9 @@ class SfxStyleControllerItem_Impl : public SfxStatusListener
 SvxStyleToolBoxControl rControl;
 };
 
+#define BUTTON_WIDTH 20
+#define ITEM_HEIGHT 30
+
 SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent,
const OUString rCommand,
SfxStyleFamily eFamily,
@@ -324,7 +330,7 @@ SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent,
 aLogicalSize = PixelToLogic( GetSizePixel(), MAP_APPFONT );
 EnableAutocomplete( true );
 EnableUserDraw( true );
-SetUserItemSize( Size( 0, 30 ) );
+SetUserItemSize( Size( 0, ITEM_HEIGHT ) );
 }
 
 SvxStyleBox_Impl::~SvxStyleBox_Impl()
@@ -548,6 +554,23 @@ void SvxStyleBox_Impl::StateChanged( StateChangedType 
nStateChange )
 }
 }
 
+bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, 
Rectangle rTextRect, long nHeight)
+{
+if (rTextRect.Bottom()  nHeight)
+{
+// the text does not fit, adjust the font size
+double ratio = static_cast double ( nHeight ) / rTextRect.Bottom();
+vcl::Font aFont(pDevice-GetFont());
+Size aPixelSize(aFont.GetSize());
+aPixelSize.Width() *= ratio;
+aPixelSize.Height() *= ratio;
+aFont.SetSize(aPixelSize);
+pDevice-SetFont(aFont);
+return true;
+}
+return false;
+}
+
 void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent rUDEvt, const 
OUString rStyleName)
 {
 OutputDevice *pDevice = rUDEvt.GetDevice();
@@ -562,18 +585,8 @@ void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent 
rUDEvt, const OUString
 
 Point aPos( rUDEvt.GetRect().TopLeft() );
 aPos.X() += nLeftDistance;
-if ( aTextRect.Bottom()  rUDEvt.GetRect().GetHeight() )
-{
-// the text does not fit, adjust the font size
-double ratio = static_cast double ( rUDEvt.GetRect().GetHeight() ) / 
aTextRect.Bottom();
-vcl::Font aFont(pDevice-GetFont());
-Size aPixelSize(aFont.GetSize());
-aPixelSize.Width() *= ratio;
-aPixelSize.Height() *= ratio;
-aFont.SetSize(aPixelSize);
-pDevice-SetFont(aFont);
-}
-else
+
+if (!AdjustFontForItemHeight(pDevice, aTextRect, 
rUDEvt.GetRect().GetHeight()))
 aPos.Y() += ( rUDEvt.GetRect().GetHeight() - aTextRect.Bottom() ) / 2;
 
 pDevice-DrawText(aPos, rStyleName);
@@ -722,10 +735,10 @@ void SvxStyleBox_Impl::SetupEntry(sal_uInt16 nItem, const 
Rectangle rRect, Outp
 if(m_pButtons[nId] == NULL)
 {
 m_pButtons[nId] = new 
MenuButton(static_castvcl::Window*(pDevice), WB_FLATBUTTON | 
WB_NOPOINTERFOCUS);
-m_pButtons[nId]-SetSizePixel(Size(20, 
rRect.GetSize().Height()));
+ 

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

2015-03-22 Thread Tomaž Vajngerl
 svx/source/sidebar/line/LinePropertyPanel.cxx |  274 +-
 svx/source/sidebar/line/LinePropertyPanel.hxx |   94 
 2 files changed, 153 insertions(+), 215 deletions(-)

New commits:
commit 74c21e709495b16787f5d6598cebf322416ce455
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Sun Mar 22 20:26:39 2015 +0900

LinePropertyPanel - scoped_ptr - unique_ptr

Change-Id: I52708b6ca13f76391355b1c0eefc1dcf22dcc273

diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx 
b/svx/source/sidebar/line/LinePropertyPanel.cxx
index f7a91e7..052e16e 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -166,8 +166,8 @@ LinePropertyPanel::LinePropertyPanel(
 mnTrans(0),
 meMapUnit(SFX_MAPUNIT_MM),
 mnWidthCoreValue(0),
-mpStartItem(0),
-mpEndItem(0),
+mpStartItem(),
+mpEndItem(),
 maLineWidthPopup(this, 
::boost::bind(LinePropertyPanel::CreateLineWidthPopupControl, this, _1)),
 maIMGNone(SVX_RES(IMG_NONE_ICON)),
 mpIMGWidthIcon(),
@@ -637,7 +637,7 @@ IMPL_LINK(LinePropertyPanel, ChangeStartHdl, void*, 
EMPTYARG)
 sal_Int32  nPos = mpLBStart-GetSelectEntryPos();
 if( nPos != LISTBOX_ENTRY_NOTFOUND  mpLBStart-IsValueChangedFromSaved() 
)
 {
-boost::scoped_ptrXLineStartItem pItem;
+std::unique_ptrXLineStartItem pItem;
 if( nPos == 0 )
 pItem.reset(new XLineStartItem());
 else if( mxLineEndList.is()  mxLineEndList-Count()  (long) ( nPos 
- 1 ) )
@@ -652,7 +652,7 @@ IMPL_LINK(LinePropertyPanel, ChangeEndHdl, void*, EMPTYARG)
 sal_Int32  nPos = mpLBEnd-GetSelectEntryPos();
 if( nPos != LISTBOX_ENTRY_NOTFOUND  mpLBEnd-IsValueChangedFromSaved() )
 {
-boost::scoped_ptrXLineEndItem pItem;
+std::unique_ptrXLineEndItem pItem;
 if( nPos == 0 )
 pItem.reset(new XLineEndItem());
 else if( mxLineEndList.is()  mxLineEndList-Count()  (long) ( nPos 
- 1 ) )
@@ -668,7 +668,7 @@ IMPL_LINK(LinePropertyPanel, ChangeEdgeStyleHdl, void*, 
EMPTYARG)
 
 if(LISTBOX_ENTRY_NOTFOUND != nPos  
mpLBEdgeStyle-IsValueChangedFromSaved())
 {
-boost::scoped_ptrXLineJointItem pItem;
+std::unique_ptrXLineJointItem pItem;
 
 switch(nPos)
 {
@@ -705,7 +705,7 @@ IMPL_LINK(LinePropertyPanel, ChangeCapStyleHdl, void*, 
EMPTYARG)
 
 if(LISTBOX_ENTRY_NOTFOUND != nPos  
mpLBCapStyle-IsValueChangedFromSaved())
 {
-boost::scoped_ptrXLineCapItem pItem;
+std::unique_ptrXLineCapItem pItem;
 
 switch(nPos)
 {
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx 
b/svx/source/sidebar/line/LinePropertyPanel.hxx
index e983683..586573f 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -25,7 +25,6 @@
 #include sfx2/sidebar/ControllerItem.hxx
 #include vcl/fixed.hxx
 #include vcl/field.hxx
-#include boost/scoped_ptr.hpp
 #include boost/scoped_array.hpp
 #include svx/sidebar/PanelLayout.hxx
 #include svx/xtable.hxx
@@ -111,16 +110,16 @@ private:
 sfx2::sidebar::ControllerItem maEdgeStyle;
 sfx2::sidebar::ControllerItem maCapStyle;
 
-boost::scoped_ptrXLineStyleItem mpStyleItem;
-boost::scoped_ptrXLineDashItem  mpDashItem;
+std::unique_ptrXLineStyleItem mpStyleItem;
+std::unique_ptrXLineDashItem  mpDashItem;
 
 sal_uInt16  mnTrans;
 SfxMapUnit  meMapUnit;
 sal_Int32   mnWidthCoreValue;
 XLineEndListRef mxLineEndList;
 XDashListRefmxLineStyleList;
-boost::scoped_ptrXLineStartItem mpStartItem;
-boost::scoped_ptrXLineEndItem   mpEndItem;
+std::unique_ptrXLineStartItem mpStartItem;
+std::unique_ptrXLineEndItem   mpEndItem;
 
 //popup windows
 LineWidthPopup maLineWidthPopup;
commit 647b968191a6b452d1d8f704200e0d604c721991
Author: Tomaž Vajngerl tomaz.vajng...@collabora.co.uk
Date:   Sun Mar 22 20:14:10 2015 +0900

cleanup sidebar: LinePropertyPanel

Change-Id: Ic8de5d12ee83713b04e947fbabfe1a1184f868ca

diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx 
b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 3913f24..f7a91e7 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -53,104 +53,102 @@
 
 using namespace css;
 using namespace css::uno;
-using ::sfx2::sidebar::Theme;
+using sfx2::sidebar::Theme;
 
 const char UNO_SELECTWIDTH[] = .uno:SelectWidth;
 
-namespace {
-void FillLineEndListBox(ListBox rListBoxStart, ListBox rListBoxEnd, 
const XLineEndList rList)
-{
-const sal_uInt32 nCount(rList.Count());
-const OUString sNone(SVX_RESSTR(RID_SVXSTR_NONE));
+namespace
+{
 
-rListBoxStart.SetUpdateMode(false);
-rListBoxEnd.SetUpdateMode(false);
+void FillLineEndListBox(ListBox rListBoxStart, ListBox rListBoxEnd, const 
XLineEndList rList)
+{
+const sal_uInt32 

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

2015-02-19 Thread Miklos Vajna
 svx/source/svdraw/svdedxv.cxx|6 +++---
 sw/inc/tabcol.hxx|2 +-
 sw/source/core/bastyp/tabcol.cxx |4 ++--
 sw/source/core/doc/tblafmt.cxx   |   14 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit fd19e3f823ef8b83f4185da173365ba1b129e4a9
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Feb 19 09:01:16 2015 +0100

sw: nAnz - nCount

Change-Id: Ia8c237009634eb0c750db42da4f68a31d40c5368

diff --git a/sw/inc/tabcol.hxx b/sw/inc/tabcol.hxx
index 72e495d..aaf0548 100644
--- a/sw/inc/tabcol.hxx
+++ b/sw/inc/tabcol.hxx
@@ -69,7 +69,7 @@ public:
 
 void Insert( long nValue, bool bValue, size_t nPos );
 void Insert( long nValue, long nMin, long nMax, bool bValue, size_t nPos );
-void Remove( size_t nPos, size_t nAnz = 1 );
+void Remove( size_t nPos, size_t nCount = 1 );
 
 const SwTabColsEntry GetEntry( size_t nPos ) const { return aData[nPos]; }
   SwTabColsEntry GetEntry( size_t nPos )  { return aData[nPos]; }
diff --git a/sw/source/core/bastyp/tabcol.cxx b/sw/source/core/bastyp/tabcol.cxx
index 0f5c789..b6e4cd1 100644
--- a/sw/source/core/bastyp/tabcol.cxx
+++ b/sw/source/core/bastyp/tabcol.cxx
@@ -105,10 +105,10 @@ void SwTabCols::Insert( long nValue, bool bValue, size_t 
nPos )
 #endif
 }
 
-void SwTabCols::Remove( size_t nPos, size_t nAnz )
+void SwTabCols::Remove( size_t nPos, size_t nCount )
 {
 SwTabColsEntries::iterator aStart = aData.begin() + nPos;
-aData.erase( aStart, aStart + nAnz );
+aData.erase( aStart, aStart + nCount );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index e4eea4a..71cb1ba 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1161,21 +1161,21 @@ bool SwTableAutoFmtTbl::Load( SvStream rStream )
 aVersions.Load( rStream, nVal );// Item versions
 
 SwTableAutoFmt* pNew;
-sal_uInt16 nAnz = 0;
-rStream.ReadUInt16( nAnz );
+sal_uInt16 nCount = 0;
+rStream.ReadUInt16( nCount );
 
 bRet = 0 == rStream.GetError();
 if (bRet)
 {
 const size_t nMinRecordSize = sizeof(sal_uInt16);
 const size_t nMaxRecords = rStream.remainingSize() / 
nMinRecordSize;
-if (nAnz  nMaxRecords)
+if (nCount  nMaxRecords)
 {
-SAL_WARN(vcl.gdi, Parsing error:   nMaxRecords 
-  max possible entries, but   nAnz   
claimed, truncating);
-nAnz = nMaxRecords;
+SAL_WARN(sw.core, Parsing error:   nMaxRecords 
+  max possible entries, but   nCount   
claimed, truncating);
+nCount = nMaxRecords;
 }
-for (sal_uInt16 i = 0; i  nAnz; ++i)
+for (sal_uInt16 i = 0; i  nCount; ++i)
 {
 pNew = new SwTableAutoFmt( OUString() );
 bRet = pNew-Load( rStream, aVersions );
commit 998d30b6c96aa4b05bcc1360d36791af81c9924c
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Feb 19 09:01:04 2015 +0100

svx: nViewAnz - nViewCount

Change-Id: I76e7f2b29c6583c32a3c2b49f3365688f8f81bce

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 67d9514..f8b234b 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -297,14 +297,14 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow 
rPaintWindow) const
 
 if(pActiveOutliner)
 {
-const sal_uInt32 nViewAnz(pActiveOutliner-GetViewCount());
+const sal_uInt32 nViewCount(pActiveOutliner-GetViewCount());
 
-if(nViewAnz)
+if(nViewCount)
 {
 const vcl::Region rRedrawRegion = 
rPaintWindow.GetRedrawRegion();
 const Rectangle aCheckRect(rRedrawRegion.GetBoundRect());
 
-for(sal_uInt32 i(0); i  nViewAnz; i++)
+for(sal_uInt32 i(0); i  nViewCount; i++)
 {
 OutlinerView* pOLV = pActiveOutliner-GetView(i);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-19 Thread Michael Stahl
 svx/source/core/extedit.cxx |   30 +-
 1 file changed, 25 insertions(+), 5 deletions(-)

New commits:
commit 5e4dc857252c8eeaaa629af2fb6b392ab02036cf
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jan 19 12:36:21 2015 +0100

svx: ExternalToolEdit: don't terminate if SystemShellExecute throws

Change-Id: Ia527a2c9467e2ab097cf688164f4176a52fa1d36

diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx
index b491253..6f6dc2c 100644
--- a/svx/source/core/extedit.cxx
+++ b/svx/source/core/extedit.cxx
@@ -87,9 +87,17 @@ public:
 
 void ExternalToolEditThread::execute()
 {
-ReferenceXSystemShellExecute xSystemShellExecute(
-SystemShellExecute::create( ::comphelper::getProcessComponentContext() 
) );
-xSystemShellExecute-execute(m_aFileName, OUString(), 
SystemShellExecuteFlags::URIS_ONLY);
+try
+{
+ReferenceXSystemShellExecute const xSystemShellExecute(
+SystemShellExecute::create( 
::comphelper::getProcessComponentContext()));
+xSystemShellExecute-execute(m_aFileName, OUString(),
+SystemShellExecuteFlags::URIS_ONLY);
+}
+catch (uno::Exception const e)
+{
+SAL_WARN(svx, ExternalToolEditThread: exception:   e.Message);
+}
 }
 
 void ExternalToolEdit::Edit(GraphicObject const*const pGraphicObject)
commit c8ae30a720474db8efed3db31348f8ae52c149c3
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jan 19 12:31:03 2015 +0100

svx: ExternalToolEdit: check that temp file is actually created

Change-Id: I03e49493c549561b4dc806f1e191a73d06733cff

diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx
index 7cc8b5f..b491253 100644
--- a/svx/source/core/extedit.cxx
+++ b/svx/source/core/extedit.cxx
@@ -106,11 +106,23 @@ void ExternalToolEdit::Edit(GraphicObject const*const 
pGraphicObject)
 OUString aTempFileName;
 
 oslFileHandle pHandle;
-osl::FileBase::createTempFile(0, pHandle, aTempFileBase);
+osl::FileBase::RC rc =
+osl::FileBase::createTempFile(0, pHandle, aTempFileBase);
+if (osl::FileBase::E_None != rc)
+{
+SAL_WARN(svx, ExternalToolEdit::Edit: cannot create temp file);
+return;
+}
 
 // Move it to a file name with image extension properly set
 aTempFileName = aTempFileBase + . + OUString(fExtension);
-osl::File::move(aTempFileBase, aTempFileName);
+// FIXME: this is pretty stupid, need a better osl temp file API
+rc = osl::File::move(aTempFileBase, aTempFileName);
+if (osl::FileBase::E_None != rc)
+{
+SAL_WARN(svx, ExternalToolEdit::Edit: cannot move temp file);
+return;
+}
 
 //Write Graphic to the Temp File
 GraphicFilter rGraphicFilter = GraphicFilter::GetGraphicFilter();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-08 Thread Stephan Bergmann
 svx/source/unodraw/unoshap4.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8eb880a04d17c888c2c986426e935e02ae309e7a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Jan 8 11:55:20 2015 +0100

HACK to avoid empty page size/div by 0 in chart2 LegendWrapper::setPosition

see thread starting at
http://lists.freedesktop.org/archives/libreoffice/2015-January/065706.html
CppunitTest_sw_ooxmlsdrexport: division by zero in
chart2/source/controller/chartapiwrapper/LegendWrapper.cxx

Change-Id: If8fde31dff04d9a223687838df6dd9fe4e57ee8b

diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 0054afc..75f8846 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -429,7 +429,7 @@ bool SvxOle2Shape::createObject( const SvGlobalName 
aClassName )
 {}
 pOle2Obj-SetLogicRect( aRect );
 }
-else
+else if (!aRect.IsEmpty()) //HACK: can aRect legally be empty?
 {
 awt::Size aSz;
 Size aSize = aRect.GetSize();
commit 51d004b1d761193aa092a7532748935970e82ec8
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Jan 8 10:04:00 2015 +0100

Re-use aRect

Change-Id: Ic63daa16e6931dd7842faae0d3c83ae0fdeb132f

diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 111883e..0054afc 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -432,7 +432,7 @@ bool SvxOle2Shape::createObject( const SvGlobalName 
aClassName )
 else
 {
 awt::Size aSz;
-Size aSize = pOle2Obj-GetLogicRect().GetSize();
+Size aSize = aRect.GetSize();
 aSz.Width = aSize.Width();
 aSz.Height = aSize.Height();
 xObj-setVisualAreaSize(  pOle2Obj-GetAspect(), aSz );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - svx/source sw/CppunitTest_sw_uiwriter.mk sw/qa

2014-12-18 Thread Miklos Vajna
 svx/source/customshapes/EnhancedCustomShape2d.cxx |   12 --
 sw/CppunitTest_sw_uiwriter.mk |   35 -
 sw/qa/extras/uiwriter/data/fdo87448.odt   |binary
 sw/qa/extras/uiwriter/uiwriter.cxx|   44 ++
 4 files changed, 53 insertions(+), 38 deletions(-)

New commits:
commit 20f8006e21943b08f1f152e4a0359c9ebe4786f2
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Dec 18 19:17:25 2014 +0100

fdo#87448 EnhancedCustomShape2d: fix handling of scaled ARCANGLETO commands

Change-Id: I7daf52a60e3fac8d9f86b464e86af60e0495fcb1

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 225ec26..9a66921 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -52,6 +52,7 @@
 #include basegfx/color/bcolortools.hxx
 #include basegfx/polygon/b2dpolygon.hxx
 #include basegfx/polygon/b2dpolygontools.hxx
+#include basegfx/matrix/b2dhommatrixtools.hxx
 #include rtl/strbuf.hxx
 #include math.h
 
@@ -1770,8 +1771,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16 
rSrcPt, sal_uInt16 rSegm
 GetParameter ( fStartAngle, seqCoordinates[ 
(sal_uInt16)( rSrcPt + 1) ].First, false, false );
 GetParameter ( fSwingAngle, seqCoordinates[ 
(sal_uInt16)( rSrcPt + 1 ) ].Second, false, false );
 
-fWR *= fXScale;
-fHR *= fYScale;
+// Convert angles to radians, but don't do any scaling 
/ translation yet.
 
 fStartAngle *= F_PI180;
 fSwingAngle *= F_PI180;
@@ -1783,7 +1783,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16 
rSrcPt, sal_uInt16 rSegm
 if (aNewB2DPolygon.count()  0)
 {
 basegfx::B2DPoint aStartPointB2D( 
aNewB2DPolygon.getB2DPoint(aNewB2DPolygon.count() - 1 ) );
-Point aStartPoint( aStartPointB2D.getX(), 
aStartPointB2D.getY() );
+Point aStartPoint( 0, 0 );
 
 double fT = atan2((fWR*sin(fStartAngle)), 
(fHR*cos(fStartAngle)));
 double fTE = atan2((fWR*sin(fStartAngle + 
fSwingAngle)), fHR*cos(fStartAngle + fSwingAngle));
@@ -1798,7 +1798,11 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16 
rSrcPt, sal_uInt16 rSegm
 OSL_TRACE(ARCANGLETO rect: %d, %d   x   %d, %d   
start: %d, %d end: %d, %d clockwise: %d,
   aRect.Left(), aRect.Top(), 
aRect.Right(), aRect.Bottom(),
   aStartPoint.X(), aStartPoint.Y(), 
aEndPoint.X(), aEndPoint.Y(), bClockwise);
-aNewB2DPolygon.append(CreateArc( aRect, bClockwise 
? aEndPoint : aStartPoint, bClockwise ? aStartPoint : aEndPoint, bClockwise, 
aStartPoint == aEndPoint  fSwingAngle  F_PI));
+basegfx::B2DPolygon aArc = CreateArc( aRect, 
bClockwise ? aEndPoint : aStartPoint, bClockwise ? aStartPoint : aEndPoint, 
bClockwise, aStartPoint == aEndPoint  fSwingAngle  F_PI);
+// Now that we have the arc, move it to 
aStartPointB2D and also scale it.
+basegfx::B2DHomMatrix aMatrix = 
basegfx::tools::createScaleTranslateB2DHomMatrix(fXScale, fYScale, 
aStartPointB2D.getX(), aStartPointB2D.getY());
+aArc.transform(aMatrix);
+aNewB2DPolygon.append(aArc);
 }
 
 rSrcPt += 2;
diff --git a/sw/qa/extras/uiwriter/data/fdo87448.odt 
b/sw/qa/extras/uiwriter/data/fdo87448.odt
new file mode 100644
index 000..3618dcd
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/fdo87448.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index c840b44..8073a43 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -8,6 +8,7 @@
  */
 
 #include com/sun/star/awt/FontWeight.hpp
+#include com/sun/star/drawing/GraphicExportFilter.hpp
 #include com/sun/star/i18n/TextConversionOption.hpp
 #include swmodeltestbase.hxx
 #include ndtxt.hxx
@@ -26,6 +27,8 @@
 #include hhcwrp.hxx
 #include swacorr.hxx
 #include editeng/acorrcfg.hxx
+#include unotools/streamwrap.hxx
+#include test/mtfxmldump.hxx
 
 #include svx/svdpage.hxx
 #include svx/svdview.hxx
@@ -72,6 +75,7 @@ public:
 void testCreatePortions();
 void testBookmarkUndo();
 void testFdo85876();
+void testFdo87448();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -101,6 +105,7 @@ public:
 CPPUNIT_TEST(testCreatePortions);
 CPPUNIT_TEST(testBookmarkUndo);
 CPPUNIT_TEST(testFdo85876);
+CPPUNIT_TEST(testFdo87448);
 
 

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

2014-10-30 Thread Caolán McNamara
 svx/source/dialog/docrecovery.src   |2 +-
 svx/source/inc/docrecovery.hxx  |2 +-
 svx/uiconfig/ui/docrecoveryrecoverdialog.ui |5 +++--
 sw/source/uibase/shells/basesh.cxx  |6 +++---
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 6ac621f1e07c2717d69880866522056996fe9546
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Oct 30 14:56:31 2014 +

Resolves: fdo#80815 rename Cancel and explain what it will do

Change-Id: Ifdd68f7e415176062b9eee6825b3c0bb09cb05db

diff --git a/svx/source/dialog/docrecovery.src 
b/svx/source/dialog/docrecovery.src
index eb55d1f..8f8cd98 100644
--- a/svx/source/dialog/docrecovery.src
+++ b/svx/source/dialog/docrecovery.src
@@ -24,7 +24,7 @@
 
 String RID_SVXSTR_QUERY_EXIT_RECOVERY
 {
-Text [ en-US ] = Are you sure you want to cancel the %PRODUCTNAME 
document recovery?;
+Text [ en-US ] = Are you sure you want to discard the %PRODUCTNAME 
document recovery data?;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index 74946f1..c29d139 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -502,7 +502,7 @@ class RecoveryDialog : public Dialog
 vcl::Window* m_pProgrParent;
 RecovDocList*   m_pFileListLB;
 PushButton* m_pNextBtn;
-CancelButton*   m_pCancelBtn;
+PushButton* m_pCancelBtn;
 OUStringm_aTitleRecoveryInProgress;
 OUStringm_aRecoveryOnlyFinish;
 OUStringm_aRecoveryOnlyFinishDescr;
diff --git a/svx/uiconfig/ui/docrecoveryrecoverdialog.ui 
b/svx/uiconfig/ui/docrecoveryrecoverdialog.ui
index 034380e..fe77eb8 100644
--- a/svx/uiconfig/ui/docrecoveryrecoverdialog.ui
+++ b/svx/uiconfig/ui/docrecoveryrecoverdialog.ui
@@ -35,12 +35,11 @@
 /child
 child
   object class=GtkButton id=cancel
-property name=labelgtk-cancel/property
+property name=labelDiscard Recovery Data/property
 property name=visibleTrue/property
 property name=can_focusTrue/property
 property name=can_defaultTrue/property
 property name=receives_defaultTrue/property
-property name=use_stockTrue/property
   /object
   packing
 property name=expandFalse/property
@@ -77,6 +76,8 @@
 property name=xalign0/property
 property name=label translatable=yesPress 'Start 
Recovery' to start the recovery process of the documents listed below.
 
+Press 'Discard Recovery Data' to abandon attempting recovery of these document.
+
 The 'Status' column shows whether the document can be recovered./property
 property name=wrapTrue/property
 property name=max_width_chars87/property
commit f6011536a888be3a4e1cda2de9532b6ba3f4a275
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Oct 30 14:35:17 2014 +

coverity#704378 gold, Logically dead code

Change-Id: I53bd1e36b2c4e9e7f5e8ec95fa79348fc9cac98b

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 96f5218..9c8b35d 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1041,7 +1041,7 @@ void SwBaseShell::Execute(SfxRequest rReq)
 if( eVOrient != text::VertOrientation::TOP  eVOrient != 
text::VertOrientation::NONE)
 aSet.Put(SwFmtVertOrient(0, 
text::VertOrientation::TOP));
 
-if(eHOrient != text::HoriOrientation::NONE || eHOrient != 
text::HoriOrientation::LEFT)
+if (eHOrient != text::HoriOrientation::NONE  eHOrient != 
text::HoriOrientation::LEFT)
 aSet.Put(SwFmtHoriOrient(0, 
text::HoriOrientation::LEFT));
 break;
 
@@ -1053,7 +1053,7 @@ void SwBaseShell::Execute(SfxRequest rReq)
 if( eVOrient != text::VertOrientation::TOP)
 aSet.Put(SwFmtVertOrient(0, 
text::VertOrientation::TOP));
 
-if(eHOrient != text::HoriOrientation::NONE || eHOrient != 
text::HoriOrientation::LEFT || eHOrient != text::HoriOrientation::RIGHT)
+if (eHOrient != text::HoriOrientation::NONE  eHOrient != 
text::HoriOrientation::LEFT  eHOrient != text::HoriOrientation::RIGHT)
 aSet.Put(SwFmtHoriOrient(0, 
text::HoriOrientation::LEFT));
 break;
 
@@ -1065,7 +1065,7 @@ void SwBaseShell::Execute(SfxRequest rReq)
 if( eVOrient != text::VertOrientation::TOP)
 aSet.Put(SwFmtVertOrient(0, 
text::VertOrientation::TOP));
 
-if(eHOrient != text::HoriOrientation::NONE || eHOrient != 
text::HoriOrientation::LEFT || eHOrient != 

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

2014-10-14 Thread Michael Stahl
 svx/source/svdraw/svdomedia.cxx |   27 +++
 vcl/source/gdi/impfont.cxx  |2 +-
 2 files changed, 20 insertions(+), 9 deletions(-)

New commits:
commit 782caa59cc0f72ef377b1d2c99b552b1be201f44
Author: Michael Stahl mst...@redhat.com
Date:   Tue Oct 14 15:04:26 2014 +0200

svx: fix another temp file leak, from SdrMediaObj's glTF models

These need a whole directory, apparently a model may have multiple
files.

Change-Id: I092c1764ddb1ed30947034f299fbb6882658d21b

diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index da5860b..4655ec9 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -41,6 +41,7 @@
 
 // For handling of glTF models
 #include unotools/tempfile.hxx
+#include unotools/localfilehelper.hxx
 #include tools/urlobj.hxx
 
 using namespace ::com::sun::star;
@@ -54,10 +55,17 @@ using namespace ::com::sun::star;
 struct MediaTempFile
 {
 OUString const m_TempFileURL;
-MediaTempFile(OUString const rURL) : m_TempFileURL(rURL) {}
+OUString const m_TempDirURL; // yet another hack, for the glTF models
+MediaTempFile(OUString const rURL, OUString const rDirURL)
+: m_TempFileURL(rURL), m_TempDirURL(rDirURL)
+{}
 ~MediaTempFile()
 {
 ::osl::File::remove(m_TempFileURL);
+if (!m_TempDirURL.isEmpty())
+{
+::utl::removeTree(m_TempDirURL);
+}
 }
 };
 
@@ -270,10 +278,11 @@ uno::Referenceio::XInputStream 
SdrMediaObj::GetInputStream()
 static bool lcl_HandleJsonPackageURL(
 const OUString rURL,
 SdrModel* const pModel,
-OUString o_rTempFileURL)
+OUString o_rTempFileURL,
+OUString o_rTempDirURL)
 {
 // Create a temporary folder which will contain all files of glTF model
-const OUString sTempFolder = ::utl::TempFile( NULL, true ).GetURL();
+o_rTempDirURL = ::utl::TempFile(NULL, true).GetURL();
 
 const sal_uInt16 nPackageLength = 
OString(vnd.sun.star.Package:).getLength();
 const OUString sUrlPath = 
rURL.copy(nPackageLength,rURL.lastIndexOf(/)-nPackageLength);
@@ -298,7 +307,7 @@ static bool lcl_HandleJsonPackageURL(
 {
 // Generate temp file path
 const OUString rFilename = aFilenames[nFileIndex];
-INetURLObject aUrlObj(sTempFolder);
+INetURLObject aUrlObj(o_rTempDirURL);
 aUrlObj.insertName(rFilename);
 const OUString sFilepath = aUrlObj.GetMainURL( 
INetURLObject::NO_DECODE );
 
@@ -367,7 +376,7 @@ void 
SdrMediaObj::SetInputStream(uno::Referenceio::XInputStream const xStream
 bool const bSuccess = lcl_CopyToTempFile(xStream, tempFileURL);
 if (bSuccess)
 {
-m_pImpl-m_pTempFile.reset(new MediaTempFile(tempFileURL));
+m_pImpl-m_pTempFile.reset(new MediaTempFile(tempFileURL, ));
 m_pImpl-m_MediaProperties.setURL(
 m_pImpl-m_LastFailedPkgURL, tempFileURL, );
 }
@@ -429,16 +438,18 @@ void SdrMediaObj::mediaPropertiesChanged( const 
::avmedia::MediaItem rNewProper
 rNewProperties.getTempURL()))
 {
 OUString tempFileURL;
+OUString tempDirURL;
 bool bSuccess;
 #if HAVE_FEATURE_GLTF
 if( url.endsWith(.json) )
-bSuccess = lcl_HandleJsonPackageURL(url, GetModel(), 
tempFileURL);
+bSuccess = lcl_HandleJsonPackageURL(url, GetModel(), 
tempFileURL, tempDirURL);
 else
 #endif
-bSuccess = lcl_HandlePackageURL( url, GetModel(), 
tempFileURL);
+bSuccess = lcl_HandlePackageURL(url, GetModel(), 
tempFileURL);
 if (bSuccess)
 {
-m_pImpl-m_pTempFile.reset(new MediaTempFile(tempFileURL));
+m_pImpl-m_pTempFile.reset(
+new MediaTempFile(tempFileURL, tempDirURL));
 m_pImpl-m_MediaProperties.setURL(url, tempFileURL, );
 }
 else // this case is for Clone via operator=
commit 616445cde0b594de1e6308944d3743cc64cd2a82
Author: Michael Stahl mst...@redhat.com
Date:   Tue Oct 14 14:44:33 2014 +0200

vcl: warning C4717: GetCharCount() recursive on all control paths

Change-Id: Id86dcd2c701510ce15cc2cf71e35c1d908ec6049

diff --git a/vcl/source/gdi/impfont.cxx b/vcl/source/gdi/impfont.cxx
index 7f80a38..354edc1 100644
--- a/vcl/source/gdi/impfont.cxx
+++ b/vcl/source/gdi/impfont.cxx
@@ -416,7 +416,7 @@ bool FontCharMap::IsDefaultMap() const
 
 int FontCharMap::GetCharCount() const
 {
-return GetCharCount();
+return mpImplFontCharMap-mnCharCount;
 }
 
 int FontCharMap::CountCharsInRange( sal_UCS4 cMin, sal_UCS4 cMax ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-10-01 Thread Samuel Mehrbrodt
 svx/source/tbxctrls/layctrl.cxx  |2 +-
 sw/source/uibase/ribbar/workctrl.cxx |2 +-
 sw/source/uibase/ribbar/workctrl.src |   32 
 3 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 5f45400ca17d52a4ee40672ac409b6521ad86f76
Author: Samuel Mehrbrodt s.mehrbr...@gmail.com
Date:   Wed Oct 1 14:17:07 2014 +0200

fdo#84550 Make 'Insert field' entry dropdown only

and reorder items; rename Other to More

Change-Id: I8a6f2a68fd43af2c7c25a2d14bdad09409964037

diff --git a/sw/source/uibase/ribbar/workctrl.cxx 
b/sw/source/uibase/ribbar/workctrl.cxx
index ff70be3..6b51a18 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -286,7 +286,7 @@ SwTbxFieldCtrl::SwTbxFieldCtrl(
 pPopup(0),
 pView(0)
 {
-rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) );
+rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
 }
 
 SwTbxFieldCtrl::~SwTbxFieldCtrl()
diff --git a/sw/source/uibase/ribbar/workctrl.src 
b/sw/source/uibase/ribbar/workctrl.src
index 0362623..4acde4c 100644
--- a/sw/source/uibase/ribbar/workctrl.src
+++ b/sw/source/uibase/ribbar/workctrl.src
@@ -30,18 +30,6 @@ Menu RID_INSERT_FIELD_CTRL
 {
 MenuItem
 {
-Identifier = FN_INSERT_FLD_DATE ;
-HelpId = CMD_FN_INSERT_FLD_DATE ;
-Text [ en-US ] = Date ;
-};
-MenuItem
-{
-Identifier = FN_INSERT_FLD_TIME ;
-HelpId = CMD_FN_INSERT_FLD_TIME ;
-Text [ en-US ] = Time ;
-};
-MenuItem
-{
 Identifier = FN_INSERT_FLD_PGNUMBER ;
 HelpId = CMD_FN_INSERT_FLD_PGNUMBER ;
 Text [ en-US ] = Page Number ;
@@ -54,9 +42,15 @@ Menu RID_INSERT_FIELD_CTRL
 };
 MenuItem
 {
-Identifier = FN_INSERT_FLD_TOPIC ;
-HelpId = CMD_FN_INSERT_FLD_TOPIC ;
-Text [ en-US ] = Subject ;
+Identifier = FN_INSERT_FLD_DATE ;
+HelpId = CMD_FN_INSERT_FLD_DATE ;
+Text [ en-US ] = Date ;
+};
+MenuItem
+{
+Identifier = FN_INSERT_FLD_TIME ;
+HelpId = CMD_FN_INSERT_FLD_TIME ;
+Text [ en-US ] = Time ;
 };
 MenuItem
 {
@@ -72,13 +66,19 @@ Menu RID_INSERT_FIELD_CTRL
 };
 MenuItem
 {
+Identifier = FN_INSERT_FLD_TOPIC ;
+HelpId = CMD_FN_INSERT_FLD_TOPIC ;
+Text [ en-US ] = Subject ;
+};
+MenuItem
+{
 Separator = TRUE ;
 };
 MenuItem
 {
 Identifier = FN_INSERT_FIELD ;
 HelpId = CMD_FN_INSERT_FIELD ;
-Text [ en-US ] = Other... ;
+Text [ en-US ] = More... ;
 };
 };
 };
commit 92bbd7bc99103df5136b012bf3b6652a2a721ab0
Author: Samuel Mehrbrodt s.mehrbr...@gmail.com
Date:   Wed Oct 1 13:49:54 2014 +0200

fdo#84551 Make 'Insert table' entry dropdown only

Change-Id: I26a3f2672fa9a849c370a24a5d21162cfb2a91c5

diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index 2794af2..920669e 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -704,7 +704,7 @@ SvxTableToolBoxControl::SvxTableToolBoxControl( sal_uInt16 
nSlotId, sal_uInt16 n
 SfxToolBoxControl( nSlotId, nId, rTbx ),
 bEnabled( true )
 {
-rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) );
+rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) );
 rTbx.Invalidate();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-09-26 Thread Michael Stahl
 svx/source/form/ParseContext.cxx   |2 +-
 sw/source/filter/html/htmlgrin.cxx |8 
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f6c6474ddea7dfdb63d5b67a0b637c8c41fa4d13
Author: Michael Stahl mst...@redhat.com
Date:   Fri Sep 26 15:23:12 2014 +0200

AddressSanitizer: alloc-dealloc-mismatch (operator new vs free)

Change-Id: I500e70e64c478210bc6da0c13894995a0984c018

diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 4e136a4..0d834fe 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -698,12 +698,12 @@ IMAGE_SETEVENT:
 INetURLObject aGraphicURL( sGrfNm );
 if( aGraphicURL.GetProtocol() == INET_PROT_DATA )
 {
-SvMemoryStream* aStream = aGraphicURL.getData();
-if( aStream )
+SvMemoryStream* pStream = aGraphicURL.getData();
+if (pStream)
 {
-if (GRFILTER_OK == 
GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, , *aStream))
+if (GRFILTER_OK == 
GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, , *pStream))
 sGrfNm = ;
-free( aStream );
+delete pStream;
 }
 }
 // sBaseURL is empty if the source is clipboard
commit 24a9eac14fc22e18a48eae5a0de1b5e98194ef86
Author: Michael Stahl mst...@redhat.com
Date:   Fri Sep 26 15:56:15 2014 +0200

svx: fix up c10225762ce2c242d21126b5730b1d60f0150ed

Change-Id: Ib810a512f5a88af88901c53025cdf132f95b2ddc

diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index f075d00..9c3c760 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -65,7 +65,7 @@ OUString OSystemParseContext::getErrorMessage(ErrorCode 
_eCode) const
 case ERROR_INVALID_INT_COMPARE: aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_INT_NO_VALID); break;
 case ERROR_INVALID_DATE_COMPARE:aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_ACCESS_DAT_NO_VALID); break;
 case ERROR_INVALID_REAL_COMPARE:aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_REAL_NO_VALID); break;
-case ERROR_INVALID_TABLE:   aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_TABLE); break;
+case ERROR_INVALID_TABLE1:   aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_TABLE); break;
 case ERROR_INVALID_TABLE_OR_QUERY:  aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_TABLE_OR_QUERY); break;
 case ERROR_INVALID_COLUMN:  aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_COLUMN); break;
 case ERROR_INVALID_TABLE_EXIST: aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_TABLE_EXISTS); break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-09-18 Thread Maxim Monastirsky
 svx/source/tbxctrls/colorwindow.hxx |1 
 svx/source/tbxctrls/tbcontrl.cxx|   40 ++--
 svx/uiconfig/ui/colorwindow.ui  |1 
 3 files changed, 17 insertions(+), 25 deletions(-)

New commits:
commit 746b51de3d3bb267e02df5712cadfcf03654b587
Author: Maxim Monastirsky momonas...@gmail.com
Date:   Thu Sep 18 15:20:33 2014 +0300

Update the status only after colors load

This is required to get the current color
selection on the palette upon opening.

Change-Id: I1660b9d17a76bf6c7ae4b6b860c7ee75c5fc857e

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 0c3c227..9562072 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1081,11 +1081,11 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const 
OUStringrCommand,
 SetHelpId( HID_POPUP_COLOR );
 mpColorSet-SetHelpId( HID_POPUP_COLOR_CTRL );
 SetText( rWndTitle );
-AddStatusListener( OUString( .uno:ColorTableState ));
-AddStatusListener( maCommand );
 
 mrPaletteManager.ReloadColorSet(*mpColorSet);
 mrPaletteManager.ReloadRecentColorSet(*mpRecentColorSet);
+AddStatusListener( .uno:ColorTableState );
+AddStatusListener( maCommand );
 }
 
 SvxColorWindow_Impl::~SvxColorWindow_Impl()
commit 05ed3a5da62b1c552f24d559f4a35c314f23a4f0
Author: Maxim Monastirsky momonas...@gmail.com
Date:   Thu Sep 18 15:17:40 2014 +0300

Adapt the code for the new automatic button

It's now used instead of the 0 item of the ValueSet,
but part of the code wasn't adapted:

* Set the correct text (Automatic/No Fill) depending on
  the command.
* Hide the button for frame/line colors, since there is
  no such thing as Automatic color.
* Remove the selection and the status update code of the
  0 item.

Change-Id: Ib7d3d97a16368f2a59373efd6b81a220151881d5

diff --git a/svx/source/tbxctrls/colorwindow.hxx 
b/svx/source/tbxctrls/colorwindow.hxx
index faffc67..2d25c7e 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -41,6 +41,7 @@ private:
 ListBox*mpPaletteListBox;
 PushButton* mpButtonAutoColor;
 PushButton* mpButtonPicker;
+FixedLine*  mpAutomaticSeparator;
 OUStringmaCommand;
 LinkmaSelectedLink;
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index f6f189c..0c3c227 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1014,11 +1014,12 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const 
OUStringrCommand,
 mnColorSetCols( 10 )
 
 {
-get(mpPaletteListBox,   palette_listbox);
-get(mpButtonAutoColor,  auto_color_button);
-get(mpButtonPicker, color_picker_button);
-get(mpColorSet, colorset);
-get(mpRecentColorSet,   recent_colorset);
+get(mpPaletteListBox, palette_listbox);
+get(mpButtonAutoColor,auto_color_button);
+get(mpButtonPicker,   color_picker_button);
+get(mpColorSet,   colorset);
+get(mpRecentColorSet, recent_colorset);
+get(mpAutomaticSeparator, separator4);
 
 mpColorSet-SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK 
| WB_NO_DIRECTSELECT) );
 mpRecentColorSet-SetStyle( WinBits(WB_FLATVALUESET | WB_ITEMBORDER | 
WB_3DLOOK | WB_NO_DIRECTSELECT) );
@@ -1031,7 +1032,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString 
   rCommand,
 
 if ( SID_ATTR_CHAR_COLOR_BACKGROUND == theSlotId || SID_BACKGROUND_COLOR 
== theSlotId )
 {
-mpColorSet-SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
+mpButtonAutoColor-SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
 mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) );
 }
 else if ( SID_ATTR_CHAR_COLOR == theSlotId || SID_ATTR_CHAR_COLOR2 == 
theSlotId || SID_EXTRUSION_3D_COLOR == theSlotId )
@@ -1045,16 +1046,20 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const 
OUStringrCommand,
 SfxItemState eState = aQueryStatus.QueryState( pDummy );
 if( (SfxItemState::DEFAULT  eState) || ( SID_EXTRUSION_3D_COLOR == 
theSlotId ) )
 {
-mpColorSet-SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) );
+mpButtonAutoColor-SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) );
 mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ) 
);
 }
 }
 else if ( SID_FRAME_LINECOLOR == theSlotId )
 {
+mpButtonAutoColor-Hide();
+mpAutomaticSeparator-Hide();
 mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) );
 }
 else
 {
+mpButtonAutoColor-Hide();
+mpAutomaticSeparator-Hide();
 mpColorSet-SetAccessibleName( SVX_RESSTR( RID_SVXSTR_LINECOLOR ) );
 }
 
@@ -1099,15 +1104,7 @@ SfxPopupWindow* 

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

2014-09-13 Thread Caolán McNamara
 svx/source/svdraw/svdcrtv.cxx   |4 ++--
 sw/source/uibase/utlui/glbltree.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 46adbf9612e56179b783b48a293dc14850045aeb
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Sep 13 17:28:38 2014 +0100

coverity#704830 Dereference after null check

Change-Id: Ifb9e226b848bfcba593bc54558680738158adc36

diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index b8ed6cb..a84c3ff 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -453,7 +453,7 @@ bool SdrCreateView::ImpBegCreateObj(sal_uInt32 nInvent, 
sal_uInt16 nIdent, const
 pAktCreate-SetMergedItemSet(aDefaultAttr);
 }
 
-if (HAS_BASE(SdrCaptionObj,pAktCreate))
+if (pMod  HAS_BASE(SdrCaptionObj,pAktCreate))
 {
 SfxItemSet aSet(pMod-GetItemPool());
 aSet.Put(XFillColorItem(OUString(),Color(COL_WHITE))); // 
in case someone turns on Solid
@@ -461,7 +461,7 @@ bool SdrCreateView::ImpBegCreateObj(sal_uInt32 nInvent, 
sal_uInt16 nIdent, const
 
 pAktCreate-SetMergedItemSet(aSet);
 }
-if (nInvent==SdrInventor  (nIdent==OBJ_TEXT || 
nIdent==OBJ_TEXTEXT ||
+if (pMod  nInvent==SdrInventor  (nIdent==OBJ_TEXT || 
nIdent==OBJ_TEXTEXT ||
 nIdent==OBJ_TITLETEXT || nIdent==OBJ_OUTLINETEXT))
 {
 // default for all text frames: no background, no border
commit 06287413acd3ea58051835a6de0383b668164f27
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Sep 13 17:26:28 2014 +0100

coverity#705042 Dereference after null check

Change-Id: Iac532477802588333560497767a613bb0a55effe

diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 83f23c3..994cd53 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -431,10 +431,10 @@ sal_uInt16  SwGlobalTree::GetEnableFlags() const
 if(nSelCount == 1)
 {
 nRet |= ENABLE_EDIT;
-if( ((SwGlblDocContent*)pEntry-GetUserData())-GetType() != 
GLBLDOC_UNKNOWN 
+if (pEntry  ((SwGlblDocContent*)pEntry-GetUserData())-GetType() != 
GLBLDOC_UNKNOWN 
 (!pPrevEntry || 
((SwGlblDocContent*)pPrevEntry-GetUserData())-GetType() != GLBLDOC_UNKNOWN))
 nRet |= ENABLE_INSERT_TEXT;
-if( GLBLDOC_SECTION == 
((SwGlblDocContent*)pEntry-GetUserData())-GetType() )
+if (pEntry  GLBLDOC_SECTION == 
((SwGlblDocContent*)pEntry-GetUserData())-GetType())
 nRet |= ENABLE_EDIT_LINK;
 }
 else if(!nEntryCount)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-16 Thread Caolán McNamara
 svx/source/gallery2/galtheme.cxx |8 
 sw/source/filter/ww8/ww8scan.cxx |8 
 sw/source/filter/ww8/ww8scan.hxx |9 +
 3 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 3a1abb6804c0012718e11dab15d4f35acdef243a
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jul 16 10:35:35 2014 +0100

coverity#707280 Uncaught exception

Change-Id: I764f6472903e6aebef55af1e96c4941e8429d18f

diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 5672d9f..41f607c 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -652,11 +652,19 @@ void GalleryTheme::Actualize( const Link rActualizeLink, 
GalleryProgress* pProg
 
 sal_uIntPtr nStorErr = 0;
 
+try
 {
 SvStorageRef aTempStorageRef( new SvStorage( false, 
aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READWRITE ) );
 aSvDrawStorageRef-CopyTo( aTempStorageRef );
 nStorErr = aSvDrawStorageRef-GetError();
 }
+catch (const css::ucb::ContentCreationException e)
+{
+SAL_WARN(svx, failed to open: 
+   aTmpURL.GetMainURL(INetURLObject::NO_DECODE)
+   due to :   e.Message);
+nStorErr = ERRCODE_IO_GENERAL;
+}
 
 if( !nStorErr )
 {
commit bfd22d4ba76df2ab3939339ddb5030f3c7082cb8
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jul 16 09:44:09 2014 +0100

coverity#708510 Uninitialized scalar field

and

coverity708511 Uninitialized scalar field

Change-Id: I05b5d836f3a207e70f8fff84524866a54a15daa2

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index bbf74a0..1800a82 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6519,9 +6519,9 @@ void WW8PLCF_HdFt::UpdateIndex( sal_uInt8 grpfIhdt )
 nIdxOffset++;
 }
 
-WW8Dop::WW8Dop(SvStream rSt, sal_Int16 nFib, sal_Int32 nPos, sal_uInt32 
nSize) : bUseThaiLineBreakingRules(false)
+WW8Dop::WW8Dop(SvStream rSt, sal_Int16 nFib, sal_Int32 nPos, sal_uInt32 nSize)
 {
-memset( nDataStart, 0, (nDataEnd - nDataStart) );
+memset(this, 0, sizeof(WW8Dop));
 fDontUseHTMLAutoSpacing = true; //default
 fAcetateShowAtn = true; //default
 const sal_uInt32 nMaxDopSize = 0x268;
@@ -6743,10 +6743,10 @@ WW8Dop::WW8Dop(SvStream rSt, sal_Int16 nFib, sal_Int32 
nPos, sal_uInt32 nSize)
 delete[] pDataPtr;
 }
 
-WW8Dop::WW8Dop() : bUseThaiLineBreakingRules(false)
+WW8Dop::WW8Dop()
 {
 // first set everything to a default of 0
-memset( nDataStart, 0, (nDataEnd - nDataStart) );
+memset(this, 0, sizeof(WW8Dop));
 
 fWidowControl = true;
 fpc = 1;
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index b3ca7ca..893df81 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -1497,7 +1497,7 @@ namespace nsHdFtFlags
 }
 
 /// Document Properties
-class WW8Dop
+struct WW8Dop
 {
 public:
 /* Error Status */
@@ -1506,9 +1506,6 @@ public:
 Corresponds only roughly to the actual structure of the Winword DOP,
 the winword FIB version matters to what exists.
 */
-// Initialisier-Dummy:
-sal_uInt8nDataStart;
-
 boolfFacingPages : 1;   // 1 when facing pages should be printed
 
 boolfWidowControl : 1;  //a: orig 97 docs say
@@ -1729,9 +1726,6 @@ public:
 bool   fAcetateShowInsDel : 1;
 bool   fAcetateShowProps : 1;
 
-// 2. Initialisier-Dummy:
-sal_uInt8 nDataEnd;
-
 bool bUseThaiLineBreakingRules;
 
 /* Constructor for importing, needs to know the version of word used */
@@ -1741,7 +1735,6 @@ public:
 WW8Dop();
 bool Write(SvStream rStrm, WW8Fib rFib) const;
 
-public:
 sal_uInt32 GetCompatabilityOptions() const;
 void SetCompatabilityOptions(sal_uInt32 a32Bit);
 // i#78591#
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-09 Thread David Tardon
 svx/source/dialog/fntctrl.cxx |   21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

New commits:
commit ca4e6cad00fd0c0a9b8670b5f67a8145622fdacf
Author: David Tardon dtar...@redhat.com
Date:   Wed Jul 9 14:43:50 2014 +0200

simplify loop

Change-Id: I26c1456ca805c6f3ecfa5bd4876e7ae345f087e7

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index e9a92eb..80ca478 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -246,11 +246,13 @@ void FontPrevWin_Impl::CheckScript()
 Reference XComponentContext  xContext = 
::comphelper::getProcessComponentContext();
 xBreak = BreakIterator::create(xContext);
 }
-sal_uInt16 nScript = xBreak-getScriptType( aText, 0 );
+
+sal_uInt16 nScript = 0;
 sal_Int32 nChg = 0;
 
-do
+while ( nChg  aText.getLength() )
 {
+nScript = xBreak-getScriptType( aText, nChg );
 nChg = xBreak-endOfScript( aText, nChg, nScript );
 if (nChg  aText.getLength()  nChg  0 
 (com::sun::star::i18n::ScriptType::WEAK ==
@@ -273,12 +275,7 @@ void FontPrevWin_Impl::CheckScript()
 }
 aScriptType.push_back( nScript );
 aTextWidth.push_back( 0 );
-
-if( nChg  aText.getLength() )
-nScript = xBreak-getScriptType( aText, nChg );
-else
-break;
-} while( true );
+}
 }
 
 /*
commit 8817e5e3a0d92a4febae955ced7a35c52cb08910
Author: David Tardon dtar...@redhat.com
Date:   Wed Jul 9 14:41:29 2014 +0200

fdo#81004 this looks like a mis-merge to me

Change-Id: I2d30774a8a89002b6c2d8487bfce15eb13c82e0d

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 6e9ca6e..e9a92eb 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -248,14 +248,6 @@ void FontPrevWin_Impl::CheckScript()
 }
 sal_uInt16 nScript = xBreak-getScriptType( aText, 0 );
 sal_Int32 nChg = 0;
-if( com::sun::star::i18n::ScriptType::WEAK == nScript )
-{
-nChg = xBreak-endOfScript( aText, nChg, nScript );
-if (nChg  aText.getLength()  nChg = 0)
-nScript = xBreak-getScriptType( aText, nChg );
-else
-nScript = com::sun::star::i18n::ScriptType::LATIN;
-}
 
 do
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-02 Thread Takeshi Abe
 svx/source/tbxctrls/extrusioncontrols.cxx |2 +-
 svx/source/tbxctrls/fillctrl.cxx  |   16 +++-
 svx/source/tbxctrls/fontworkgallery.cxx   |7 +++
 svx/source/tbxctrls/linectrl.cxx  |   16 +++-
 svx/source/unodraw/UnoGraphicExporter.cxx |8 +++-
 svx/source/unodraw/UnoNameItemTable.cxx   |4 ++--
 svx/source/unodraw/unoshape.cxx   |4 ++--
 7 files changed, 25 insertions(+), 32 deletions(-)

New commits:
commit 8374bbe589511721cbca6adacf15380c5f2dc0f5
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Wed Jul 2 22:05:18 2014 +0900

Avoid possible memory leaks in case of exceptions

Change-Id: I7878d425cea773338799fb784c25039e6b923e47

diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 4a26ac4..097d475 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -36,6 +36,7 @@
 #include svx/itemwin.hxx
 #include svx/dialmgr.hxx
 #include helpid.hrc
+#include boost/scoped_ptr.hpp
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
@@ -317,9 +318,9 @@ void SvxFillToolBoxControl::Update(const SfxPoolItem* 
pState)
 }
 aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END;
 
-XGradientEntry* pEntry = new 
XGradientEntry(mpGradientItem-GetGradientValue(), aTmpStr);
+boost::scoped_ptrXGradientEntry pEntry(new 
XGradientEntry(mpGradientItem-GetGradientValue(), aTmpStr));
 XGradientList aGradientList( , /*TODO?*/ );
-aGradientList.Insert( pEntry );
+aGradientList.Insert( pEntry.get() );
 aGradientList.SetDirty( false );
 const Bitmap aBmp = aGradientList.GetUiBitmap( 0 );
 
@@ -330,7 +331,6 @@ void SvxFillToolBoxControl::Update(const SfxPoolItem* 
pState)
 }
 
 aGradientList.Remove( 0 );
-delete pEntry;
 }
 }
 else
@@ -363,9 +363,9 @@ void SvxFillToolBoxControl::Update(const SfxPoolItem* 
pState)
 }
 aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END;
 
-XHatchEntry* pEntry = new 
XHatchEntry(mpHatchItem-GetHatchValue(), aTmpStr);
+boost::scoped_ptrXHatchEntry pEntry(new 
XHatchEntry(mpHatchItem-GetHatchValue(), aTmpStr));
 XHatchList aHatchList( , /*TODO?*/ );
-aHatchList.Insert( pEntry );
+aHatchList.Insert( pEntry.get() );
 aHatchList.SetDirty( false );
 const Bitmap aBmp = aHatchList.GetUiBitmap( 0 );
 
@@ -376,7 +376,6 @@ void SvxFillToolBoxControl::Update(const SfxPoolItem* 
pState)
 }
 
 aHatchList.Remove( 0 );
-delete pEntry;
 }
 }
 else
@@ -409,16 +408,15 @@ void SvxFillToolBoxControl::Update(const SfxPoolItem* 
pState)
 }
 aTmpStr = TMP_STR_BEGIN + aString + TMP_STR_END;
 
-XBitmapEntry* pEntry = new 
XBitmapEntry(mpBitmapItem-GetGraphicObject(), aTmpStr);
+boost::scoped_ptrXBitmapEntry pEntry(new 
XBitmapEntry(mpBitmapItem-GetGraphicObject(), aTmpStr));
 XBitmapListRef xBitmapList =
 XPropertyList::CreatePropertyList(XBITMAP_LIST,
 OUString(TmpList), /*TODO?*/)-AsBitmapList();
-xBitmapList-Insert( pEntry );
+xBitmapList-Insert( pEntry.get() );
 xBitmapList-SetDirty( false );
 mpFillAttrLB-Fill( xBitmapList );
 
mpFillAttrLB-SelectEntryPos(mpFillAttrLB-GetEntryCount() - 1);
 xBitmapList-Remove( 0 );
-delete pEntry;
 }
 }
 else
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx 
b/svx/source/tbxctrls/fontworkgallery.cxx
index 1f7281d..270c83c 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -52,6 +52,7 @@
 #include fontworkgallery.hrc
 
 #include algorithm
+#include boost/scoped_ptr.hpp
 
 #include helpid.hrc
 
@@ -202,10 +203,10 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
 
 if( nItemId  0 )
 {
-FmFormModel* pModel = new FmFormModel();
+boost::scoped_ptrFmFormModel pModel(new FmFormModel());
 pModel-GetItemPool().FreezeIdRanges();
 
-if( GalleryExplorer::GetSdrObj( mnThemeId, nItemId-1, pModel ) )
+if( GalleryExplorer::GetSdrObj( mnThemeId, nItemId-1, pModel.get() ) )
   

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

2014-06-21 Thread Takeshi Abe
 svx/source/dialog/_bmpmask.cxx|   26 +-
 svx/source/dialog/connctrl.cxx|   12 ++--
 svx/source/dialog/dialmgr.cxx |5 -
 svx/source/dialog/docrecovery.cxx |   13 +++--
 svx/source/dialog/grfflt.cxx  |   19 +++
 svx/source/dialog/hdft.cxx|7 +++
 6 files changed, 32 insertions(+), 50 deletions(-)

New commits:
commit 48fe2c03758dbfb68868a1746ccf1ed67167781b
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Sun Jun 22 10:40:26 2014 +0900

Avoid possible memory leaks in case of exceptions

Change-Id: Ic84b7275f3dfa9a7db47757f94d82b0036fd42da

diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 906757f..c42549d 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -33,7 +33,8 @@
 #include svx/dialogs.hrc
 #include bmpmask.hrc
 #include svx/svxids.hrc
-
+#include boost/scoped_array.hpp
+#include boost/scoped_ptr.hpp
 
 
 #define BMP_RESID(nId)  ResId(nId, DIALOG_MGR())
@@ -148,14 +149,12 @@ void MaskSet::KeyInput( const KeyEvent rKEvt )
 
 void MaskSet::onEditColor()
 {
-SvColorDialog* pColorDlg = new SvColorDialog( GetParent() );
+boost::scoped_ptrSvColorDialog pColorDlg(new SvColorDialog( GetParent() 
));
 
 pColorDlg-SetColor(GetItemColor(1));
 
 if( pColorDlg-Execute() )
 SetItemColor( 1, pColorDlg-GetColor() );
-
-delete pColorDlg;
 }
 
 
@@ -775,12 +774,12 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile rMtf )
 longnR;
 longnG;
 longnB;
-long*   pMinR = new long[nCount];
-long*   pMaxR = new long[nCount];
-long*   pMinG = new long[nCount];
-long*   pMaxG = new long[nCount];
-long*   pMinB = new long[nCount];
-long*   pMaxB = new long[nCount];
+boost::scoped_arraylong pMinR(new long[nCount]);
+boost::scoped_arraylong pMaxR(new long[nCount]);
+boost::scoped_arraylong pMinG(new long[nCount]);
+boost::scoped_arraylong pMaxG(new long[nCount]);
+boost::scoped_arraylong pMinB(new long[nCount]);
+boost::scoped_arraylong pMaxB(new long[nCount]);
 sal_uInt16  i;
 boolbReplace;
 
@@ -1006,13 +1005,6 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile rMtf 
)
 break;
 }
 }
-
-delete[] pMinR;
-delete[] pMaxR;
-delete[] pMinG;
-delete[] pMaxG;
-delete[] pMinB;
-delete[] pMaxB;
 }
 
 LeaveWait();
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index fb8f85e..bc6d869 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -34,6 +34,7 @@
 
 #include vcl/builder.hxx
 #include vcl/settings.hxx
+#include boost/scoped_ptr.hpp
 
 SvxXConnectionPreview::SvxXConnectionPreview( Window* pParent, WinBits nStyle)
 : Control(pParent, nStyle)
@@ -262,21 +263,21 @@ void SvxXConnectionPreview::MouseButtonDown( const 
MouseEvent rMEvt )
 MapMode aMapMode = GetMapMode();
 Fraction aXFrac = aMapMode.GetScaleX();
 Fraction aYFrac = aMapMode.GetScaleY();
-Fraction* pMultFrac;
+boost::scoped_ptrFraction pMultFrac;
 
 if( bZoomIn )
 {
 if( bCtrl )
-pMultFrac = new Fraction( 3, 2 );
+pMultFrac.reset(new Fraction( 3, 2 ));
 else
-pMultFrac = new Fraction( 11, 10 );
+pMultFrac.reset(new Fraction( 11, 10 ));
 }
 else
 {
 if( bCtrl )
-pMultFrac = new Fraction( 2, 3 );
+pMultFrac.reset(new Fraction( 2, 3 ));
 else
-pMultFrac = new Fraction( 10, 11 );
+pMultFrac.reset(new Fraction( 10, 11 ));
 }
 
 aXFrac *= *pMultFrac;
@@ -301,7 +302,6 @@ void SvxXConnectionPreview::MouseButtonDown( const 
MouseEvent rMEvt )
 
 Invalidate();
 }
-delete pMultFrac;
 }
 }
 
diff --git a/svx/source/dialog/docrecovery.cxx 
b/svx/source/dialog/docrecovery.cxx
index f20ab7b..f1d 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -58,6 +58,7 @@
 #include unotools/localfilehelper.hxx
 #include svtools/treelistentry.hxx
 #include officecfg/Office/Recovery.hxx
+#include boost/scoped_ptr.hpp
 
 namespace svx{
 namespace DocRecovery{
@@ -655,9 +656,9 @@ SaveDialog::SaveDialog(Window* pParent, RecoveryCore* pCore)
 IMPL_LINK_NOARG(SaveDialog, OKButtonHdl)
 {
 // start crash-save with progress
-SaveProgressDialog* pProgress = new SaveProgressDialog(this, m_pCore);
+boost::scoped_ptrSaveProgressDialog pProgress(new 
SaveProgressDialog(this, m_pCore));
 short nResult = pProgress-Execute();
-delete pProgress;
+pProgress.reset();
 
 // if CANCEL = return CANCEL
 // if 

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

2014-05-27 Thread Matúš Kukan
 svx/source/table/cell.cxx  |   14 +-
 svx/source/table/cell.hxx  |1 +
 vcl/inc/outdev.h   |2 +-
 vcl/source/outdev/font.cxx |   12 +++-
 4 files changed, 18 insertions(+), 11 deletions(-)

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

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

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

Change-Id: If15b368feeba94c8fff8ee7cbe049fc4a2069768

diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h
index dcde57c..e468ae2 100644
--- a/vcl/inc/outdev.h
+++ b/vcl/inc/outdev.h
@@ -149,7 +149,7 @@ public:
 
 ImplFontEntry*  GetFontEntry( PhysicalFontCollection*,
  const Font, const Size rPixelSize, float 
fExactHeight);
-ImplFontEntry*  GetFontEntry( PhysicalFontCollection*, 
FontSelectPattern );
+ImplFontEntry*  GetFontEntry( PhysicalFontCollection*, const 
FontSelectPattern );
 ImplFontEntry*  GetGlyphFallbackFont( PhysicalFontCollection*, 
FontSelectPattern,
 int nFallbackLevel, OUString rMissingCodes );
 voidRelease( ImplFontEntry* );
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 9e40712..d8b77db 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1227,22 +1227,23 @@ ImplFontEntry* ImplFontCache::GetFontEntry( 
PhysicalFontCollection* pFontList,
 }
 
 ImplFontEntry* ImplFontCache::GetFontEntry( PhysicalFontCollection* pFontList,
-FontSelectPattern aFontSelData )
+const FontSelectPattern rFontSelData )
 {
 // check if a directly matching logical font instance is already cached,
 // the most recently used font usually has a hit rate of 50%
 ImplFontEntry *pEntry = NULL;
 PhysicalFontFamily* pFontFamily = NULL;
 IFSD_Equal aIFSD_Equal;
-if( mpFirstEntry  aIFSD_Equal( aFontSelData, mpFirstEntry-maFontSelData 
) )
+if( mpFirstEntry  aIFSD_Equal( rFontSelData, mpFirstEntry-maFontSelData 
) )
 pEntry = mpFirstEntry;
 else
 {
-FontInstanceList::iterator it = maFontInstanceList.find( aFontSelData 
);
+FontInstanceList::iterator it = maFontInstanceList.find( rFontSelData 
);
 if( it != maFontInstanceList.end() )
 pEntry = (*it).second;
 }
 
+FontSelectPattern aFontSelData(rFontSelData);
 if( !pEntry ) // no direct cache hit
 {
 // find the best matching logical font family and update font selector 
accordingly
@@ -1315,8 +1316,9 @@ ImplFontEntry* ImplFontCache::GetFontEntry( 
PhysicalFontCollection* pFontList,
 }
 #endif
 
-// add the new entry to the cache
-maFontInstanceList[ aFontSelData ] = pEntry;
+// Add the new entry to the cache with the original FontSelectPattern,
+// so that we can find it next time as a direct cache hit.
+maFontInstanceList[ rFontSelData ] = pEntry;
 }
 
 mpFirstEntry = pEntry;
commit 5792e76cb5beb630c135f57b74f57d74dd2dc2b0
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue May 27 10:39:45 2014 +0200

Related bnc#822625: Cache minimum height for table cells.

Change-Id: I35e295347a046376289f5d4fd5468860d0b8f0ae

diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index d26d70c..20d676d 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -359,6 +359,7 @@ Cell::Cell( SdrTableObj rTableObj, OutlinerParaObject* 
pOutlinerParaObject ) th
 , mbMerged( false )
 , mnRowSpan( 1 )
 , mnColSpan( 1 )
+, mnCachedMinHeight( -1 )
 , mxTable( rTableObj.getTable() )
 {
 if( rTableObj.GetModel() )
@@ -525,6 +526,7 @@ void Cell::setMerged()
 
 void Cell::notifyModified()
 {
+mnCachedMinHeight = -1;
 if( mxTable.is() )
 mxTable-setModified( sal_True );
 }
@@ -681,8 +683,10 @@ sal_Int32 Cell::getMinimumHeight()
 if( !mpProperties )
 return 0;
 
+if( mnCachedMinHeight != -1 )
+return mnCachedMinHeight;
+
 SdrTableObj rTableObj = dynamic_cast SdrTableObj ( GetObject() );
-sal_Int32 nMinimumHeight = 0;
 
 Rectangle aTextRect;
 TakeTextAnchorRect( aTextRect );
@@ -693,7 +697,7 @@ sal_Int32 Cell::getMinimumHeight()
 if(pEditOutliner)
 {
 pEditOutliner-SetMaxAutoPaperSize(aSize);
-nMinimumHeight = pEditOutliner-GetTextHeight()+1;
+mnCachedMinHeight = pEditOutliner-GetTextHeight()+1;
 }
 else /*if ( hasText() )*/
 {
@@ -706,12 +710,12 @@ sal_Int32 Cell::getMinimumHeight()
 {
 rOutliner.SetText(*GetOutlinerParaObject());
 }
-nMinimumHeight=rOutliner.GetTextHeight()+1;
+mnCachedMinHeight=rOutliner.GetTextHeight()+1;
 rOutliner.Clear();
 }
 
-nMinimumHeight += GetTextUpperDistance() + GetTextLowerDistance();
-return 

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

2014-05-23 Thread Oliver-Rainer Wittmann
 svx/source/svdraw/svdograf.cxx|8 +---
 sw/inc/ndgrf.hxx  |2 +-
 sw/source/core/graphic/ndgrf.cxx  |   18 +-
 sw/source/filter/xml/xmltexte.cxx |   11 ++-
 4 files changed, 25 insertions(+), 14 deletions(-)

New commits:
commit 597ae8dd9c28ee370874b219d594fa1c105f2c72
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Fri May 23 14:50:23 2014 +

Resolves: #i124966# keep picture format information

- GfxLink instance - also for the reading of preview picture data

in order to avoid trouble on save in case that the preview data equals the
picture data

(cherry picked from commit d6af1b601bb8fe2569d17e01505f67e1becc9366)

Conflicts:
svx/source/svdraw/svdograf.cxx

Change-Id: Ifecb07b4d5d33d593502fccd6f21644893027d2d

diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index df6189d..5a9496f 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1352,9 +1352,11 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
 {
 pFilterData = new com::sun::star::uno::Sequence 
com::sun::star::beans::PropertyValue ( 3 );
 
-com::sun::star::awt::Size aPreviewSizeHint( 64, 64 );
-bool bAllowPartialStreamRead = true;
-bool bCreateNativeLink = false;
+const com::sun::star::awt::Size aPreviewSizeHint( 64, 
64 );
+const bool bAllowPartialStreamRead = true;
+// create GfxLink instance also for previews in 
order to avoid that its corresponding
+// data is cleared in the graphic cache entry in case 
that the preview data equals the complete graphic data
+const bool bCreateNativeLink = true;
 (*pFilterData)[ 0 ].Name = PreviewSizeHint;
 (*pFilterData)[ 0 ].Value = aPreviewSizeHint;
 (*pFilterData)[ 1 ].Name = AllowPartialStreamRead;
commit 05e07167e422caf58d23ff883edda30acc3ba88d
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Fri May 23 14:28:40 2014 +

Resolves: #i124946# only apply new embedded stream name...

for a graphic, if is already has one.

- needed correction for the fix made for issue #i114361#

(cherry picked from commit 23a4bd91ceb89e5e0a2413f80fc987db106a0bc9)

Conflicts:
sw/inc/ndgrf.hxx
sw/source/core/graphic/ndgrf.cxx
sw/source/filter/xml/xmltexte.cxx

Change-Id: Ia9771932ae5b380ccae9b0a3cbb79d41f5d9bdb8

diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 5292561..4d97b6a 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -72,7 +72,6 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode
 
 void InsertLink( const OUString rGrfName, const OUString rFltName );
 bool ImportGraphic( SvStream rStrm );
-bool HasStreamName() const { return maGrfObj.HasUserData(); }
 /** adjust return type and rename method to
indicate that its an private one. */
 
@@ -174,6 +173,7 @@ public:
 bool SwapIn( bool bWaitForData = false );
 /// Remove graphic in order to free memory.
 bool SwapOut();
+bool HasEmbeddedStreamName() const { return maGrfObj.HasUserData(); }
 /// applying new stream name for embedded graphic - needed as saving the 
document might change this stream name
 void ApplyNewEmbeddedStreamName(const OUString r)
 {
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index c868c56..00e383d 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -233,7 +233,7 @@ bool SwGrfNode::ReRead(
 else if( pGraphic  rGrfName.isEmpty() )
 {
 // Old stream must be deleted before the new one is set.
-if( HasStreamName() )
+if( HasEmbeddedStreamName() )
 DelStreamName();
 
 maGrfObj.SetGraphic( *pGraphic );
@@ -243,7 +243,7 @@ bool SwGrfNode::ReRead(
 else if( pGrfObj  rGrfName.isEmpty() )
 {
 // Old stream must be deleted before the new one is set.
-if( HasStreamName() )
+if( HasEmbeddedStreamName() )
 DelStreamName();
 
 maGrfObj = *pGrfObj;
@@ -257,7 +257,7 @@ bool SwGrfNode::ReRead(
 return true;
 else
 {
-if( HasStreamName() )
+if( HasEmbeddedStreamName() )
 DelStreamName();
 
 // create new link for the graphic object
@@ -563,7 +563,7 @@ bool SwGrfNode::SwapIn( bool bWaitForData )
 else if( maGrfObj.IsSwappedOut() )
 {
 // graphic is in storage or in a temp file
-if( !HasStreamName() )
+if( !HasEmbeddedStreamName() )
 {
 bRet = maGrfObj.SwapIn();
 }
@@ -617,7 +617,7 @@ bool SwGrfNode::SwapOut()
 // Swapping is only needed for embedded 

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

2014-05-16 Thread Michael Stahl
 svx/source/sdr/contact/objectcontactofpageview.cxx |4 +++-
 sw/source/core/text/txtfrm.cxx |2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit aa68e1309450f79d1b40545ad6c340a49eff51c6
Author: Michael Stahl mst...@redhat.com
Date:   Sat May 17 00:08:34 2014 +0200

fdo#78149: set the ViewPort even when painting to a MetaFile

ObjectContactOfPageView::DoProcessDisplay() has a special case for
painting to MetaFiles, and does not set the ViewPort from the passed-in
RedrawArea unless it's a printing or PDF export, with the result
that for a plain MetaFile all fly-frames in a Writer document
are painted, whether visible or not.

Since e2eda70f2746f08376d8cdf5e5360df217335aef now calls
GetPreviewMetaFile() after every document load, this issue is more
visible.

Since there is no obvious reason to ever ignore a passed RedrawArea,
simply always use it for the ViewPort, not just when printing.

Change-Id: I256710f1476181f567069b45a2a494b0d2064d6b

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx 
b/svx/source/sdr/contact/objectcontactofpageview.cxx
index cefbd96..864e730 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -175,12 +175,14 @@ namespace sdr
 // create ViewRange
 if(isOutputToRecordingMetaFile())
 {
-if(isOutputToPDFFile() || isOutputToPrinter())
+if (!rDisplayInfo.GetRedrawArea().IsEmpty())
 {
 // #i98402# if it's a PDF export, set the ClipRegion as 
ViewRange. This is
 // mainly because SW does not use DrawingLayer 
Page-Oriented and if not doing this,
 // all existing objects will be collected as primitives 
and processed.
 // OD 2009-03-05 #i99876# perform the same also for SW on 
printing.
+// fdo#78149 same thing also needed for plain MetaFile
+//   export, so why not do it always
 const Rectangle 
aLogicClipRectangle(rDisplayInfo.GetRedrawArea().GetBoundRect());
 
 aViewRange = basegfx::B2DRange(
commit 44c81ce21825554aad8dcebd58388cb5c0f81df8
Author: Michael Stahl mst...@redhat.com
Date:   Fri May 16 17:58:12 2014 +0200

sw: try to fix a valgrind warning

Invalid read of size 1
   at SwParaPortion::SetPrep(bool) (porlay.hxx:299)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1756)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1663)
   by SwCntntFrm::MakeAll() (calcmove.cxx:1310)
   by SwFrm::OptPrepareMake() (calcmove.cxx:356)
   by SwFrm::OptCalc() const (frame.hxx:1037)
   by SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) 
(layact.cxx:1829)
   by SwLayAction::FormatCntnt(SwPageFrm const*) (layact.cxx:1660)
   by SwLayAction::InternalAction() (layact.cxx:597)
   by SwLayAction::Action() (layact.cxx:376)
   by SwLayIdle::SwLayIdle(SwRootFrm*, SwViewImp*) (layact.cxx:2179)
 Address 0x1f9507e0 is 832 bytes inside a block of size 840 free'd
   by FixedMemPool::Free(void*) (mempool.cxx:48)
   by SwParaPortion::operator delete(void*, unsigned long) (in 
/work/lo/master/instdir/program/libswlo.so)
   by SwParaPortion::~SwParaPortion() (porlay.cxx:1972)
   by SwTxtFrm::ClearPara() (txtcache.cxx:102)
   by SwTxtFrm::Init() (txtfrm.cxx:329)
   by SwTxtFrm::CalcLineSpace() (txtfrm.cxx:746)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1680)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1663)
   by SwCntntFrm::MakeAll() (calcmove.cxx:1310)
   by SwFrm::OptPrepareMake() (calcmove.cxx:356)
   by SwFrm::OptCalc() const (frame.hxx:1037)
   by SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) 
(layact.cxx:1829)
   by SwLayAction::FormatCntnt(SwPageFrm const*) (layact.cxx:1660)
   by SwLayAction::InternalAction() (layact.cxx:597)
   by SwLayAction::Action() (layact.cxx:376)
   by SwLayIdle::SwLayIdle(SwRootFrm*, SwViewImp*) (layact.cxx:2179)

Change-Id: I64a1cc6ea301b653af951ba0e00e28d4655d2d97

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index bd4fc8c..ab0d613 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1678,6 +1678,8 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const 
void* pVoid,
 {
 pPara-SetPrepAdjust();
 CalcLineSpace();
+// possible that pPara was deleted above; retrieve it again
+pPara = aAccess.GetPara();
 InvalidateSize();
 _InvalidatePrt();
 SwFrm* pNxt;
___

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

2014-04-27 Thread Luboš Luňák
 svx/source/sdr/primitive2d/sdrattributecreator.cxx   |   27 ++-
 writerfilter/source/dmapper/TablePositionHandler.cxx |4 ++
 2 files changed, 23 insertions(+), 8 deletions(-)

New commits:
commit 313b59d787357ef3da34e2833fefcf1143b09b5e
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sun Apr 27 17:48:46 2014 +0200

fix transparency of floating tables in docx import (fdo#77723)

Normal tables do not have any fill background on their own, i.e. it's
possible to see e.g. an image in the background, so if we put a table
inside a frame in order to make it floating, make the frame transparent
in order to achieve the same result.

Change-Id: I77b1c8f847af5355c4238bfa089d760dd6121a69

diff --git a/writerfilter/source/dmapper/TablePositionHandler.cxx 
b/writerfilter/source/dmapper/TablePositionHandler.cxx
index 6909f71..ca20875 100644
--- a/writerfilter/source/dmapper/TablePositionHandler.cxx
+++ b/writerfilter/source/dmapper/TablePositionHandler.cxx
@@ -93,7 +93,7 @@ void TablePositionHandler::lcl_sprm(Sprm /*rSprm*/)
 
 uno::Sequencebeans::PropertyValue TablePositionHandler::getTablePosition() 
const
 {
-uno::Sequence beans::PropertyValue  aFrameProperties(18);
+uno::Sequence beans::PropertyValue  aFrameProperties(19);
 beans::PropertyValue* pFrameProperties = aFrameProperties.getArray();
 
 pFrameProperties[0].Name = LeftBorderDistance;
@@ -178,6 +178,8 @@ uno::Sequencebeans::PropertyValue 
TablePositionHandler::getTablePosition() con
 pFrameProperties[16].Value = nVertOrientRelation;
 pFrameProperties[17].Name = VertOrientPosition;
 pFrameProperties[17].Value = ConversionHelper::convertTwipToMM100(m_nY);
+pFrameProperties[18].Name = FillTransparence;
+pFrameProperties[18].Value = sal_Int32(100);
 
 return aFrameProperties;
 }
commit a55dac47b386cd5485ba1d828316e7695c34769b
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sun Apr 27 17:33:07 2014 +0200

fix drawing of 100% transparent frames (fdo#77723)

Without this, the 100% transparent frame is actually drawn opaque.

Change-Id: Ibaaeead7fe2379d48ea9680719a082e322b7b0c9

diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx 
b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index ea4bbb9..4726d06 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -383,15 +383,15 @@ namespace drawinglayer
 {
 const XFillStyle 
eStyle(((XFillStyleItem)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
 
-if(XFILL_NONE != eStyle)
-{
-sal_uInt16 nTransparence(((const 
XFillTransparenceItem)(rSet.Get(XATTR_FILLTRANSPARENCE))).GetValue());
+sal_uInt16 nTransparence(((const 
XFillTransparenceItem)(rSet.Get(XATTR_FILLTRANSPARENCE))).GetValue());
 
-if(nTransparence  100)
-{
-nTransparence = 100;
-}
+if(nTransparence  100)
+{
+nTransparence = 100;
+}
 
+if(XFILL_NONE != eStyle)
+{
 if(100 != nTransparence)
 {
 // need to check XFillFloatTransparence, object fill may 
still be completely transparent
@@ -494,6 +494,19 @@ namespace drawinglayer
 }
 }
 
+if(nTransparence == 100)
+{
+attribute::FillGradientAttribute aGradient;
+attribute::FillHatchAttribute aHatch;
+attribute::SdrFillGraphicAttribute aFillGraphic;
+return attribute::SdrFillAttribute(
+1,
+basegfx::BColor( 0, 0, 0 ),
+aGradient,
+aHatch,
+aFillGraphic);
+}
+
 return attribute::SdrFillAttribute();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-20 Thread Julien Nabet
 svx/source/items/svxerr.src   |4 ++--
 sw/source/ui/index/cnttab.cxx |2 +-
 vcl/ios/iosinst.cxx   |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 80915b8f21f0745cd4de2c4bb72fba24a0ffebcd
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Apr 20 22:54:18 2014 +0200

cppcheck: Prefer prefix ++/-- operators for non-primitive types

Change-Id: Ic24715d86b3f822babd236ac73c041f3a5c1d92b

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index ff0857b..0e44b97 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2282,7 +2282,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, 
pBox)
 m_pAuthFieldsLB-RemoveEntry(nLstBoxPos);
 }
 
-aIt++; // #i21237#
+++aIt; // #i21237#
 }
 m_pAuthFieldsLB-SelectEntryPos(0);
 }
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx
index 91735bb..b4fa76a 100644
--- a/vcl/ios/iosinst.cxx
+++ b/vcl/ios/iosinst.cxx
@@ -301,7 +301,7 @@ IMPL_LINK( IosSalInstance, DisplayConfigurationChanged, 
void*, )
 {
 for( std::list SalFrame* ::const_iterator it = getFrames().begin();
  it != getFrames().end();
- it++ ) {
+ ++it ) {
 (*it)-Show( false, false );
 (*it)-CallCallback( SALEVENT_SETTINGSCHANGED, 0 );
 (*it)-SetPosSize(0, 0, viewWidth, viewHeight, SAL_FRAME_POSSIZE_WIDTH 
| SAL_FRAME_POSSIZE_HEIGHT);
@@ -343,7 +343,7 @@ IMPL_LINK( IosSalInstance, RenderWindows, 
RenderWindowsArg*, arg )
 
 for( std::list SalFrame* ::const_reverse_iterator it = 
getFrames().rbegin();
  it != getFrames().rend();
- it++ ) {
+ ++it ) {
 IosSalFrame *pFrame = static_castIosSalFrame *(*it);
 SalFrameGeometry aGeom = pFrame-GetGeometry();
 CGRect bbox = CGRectMake( 0, 0, aGeom.nWidth, aGeom.nHeight );
commit 664c175e33a04f36e8af8a4a5e885542d2e22f7a
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Apr 20 20:45:30 2014 +0200

cpplint: invalid UTF-8 + punctuation

Change-Id: I31871db6f344e90c54ed9efb51b9576cd36d9fa8

diff --git a/svx/source/items/svxerr.src b/svx/source/items/svxerr.src
index 90a0b8c..1feaed2 100644
--- a/svx/source/items/svxerr.src
+++ b/svx/source/items/svxerr.src
@@ -112,9 +112,9 @@ Resource RID_SVXERRCODE
 
 String ERRCODE_SVX_MODIFIED_VBASIC_STORAGE  ERRCODE_RES_MASK
 {
-//  TEXT = Der Basic-Code wurde verändert und kann somit nicht mehr als 
Original gespeichert werden. ;
+//  TEXT = Der Basic-Code wurde verändert und kann somit nicht mehr als 
Original gespeichert werden. ;
 //  TEXT [ English ] = The Basic-Code is modified and so it can not be 
saved as original. ;
-Text [ en-US ] = All changes to the Basic Code are lost.The original 
VBA Macro Code is saved instead.;
+Text [ en-US ] = All changes to the Basic Code are lost. The original 
VBA Macro Code is saved instead.;
 };
 
 String ERRCODE_SVX_VBASIC_STORAGE_EXIST  ERRCODE_RES_MASK
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-15 Thread Tor Lillqvist
 svx/source/toolbars/extrusionbar.cxx |2 +-
 svx/source/toolbars/fontworkbar.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b1b18894cae8fc080331ef2020a48c581d113746
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Apr 15 10:43:03 2014 +0300

WaE: 'bOn' may be used uninitialized in this function

Change-Id: I6f715ffa264a4642c9a4470988383a18ddd9432b

diff --git a/svx/source/toolbars/fontworkbar.cxx 
b/svx/source/toolbars/fontworkbar.cxx
index b838520..83a1ee1 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -275,7 +275,7 @@ static void impl_execute( SdrView*, SfxRequest rReq, 
SdrCustomShapeGeometryItem
 com::sun::star::uno::Any* pAny = 
rGeometryItem.GetPropertyValueByName( sTextPath, sSameLetterHeights );
 if( pAny )
 {
-bool bOn;
+bool bOn = false;
 (*pAny) = bOn;
 bOn = !bOn;
 (*pAny) = bOn;
commit 9d101a302caca8271ce3d93e0d7f31129a61224e
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Apr 15 10:42:13 2014 +0300

WaE: 'bHarsh2' may be used uninitialized in this function

Change-Id: I900545e1556ddf8b76453d7fb189a2fc79f8744c

diff --git a/svx/source/toolbars/extrusionbar.cxx 
b/svx/source/toolbars/extrusionbar.cxx
index 06169c7..2ad2b3b 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -407,7 +407,7 @@ static void impl_execute( SdrView*, SfxRequest rReq, 
SdrCustomShapeGeometryItem
 sal_Int32 nLevel = ((const 
SfxInt32Item*)rReq.GetArgs()-GetItem(SID_EXTRUSION_LIGHTING_INTENSITY))-GetValue();
 
 double fBrightness;
-bool bHarsh2;
+bool bHarsh2 = false;
 double fLevel1;
 double fLevel2;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-11 Thread Norbert Thiebaud
 svx/source/sidebar/tools/ValueSetWithTextControl.cxx |7 +++
 svx/source/stbctrls/modctrl.cxx  |4 ++--
 svx/source/stbctrls/pszctrl.cxx  |3 +--
 svx/source/stbctrls/selctrl.cxx  |4 ++--
 svx/source/stbctrls/xmlsecctrl.cxx   |2 --
 svx/source/stbctrls/zoomsliderctrl.cxx   |4 ++--
 svx/source/tbxctrls/tbcontrl.cxx |4 ++--
 sw/source/core/uibase/utlui/content.cxx  |2 --
 sw/source/core/uibase/utlui/viewlayoutctrl.cxx   |3 +--
 vcl/source/window/toolbox2.cxx   |3 +--
 vcl/source/window/window.cxx |   10 --
 11 files changed, 22 insertions(+), 24 deletions(-)

New commits:
commit 58fae0f715433a72d814584d97a1368f8a1b62d2
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Tue Mar 11 15:43:48 2014 -0500

remove osolete ifdef

now that the ScaleDPI is forced to 1 on mac there is no need
for these ifdef

Change-Id: I0ca3bc301b63f5f4c7d1eb36f27bc9b6ab41af29

diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx 
b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index 51c157f..5dd6e99 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -101,7 +101,6 @@ void ValueSetWithTextControl::AddItem(
 ? *pSelectedItemImage
 : rItemImage;
 
-#ifndef MACOSX
 if ( GetDPIScaleFactor()  1 )
 {
 BitmapEx b = aItem.maItemImage.GetBitmapEx();
@@ -115,7 +114,7 @@ void ValueSetWithTextControl::AddItem(
 aItem.maSelectedItemImage = Image(b);
 }
 }
-#endif
+
 aItem.maItemText = rItemText;
 
 maItems.push_back( aItem );
@@ -169,7 +168,7 @@ void ValueSetWithTextControl::ReplaceItemImages(
  ? *pSelectedItemImage
  : rItemImage;
 
-#ifndef MACOSX
+//#ifndef MACOSX
 if ( GetDPIScaleFactor()  1 )
 {
 BitmapEx b = maItems[nItemId-1].maItemImage.GetBitmapEx();
@@ -183,7 +182,7 @@ void ValueSetWithTextControl::ReplaceItemImages(
 maItems[nItemId-1].maSelectedItemImage = Image(b);
 }
 }
-#endif
+//#endif
 }
 
 
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index 3d7c577..15bc693 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -73,7 +73,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, 
sal_uInt16 _nId, Status
 SfxStatusBarControl( _nSlotId, _nId, rStb ),
 mpImpl(new ImplData)
 {
-#ifndef MACOSX
+//#ifndef MACOSX
 if ( rStb.GetDPIScaleFactor()  1 )
 {
 for (int i = 0; i  mpImpl-MODIFICATION_STATE_SIZE; i++)
@@ -83,7 +83,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, 
sal_uInt16 _nId, Status
 mpImpl-maImages[i] = Image(b);
 }
 }
-#endif
+//#endif
 mpImpl-maTimer.SetTimeoutHdl( LINK(this, SvxModifyControl, OnTimer) );
 }
 
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index 634badf..a3383fe 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -178,7 +178,6 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( 
sal_uInt16 _nSlotId,
 pImp-aPosImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) );
 pImp-aSizeImage = Image( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) );
 
-#ifndef MACOSX
 if ( rStb.GetDPIScaleFactor()  1)
 {
 BitmapEx b = pImp-aPosImage.GetBitmapEx();
@@ -189,7 +188,7 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( 
sal_uInt16 _nSlotId,
 b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), 
BMP_SCALE_FAST);
 pImp-aSizeImage = Image(b);
 }
-#endif
+
 addStatusListener( OUString( STR_POSITION )); // SID_ATTR_POSITION
 addStatusListener( OUString( STR_TABLECELL ));   // SID_TABLE_CELL
 addStatusListener( OUString( STR_FUNC ));// SID_PSZ_FUNCTION
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index a56cd0a..acfb2da 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -80,14 +80,14 @@ SvxSelectionModeControl::SvxSelectionModeControl( 
sal_uInt16 _nSlotId,
 mnState( 0 ),
 maImage( SVX_RES( RID_SVXBMP_SELECTION ) )
 {
-#ifndef MACOSX
+//#ifndef MACOSX
 if ( GetStatusBar().GetDPIScaleFactor()  1 )
 {
 BitmapEx b = maImage.GetBitmapEx();
 b.Scale(GetStatusBar().GetDPIScaleFactor(), 
GetStatusBar().GetDPIScaleFactor(), BMP_SCALE_FAST);
 maImage = Image(b);
 }
-#endif
+//#endif
 GetStatusBar().SetItemText( GetId(),  );
 }
 
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx 
b/svx/source/stbctrls/xmlsecctrl.cxx
index 1ecfd52..46ea35b 100644
--- 

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

2014-01-28 Thread Michael Stahl
 svx/source/tbxctrls/tbcontrl.cxx |7 +--
 sw/source/core/fields/reffld.cxx |   30 +++---
 2 files changed, 24 insertions(+), 13 deletions(-)

New commits:
commit d9896aeeedb0ca03bec65df23e2fd96f30239619
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jan 28 20:45:20 2014 +0100

fix bad cast in SvxStyleBox_Impl::StateChanged()

This causes various JunitTest crashes on Windows, regression from
887bc4dd3e62fe6dd19dc9d1c3ba273a5b21b5ec.

Change-Id: Iab24e0d39375ac1e5ac63d32470dca1e54d518c5

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 5284816..0a96bd0 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -596,7 +596,10 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent 
rUDEvt )
 Size aPixelSize( pDevice-LogicToPixel( aFontSize, 
pShell-GetMapUnit() ) );
 
 // setup the font properties
-Font aFont( pFontItem-GetFamilyName(), 
pFontItem-GetStyleName(), aPixelSize );
+SvxFont aFont;
+aFont.SetName(pFontItem-GetFamilyName());
+aFont.SetStyleName(pFontItem-GetStyleName());
+aFont.SetSize(aPixelSize);
 
 const SfxPoolItem *pItem = aItemSet.GetItem( 
SID_ATTR_CHAR_WEIGHT );
 if ( pItem )
@@ -632,7 +635,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent 
rUDEvt )
 
 pItem = aItemSet.GetItem( SID_ATTR_CHAR_CASEMAP );
 if ( pItem )
-((SvxFont )aFont).SetCaseMap( static_cast const 
SvxCaseMapItem* ( pItem )-GetCaseMap() );
+aFont.SetCaseMap(static_castconst 
SvxCaseMapItem*(pItem)-GetCaseMap());
 
 pItem = aItemSet.GetItem( SID_ATTR_CHAR_EMPHASISMARK );
 if ( pItem )
commit 8676c2157a0d294dabd967b9591f48ba2ec95ac1
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jan 28 17:04:24 2014 +0100

sw: style cleanup in GetFieldIdsFromDoc

Change-Id: Ib7141b47d5c2a27b75e47756adb4c644aace721a

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 2974c7b..1288582 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -950,17 +950,23 @@ typedef boost::ptr_vector_RefIdsMap _RefIdsMaps;
 /// @param[in,out] rIds The list of IDs found in the document.
 void _RefIdsMap::GetFieldIdsFromDoc( SwDoc rDoc, std::setsal_uInt16 rIds)
 {
-const SwTxtNode* pNd;
-SwFieldType* pType;
+SwFieldType *const pType = rDoc.GetFldType(RES_SETEXPFLD, aName, false);
 
-if( 0 != ( pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
+if (!pType)
+return;
+
+SwIteratorSwFmtFld,SwFieldType aIter( *pType );
+for (SwFmtFld const* pF = aIter.First(); pF; pF = aIter.Next())
 {
-SwIteratorSwFmtFld,SwFieldType aIter( *pType );
-for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
-if( pF-GetTxtFld() 
-0 != ( pNd = pF-GetTxtFld()-GetpTxtNode() ) 
-pNd-GetNodes().IsDocNodes() )
-rIds.insert( ((SwSetExpField*)pF-GetField())-GetSeqNumber() 
);
+if (pF-GetTxtFld())
+{
+SwTxtNode const*const pNd = pF-GetTxtFld()-GetpTxtNode();
+if (pNd  pNd-GetNodes().IsDocNodes())
+{
+rIds.insert(static_castSwSetExpField const*(pF-GetField())
+-GetSeqNumber());
+}
+}
 }
 }
 
@@ -999,8 +1005,10 @@ void _RefIdsMap::Init( SwDoc rDoc, SwDoc rDestDoc, bool 
bField )
 for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
 if( pF-GetTxtFld() )
 {
-sal_uInt16 n = 
((SwSetExpField*)pF-GetField())-GetSeqNumber( );
-((SwSetExpField*)pF-GetField())-SetSeqNumber( 
sequencedIds[ n ] );
+SwSetExpField *const pSetExp(
+static_castSwSetExpField *(pF-GetField()));
+sal_uInt16 const n = pSetExp-GetSeqNumber();
+pSetExp-SetSeqNumber( sequencedIds[n] );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-23 Thread Caolán McNamara
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |7 ---
 sw/source/core/doc/docedt.cxx  |8 ++--
 2 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 5a4766857ad3c9172847197a262e25c1926cbab2
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jan 23 16:07:04 2014 +

coverity#1158448 Uninitialized scalar field

Change-Id: I189503d88d54b32b20d5f866687214cb4af35200

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 2816f8d..2a0a14a 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -60,7 +60,9 @@ struct _SaveRedline
 sal_Int32 nEndCnt;
 
 _SaveRedline( SwRangeRedline* pR, const SwNodeIndex rSttIdx )
-: pRedl( pR )
+: pRedl(pR)
+, nEnd(0)
+, nEndCnt(0)
 {
 const SwPosition* pStt = pR-Start(),
 * pEnd = pR-GetMark() == pStt ? pR-GetPoint() : pR-GetMark();
@@ -80,7 +82,9 @@ struct _SaveRedline
 }
 
 _SaveRedline( SwRangeRedline* pR, const SwPosition rPos )
-: pRedl( pR )
+: pRedl(pR)
+, nEnd(0)
+, nEndCnt(0)
 {
 const SwPosition* pStt = pR-Start(),
 * pEnd = pR-GetMark() == pStt ? pR-GetPoint() : pR-GetMark();
commit 4bc75ba3eb07bac4c079d5de8cac6de10d93c0f1
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jan 23 16:05:25 2014 +

coverity#1158462 Uninitialized pointer field

Change-Id: Ie5b72f4d3f357e76e233ccf412e2f5863a6999dc

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 8cedb04..2cbdc93 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -348,9 +348,10 @@ css::uno::Reference css::frame::XStatusListener  
SearchToolbarControllersManag
 // FindTextToolbarController
 
 FindTextToolbarController::FindTextToolbarController( const 
css::uno::Reference css::uno::XComponentContext  rxContext )
-:svt::ToolboxController( rxContext,
-css::uno::Reference css::frame::XFrame (),
-OUString(COMMAND_FINDTEXT) )
+: svt::ToolboxController(rxContext, css::uno::Reference 
css::frame::XFrame (), OUString(COMMAND_FINDTEXT))
+, m_pFindTextFieldControl(NULL)
+, m_nDownSearchId(0)
+, m_nUpSearchId(0)
 {
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - svx/source sw/source sw/uiconfig sw/UIConfig_swriter.mk

2013-12-17 Thread Caolán McNamara
 svx/source/gallery2/galmisc.cxx |   20 ++-
 sw/UIConfig_swriter.mk  |1 
 sw/source/ui/config/optload.cxx |   11 +---
 sw/source/ui/inc/optload.hxx|5 -
 sw/uiconfig/swriter/ui/captiondialog.ui |   81 
 5 files changed, 104 insertions(+), 14 deletions(-)

New commits:
commit 2e4360815b08e1b5bd7233509d033b5a49b7c61e
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 17 10:21:49 2013 +

fix caption dialog

Change-Id: I499f47b116ff6957bbbc20b91224fe95593d1da1

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 441cc43..2787065 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/bulletsandnumbering \
sw/uiconfig/swriter/ui/businessdatapage \
sw/uiconfig/swriter/ui/cannotsavelabeldialog \
+   sw/uiconfig/swriter/ui/captiondialog \
sw/uiconfig/swriter/ui/captionoptions \
sw/uiconfig/swriter/ui/cardformatpage \
sw/uiconfig/swriter/ui/cardmediumpage \
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 8196d48..3eef208 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -312,15 +312,12 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl)
 return 0;
 }
 
-SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet) :
-SfxNoLayoutSingleTabDialog(pParent, rSet, 0)
+SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet)
+: SfxSingleTabDialog(pParent, rSet, CaptionDialog,
+modules/swriter/ui/captiondialog.ui)
 {
 // create TabPage
-SetTabPage((SwCaptionOptPage*) SwCaptionOptPage::Create(this, rSet));
-}
-
-SwCaptionOptDlg::~SwCaptionOptDlg()
-{
+setTabPage(SwCaptionOptPage::Create(get_content_area(), rSet));
 }
 
 SwCaptionPreview::SwCaptionPreview( Window* pParent, WinBits nStyle )
diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx
index 7825ab5..0ee5023 100644
--- a/sw/source/ui/inc/optload.hxx
+++ b/sw/source/ui/inc/optload.hxx
@@ -69,11 +69,10 @@ public:
 virtual voidReset( const SfxItemSet rSet );
 };
 
-class SwCaptionOptDlg : public SfxNoLayoutSingleTabDialog
+class SwCaptionOptDlg : public SfxSingleTabDialog
 {
 public:
- SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet);
-~SwCaptionOptDlg();
+SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet);
 };
 
 class CaptionComboBox : public SwComboBox
diff --git a/sw/uiconfig/swriter/ui/captiondialog.ui 
b/sw/uiconfig/swriter/ui/captiondialog.ui
new file mode 100644
index 000..0b6e2d2
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/captiondialog.ui
@@ -0,0 +1,81 @@
+?xml version=1.0 encoding=UTF-8?
+interface
+  !-- interface-requires gtk+ 3.0 --
+  object class=GtkDialog id=CaptionDialog
+property name=can_focusFalse/property
+property name=border_width6/property
+property name=title translatable=yesCaption/property
+property name=type_hintdialog/property
+child internal-child=vbox
+  object class=GtkBox id=dialog-vbox1
+property name=can_focusFalse/property
+property name=orientationvertical/property
+property name=spacing12/property
+child internal-child=action_area
+  object class=GtkButtonBox id=dialog-action_area1
+property name=can_focusFalse/property
+property name=layout_styleend/property
+child
+  object class=GtkButton id=ok
+property name=labelgtk-ok/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property name=can_defaultTrue/property
+property name=has_defaultTrue/property
+property name=receives_defaultTrue/property
+property name=use_stockTrue/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=position0/property
+  /packing
+/child
+child
+  object class=GtkButton id=cancel
+property name=labelgtk-cancel/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property name=receives_defaultTrue/property
+property name=use_stockTrue/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=position1/property
+  /packing
+/child
+child
+  object class=GtkButton id=help
+property name=labelgtk-help/property
+property name=visibleTrue/property
+  

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

2013-12-11 Thread Caolán McNamara
 svx/source/table/accessibletableshape.cxx |1 +
 svx/source/table/svdotable.cxx|   20 +++-
 2 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 1c28065d8fe3e9a1394a7ecfc29e95a9639a1012
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Dec 11 11:57:34 2013 +

disposed but not dtored

just die when you are supposed to, without this endless amounts of 
accessiblity
cells remain after sorting slides with tables in them

Change-Id: Ice9a86b8b806e58f9bf871341a38f7729798dda9

diff --git a/svx/source/table/accessibletableshape.cxx 
b/svx/source/table/accessibletableshape.cxx
index b423a75..9d1ab93 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -132,6 +132,7 @@ void AccessibleTableShapeImpl::dispose()
 {
 (*iter).second-dispose();
 }
+maChildMap.clear();
 Reference XModifyListener  xListener( this );
 mxTable-removeModifyListener( xListener );
 mxTable.clear();
commit 0b8e2e5efe20519e8b5563314bac0cbb84a3b967
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 10 16:54:59 2013 +

correctly dispose to avoid cyclic dependencies

accessibility cruft is still listening to dead tables so crashes in
slidesorting in main panel if moved slide has tables in it after visiting 
slide
sorter once.

Change-Id: I09f9a73b01fb2ddf059402146acdc7bd823798b9

diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 1cc828e..9009aa6 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -266,9 +266,9 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 
nColumns, sal_Int32 n
 mpTableObj = pTable;
 mxTable = new TableModel( pTable );
 mxTable-init( nColumns, nRows );
-mpLayouter = new TableLayouter( mxTable );
 Reference XModifyListener  xListener( static_cast 
::com::sun::star::util::XModifyListener* (this) );
 mxTable-addModifyListener( xListener );
+mpLayouter = new TableLayouter( mxTable );
 LayoutTable( mpTableObj-aRect, true, true );
 mpTableObj-maLogicRect = mpTableObj-aRect;
 }
@@ -279,6 +279,8 @@ SdrTableObjImpl SdrTableObjImpl::operator=( const 
SdrTableObjImpl rSource )
 {
 if (this != rSource)
 {
+disconnectTableStyle();
+
 if( mpLayouter )
 {
 delete mpLayouter;
@@ -303,6 +305,8 @@ SdrTableObjImpl SdrTableObjImpl::operator=( const 
SdrTableObjImpl rSource )
 ApplyCellStyles();
 mpTableObj-aRect = mpTableObj-maLogicRect;
 LayoutTable( mpTableObj-aRect, false, false );
+
+connectTableStyle();
 }
 return *this;
 }
@@ -449,8 +453,22 @@ bool SdrTableObjImpl::ApplyCellStyles()
 
 void SdrTableObjImpl::dispose()
 {
+disconnectTableStyle();
+mxTableStyle.clear();
+
+if( mpLayouter )
+{
+delete mpLayouter;
+mpLayouter = 0;
+}
+
 if( mxTable.is() )
+{
+Reference XModifyListener  xListener( static_cast 
::com::sun::star::util::XModifyListener* (this) );
+mxTable-removeModifyListener( xListener );
 mxTable-dispose();
+mxTable.clear();
+}
 }
 
 // 
-
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-11-27 Thread Stephan Bergmann
 svx/source/accessibility/ShapeTypeHandler.cxx |2 --
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx |2 --
 2 files changed, 4 deletions(-)

New commits:
commit e556e2890ca2baaf05a2694463b15aee6b803454
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 27 16:48:05 2013 +0100

-Werror,-Wunused-variable

Change-Id: Ia202059eb891b1088dc276c963e16ede93fe8d05

diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx 
b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index e433f67..a4b25dd 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -345,7 +345,6 @@ void SvxPixelCtlAccessible::grabFocus(  ) throw 
(uno::RuntimeException)
 sal_Int32 SvxPixelCtlAccessible::getForeground(  )
 throw (::com::sun::star::uno::RuntimeException)
 {
-uno::Any aRet;
 ::osl::MutexGuard   aGuard( m_aMutex );
 IsValid();
 return pPixelCtl-GetControlForeground().GetColor();
@@ -354,7 +353,6 @@ sal_Int32 SvxPixelCtlAccessible::getForeground(  )
 sal_Int32 SvxPixelCtlAccessible::getBackground(  )
 throw (::com::sun::star::uno::RuntimeException)
 {
-uno::Any aRet;
 ::osl::MutexGuard   aGuard( m_aMutex );
 IsValid();
 return pPixelCtl-GetControlBackground().GetColor();
commit 2733831474036f4893e8a90795f5799279d151d0
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 27 16:47:32 2013 +0100

-Werror,-Wunused-variable

Change-Id: Id3e24e7efd84db03d0d1636bf099bac3fede55db

diff --git a/svx/source/accessibility/ShapeTypeHandler.cxx 
b/svx/source/accessibility/ShapeTypeHandler.cxx
index f23b9ab..dc3fb56 100644
--- a/svx/source/accessibility/ShapeTypeHandler.cxx
+++ b/svx/source/accessibility/ShapeTypeHandler.cxx
@@ -306,8 +306,6 @@ OUString
 SdrObject *pSdrObj = pShape-GetSdrObject();
 if (pSdrObj)
 {
-OUString aTmp(pSdrObj-TakeObjNameSingul());
-
 if(pSdrObj-ISA(SdrObjCustomShape))
 {
 SdrObjCustomShape* pCustomShape = 
(SdrObjCustomShape*)pSdrObj;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - svx/source sw/AllLangResTarget_sw.mk sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk

2013-08-23 Thread Caolán McNamara
 svx/source/svdraw/svdibrow.cxx  |  127 +++
 sw/AllLangResTarget_sw.mk   |1 
 sw/UIConfig_swriter.mk  |1 
 sw/inc/globals.hrc  |1 
 sw/inc/helpid.h |4 
 sw/source/ui/chrdlg/ccoll.cxx   |1 
 sw/source/ui/chrdlg/ccoll.hrc   |   43 -
 sw/source/ui/chrdlg/ccoll.src   |  157 --
 sw/source/ui/chrdlg/swuiccoll.cxx   |  178 ++---
 sw/source/ui/inc/swuiccoll.hxx  |   22 +-
 sw/uiconfig/swriter/ui/conditionpage.ui |  266 
 11 files changed, 427 insertions(+), 374 deletions(-)

New commits:
commit 6243704ca068a9c2e3ae4c743bdf98630eb831e8
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Aug 23 11:01:35 2013 +0100

convert condition page to .ui

Change-Id: Ifd05bdb46cd0cbbce09bd91a3fbf78d6eac0d8c5

diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 14cbfdd..5305e4d 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -67,7 +67,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
 sw/source/ui/app/app.src \
 sw/source/ui/app/error.src \
 sw/source/ui/app/mn.src \
-sw/source/ui/chrdlg/ccoll.src \
 sw/source/ui/chrdlg/chrdlg.src \
 sw/source/ui/config/mailconfigpage.src \
 sw/source/ui/config/optcomp.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 8dfb01a..9daa0a3 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -76,6 +76,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/columndialog \
sw/uiconfig/swriter/ui/columnpage \
sw/uiconfig/swriter/ui/columnwidth \
+   sw/uiconfig/swriter/ui/conditionpage \
sw/uiconfig/swriter/ui/converttexttable \
sw/uiconfig/swriter/ui/createauthorentry \
sw/uiconfig/swriter/ui/createautomarkdialog \
diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index a65c7b5..122514e 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -129,7 +129,6 @@
 
 #define TP_CONTENT_OPT  (RC_GLOBALS_BEGIN +  45)
 #define TP_STD_FONT (RC_GLOBALS_BEGIN +  47)
-#define TP_CONDCOLL (RC_GLOBALS_BEGIN +  48)
 
 #define TP_NUMBER   (RC_GLOBALS_BEGIN +  57)
 
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 8fc895a..e8c86d2 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -136,8 +136,6 @@
 
 // TabPage Help-IDs
 
-#define HID_COND_COLL   
SW_HID_COND_COLL
-
 #define HID_REDLINE_CTRL
SW_HID_REDLINE_CTRL
 #define HID_OPTCAPTION_PAGE 
SW_HID_OPTCAPTION_PAGE
 #define HID_TP_TOX_SELECT   
SW_HID_TP_TOX_SELECT
@@ -307,8 +305,6 @@
 #define HID_CALC_TOOLBOX
SW_HID_CALC_TOOLBOX
 #define HID_PVIEW_TOOLBOX   
SW_HID_PVIEW_TOOLBOX
 
-#define HID_COND_COLL_TABLIST   
SW_HID_COND_COLL_TABLIST
-
 #define HID_SELECT_TEMPLATE 
SW_HID_SELECT_TEMPLATE
 
 #define HID_AP_INSERT_DB_SEL
SW_HID_AP_INSERT_DB_SEL
diff --git a/sw/source/ui/chrdlg/ccoll.cxx b/sw/source/ui/chrdlg/ccoll.cxx
index 7968527..4039495 100644
--- a/sw/source/ui/chrdlg/ccoll.cxx
+++ b/sw/source/ui/chrdlg/ccoll.cxx
@@ -36,7 +36,6 @@
 #include hints.hxx
 
 #include chrdlg.hrc
-#include ccoll.hrc
 #include vcl/svapp.hxx
 
 #include unomid.h
diff --git a/sw/source/ui/chrdlg/ccoll.hrc b/sw/source/ui/chrdlg/ccoll.hrc
deleted file mode 100644
index 605fc8e..000
--- a/sw/source/ui/chrdlg/ccoll.hrc
+++ /dev/null
@@ -1,43 +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 .
- */
-
-#ifndef _CCOLL_HRC
-#define _CCOLL_HRC
-
-// #define **
-
-#define CB_CONDITION1
-#define FL_CONDITION2
-#define FT_CONTEXT  3
-#define 

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

2013-07-11 Thread Andras Timar
 svx/source/xoutdev/_xoutbmp.cxx   |1 -
 sw/source/filter/html/htmlfly.cxx |6 ++
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 0b48a9b5e05e57306d7f3a32d2be01bb352b0d18
Author: Andras Timar ati...@suse.com
Date:   Thu Jul 11 15:17:15 2013 +0200

remove unused headers

Change-Id: I3345e6322a9aa25239df98033b8436ec377e197f

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 40f9f7f..bad0533 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -31,7 +31,6 @@
 #include vcl/graphicfilter.hxx
 #include vcl/cvtgrf.hxx
 #include sax/tools/converter.hxx
-#include svtools/htmlkywd.hxx
 
 #define FORMAT_BMP  OUString(bmp)
 #define FORMAT_GIF  OUString(gif)
commit e6fb87e6039de7d871563cd14b5b9d21129cd216
Author: Andras Timar ati...@suse.com
Date:   Thu Jul 11 15:15:08 2013 +0200

statement aligned as second statement in if body but not in a statement 
block

Change-Id: I0d691c75cc5477b3b0f9c6f6f2dc420a51751201

diff --git a/sw/source/filter/html/htmlfly.cxx 
b/sw/source/filter/html/htmlfly.cxx
index 0bac1d7..fb7ac88 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -1220,16 +1220,14 @@ Writer OutHTML_BulletImage( Writer rWrt,
 const Graphic* pGrf = pBrush-GetGraphic();
 if( pGrf )
 {
-const Graphic* aGraphic = pBrush-GetGraphic();
-sal_uLong nErr = XOutBitmap::GraphicToBase64(*aGraphic, 
aGraphicInBase64);
+sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, 
aGraphicInBase64);
 if( nErr )
 {
 rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE;
 }
-// Grafik als (JPG-)File speichern
 if( rHTMLWrt.GetOrigFileName() )
 rGrfName = *rHTMLWrt.GetOrigFileName();
-pLink = rGrfName;
+pLink = rGrfName;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-06-20 Thread Thorsten Behrens
 svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx |4 -
 vcl/source/gdi/bitmapex.cxx |   34 ++--
 2 files changed, 7 insertions(+), 31 deletions(-)

New commits:
commit 77b273ee3a2df87664262418c360d3a4a0ed48ea
Author: Thorsten Behrens tbehr...@suse.com
Date:   Fri Jun 14 13:26:43 2013 +0200

Fixup alpha bitmap generation for Windows.

This improves upon d6f58fd25eeca84a94528409a05b80aa5172b8b8 by
using the BitmapEx ctor instead of manual initialisation. Several
EMF+ files would otherwise show up horribly mangled on Windows.

Change-Id: I1808cb45818f3f0118653164c83c49d6134b9324
(cherry picked from commit fefab3bb38f55471d9fa9316d1249ad00adefc37)

diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 227e630..e123ac2 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -787,9 +787,6 @@ bool BitmapEx::Create( const 
::com::sun::star::uno::Reference
::com::sun::star::rendering::XBitmapCanvas  
xBitmapCanvas,
const Size rSize )
 {
-SetEmpty();
-Size aSize( rSize );
-
 uno::Reference beans::XFastPropertySet  xFastPropertySet( xBitmapCanvas, 
uno::UNO_QUERY );
 if( xFastPropertySet.get() )
 {
@@ -809,38 +806,17 @@ bool BitmapEx::Create( const 
::com::sun::star::uno::Reference
 pSalBmp = ImplGetSVData()-mpDefInst-CreateSalBitmap();
 pSalMask = ImplGetSVData()-mpDefInst-CreateSalBitmap();
 
-if( pSalBmp-Create( xBitmapCanvas, aSize ) )
+Size aLocalSize(rSize);
+if( pSalBmp-Create( xBitmapCanvas, aLocalSize ) )
 {
-#ifdef CLAMP_BITDEPTH_PARANOIA
-// did we get alpha mixed up in the bitmap itself
-// eg. Cairo Canvas ... yes performance of this is awful.
-if( pSalBmp-GetBitCount()  24 )
-{
-// Format convert the pixels with generic code
-Bitmap aSrcPixels( pSalBmp );
-aBitmap = Bitmap( rSize, 24 );
-BitmapReadAccess aSrcRead( aSrcPixels );
-BitmapWriteAccess aDestWrite( aBitmap );
-aDestWrite.CopyBuffer( aSrcRead );
-}
-else
-#endif
-aBitmap = Bitmap( pSalBmp );
-
-aBitmapSize = rSize;
-if ( pSalMask-Create( xBitmapCanvas, aSize, true ) )
+if ( pSalMask-Create( xBitmapCanvas, aLocalSize, true ) )
 {
-aMask = Bitmap( pSalMask );
-bAlpha = sal_True;
-aBitmapSize = rSize;
-eTransparent = !aMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP;
-
+*this = BitmapEx(Bitmap(pSalBmp), Bitmap(pSalMask) );
 return true;
 }
 else
 {
-bAlpha = sal_False;
-eTransparent = TRANSPARENT_NONE;
+*this = BitmapEx(Bitmap(pSalBmp));
 return true;
 }
 }
commit fbb7c74a2c5cd37d4ff27deb154656655f047bbc
Author: Tor Lillqvist t...@iki.fi
Date:   Wed Jun 12 17:04:49 2013 +0300

Don't display the broken OLE link icon except on Windows

Change-Id: Iede3d98ab5e5f9cd1896465e2a8c61605601999f

diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx 
b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index cea71d5..4e14184 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -51,14 +51,14 @@ namespace drawinglayer
 bScaleContent = pSource-IsEmptyPresObj();
 }
 }
-
+#ifdef WNT // Little point in displaying the broken OLE graphic on OSes that 
don't have real OLE, maybe?
 if(GRAPHIC_NONE == aGraphic.GetType())
 {
 // no source, use fallback resource emty OLE graphic
 aGraphic = SdrOle2Obj::GetEmptyOLEReplacementGraphic();
 bScaleContent = true;
 }
-
+#endif
 if(GRAPHIC_NONE != aGraphic.GetType())
 {
 const GraphicObject aGraphicObject(aGraphic);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-21 Thread Tor Lillqvist
 svx/source/sidebar/nbdtmg.cxx |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 2b4b867304a666b8d412fd6ff0f88519a3db753b
Author: Tor Lillqvist t...@iki.fi
Date:   Tue May 21 16:49:04 2013 +0300

WaE: unused variables

Change-Id: Ib46ec040c4adc5bdab3c5219157ae60582604c63

diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index e88c9f5..0976150 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -302,7 +302,7 @@ BulletsTypeMgr::BulletsTypeMgr(const BulletsTypeMgr 
aTypeMgr):
 void BulletsTypeMgr::Init()
 {
 Font rActBulletFont = lcl_GetDefaultBulletFont();
-String sName = rActBulletFont.GetName();
+
 if( Application::GetSettings().GetLayoutRTL() )
 {
 for (sal_uInt16 i=0;iDEFAULT_BULLET_TYPES;i++)
@@ -679,7 +679,6 @@ sal_Bool 
GraphyicBulletsTypeMgr::RelplaceNumRule(SvxNumRule aNum,sal_uInt16 nIn
 else
 return sal_False;
 
-String sEmpty;
 if ( pGrf )
 {
 const String* pGrfName = pBrsh-GetGraphicLink();
@@ -988,14 +987,12 @@ sal_uInt16 
MixBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule aNum,sal_uInt16
 if( eNumType == SVX_NUM_CHAR_SPECIAL)
 {
 sal_Unicode cChar = aFmt.GetBulletChar();
-const Font* pFont = aFmt.GetBulletFont();
-String sName = pFont?pFont-GetName():String();
+// const Font* pFont = aFmt.GetBulletFont();
 
 for(sal_uInt16 i = nFromIndex; i  DEFAULT_BULLET_TYPES; i++)
 {
 if ( pActualBullets[i]-eType == eNBType::BULLETS )
 {
-String ssName = 
((BulletsSettings_Impl*)(pActualBullets[i]-pBullets))-aFont.GetName();
 if ( (cChar == 
((BulletsSettings_Impl*)(pActualBullets[i]-pBullets))-cBulletChar||
 (cChar == 9830  57356 == 
((BulletsSettings_Impl*)(pActualBullets[i]-pBullets))-cBulletChar) ||
 (cChar == 9632  57354 == 
((BulletsSettings_Impl*)(pActualBullets[i]-pBullets))-cBulletChar)))//
@@ -1161,7 +1158,6 @@ sal_Bool MixBulletsTypeMgr::RelplaceNumRule(SvxNumRule 
aNum,sal_uInt16 nIndex,s
 else
 return sal_False;
 
-String sEmpty;
 const String* pGrfName = 0;
 if ( pGrf )
 {
@@ -1498,7 +1494,6 @@ sal_uInt16 
NumberingTypeMgr::GetNBOIndexForNumRule(SvxNumRule aNum,sal_uInt16 m
 //sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0];
 String sPreFix = aFmt.GetPrefix();
 String sLclSuffix = aFmt.GetSuffix();
-String sEmpty;
 sal_Int16 eNumType = aFmt.GetNumberingType();
 
 sal_uInt16 nCount = pNumberSettingsArr-size();
@@ -1757,14 +1752,13 @@ sal_uInt16 
OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule aNum,sal_uInt16 /*m
 SvxNumberFormat aFmt(aNum.GetLevel(iLevel));
 String sPreFix = aFmt.GetPrefix();
 String sLclSuffix = aFmt.GetSuffix();
-String sEmpty;
 sal_Int16 eNumType = aFmt.GetNumberingType();
 if( eNumType == SVX_NUM_CHAR_SPECIAL)
 {
 sal_Unicode cChar = aFmt.GetBulletChar();
 //const Font* pFont = aFmt.GetBulletFont();
 sal_Unicode ccChar = _pSet-sBulletChar.getStr()[0];
-rtl::OUString sFont = _pSet-sBulletFont;
+// rtl::OUString sFont = _pSet-sBulletFont;
 if ( !((cChar == ccChar)  //pFont  
sFont.compareTo(pFont-GetName()) 
 _pSet-eLabelFollowedBy == aFmt.GetLabelFollowedBy() 
 _pSet-nTabValue == aFmt.GetListtabPos() 
commit 61493e499f44821405c10c4347038bde16a9072c
Author: Tor Lillqvist t...@iki.fi
Date:   Tue May 21 16:46:10 2013 +0300

Fix warning: statement aligned as second statement in if body ... [loplugin]

Change-Id: Ic3ef17414cbae5fea5a62d61d33e64727603d058

diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 2acc98d..e88c9f5 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -1953,7 +1953,7 @@ sal_Bool OutlineTypeMgr::ApplyNumRule(SvxNumRule 
aNum,sal_uInt16 nIndex,sal_uIn
  aFmt.SetBulletFont( aCreateFont );
 }
 }else
-aFmt.SetBulletFont( rActBulletFont );
+aFmt.SetBulletFont( rActBulletFont );
 
 sal_Unicode cChar = 0;
 if( pLevelSettings-sBulletChar.getLength() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-20 Thread Tor Lillqvist
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx  |2 --
 svx/source/sidebar/tools/ValueSetWithTextControl.cxx |3 ---
 2 files changed, 5 deletions(-)

New commits:
commit bee150931d4913edbc0f8cdc3854c2699ebdde46
Author: Tor Lillqvist t...@iki.fi
Date:   Mon May 20 14:35:14 2013 +0300

WaE: macro is not used

Change-Id: I1f88819c85f0c0539bfa3b48ffc215e279c007d0

diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx 
b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index df1bc7d..91a1848 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -48,8 +48,6 @@ using namespace com::sun::star::container;
 using namespace com::sun::star::style;
 using rtl::OUString;
 
-#define C2U(cChar) OUString::createFromAscii(cChar)
-
 namespace svx { namespace sidebar {
 static const sal_Char cValue[] = Value;
 
commit b9c661e2bb4c521e5e71150f9b52272eb05aa9b7
Author: Tor Lillqvist t...@iki.fi
Date:   Mon May 20 14:34:47 2013 +0300

Fix warnings: unused variables [loplugin]

Change-Id: Id5c62c21f65165085616390d24605efe35ca9924

diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx 
b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index a3aafaa..fdba30f 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -1070,7 +1070,6 @@ void PosSizePropertyPanel::executePosX()
 lX = -lX;
 long lY = GetCoreValue( *mpMtrPosY, mePoolUnit );
 
-Size aPageSize;
 Rectangle aRect;
 maRect = mpView-GetAllMarkedRect();
 aRect = mpView-GetAllMarkedRect();
@@ -1098,7 +1097,6 @@ void PosSizePropertyPanel::executePosY()
 long lX = GetCoreValue( *mpMtrPosX, mePoolUnit );
 long lY = GetCoreValue( *mpMtrPosY, mePoolUnit );
 
-Size aPageSize;
 Rectangle aRect;
 maRect = mpView-GetAllMarkedRect();
 aRect = mpView-GetAllMarkedRect();
diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx 
b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index 3489a53..df1bc7d 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -344,7 +344,6 @@ void  SvxNumValueSet2::UserDraw( const UserDrawEvent 
rUDEvt )
 pDev-DrawOutDev(   aRect.TopLeft(), aRectSize,
 aOrgRect.TopLeft(), aRectSize,
 *pVDev );
-const OUString sValue(C2U(cValue));
 
 Point aStart(aBLPos.X() + nRectWidth / 9,0);
 if ( nItemId == DEFAULT_NONE)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-17 Thread Michael Stahl
 svx/source/dialog/_contdlg.cxx |2 ++
 svx/source/svdraw/svdundo.cxx  |2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit fc63700181ab0f42eab5f98328074fe1682344f8
Author: Michael Stahl mst...@redhat.com
Date:   Fri May 17 14:02:25 2013 +0200

fdo#57079: SvxSuperContourDlg: unregister configuration listener

... in destructor.  Otherwise it will access freed memory when
eventually called.  This crashes since OOo 3.2 but no idea why it would
appear to not crash in earlier versions.

Change-Id: Ie3ab7ddf19fb1086f0b7d824555ab6b063e2b9ad

diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index ba192eb..1b961be 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -264,6 +264,8 @@ SvxSuperContourDlg::SvxSuperContourDlg( SfxBindings 
*_pBindings, SfxChildWindow
 
 SvxSuperContourDlg::~SvxSuperContourDlg()
 {
+SvtMiscOptions aMiscOptions;
+aMiscOptions.RemoveListenerLink( LINK(this, SvxSuperContourDlg, MiscHdl) );
 }
 
 // Resize methods
commit 71f990d286c603b3bf220c8d93af69f04a45dd7a
Author: Michael Stahl mst...@redhat.com
Date:   Fri May 17 13:23:34 2013 +0200

fdo#62965: fix crash in Edit Contour dialog

The pObjList is 0, so use pObj's GetModel() which should be the same.
(regression from 115054fef08998c56cba8f14472df1d15007f635)

Change-Id: Ib20e1806518f7b3b33d3fb4472d79d531ea9f1de

diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 3bcace5..5026435 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -738,7 +738,7 @@ SdrUndoObjList::SdrUndoObjList(SdrObject rNewObj, bool 
bOrdNumDirect)
 nOrdNum=pObj-GetOrdNum();
 }
 
-m_pListener = new ObjListListener(*this, *pObj, *pObjList-GetModel());
+m_pListener = new ObjListListener(*this, *pObj, *pObj-GetModel());
 }
 
 SdrUndoObjList::~SdrUndoObjList()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >