[Libreoffice-commits] .: Branch 'libreoffice-3-6' - chart2/source

2013-01-25 Thread Libreoffice Gerrit user
 chart2/source/model/filter/XMLFilter.cxx |   40 ++-
 1 file changed, 19 insertions(+), 21 deletions(-)

New commits:
commit 78ab871ca7b32867f23df18280d04845d6bf2d61
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Jan 24 22:24:44 2013 -0500

bnc#798271: Don't delete the PropertyMapEntry instance prematurely.

When using comphelper::PropertyMapEntry array to create a UNO property
set, we need to make sure we keep this instance while the property set
object is alive, else it would cause a very hard-to-debug problem down
the road...

In this particular case, the aExportInfoMap array instance was destroyed
when it went out of scope, but the xInfoSet which references it was used
afterward.

Change-Id: I02132b6b2e6bef7b461f0f77c2c4a3e911e42014
Reviewed-on: https://gerrit.libreoffice.org/1859
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/chart2/source/model/filter/XMLFilter.cxx 
b/chart2/source/model/filter/XMLFilter.cxx
index 2a6e35b..551e9b2 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -644,28 +644,26 @@ sal_Int32 XMLFilter::impl_Export(
 xServiceFactory-createInstanceWithArguments(
 C2U(com.sun.star.comp.Svx.GraphicExportHelper), 
aGraphicResolverArgs ), uno::UNO_QUERY );
 
-uno::Reference beans::XPropertySet  xInfoSet;
+// property map for export info set
+comphelper::PropertyMapEntry aExportInfoMap[] =
 {
-// property map for export info set
-comphelper::PropertyMapEntry aExportInfoMap[] =
-{
-{ MAP_LEN(UsePrettyPrinting), 0, ::getBooleanCppuType(), 
beans::PropertyAttribute::MAYBEVOID, 0},
-{ MAP_LEN(BaseURI), 0, ::getCppuType( (OUString *)0 ), 
beans::PropertyAttribute::MAYBEVOID, 0 },
-{ MAP_LEN(StreamRelPath), 0, ::getCppuType( (OUString *)0 
), beans::PropertyAttribute::MAYBEVOID, 0 },
-{ MAP_LEN(StreamName), 0, ::getCppuType( (OUString *)0 ), 
beans::PropertyAttribute::MAYBEVOID, 0 },
-{ MAP_LEN(ExportTableNumberList), 0, 
::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 },
-{ NULL, 0, 0, NULL, 0, 0 }
-};
-
-xInfoSet = comphelper::GenericPropertySet_CreateInstance( new 
comphelper::PropertySetInfo( aExportInfoMap ) );
-
-SvtSaveOptions aSaveOpt;
-OUString 
sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM(UsePrettyPrinting));
-sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() );
-xInfoSet-setPropertyValue( sUsePrettyPrinting, uno::makeAny( 
bUsePrettyPrinting ) );
-if( ! bOasis )
-xInfoSet-setPropertyValue( C2U(ExportTableNumberList), 
uno::makeAny( true ));
-}
+{ MAP_LEN(UsePrettyPrinting), 0, ::getBooleanCppuType(), 
beans::PropertyAttribute::MAYBEVOID, 0},
+{ MAP_LEN(BaseURI), 0, ::getCppuType( (OUString *)0 ), 
beans::PropertyAttribute::MAYBEVOID, 0 },
+{ MAP_LEN(StreamRelPath), 0, ::getCppuType( (OUString *)0 ), 
beans::PropertyAttribute::MAYBEVOID, 0 },
+{ MAP_LEN(StreamName), 0, ::getCppuType( (OUString *)0 ), 
beans::PropertyAttribute::MAYBEVOID, 0 },
+{ MAP_LEN(ExportTableNumberList), 0, ::getBooleanCppuType(), 
beans::PropertyAttribute::MAYBEVOID, 0 },
+{ NULL, 0, 0, NULL, 0, 0 }
+};
+
+uno::Reference beans::XPropertySet  xInfoSet =
+comphelper::GenericPropertySet_CreateInstance( new 
comphelper::PropertySetInfo( aExportInfoMap ) );
+
+SvtSaveOptions aSaveOpt;
+OUString 
sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM(UsePrettyPrinting));
+sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() );
+xInfoSet-setPropertyValue( sUsePrettyPrinting, uno::makeAny( 
bUsePrettyPrinting ) );
+if( ! bOasis )
+xInfoSet-setPropertyValue( C2U(ExportTableNumberList), 
uno::makeAny( true ));
 
 sal_Int32 nArgs = 2;
 if( xGraphicObjectResolver.is())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-6' - chart2/source

2013-01-25 Thread Libreoffice Gerrit user
 chart2/source/view/main/VDataSeries.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cf00b9530d6e70107c5155ecb3870aa15de63896
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Jan 25 16:56:43 2013 -0500

bnc#590020: Sort data points stably.

std::sort is unstable sort, which is not what we want.  Use std::stable_sort
to sort data points by X values.  If we use unstable sort, it may mess up
the order of the sequence when two data points contain identical X values.

