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

2022-09-19 Thread Noel Grandin (via logerrit)
 chart2/source/tools/ObjectIdentifier.cxx |   21 -
 sc/source/core/data/queryevaluator.cxx   |   19 ++-
 2 files changed, 14 insertions(+), 26 deletions(-)

New commits:
commit 716a81042558143b400c502d1ba3e1ff1b3672e1
Author: Noel Grandin 
AuthorDate: Mon Sep 19 16:05:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 19 18:44:53 2022 +0200

no need to use an OUStringBuffer here

can just return the substring we need

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

diff --git a/chart2/source/tools/ObjectIdentifier.cxx 
b/chart2/source/tools/ObjectIdentifier.cxx
index ad98d645170f..0952effbbf86 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -155,20 +155,15 @@ rtl::Reference lcl_getFirstStockChartType( 
const rtl::Reference<::cha
 
 OUString lcl_getIndexStringAfterString( const OUString& rString, const 
OUString& rSearchString )
 {
-OUStringBuffer aRet;
-
 sal_Int32 nIndexStart = rString.lastIndexOf( rSearchString );
-if( nIndexStart != -1 )
-{
-nIndexStart += rSearchString.getLength();
-sal_Int32 nIndexEnd = rString.getLength();
-sal_Int32 nNextColon = rString.indexOf( ':', nIndexStart );
-if( nNextColon != -1 )
-nIndexEnd = nNextColon;
-aRet = rString.subView(nIndexStart,nIndexEnd-nIndexStart);
-}
-
-return aRet.makeStringAndClear();
+if( nIndexStart == -1 )
+return OUString();
+nIndexStart += rSearchString.getLength();
+sal_Int32 nIndexEnd = rString.getLength();
+sal_Int32 nNextColon = rString.indexOf( ':', nIndexStart );
+if( nNextColon != -1 )
+nIndexEnd = nNextColon;
+return rString.copy(nIndexStart,nIndexEnd-nIndexStart);
 }
 
 sal_Int32 lcl_StringToIndex( std::u16string_view rIndexString )
commit c3ea4a8025f1ba241a8ac5c53ac79fd274ec6b3a
Author: Noel Grandin 
AuthorDate: Mon Sep 19 10:58:41 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 19 18:44:42 2022 +0200

use optional in processEntry

which means we save the cost of initialising an OUString

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

diff --git a/sc/source/core/data/queryevaluator.cxx 
b/sc/source/core/data/queryevaluator.cxx
index b5ff8a354c84..2562e513c670 100644
--- a/sc/source/core/data/queryevaluator.cxx
+++ b/sc/source/core/data/queryevaluator.cxx
@@ -766,19 +766,15 @@ std::pair 
ScQueryEvaluator::processEntry(SCROW nRow, SCCOL nCol, ScR
 }
 }
 const svl::SharedString* cellSharedString = nullptr;
-OUString cellString;
-bool cellStringSet = false;
+std::optional oCellString;
 const bool bFastCompareByString = isFastCompareByString(rEntry);
 if (rEntry.eOp == SC_EQUAL && rItems.size() >= 10 && bFastCompareByString)
 {
 // The same as above but for strings. Try to optimize the case when
 // it's a svl::SharedString comparison. That happens when SC_EQUAL is 
used
 // and simple matching is used, see compareByString()
-if (!cellStringSet)
-{
-cellString = getCellString(aCell, nRow, rEntry.nField, 
);
-cellStringSet = true;
-}
+if (!oCellString)
+oCellString = getCellString(aCell, nRow, rEntry.nField, 
);
 // Allow also checking ScQueryEntry::ByValue if the cell is not 
numeric,
 // as in that case isQueryByNumeric() would be false and 
isQueryByString() would
 // be true because of SC_EQUAL making isTextMatchOp() true.
@@ -858,18 +854,15 @@ std::pair 
ScQueryEvaluator::processEntry(SCROW nRow, SCCOL nCol, ScR
 }
 else if (isQueryByString(rEntry.eOp, rItem.meType, aCell))
 {
-if (!cellStringSet)
-{
-cellString = getCellString(aCell, nRow, rEntry.nField, 
);
-cellStringSet = true;
-}
+if (!oCellString)
+oCellString = getCellString(aCell, nRow, rEntry.nField, 
);
 std::pair aThisRes;
 if (cellSharedString && bFastCompareByString) // fast
 aThisRes = compareByString(rEntry, rItem, 
cellSharedString, nullptr);
 else if (cellSharedString)
 aThisRes = compareByString(rEntry, rItem, cellSharedString, 
nullptr);
 else
-aThisRes = compareByString(rEntry, rItem, nullptr, 
);
+aThisRes = compareByString(rEntry, rItem, nullptr, 
&*oCellString);
 aRes.first |= aThisRes.first;
 aRes.second |= aThisRes.second;
 }


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

2022-02-06 Thread Tomaž Vajngerl (via logerrit)
 chart2/source/view/axes/VAxisBase.cxx   |4 
 chart2/source/view/axes/VAxisProperties.cxx |   38 
 chart2/source/view/axes/VAxisProperties.hxx |   14 +-
 chart2/source/view/axes/VCartesianAxis.cxx  |  132 ++--
 chart2/source/view/axes/VPolarAngleAxis.cxx |   10 +-
 sc/source/ui/view/output.cxx|   21 ++--
 6 files changed, 109 insertions(+), 110 deletions(-)

New commits:
commit d0a11f591a57754362bb86c4bb07869bc18e5f75
Author: Tomaž Vajngerl 
AuthorDate: Sun Feb 6 18:30:39 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Feb 6 13:00:14 2022 +0100

sc: fix rendering of conditional formatting icon

The bWorksInPixels flag isn't needed as it means some rendering
information is in pixel instead of logic, but we render in logic,
not in pixels as it is falsely assumed. So don't take into account
the bWorksInPixels flag and just render in pixels when LOKit is
active.

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

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index bd630f531ed6..2f9674a1edae 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -908,7 +908,7 @@ const BitmapEx& getIcon(sc::IconSetBitmapMap & 
rIconSetBitmapMap, ScIconSetType
 }
 
 void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* 
pOldIconSetInfo, const tools::Rectangle& rRect, tools::Long nOneX, tools::Long 
nOneY,
-sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels)
+sc::IconSetBitmapMap & rIconSetBitmapMap)
 {
 ScIconSetType eType = pOldIconSetInfo->eIconSetType;
 sal_Int32 nIndex = pOldIconSetInfo->nIconIndex;
@@ -918,16 +918,15 @@ void drawIconSets(vcl::RenderContext& rRenderContext, 
const ScIconSetInfo* pOldI
 
 if (pOldIconSetInfo->mnHeight)
 {
-if (bWorksInPixels)
+if (comphelper::LibreOfficeKit::isActive())
 {
 aHeight = rRenderContext.LogicToPixel(Size(0, 
pOldIconSetInfo->mnHeight), MapMode(MapUnit::MapTwip)).Height();
-if (comphelper::LibreOfficeKit::isActive())
-{
-aHeight *= comphelper::LibreOfficeKit::getDPIScale();
-}
+aHeight *= comphelper::LibreOfficeKit::getDPIScale();
 }
 else
+{
 aHeight = o3tl::convert(pOldIconSetInfo->mnHeight, 
o3tl::Length::twip, o3tl::Length::mm100);
+}
 }
 
 Size aSize = rIcon.GetSizePixel();
@@ -943,7 +942,7 @@ void drawIconSets(vcl::RenderContext& rRenderContext, const 
ScIconSetInfo* pOldI
 void drawCells(vcl::RenderContext& rRenderContext, std::optional const 
& pColor, const SvxBrushItem* pBackground, std::optional& pOldColor, 
const SvxBrushItem*& pOldBackground,
 tools::Rectangle& rRect, tools::Long nPosX, tools::Long nLayoutSign, 
tools::Long nOneX, tools::Long nOneY, const ScDataBarInfo* pDataBarInfo, const 
ScDataBarInfo*& pOldDataBarInfo,
 const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& 
pOldIconSetInfo,
-sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels)
+sc::IconSetBitmapMap & rIconSetBitmapMap)
 {
 tools::Long nSignedOneX = nOneX * nLayoutSign;
 // need to paint if old color scale has been used and now
@@ -960,7 +959,7 @@ void drawCells(vcl::RenderContext& rRenderContext, 
std::optional const &
 if( pOldDataBarInfo )
 drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY);
 if( pOldIconSetInfo )
-drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, 
rIconSetBitmapMap, bWorksInPixels);
+drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, 
rIconSetBitmapMap);
 
 rRect.SetLeft( nPosX - nSignedOneX );
 }
@@ -980,7 +979,7 @@ void drawCells(vcl::RenderContext& rRenderContext, 
std::optional const &
 if( pOldDataBarInfo )
 drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY);
 if( pOldIconSetInfo )
-drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, 
rIconSetBitmapMap, bWorksInPixels);
+drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, 
rIconSetBitmapMap);
 
 rRect.SetLeft( nPosX - nSignedOneX );
 }
@@ -1143,7 +1142,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& 
rRenderContext)
 if (bWorksInPixels)
 nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 
0)).X();
 
-drawCells(rRenderContext, pColor, pBackground, pOldColor, 
pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, 
pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, 
mpDoc->GetIconSetBitmapMap(), bWorksInPixels);
+drawCells(rRenderContext, pColor, 

[Libreoffice-commits] core.git: 2 commits - chart2/source sc/source sw/qa sw/source vcl/source writerfilter/source

2020-03-02 Thread László Németh (via logerrit)
 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx |   57 +++--
 chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx |   18 +
 sc/source/ui/drawfunc/fuins2.cxx|  132 ++--
 sc/source/ui/inc/fuinsert.hxx   |   14 +
 sc/source/ui/inc/tabvwsh.hxx|3 
 sc/source/ui/view/tabvwsh4.cxx  |1 
 sc/source/ui/view/tabvwshb.cxx  |2 
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx  |3 
 sw/source/uibase/inc/chartins.hxx   |8 
 sw/source/uibase/inc/textsh.hxx |3 
 sw/source/uibase/shells/textsh.cxx  |   23 ++
 sw/source/uibase/table/chartins.cxx |   32 +-
 vcl/source/control/wizardmachine.cxx|3 
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx|   31 ++
 writerfilter/source/dmapper/PropertyIds.cxx |2 
 15 files changed, 220 insertions(+), 112 deletions(-)

New commits:
commit 7f805108a4ccc5751d7cbcb722ded5247e398578
Author: László Németh 
AuthorDate: Fri Feb 21 15:44:26 2020 +0100
Commit: László Németh 
CommitDate: Mon Mar 2 10:31:05 2020 +0100

tdf#131062 DOCX import: fix table-style paragraph background color

by comparing fill attributes to ParaBackColor to avoid losing them.

Regression from commit a9ba8e57a41c5ddf3597272bddab30e51fb3fd38
(Revert "tdf#118947 sw tablestyle: manually scan parents for ::SET").

See also commit 24077b2d52ab3d0fd0db5afb25d8b94b62386e3e
(writerfilter: import paragraph color as fill attributes)

Change-Id: Id42ea3adaddf883435dd61e5dea0e6c5fb89f927
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89215
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 9c1f362b8a70..a37c603732ad 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -338,6 +338,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, 
"tdf118947_tableStyle.docx")
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Table has 10pt space above paragraph", 
sal_Int32(353), getProperty(xPara, "ParaTopMargin"));
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Table style sets 0 right margin", 
sal_Int32(0), getProperty(xPara, "ParaRightMargin"));
 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("TextBody has 1.07 line-spacing", 
sal_Int16(107), getProperty(xPara, 
"ParaLineSpacing").Height, 1);
+// table-style based paragraph background color
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Missing paragraph background color in cell 
A1", sal_Int32(0xCCFFCC), getProperty(xPara, "ParaBackColor"));
 
 xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY);
 xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY);
@@ -351,6 +353,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, 
"tdf118947_tableStyle.docx")
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Table sets 10pt space above paragraph", 
sal_Int32(353), getProperty(xPara, "ParaTopMargin"));
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Table style sets 0 right margin", 
sal_Int32(0), getProperty(xPara, "ParaRightMargin"));
 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table sets 2.5 line-spacing", 
sal_Int16(250), getProperty(xPara, 
"ParaLineSpacing").Height, 1);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph background color in cell A2", 
sal_Int32(-1), getProperty(xPara, "ParaBackColor"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(tdf123912_protectedForm, 
"tdf123912_protectedForm.odt")
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 7dcbae415ff2..3cc394b8a50d 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "TablePositionHandler.hxx"
 #include "TagLogger.hxx"
 #include "util.hxx"
@@ -1094,6 +1095,23 @@ void 
DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag
 if (pCellProp != rCellProperties.end())
 {
 bool bDocDefault;
+// handle paragraph background color defined in 
CellColorHandler
+if (eId == PROP_FILL_COLOR)
+{
+// table style defines paragraph background color, use the 
correct property name
+auto pFillStyleProp = 
std::find_if(rCellProperties.begin(), rCellProperties.end(),
+[&](const beans::PropertyValue& rProp) { return 
rProp.Name == "FillStyle"; });
+if ( pFillStyleProp != rCellProperties.end() &&
+ pFillStyleProp->Value == 
uno::makeAny(drawing::FillStyle_SOLID) )
+{
+ 

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

2019-02-10 Thread Libreoffice Gerrit user
 chart2/source/view/axes/VCartesianAxis.cxx   |2 +-
 sc/source/ui/vba/vbaapplication.cxx  |4 +++-
 svx/source/engine3d/view3d.cxx   |4 ++--
 svx/source/sdr/contact/viewcontactofe3dscene.cxx |2 +-
 sw/source/ui/vba/vbatabstops.cxx |2 +-
 sw/source/uibase/uiview/view1.cxx|2 +-
 toolkit/source/awt/vclxmenu.cxx  |2 +-
 7 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 3165146f6deef86eb408837275ec3f7edda0183b
Author: Mike Kaganski 
AuthorDate: Thu Feb 7 14:40:49 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Feb 11 07:08:08 2019 +0100

tdf#120703 PVS: V560 A part of conditional expression is always true/false

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

diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index e058101524df..2a9b592b46cb 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -1101,7 +1101,7 @@ B2DVector VCartesianAxis::getScreenPosition( double 
fLogicX, double fLogicY, dou
 drawing::Position3D aScenePos = m_pPosHelper->transformLogicToScene( 
fLogicX, fLogicY, fLogicZ, true );
 if(m_nDimension==3)
 {
-if( m_xLogicTarget.is() && m_pPosHelper && m_pShapeFactory )
+if (m_xLogicTarget.is() && m_pShapeFactory)
 {
 tPropertyNameMap aDummyPropertyNameMap;
 Reference< drawing::XShape > xShape3DAnchor = 
m_pShapeFactory->createCube( m_xLogicTarget
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index e3def1a409f6..a3b3af4d41b7 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -823,12 +823,12 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, 
SdrObject* pObj, bool bExtrude
 ImpCreateSingle3DObjectFlat(pScene, pNewObj2, bExtrude, 
fDepth, rLatheMat);
 
 // delete object in between
-if(pNewObj2 != pObj && pNewObj2 != pNewObj1 && pNewObj2)
+if (pNewObj2 != pObj && pNewObj2 != pNewObj1)
 SdrObject::Free( pNewObj2 );
 }
 
 // delete object in between
-if(pNewObj1 != pObj && pNewObj1)
+if (pNewObj1 != pObj)
 SdrObject::Free( pNewObj1 );
 }
 }
diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx 
b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
index 86ca5f0ed09c..46ceeb6b7e45 100644
--- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
@@ -119,7 +119,7 @@ void createSubPrimitive3DVector(
 bVisible = rE3dObject.GetSelected();
 }
 
-if(bVisible && o_pVisibleTarget)
+if (bVisible)
 {
 // add to visible target vector
 o_pVisibleTarget->append(xPrimitive3DSeq);
diff --git a/sw/source/ui/vba/vbatabstops.cxx b/sw/source/ui/vba/vbatabstops.cxx
index 0c2ee09dea33..2f18e784dcb8 100644
--- a/sw/source/ui/vba/vbatabstops.cxx
+++ b/sw/source/ui/vba/vbatabstops.cxx
@@ -207,7 +207,7 @@ uno::Reference< word::XTabStop > SAL_CALL 
SwVbaTabStops::Add( float Position, co
 style::TabStop* pOldTab = aOldTabs.getArray();
 style::TabStop* pNewTab = aNewTabs.getArray();
 pNewTab[0] = aTab;
-for( sal_Int32 nIndex = 0; nIndex < nTabs && !bOverWriter; nIndex++ )
+for (sal_Int32 nIndex = 0; nIndex < nTabs; nIndex++)
 {
 if( pOldTab[nIndex].Position == nPosition )
 {
diff --git a/sw/source/uibase/uiview/view1.cxx 
b/sw/source/uibase/uiview/view1.cxx
index e985721e78e5..556899c1e416 100644
--- a/sw/source/uibase/uiview/view1.cxx
+++ b/sw/source/uibase/uiview/view1.cxx
@@ -193,7 +193,7 @@ void SwView::StateFormatPaintbrush(SfxItemSet )
 if(!m_pFormatClipboard)
 return;
 
-bool bHasContent = m_pFormatClipboard && m_pFormatClipboard->HasContent();
+const bool bHasContent = m_pFormatClipboard->HasContent();
 if( !bHasContent &&
 !SwFormatClipboard::CanCopyThisType( GetWrtShell().GetSelectionType())
   )
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index d9ec3a6487f7..716eec4a0105 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -303,7 +303,7 @@ void VCLXMenu::removeItem(
 return;
 
 sal_Int32 nItemCount = static_cast(mpMenu->GetItemCount());
-if ( ( nCount > 0 ) && ( nPos >= 0 ) && ( nPos < nItemCount ) && ( 
nItemCount > 0 ))
+if ((nCount > 0) && (nPos >= 0) && (nPos < nItemCount))
 {
 sal_Int16 nP = sal::static_int_cast< sal_Int16 >(
 std::min( 

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

2018-09-17 Thread Libreoffice Gerrit user
 chart2/source/controller/main/ChartController_Window.cxx |   18 +--
 chart2/source/tools/DiagramHelper.cxx|7 ++---
 sc/source/core/data/dptabres.cxx |5 ++--
 sc/source/core/tool/compiler.cxx |4 +--
 sc/source/core/tool/scmatrix.cxx |3 --
 sc/source/filter/excel/excform.cxx   |3 --
 sc/source/filter/xml/xmlexprt.cxx|4 +--
 sc/source/ui/docshell/impex.cxx  |5 ++--
 sc/source/ui/vba/vbarange.cxx|5 +---
 sc/source/ui/vba/vbaworksheet.cxx|9 ---
 sc/source/ui/vba/vbaworksheets.cxx   |5 
 sc/source/ui/view/drawview.cxx   |3 --
 sc/source/ui/view/gridwin2.cxx   |3 --
 sc/source/ui/view/tabview.cxx|8 +++---
 14 files changed, 30 insertions(+), 52 deletions(-)

New commits:
commit 35109fe7c058cf6d961245fc24550d1c1d39a300
Author: Jochen Nitschke 
AuthorDate: Sun Sep 16 18:05:29 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 17 09:25:23 2018 +0200

cppcheck: knownConditionTrueFalse in chart2

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

diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index 5e307d7a409b..e7f656337507 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1435,12 +1435,9 @@ bool ChartController::execute_KeyInput( const KeyEvent& 
rKEvt )
 if( bAlternate && pChartWindow )
 {
 // together with Alt-key: 1 px in each direction
-if( pChartWindow )
-{
-Size aPixelSize = pChartWindow->PixelToLogic( 
Size( 2, 2 ));
-fGrowAmountX = static_cast< double >( 
aPixelSize.Width());
-fGrowAmountY = static_cast< double >( 
aPixelSize.Height());
-}
+Size aPixelSize = pChartWindow->PixelToLogic( Size( 2, 
2 ));
+fGrowAmountX = static_cast< double >( 
aPixelSize.Width());
+fGrowAmountY = static_cast< double >( 
aPixelSize.Height());
 }
 if( nCode == KEY_SUBTRACT )
 {
@@ -1465,12 +1462,9 @@ bool ChartController::execute_KeyInput( const KeyEvent& 
rKEvt )
 if( bAlternate && pChartWindow )
 {
 // together with Alt-key: 1 px
-if(pChartWindow)
-{
-Size aPixelSize = pChartWindow->PixelToLogic( 
Size( 1, 1 ));
-fShiftAmountX = static_cast< double >( 
aPixelSize.Width());
-fShiftAmountY = static_cast< double >( 
aPixelSize.Height());
-}
+Size aPixelSize = pChartWindow->PixelToLogic( Size( 1, 
1 ));
+fShiftAmountX = static_cast< double >( 
aPixelSize.Width());
+fShiftAmountY = static_cast< double >( 
aPixelSize.Height());
 }
 switch( nCode )
 {
diff --git a/chart2/source/tools/DiagramHelper.cxx 
b/chart2/source/tools/DiagramHelper.cxx
index faaf3c1a4fdd..a3059ecc5c4a 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -1392,11 +1392,10 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
 if( xOtherDataSeriesContainer.is() 
)
 {
 uno::Sequence< uno::Reference< 
XDataSeries > > aOtherSeriesList( xOtherDataSeriesContainer->getDataSeries() );
-sal_Int32 nOtherSeriesIndex = 
0;
-if( nOtherSeriesIndex >= 0 && 
nOtherSeriesIndex < aOtherSeriesList.getLength() )
+if( 0 < 
aOtherSeriesList.getLength() )
 {
-uno::Reference< 
XDataSeries > xExchangeSeries( aOtherSeriesList[nOtherSeriesIndex] );
-
aOtherSeriesList[nOtherSeriesIndex] = xGivenDataSeries;
+uno::Reference< 
XDataSeries > xExchangeSeries( aOtherSeriesList[0] );
+ 

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

2017-03-28 Thread Jochen Nitschke
 chart2/source/controller/main/ChartController.cxx |9 ++---
 sc/source/ui/view/gridwin_dbgutil.cxx |4 ++--
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 799824565b783ec0b2323bd609a0e69a70182ac1
Author: Jochen Nitschke 
Date:   Tue Mar 28 13:00:03 2017 +

fix too small loop var

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

diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx 
b/sc/source/ui/view/gridwin_dbgutil.cxx
index 517bbe08dd8f..54050a4287ee 100644
--- a/sc/source/ui/view/gridwin_dbgutil.cxx
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -96,8 +96,8 @@ void ScGridWindow::dumpGraphicInformation()
 for (sal_uInt16 nPage = 0; nPage < nPageCount; ++nPage)
 {
 SdrPage* pPage = pDrawLayer->GetPage(nPage);
-sal_uInt16 nObjCount = pPage->GetObjCount();
-for (sal_uInt16 nObj = 0; nObj < nObjCount; ++nObj)
+size_t nObjCount = pPage->GetObjCount();
+for (size_t nObj = 0; nObj < nObjCount; ++nObj)
 {
 SdrObject* pObj = pPage->GetObj(nObj);
 std::cout << "Graphic Object" << std::endl;
commit 539470ebd5c47a7876ccc19df6110acacd477bb8
Author: Bjoern Michaelsen 
Date:   Sun Mar 26 00:42:31 2017 +0100

it makes no sense for CC to leak resources when its unaware of model

- if the UNO_QUERY_THROW cast throws, this skips all of the disposing
  (and thus leaks)
- the whole try-catch-ignore case has been there since early c6b95527
- even in that commit message, no sane justification has been given
- apparently the try-block was Java-style "catch exceptions until it
  runs" cargo-cult
- this change is still the more conservative change: probably the whole
  try-catch framing should be removed

Change-Id: Ie3a71e48eb056afd8a844e19898dc1555de4297e
Reviewed-on: https://gerrit.libreoffice.org/35690
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 3d163b791e1a..394a4e5b760b 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -803,8 +803,9 @@ void SAL_CALL ChartController::dispose()
 
 //--release all resources and references
 {
-uno::Reference< chart2::X3DChartWindowProvider > 
x3DWindowProvider(getModel(), uno::UNO_QUERY_THROW);
-x3DWindowProvider->setWindow(0);
+uno::Reference< chart2::X3DChartWindowProvider > 
x3DWindowProvider(getModel(), uno::UNO_QUERY);
+if(x3DWindowProvider.is())
+x3DWindowProvider->setWindow(0);
 
 uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( 
m_xChartView, uno::UNO_QUERY );
 if( xViewBroadcaster.is() )
@@ -818,7 +819,8 @@ void SAL_CALL ChartController::dispose()
 m_apDropTargetHelper.reset();
 
 //the accessible view is disposed within window destructor of 
m_pChartWindow
-m_xViewWindow->dispose(); //ChartWindow is deleted via UNO due to 
dispose of m_xViewWindow (triggered by Framework (Controller pretends to be 
XWindow also))
+if(m_xViewWindow.is())
+m_xViewWindow->dispose(); //ChartWindow is deleted via UNO due 
to dispose of m_xViewWindow (triggered by Framework (Controller pretends to be 
XWindow also))
 m_xChartView.clear();
 }
 
@@ -865,6 +867,7 @@ void SAL_CALL ChartController::dispose()
 }
 catch( const uno::Exception & ex )
 {
+assert(!m_xChartView.is());
 ASSERT_EXCEPTION( ex );
 }
  }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-20 Thread Eike Rathke
 chart2/source/controller/dialogs/tp_Scale.cxx |4 ++--
 sc/source/core/data/column3.cxx   |2 +-
 sc/source/ui/view/viewfun6.cxx|2 +-
 svl/source/numbers/zforlist.cxx   |   11 +--
 svx/source/items/numfmtsh.cxx |   14 +++---
 5 files changed, 16 insertions(+), 17 deletions(-)

New commits:
commit 2f6d2c0c47ebfd1b98f9610aec99566fe3a1a982
Author: Eike Rathke 
Date:   Mon Feb 20 20:55:39 2017 +0100

use SvNumberformat::GetMaskedType()

... instead of manually masking out css::util::NumberFormat::DEFINED

Change-Id: I0761132800b2b1693df41085695f36cd3cc1236b

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index dd33288..9bd32c0 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1700,7 +1700,7 @@ bool ScColumn::ParseString(
 bool bOverwrite = false;
 if ( pOldFormat )
 {
-short nOldType = pOldFormat->GetType() & 
~css::util::NumberFormat::DEFINED;
+short nOldType = pOldFormat->GetMaskedType();
 if ( nOldType == css::util::NumberFormat::NUMBER || 
nOldType == css::util::NumberFormat::DATE ||
  nOldType == css::util::NumberFormat::TIME || 
nOldType == css::util::NumberFormat::LOGICAL )
 {
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 92a1804..97ca1bd 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -269,7 +269,7 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const 
OUString& rUndoStr)
 SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
 const SvNumberformat* pCurNumFormatEntry = 
pFormatter->GetEntry(nCurNumFormat);
 const short nCurNumFormatType = (pCurNumFormatEntry ?
-(pCurNumFormatEntry->GetType() & 
~css::util::NumberFormat::DEFINED) : css::util::NumberFormat::UNDEFINED);
+pCurNumFormatEntry->GetMaskedType() : 
css::util::NumberFormat::UNDEFINED);
 
 if (bInputMode)
 {
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 71a0718..2ddd642 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -928,7 +928,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable(
 else
 {
 rLnge = pFormat->GetLanguage();
-eType = pFormat->GetType()&~css::util::NumberFormat::DEFINED;
+eType = pFormat->GetMaskedType();
 if (eType == 0)
 {
 eType = css::util::NumberFormat::DEFINED;
@@ -1081,7 +1081,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& 
sString,
 }
 else
 {
-FType = pFormat->GetType() &~css::util::NumberFormat::DEFINED;
+FType = pFormat->GetMaskedType();
 if (FType == 0)
 {
 FType = css::util::NumberFormat::DEFINED;
@@ -1249,8 +1249,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short 
nType )
 while ( it2 != aFTable.end() && (nKey = it2->first ) >= CLOffset && 
nKey < nStopKey )
 {
 const SvNumberformat* pEntry = it2->second;
-if ( pEntry->IsStandard() && ((pEntry->GetType() &
-~css::util::NumberFormat::DEFINED) == nType) )
+if ( pEntry->IsStandard() && (pEntry->GetMaskedType() == nType) )
 {
 nDefaultFormat = nKey;
 break;  // while
@@ -1490,7 +1489,7 @@ void SvNumberFormatter::GetInputLineString(const double& 
fOutNumber,
 LanguageType eLang = pFormat->GetLanguage();
 ChangeIntl( eLang );
 
-short eType = pFormat->GetType() & ~css::util::NumberFormat::DEFINED;
+short eType = pFormat->GetMaskedType();
 if (eType == 0)
 {
 // Mixed types in subformats, use first.
@@ -3039,7 +3038,7 @@ short SvNumberFormatter::GetType(sal_uInt32 nFIndex)
 }
 else
 {
-eType = pFormat->GetType() &~css::util::NumberFormat::DEFINED;
+eType = pFormat->GetMaskedType();
 if (eType == 0)
 {
 eType = css::util::NumberFormat::DEFINED;
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 765ec8d..b0a8d92 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -692,7 +692,7 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( 
std::vector& rL
 
 if(pNumEntry==nullptr) continue;
 
-nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
+nMyCat=pNumEntry->GetMaskedType();
 aStrComment=pNumEntry->GetComment();
 CategoryToPos_Impl(nMyCat,nMyType);
 aNewFormNInfo=  pNumEntry->GetFormatstring();
@@ -727,7 +727,7 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( 
std::vector& r
 const 

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

2017-02-13 Thread Tomaž Vajngerl
 chart2/source/controller/dialogs/RangeSelectionHelper.cxx |   11 ---
 sc/source/ui/inc/dbfunc.hxx   |1 
 sc/source/ui/inc/gridwin.hxx  |7 +-
 sc/source/ui/inc/tabview.hxx  |1 
 sc/source/ui/view/dbfunc3.cxx |   22 +--
 sc/source/ui/view/gridwin2.cxx|   42 +-
 sc/source/ui/view/tabview3.cxx|   23 +++
 sc/source/ui/view/tabvwshb.cxx|   33 ++-
 8 files changed, 108 insertions(+), 32 deletions(-)

New commits:
commit 8faff1ee9cbf5d9dd23360bb87b30eaa620c48b5
Author: Tomaž Vajngerl 
Date:   Sat Feb 11 13:30:18 2017 +0100

chart2: remove unneeded includes

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

diff --git a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx 
b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
index addc52a..48db808 100644
--- a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
+++ b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
@@ -20,18 +20,7 @@
 #include "RangeSelectionHelper.hxx"
 #include "RangeSelectionListener.hxx"
 #include "macros.hxx"
-#include "ControllerLockGuard.hxx"
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 
 using namespace ::com::sun::star;
 
commit a423ed8a474e114d21b81b84b2900099a6527481
Author: Tomaž Vajngerl 
Date:   Tue Feb 7 17:03:26 2017 +0100

base work to trigger pivot table filter popup with a callback

Change-Id: I5b85a760eb1f3f9090fbbd02f5510878ad3c51c2
Reviewed-on: https://gerrit.libreoffice.org/34007
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index ad71348..e407580 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -86,6 +86,7 @@ public:
 void DataPilotInput( const ScAddress& rPos, const OUString& rString );
 
 voidDataPilotSort( const ScAddress& rPos, bool bAscending, 
sal_uInt16* pUserListId = nullptr );
+voidDataPilotSort(ScDPObject* pDPObject, long nDimIndex, bool 
bAscending, sal_uInt16* pUserListId = nullptr);
 boolDataPilotMove( const ScRange& rSource, const ScAddress& 
rDest );
 
 bool HasSelectionForDrillDown( sal_uInt16& rOrientation );
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 709b388..dff2da7 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -213,8 +213,8 @@ class ScGridWindow : public vcl::Window, public 
DropTargetHelper, public DragSou
  * mouse event handling is necessary, false otherwise.
  */
 bool DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, 
const ScAddress& rDimPos, ScDPObject* pDPObj);
-voidDPLaunchFieldPopupMenu(
-const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, 
ScDPObject* pDPObj);
+
+void DPLaunchFieldPopupMenu(const Point& rScrPos, const Size& rScrSize, 
const ScAddress& rPos, ScDPObject* pDPObj);
 
 voidRFMouseMove( const MouseEvent& rMEvt, bool bUp );
 
@@ -364,6 +364,9 @@ public:
 
 css::sheet::DataPilotFieldOrientation GetDPFieldOrientation( SCCOL nCol, 
SCROW nRow ) const;
 
+void DPLaunchFieldPopupMenu(const Point& rScrPos, const Size& rScrSize,
+long nDimIndex, ScDPObject* pDPObj);
+
 void DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo, 
OutputDevice* pContentDev);
 
 using Window::Draw;
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 5afc3d3..d7c659e 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -482,6 +482,7 @@ public:
 voidClearHighlightRanges();
 
 voidDoChartSelection( const css::uno::Sequence< 
css::chart2::data::HighlightedRange > & rHilightRanges );
+voidDoDPFieldPopup(Point aPoint, Size aSize);
 
 longGetGridWidth( ScHSplitPos eWhich );
 longGetGridHeight( ScVSplitPos eWhich );
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 1a35636..d298d39 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1610,10 +1610,8 @@ struct ScOUStringCollate
 }
 };
 
-void ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, 
sal_uInt16* pUserListId )
+void ScDBFunc::DataPilotSort(ScDPObject* pDPObj, long nDimIndex, bool 
bAscending, sal_uInt16* pUserListId)
 {
-ScDocument* pDoc 

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

2015-01-23 Thread Caolán McNamara
 chart2/source/view/charttypes/GL3DBarChart.cxx |   11 +--
 sc/source/ui/dbgui/tpsort.cxx  |2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 05e7b1db351ee964d155e49c55de7db3c917083f
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jan 23 15:02:31 2015 +

Resolves: fdo#88229 Crash when you try to create a bar chart GL3D

Change-Id: I6390f8988ca287de19e9981053bdeb9473d1e3e1

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx 
b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 407c34f..0701b8c 100755
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -649,8 +649,15 @@ void GL3DBarChart::create3DShapes(const 
boost::ptr_vectorVDataSeries rDataSer
 sal_Int32 nSeriesIndex = 0;
 sal_Int32 nMaxPointCount = 0;
 double nMaxVal = findMaxValue(rDataSeriesContainer)/100;
-const VDataSeries rFirstRow = *(rDataSeriesContainer.begin());
-mnBarsInRow = rFirstRow.getTotalPointCount();
+if (rDataSeriesContainer.empty())
+{
+mnBarsInRow = 0;
+}
+else
+{
+const VDataSeries rFirstRow = *(rDataSeriesContainer.begin());
+mnBarsInRow = rFirstRow.getTotalPointCount();
+}
 for (boost::ptr_vectorVDataSeries::const_iterator itr = 
rDataSeriesContainer.begin(),
 itrEnd = rDataSeriesContainer.end(); itr != itrEnd; ++itr)
 {
commit 0442cd217645aa4fdd924e4c2e4f90a77f1fbbad
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jan 23 14:42:28 2015 +

Resolves: fdo#88735 crash after calling sort after subtotal removal

Change-Id: Ia30271426ea47b7bf5af85d16591a02e6d52b3d9

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 7b2..ba3703f 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -150,7 +150,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet* /* 
rArgSet */ )
 FillFieldLists(0);
 
 // ListBox selection:
-if ( aSortData.maKeyState[0].bDoSort )
+if (!aSortData.maKeyState.empty()  aSortData.maKeyState[0].bDoSort)
 {
 // Make sure that the all sort keys are reset
 for ( sal_uInt16 i=nSortKeyCount; iaSortData.GetSortKeyCount(); i++ )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-11-17 Thread Caolán McNamara
 chart2/source/controller/main/SelectionHelper.cxx |9 ++---
 sc/source/filter/excel/xistyle.cxx|   12 +---
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 96b524cdd639b57c875eada551e267654f2a83fc
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Nov 17 17:03:15 2014 +

coverity#1242891 Untrusted loop bound

Change-Id: I5859cef0fa6b9c49225c5d7b073bcbc521734854

diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index 7349a8e..446b283 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -150,8 +150,15 @@ void XclImpPalette::ReadPalette( XclImpStream rStrm )
 {
 sal_uInt16 nCount;
 rStrm  nCount;
-OSL_ENSURE( rStrm.GetRecLeft() == static_cast sal_Size ( 4 * nCount ),
-XclImpPalette::ReadPalette - size mismatch );
+
+const size_t nMinRecordSize = 4;
+const size_t nMaxRecords = rStrm.GetRecLeft() / nMinRecordSize;
+if (nCount  nMaxRecords)
+{
+SAL_WARN(sc, Parsing error:   nMaxRecords 
+  max possible entries, but   nCount   claimed, 
truncating);
+nCount = nMaxRecords;
+}
 
 maColorTable.resize( nCount );
 Color aColor;
@@ -164,7 +171,6 @@ void XclImpPalette::ReadPalette( XclImpStream rStrm )
 }
 
 // FONT record - font information =
-
 XclImpFont::XclImpFont( const XclImpRoot rRoot ) :
 XclImpRoot( rRoot ),
 mbHasCharSet( false ),
commit 5d0da4db5a8c7a76f83c4db60e4577bf2202ed9f
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Nov 17 16:39:03 2014 +

coverity#1242824 Unused value

Change-Id: I5f53e538f8f76c337cda8b90fcf4ed717ed2476e

diff --git a/chart2/source/controller/main/SelectionHelper.cxx 
b/chart2/source/controller/main/SelectionHelper.cxx
index 8389fe4e..ee54fc8 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -172,13 +172,12 @@ void Selection::adaptSelectionToNewPos( const Point 
rMousePos, DrawViewWrapper*
 //bAllowMultiClickSelectionChange==true - a second click on the same 
object can lead to a changed selection (e.g. series - single data point)
 
 //get object to select:
-SdrObject* pNewObj = 0;
 {
 m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = 
ObjectIdentifier();
 
 //the search for the object to select starts with the hit object 
deepest in the grouping hierarchy (a leaf in the tree)
 //further we travel along the grouping hierarchy from child to 
parent
-pNewObj = pDrawViewWrapper-getHitObject(rMousePos);
+SdrObject* pNewObj = pDrawViewWrapper-getHitObject(rMousePos);
 m_aSelectedOID = ObjectIdentifier( lcl_getObjectName( pNewObj ) 
);//name of pNewObj
 
 //ignore handle only objects for hit test
@@ -207,7 +206,6 @@ void Selection::adaptSelectionToNewPos( const Point 
rMousePos, DrawViewWrapper*
 //if a sibling of the last selected object is clicked 
don't go up further
 break;
 }
-SdrObject*pLastChild = pNewObj;
 ObjectIdentifier aLastChild = m_aSelectedOID;
 if ( !SelectionHelper::findNamedParent( pNewObj, 
m_aSelectedOID, false ) )
 {
@@ -220,17 +218,15 @@ void Selection::adaptSelectionToNewPos( const Point 
rMousePos, DrawViewWrapper*
 {
 if( bAllowMultiClickSelectionChange )
 {
-pNewObj  = pLastChild;
 m_aSelectedOID = aLastChild;
 }
 else
 
m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = aLastChild;
-
 break;
 }
 }
 
-OSL_ENSURE( pNewObj  m_aSelectedOID.isValid(), somehow lost 
selected object );
+OSL_ENSURE(m_aSelectedOID.isValid(), somehow lost selected 
object);
 }
 else
 {
@@ -281,7 +277,6 @@ void Selection::adaptSelectionToNewPos( const Point 
rMousePos, DrawViewWrapper*
 if( pDrawViewWrapper-IsObjectHit( pLegend, rMousePos 
) )
 {
 m_aSelectedOID = ObjectIdentifier( aLegendCID );
-pNewObj = pLegend;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-30 Thread Markus Mohrhard
 chart2/source/view/inc/GL3DRenderer.hxx  |   22 ++
 chart2/source/view/main/GL3DRenderer.cxx |   20 ++--
 sc/source/core/data/documen5.cxx |3 +++
 sc/source/ui/view/tabvwsh4.cxx   |3 +++
 4 files changed, 26 insertions(+), 22 deletions(-)

New commits:
commit 561b6824e6cbb8762f667e3bcc087a6105ee78b7
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Fri May 30 22:44:21 2014 +0200

avoid crash when finding a non chart OLE2 shape

Change-Id: I5f69e3dabe67aa09f6a77c65e196401622f4b951

diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 4076b43..d89be23 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -688,6 +688,9 @@ 
std::vectorstd::pairuno::Referencechart2::XChartDocument, Rectangle  ScDoc
 continue;
 
 uno::Reference chart2::XChartDocument  xChartDoc( 
ScChartHelper::GetChartFromSdrObject( pObject ) );
+if(!xChartDoc.is())
+continue;
+
 Rectangle aRect = pObject-GetLastBoundRect();
 aRet.push_back(std::pairuno::Referencechart2::XChartDocument, 
Rectangle(xChartDoc, aRect));
 }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 338405a..80b7e77 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -581,7 +581,10 @@ void ScTabViewShell::AddOpenGLChartWindows()
 for(std::vectorstd::pairuno::Referencechart2::XChartDocument, 
Rectangle ::iterator itr = aCharts.begin(),
 itrEnd = aCharts.end(); itr != itrEnd; ++itr)
 {
+if(!itr-first.is())
+return;
 OpenGLWindow* pOpenGLWindow = new OpenGLWindow(pParentWindow);
+
 pOpenGLWindow-Show(false);
 Size aSize = itr-second.GetSize();
 Size aWindowSize = pOpenGLWindow-LogicToPixel( aSize, MapMode( 
MAP_100TH_MM ) );
commit e7aa4170212612f8b6bead91ceb6b4e86cf008d4
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Thu May 29 02:00:24 2014 +0200

pass more parameters by const reference

Change-Id: I46be96d6ba9f3fecb590c4be62775824194c380a

diff --git a/chart2/source/view/inc/GL3DRenderer.hxx 
b/chart2/source/view/inc/GL3DRenderer.hxx
index a0036ed..61d297b 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -168,17 +168,15 @@ public:
 void AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 color, 
sal_uInt32 specular, const glm::mat4 modelMatrix, sal_uInt32 nUniqueId);
 void EndAddShape3DExtrudeObject();
 void SetSize(const Size rSize);
-void SetCameraInfo(glm::vec3 pos, glm::vec3 direction, glm::vec3 up);
+void SetCameraInfo(const glm::vec3 pos, const glm::vec3 direction, const 
glm::vec3 up);
 void CreateTextTexture(const boost::shared_arraysal_uInt8 bitmapBuf,
::Size maSizePixels,
-   glm::vec3 vTopLeft,glm::vec3 vTopRight,
-   glm::vec3 vBottomRight, glm::vec3 vBottomLeft,
+   const glm::vec3 vTopLeft, const glm::vec3 
vTopRight,
+   const glm::vec3 vBottomRight, const glm::vec3 
vBottomLeft,
sal_uInt32 nUniqueId);
 void CreateScreenTextTexture(const boost::shared_arraysal_uInt8 
bitmapBuf,
- ::Size maSizePixels,
-
- glm::vec2 vTopLeft, glm::vec2 vBottomRight,
- sal_uInt32 nUniqueId);
+ ::Size maSizePixels, const glm::vec2 
vTopLeft,
+ const glm::vec2 vBottomRight, sal_uInt32 
nUniqueId);
 void ProcessUnrenderedShape(bool bNewScene);
 
 void SetPickingMode(bool bPickingMode);
@@ -188,12 +186,12 @@ public:
 void ReleaseShapes();
 void ReleaseScreenTextShapes();
 private:
-void MoveModelf(PosVecf3 trans,PosVecf3 angle,PosVecf3 scale);
+void MoveModelf( const PosVecf3 trans, const PosVecf3 angle, const 
PosVecf3 scale);
 
 void ClearBuffer();
 void RenderPolygon3DObject();
-void RenderLine3D(Polygon3DInfo polygon);
-void RenderPolygon3D(Polygon3DInfo polygon);
+void RenderLine3D(const Polygon3DInfo polygon);
+void RenderPolygon3D(const Polygon3DInfo polygon);
 void Init3DUniformBlock();
 void Update3DUniformBlock();
 void RenderExtrude3DObject();
@@ -228,8 +226,8 @@ private:
 void ReleaseTextShapes();
 void ReleaseBatchBarInfo();
 void GetBatchBarsInfo();
-void GetBatchTopAndFlatInfo(Extrude3DInfo extrude3D);
-void GetBatchMiddleInfo(Extrude3DInfo extrude3D);
+void GetBatchTopAndFlatInfo(const Extrude3DInfo extrude3D);
+void GetBatchMiddleInfo(const Extrude3DInfo extrude3D);
 void InitBatch3DUniformBlock();
 void UpdateBatch3DUniformBlock();
 void RenderBatchBars(bool bNewScene);
diff 

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

2014-05-23 Thread Markus Mohrhard
 chart2/source/view/main/GL3DRenderer.cxx |2 +-
 sc/source/ui/view/tabvwsh4.cxx   |5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit c2ce981dfb40c36797620e8d026f616571b98082
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri May 23 17:36:40 2014 +0200

don't enable debug renderingto png

Change-Id: Ib15c3fb2f2dd61a9bbab9b6c47866e15c8a7659a

diff --git a/chart2/source/view/main/GL3DRenderer.cxx 
b/chart2/source/view/main/GL3DRenderer.cxx
index 6b96b5f..b2db1e7 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -21,7 +21,7 @@
 #include glm/gtc/matrix_inverse.hpp
 #include boost/checked_delete.hpp
 
-#define DEBUG_FBO 1
+#define DEBUG_FBO 0
 
 #define GL_PI 3.14159f
 
commit 77b320118b4ce837d038d6cb8eabb1d959010ae8
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Fri May 23 17:33:39 2014 +0200

we need to map 100th mm to pixel also for the import

Change-Id: I09084d67283b10e024ed926dc0e8d38030d28713

diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 01c171d..7a3a35f 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -545,10 +545,11 @@ void ScTabViewShell::AddOpenGLChartWindows()
 OpenGLWindow* pOpenGLWindow = new OpenGLWindow(pParentWindow);
 pOpenGLWindow-Show(false);
 Size aSize = itr-second.GetSize();
+Size aWindowSize = pOpenGLWindow-LogicToPixel( aSize, MapMode( 
MAP_100TH_MM ) );
 
-pOpenGLWindow-SetSizePixel(aSize);
+pOpenGLWindow-SetSizePixel(aWindowSize);
 Point aPos = itr-second.TopLeft();
-pOpenGLWindow-SetPosPixel(aPos);
+pOpenGLWindow-SetPosPixel(pOpenGLWindow-LogicToPixel(aPos, 
MapMode(MAP_100TH_MM)));
 pParentWindow-AddChildWindow(pOpenGLWindow);
 uno::Reference chart2::X3DChartWindowProvider  x3DWindowProvider( 
itr-first, uno::UNO_QUERY_THROW );
 sal_uInt64 nWindowPtr = reinterpret_castsal_uInt64(pOpenGLWindow);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-12 Thread weigao
 chart2/source/view/main/GL3DRenderer.cxx |3 +--
 sc/source/ui/view/gridwin.cxx|3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 21162eab55e3ae6e21c5cef6f7fd1f35d71aac3e
Author: weigao wei...@multicorewareinc.com
Date:   Mon May 12 22:41:03 2014 +0200

some fixes for positioning problems

Change-Id: I4e970837ebe6867458e4a75c7cc323f8f6b3ecc8

diff --git a/chart2/source/view/main/GL3DRenderer.cxx 
b/chart2/source/view/main/GL3DRenderer.cxx
index 69e961b..686413d 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1287,7 +1287,7 @@ void OpenGL3DRenderer::RenderTextShape()
 PosVecf3 angle = {0.0f, 0.0f, 0.0f};
 PosVecf3 scale = {1.0, 1.0, 1.0f};
 MoveModelf(trans, angle, scale);
-m_MVP = m_Projection * m_View * m_Model;
+m_MVP = m_3DProjection * m_3DView * m_Model;
 glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
 CHECK_GL_ERROR();
 glBufferData(GL_ARRAY_BUFFER, sizeof(textInfo.vertex), 
textInfo.vertex, GL_STATIC_DRAW);
@@ -1401,7 +1401,6 @@ void OpenGL3DRenderer::ProcessUnrenderedShape()
 CreateSceneBoxView();
 glViewport(0, 0, m_iWidth, m_iHeight);
 glClearDepth(1.0f);
-glViewport(0, 0, m_iWidth, m_iHeight);
 glClearColor(1.0, 1.0, 1.0, 1.0);
 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 //Polygon
commit 3dbd2968025ab51fb961d64093a14f910828f57f
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Mon May 12 22:39:50 2014 +0200

only send mouse events if the window is visible

Change-Id: I2564159cd21e068c0893fc96d1c7e90746788f39

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 95ce9fd..d1194bf 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1642,6 +1642,9 @@ void ScGridWindow::MouseButtonDown( const MouseEvent 
rMEvt )
 for(boost::ptr_vectorWindow::iterator itr = maChildWindows.begin(),
 itrEnd = maChildWindows.end(); itr != itrEnd; ++itr)
 {
+if(!itr-IsVisible())
+continue;
+
 Point aPoint = itr-GetPosPixel();
 Size aSize = itr-GetSizePixel();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-16 Thread Markus Mohrhard
 chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx |3 ++-
 chart2/source/inc/FastPropertyIdRanges.hxx |3 ++-
 sc/source/ui/unoobj/chart2uno.cxx  |5 +
 3 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 0ce6d9bcea7c37a7cb2c42e8393e2e20780bd171
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Thu Apr 17 02:02:15 2014 +0200

limit the range shrinking in charts to really large ranges, fdo#70609,

Also improves the situation for fdo#55697.

It is just the fist step to a better algorithm.

Change-Id: I15de1ca6604e585fcf5690f0d903c757d641e765

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 826e74b..348c86d 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1368,6 +1368,8 @@ bool lcl_addUpperLeftCornerIfMissing(vectorScTokenRef 
rRefTokens,
 return true;
 }
 
+#define SHRINK_RANGE_THRESHOLD 1
+
 class ShrinkRefTokenToDataRange : std::unary_functionScTokenRef, void
 {
 ScDocument* mpDoc;
@@ -1387,6 +1389,9 @@ public:
 ScSingleRefData s = rData.Ref1;
 ScSingleRefData e = rData.Ref2;
 
+if(abs((e.Col()-s.Col())*(e.Row()-s.Row()))  SHRINK_RANGE_THRESHOLD)
+return;
+
 SCCOL nMinCol = MAXCOL, nMaxCol = 0;
 SCROW nMinRow = MAXROW, nMaxRow = 0;
 
commit b7ba33e4a0a2094b9e515249d9da0c30a1272402
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Thu Apr 17 01:28:38 2014 +0200

fix non unique property handle

Change-Id: I110feee77ab65bc8f528e85cba7c74063937b086

diff --git a/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx 
b/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx
index 20e366c..5625242 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx
@@ -9,6 +9,7 @@
 
 #include WrappedGL3DProperties.hxx
 #include Chart2ModelContact.hxx
+#include FastPropertyIdRanges.hxx
 #include unonames.hxx
 #include WrappedProperty.hxx
 #include DiagramHelper.hxx
@@ -24,7 +25,7 @@ namespace {
 
 enum
 {
-PROP_GL3DCHARTTYPE_ROUNDED_EDGE
+PROP_GL3DCHARTTYPE_ROUNDED_EDGE = FAST_PROPERTY_ID_START_GL_3D
 };
 
 class WrappedGL3DProperty : public WrappedProperty
diff --git a/chart2/source/inc/FastPropertyIdRanges.hxx 
b/chart2/source/inc/FastPropertyIdRanges.hxx
index 0c24f46..d848bab 100644
--- a/chart2/source/inc/FastPropertyIdRanges.hxx
+++ b/chart2/source/inc/FastPropertyIdRanges.hxx
@@ -40,7 +40,8 @@ enum FastPropertyIdRanges
 FAST_PROPERTY_ID_START_CHART_SPLINE_PROP = FAST_PROPERTY_ID_START + 15000,
 FAST_PROPERTY_ID_START_CHART_STOCK_PROP = FAST_PROPERTY_ID_START + 16000,
 FAST_PROPERTY_ID_START_CHART_AUTOPOSITION_PROP = FAST_PROPERTY_ID_START + 
17000,
-FAST_PROPERTY_ID_START_SCALE_TEXT_PROP = FAST_PROPERTY_ID_START + 18000
+FAST_PROPERTY_ID_START_SCALE_TEXT_PROP = FAST_PROPERTY_ID_START + 18000,
+FAST_PROPERTY_ID_START_GL_3D = FAST_PROPERTY_ID_START + 19000
 };
 
 } //  namespace chart
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-12-10 Thread Tomaž Vajngerl
 chart2/source/controller/dialogs/ObjectNameProvider.cxx |   17 ++--
 sc/source/core/opencl/opencl_device_selection.h |3 +-
 2 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 0a3432850458f3c4e880f087f774f376761b521b
Author: Tomaž Vajngerl qui...@gmail.com
Date:   Wed Dec 11 08:08:56 2013 +0100

WaE: : ignoring return value -Werror=unused-result

Change-Id: Ia75ccbe4ffd1e44585a590c7931b920168a6c703

diff --git a/sc/source/core/opencl/opencl_device_selection.h 
b/sc/source/core/opencl/opencl_device_selection.h
index b4c60b9..d6f775a 100644
--- a/sc/source/core/opencl/opencl_device_selection.h
+++ b/sc/source/core/opencl/opencl_device_selection.h
@@ -365,7 +365,8 @@ inline ds_status readProFile(const char* fileName, char** 
content, size_t* conte
 {
 return DS_FILE_ERROR;
 }
-fread(binary, sizeof(char), size, input);
+size_t bytesRead = fread(binary, sizeof(char), size, input);
+(void) bytesRead; // avoid warning
 fclose(input);
 
 *contentSize = size;
commit 2300cdcb637face2bd63935ac923817565370466
Author: Tomaž Vajngerl qui...@gmail.com
Date:   Tue Dec 10 21:55:15 2013 +0100

Show name of the trendline in tooltip (at hovering).

Change-Id: Iaaef26fdb5f1f46b6e0ffece484cf884cc29c84c

diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx 
b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 39a776f..1ceba06 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -615,8 +615,21 @@ OUString ObjectNameProvider::getHelpText( const OUString 
rObjectCID, const Refe
 }
 else
 {
-// non-verbose
-aRet = ObjectNameProvider::getName( eObjectType, false );
+Reference chart2::XDataSeries  xSeries( 
ObjectIdentifier::getDataSeriesForCID(rObjectCID , xChartModel));
+Reference chart2::XRegressionCurveContainer  xCurveCnt( xSeries, 
uno::UNO_QUERY );
+aRet += getName(eObjectType, false);
+
+if( xCurveCnt.is())
+{
+sal_Int32 nCurveIndex = 
ObjectIdentifier::getIndexFromParticleOrCID( rObjectCID );
+Reference chart2::XRegressionCurve  xCurve( 
RegressionCurveHelper::getRegressionCurveAtIndex(xCurveCnt, nCurveIndex) );
+if( xCurve.is())
+{
+aRet +=  (;
+aRet += 
RegressionCurveHelper::getRegressionCurveName(xCurve);
+aRet +=  );
+}
+}
 }
 }
 else if( OBJECTTYPE_DATA_AVERAGE_LINE == eObjectType )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-07 Thread Julien Nabet
 chart2/source/controller/dialogs/ObjectNameProvider.cxx |9 +++--
 chart2/source/tools/ObjectIdentifier.cxx|7 ++-
 sc/source/filter/qpro/qpro.cxx  |3 +--
 sw/source/ui/shells/textsh1.cxx |3 +--
 xmloff/source/core/xmluconv.cxx |3 +--
 5 files changed, 8 insertions(+), 17 deletions(-)

New commits:
commit 3f3980ff242203e45e10c8fb13f871f968377383
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Apr 7 22:18:57 2013 +0200

Some cppcheck cleaning

Change-Id: I425ed98a721ded162c2ae08d145aaa9dbf548632

diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx 
b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 6ef7bd9..29a3f38 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -509,9 +509,8 @@ OUString ObjectNameProvider::getHelpText( const OUString 
rObjectCID, const Refe
 sal_Int32 nPointIndex( 
ObjectIdentifier::getParticleID(rObjectCID).toInt32() );
 
 //replace data point index
-sal_Int32 nIndex = -1;
 OUString aWildcard(  %POINTNUMBER );
-nIndex = aRet.indexOf( aWildcard );
+sal_Int32 nIndex = aRet.indexOf( aWildcard );
 if( nIndex != -1 )
 {
 aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), 
OUString::valueOf(nPointIndex+1) );
@@ -569,9 +568,8 @@ OUString ObjectNameProvider::getHelpText( const OUString 
rObjectCID, const Refe
 RegressionCurveHelper::initializeCurveCalculator( 
xCalculator, xSeries, xChartModel );
 
 // replace formula
-sal_Int32 nIndex = -1;
 OUString aWildcard( %FORMULA );
-nIndex = aRet.indexOf( aWildcard );
+sal_Int32 nIndex = aRet.indexOf( aWildcard );
 if( nIndex != -1 )
 aRet = aRet.replaceAt( nIndex, 
aWildcard.getLength(), xCalculator-getRepresentation());
 
@@ -620,9 +618,8 @@ OUString ObjectNameProvider::getHelpText( const OUString 
rObjectCID, const Refe
 
 sal_Unicode aDecimalSep( '.' );
 
-sal_Int32 nIndex = -1;
 OUString aWildcard( %AVERAGE_VALUE );
-nIndex = aRet.indexOf( aWildcard );
+sal_Int32 nIndex = aRet.indexOf( aWildcard );
 // as the curve is constant, the value at any x-value 
is ok
 if( nIndex != -1 )
 {
diff --git a/chart2/source/tools/ObjectIdentifier.cxx 
b/chart2/source/tools/ObjectIdentifier.cxx
index 1097984..8d4b3ba 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -764,8 +764,7 @@ bool ObjectIdentifier::isMultiClickObject( const OUString 
rClassifiedIdentifier
 //was selected before;
 
 //! by definition the name of a MultiClickObject starts with 
CID/MultiClick:
-bool bRet = false;
-bRet = rClassifiedIdentifier.match( m_aMultiClick, m_aProtocol.getLength() 
);
+bool bRet = rClassifiedIdentifier.match( m_aMultiClick, 
m_aProtocol.getLength() );
 return bRet;
 }
 
@@ -1027,11 +1026,9 @@ OUString ObjectIdentifier::createChildParticleWithIndex( 
ObjectType eObjectType,
 
 sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( const OUString 
rParticleOrCID )
 {
-sal_Int32 nRet = -1;
-
 OUString aIndexString = lcl_getIndexStringAfterString( rParticleOrCID, = 
);
 sal_Int32 nCharacterIndex=0;
-nRet = lcl_StringToIndex( aIndexString.getToken( 0, ',', nCharacterIndex ) 
);
+sal_Int32 nRet = lcl_StringToIndex( aIndexString.getToken( 0, ',', 
nCharacterIndex ) );
 
 return nRet;
 }
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 1247ecc..f665884 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -126,9 +126,8 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* 
pDoc, ScQProStyle *pSt
 
 FltError ScFormatFilterPluginImpl::ScImportQuattroPro( SfxMedium rMedium, 
ScDocument *pDoc )
 {
-FltError   eRet = eERR_OK;
 ScQProReader aReader( rMedium );
-eRet = aReader.import( pDoc );
+FltError eRet = aReader.import( pDoc );
 return eRet;
 }
 
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 056a5c8..23b8500 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -431,11 +431,10 @@ sal_Bool SvXMLUnitConverter::convertDateTime( double 
fDateTime,
 
 if (bSuccess)
 {
-double fTempDateTime = 0.0;
 const Date aTmpNullDate(aTempNullDate.Day, aTempNullDate.Month, 
aTempNullDate.Year);
 const Date aTempDate((sal_uInt16)aDateTime.Day,