Change-Id: I6453a986185b326dc680fbcec6227ea332235b22
Reviewed-on: https://gerrit.libreoffice.org/1872
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/chart2/source/view/main/VDataSeries.cxx 
b/chart2/source/view/main/VDataSeries.cxx
index 9fc7695..811422b 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -313,7 +313,7 @@ void VDataSeries::doSortByXValues()
 }
 
 //do sort
-std::sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() );
+std::stable_sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() );
 
 //fill the sorted points back to the members
 m_aValues_X.Doubles.realloc( m_nPointCount );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-6' - chart2/source

2012-09-26 Thread Libreoffice Gerrit user
 chart2/source/view/axes/VCartesianAxis.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 0a01bd496037bb34f90b7baf9d7bd8a46eea762f
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Mon Sep 24 15:29:01 2012 -0400

fdo#55297: Fix regression in chart complex category placements.

This is effectively a revert of a769fd1ec076b61c1ce2f84da87283cc637dd5d5
and a1be31fd8bf830a4f5961e690bcffd050782e210 which unfortunately caused
regression in complex category placements.

This unfortunately re-introduces fdo#44832. We need to re-think how to
fix that one without breaking the multi-level category feature.

Change-Id: I1ed8364a46174ac6c29aa0b027a33f84bcca51fa
Signed-off-by: Noel Power noel.po...@suse.com

diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index 9ffd923..b75e12d 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -473,11 +473,11 @@ void 
VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector ::s
 rAllTickInfos.clear();
 sal_Int32 nLevel=0;
 sal_Int32 nLevelCount = 
m_aAxisProperties.m_pExplicitCategoriesProvider-getCategoryLevelCount();
-sal_Int32 nCatIndex = 0;
 for( ; nLevelnLevelCount; nLevel++ )
 {
 ::std::vector TickInfo  aTickInfoVector;
 std::vector ComplexCategory  aComplexCategories( 
m_aAxisProperties.m_pExplicitCategoriesProvider-getCategoriesByLevel( nLevel ) 
);
+sal_Int32 nCatIndex = 0;
 std::vector ComplexCategory ::const_iterator 
aIt(aComplexCategories.begin());
 std::vector ComplexCategory ::const_iterator 
aEnd(aComplexCategories.end());
 for(;aIt!=aEnd;++aIt)
@@ -1328,13 +1328,18 @@ void VCartesianAxis::doStaggeringOfLabels( const 
AxisLabelProperties rAxisLabel
 B2DVector aCummulatedLabelsDistance(0,0);
 for( sal_Int32 nTextLevel=0; nTextLevelnTextLevelCount; nTextLevel++ )
 {
-boost::scoped_ptr TickIter  apTickIter(createLabelTickIterator( 
nTextLevel ));
-if(apTickIter)
+boost::scoped_ptrTickIter 
apTickIter(createLabelTickIterator(nTextLevel));
+if (apTickIter)
 {
 double fRotationAngleDegree = 
m_aAxisLabelProperties.fRotationAngleDegree;
+if( nTextLevel0 )
+{
+lcl_shiftLables( *apTickIter.get(), 
aCummulatedLabelsDistance );
+fRotationAngleDegree = 0.0;
+}
 aCummulatedLabelsDistance += lcl_getLabelsDistance( 
*apTickIter.get()
-, pTickFactory2D-getDistanceAxisTickToText( 
m_aAxisProperties )
-, fRotationAngleDegree );
+, pTickFactory2D-getDistanceAxisTickToText( 
m_aAxisProperties )
+, fRotationAngleDegree );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-6' - chart2/source

2012-09-26 Thread Libreoffice Gerrit user
 chart2/source/tools/ExplicitCategoriesProvider.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit f665c41f2dfeedeee34f2a7024432083ed809a18
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Mon Sep 24 16:09:10 2012 -0400

fdo#55298: We should only treat empty values as continuation of previous 
ones.

For better Excel compatibility.

Change-Id: I3bc44f65127d3f020894dc29e5c6549bb257f218
Signed-off-by: Noel Power noel.po...@suse.com

diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx 
b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index 73f5801..bc938e6 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -293,7 +293,7 @@ std::vector ComplexCategory  
lcl_DataSequenceToComplexCategoryVector(
 sal_Int32 nCurrentCount=0;
 for( sal_Int32 nN=0; nNnMaxCount; nN++ )
 {
-OUString aCurrent = rStrings[nN];
+const OUString aCurrent = rStrings[nN];
 if( bCreateSingleCategories || ::std::find( rLimitingBorders.begin(), 
rLimitingBorders.end(), nN ) != rLimitingBorders.end() )
 {
 aResult.push_back( ComplexCategory(aPrevious,nCurrentCount) );
@@ -302,14 +302,18 @@ std::vector ComplexCategory  
lcl_DataSequenceToComplexCategoryVector(
 }
 else
 {
-if( !aCurrent.isEmpty()  aPrevious != aCurrent )
+// Empty value is interpreted as a continuation of the previous
+// category. Note that having the same value as the previous one
+// does not equate to a continuation of the category.
+
+if (aCurrent.isEmpty())
+++nCurrentCount;
+else
 {
 aResult.push_back( ComplexCategory(aPrevious,nCurrentCount) );
 nCurrentCount=1;
 aPrevious = aCurrent;
 }
-else
-nCurrentCount++;
 }
 }
 if( nCurrentCount )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits