loplugin:constantparam in canvas..comphelper
Change-Id: Ia666cb46c409852a13789389c032f0ce4377c0d5 Reviewed-on: https://gerrit.libreoffice.org/50927 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -266,7 +266,6 @@ namespace vclcanvas
|
||||
const ::basegfx::B2DHomMatrix& rTextureTransform,
|
||||
const ::tools::Rectangle& rBounds,
|
||||
unsigned int nStepCount,
|
||||
bool bFillNonOverlapping,
|
||||
const ::canvas::ParametricPolyPolygon::Values& rValues,
|
||||
const std::vector< ::Color >& rColors )
|
||||
{
|
||||
@@ -356,131 +355,48 @@ namespace vclcanvas
|
||||
|
||||
basegfx::utils::KeyStopLerp aLerper(rValues.maStops);
|
||||
|
||||
if( !bFillNonOverlapping )
|
||||
// fill background
|
||||
rOutDev.SetFillColor( rColors.front() );
|
||||
rOutDev.DrawRect( rBounds );
|
||||
|
||||
// render polygon
|
||||
// ==============
|
||||
|
||||
for( unsigned int i=1,p; i<nStepCount; ++i )
|
||||
{
|
||||
// fill background
|
||||
rOutDev.SetFillColor( rColors.front() );
|
||||
rOutDev.DrawRect( rBounds );
|
||||
const double fT( i/double(nStepCount) );
|
||||
|
||||
// render polygon
|
||||
// ==============
|
||||
std::ptrdiff_t nIndex;
|
||||
double fAlpha;
|
||||
std::tie(nIndex,fAlpha)=aLerper.lerp(fT);
|
||||
|
||||
for( unsigned int i=1,p; i<nStepCount; ++i )
|
||||
// lerp color
|
||||
rOutDev.SetFillColor(
|
||||
Color( static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
|
||||
static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
|
||||
static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
|
||||
|
||||
// scale and render polygon, by interpolating between
|
||||
// outer and inner polygon.
|
||||
|
||||
for( p=0; p<nNumPoints; ++p )
|
||||
{
|
||||
const double fT( i/double(nStepCount) );
|
||||
const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
|
||||
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
|
||||
|
||||
std::ptrdiff_t nIndex;
|
||||
double fAlpha;
|
||||
std::tie(nIndex,fAlpha)=aLerper.lerp(fT);
|
||||
|
||||
// lerp color
|
||||
rOutDev.SetFillColor(
|
||||
Color( static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
|
||||
static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
|
||||
static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
|
||||
|
||||
// scale and render polygon, by interpolating between
|
||||
// outer and inner polygon.
|
||||
|
||||
for( p=0; p<nNumPoints; ++p )
|
||||
{
|
||||
const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
|
||||
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
|
||||
|
||||
aTempPoly[static_cast<sal_uInt16>(p)] = ::Point(
|
||||
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
|
||||
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
|
||||
}
|
||||
|
||||
// close polygon explicitly
|
||||
aTempPoly[static_cast<sal_uInt16>(p)] = aTempPoly[0];
|
||||
|
||||
// TODO(P1): compare with vcl/source/gdi/outdev4.cxx,
|
||||
// OutputDevice::ImplDrawComplexGradient(), there's a note
|
||||
// that on some VDev's, rendering disjunct poly-polygons
|
||||
// is faster!
|
||||
rOutDev.DrawPolygon( aTempPoly );
|
||||
aTempPoly[static_cast<sal_uInt16>(p)] = ::Point(
|
||||
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
|
||||
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// render polygon
|
||||
// ==============
|
||||
|
||||
// For performance reasons, we create a temporary VCL polygon
|
||||
// here, keep it all the way and only change the vertex values
|
||||
// in the loop below (as ::Polygon is a pimpl class, creating
|
||||
// one every loop turn would really stress the mem allocator)
|
||||
::tools::PolyPolygon aTempPolyPoly;
|
||||
::tools::Polygon aTempPoly2( static_cast<sal_uInt16>(nNumPoints+1) );
|
||||
// close polygon explicitly
|
||||
aTempPoly[static_cast<sal_uInt16>(p)] = aTempPoly[0];
|
||||
|
||||
aTempPoly2[0] = rBounds.TopLeft();
|
||||
aTempPoly2[1] = rBounds.TopRight();
|
||||
aTempPoly2[2] = rBounds.BottomRight();
|
||||
aTempPoly2[3] = rBounds.BottomLeft();
|
||||
aTempPoly2[4] = rBounds.TopLeft();
|
||||
|
||||
aTempPolyPoly.Insert( aTempPoly );
|
||||
aTempPolyPoly.Insert( aTempPoly2 );
|
||||
|
||||
for( unsigned int i=0,p; i<nStepCount; ++i )
|
||||
{
|
||||
const double fT( (i+1)/double(nStepCount) );
|
||||
|
||||
std::ptrdiff_t nIndex;
|
||||
double fAlpha;
|
||||
std::tie(nIndex,fAlpha)=aLerper.lerp(fT);
|
||||
|
||||
// lerp color
|
||||
rOutDev.SetFillColor(
|
||||
Color( static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha)),
|
||||
static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha)),
|
||||
static_cast<sal_uInt8>(basegfx::utils::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha)) ));
|
||||
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
if( i && !(i % 10) )
|
||||
rOutDev.SetFillColor( COL_RED );
|
||||
#endif
|
||||
|
||||
// scale and render polygon. Note that here, we
|
||||
// calculate the inner polygon, which is actually the
|
||||
// start of the _next_ color strip. Thus, i+1
|
||||
|
||||
for( p=0; p<nNumPoints; ++p )
|
||||
{
|
||||
const ::basegfx::B2DPoint& rOuterPoint( aOuterPoly.getB2DPoint(p) );
|
||||
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
|
||||
|
||||
aTempPoly[static_cast<sal_uInt16>(p)] = ::Point(
|
||||
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
|
||||
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
|
||||
}
|
||||
|
||||
// close polygon explicitly
|
||||
aTempPoly[static_cast<sal_uInt16>(p)] = aTempPoly[0];
|
||||
|
||||
// swap inner and outer polygon
|
||||
aTempPolyPoly.Replace( aTempPolyPoly.GetObject( 1 ), 0 );
|
||||
|
||||
if( i+1<nStepCount )
|
||||
{
|
||||
// assign new inner polygon. Note that with this
|
||||
// formulation, the internal pimpl objects for both
|
||||
// temp polygons and the polypolygon remain identical,
|
||||
// minimizing heap accesses (only a Polygon wrapper
|
||||
// object is freed and deleted twice during this swap).
|
||||
aTempPolyPoly.Replace( aTempPoly, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// last, i.e. inner strip. Now, the inner polygon
|
||||
// has zero area anyway, and to not leave holes in
|
||||
// the gradient, finally render a simple polygon:
|
||||
aTempPolyPoly.Remove( 1 );
|
||||
}
|
||||
|
||||
rOutDev.DrawPolyPolygon( aTempPolyPoly );
|
||||
}
|
||||
// TODO(P1): compare with vcl/source/gdi/outdev4.cxx,
|
||||
// OutputDevice::ImplDrawComplexGradient(), there's a note
|
||||
// that on some VDev's, rendering disjunct poly-polygons
|
||||
// is faster!
|
||||
rOutDev.DrawPolygon( aTempPoly );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,7 +425,6 @@ namespace vclcanvas
|
||||
rTextureTransform,
|
||||
rBounds,
|
||||
nStepCount,
|
||||
false/*bFillNonOverlapping*/,
|
||||
rValues,
|
||||
rColors );
|
||||
break;
|
||||
|
||||
@@ -340,8 +340,7 @@ void checkNameAndType(Reference<XPropertySet> const & xProperties, const OUStrin
|
||||
void checkLinearTrendline(
|
||||
Reference<chart2::XRegressionCurve> const & xCurve, const OUString& aExpectedName,
|
||||
double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward,
|
||||
bool aExpectedForceIntercept, double aExpectedInterceptValue,
|
||||
bool aExpectedShowEquation, bool aExpectedR2)
|
||||
double aExpectedInterceptValue)
|
||||
{
|
||||
Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY );
|
||||
CPPUNIT_ASSERT(xProperties.is());
|
||||
@@ -351,16 +350,15 @@ void checkLinearTrendline(
|
||||
checkCommonTrendline(
|
||||
xCurve,
|
||||
aExpectedExtrapolateForward, aExpectedExtrapolateBackward,
|
||||
aExpectedForceIntercept, aExpectedInterceptValue,
|
||||
aExpectedShowEquation, aExpectedR2);
|
||||
/*aExpectedForceIntercept*/false, aExpectedInterceptValue,
|
||||
/*aExpectedShowEquation*/true, /*aExpectedR2*/false);
|
||||
}
|
||||
|
||||
void checkPolynomialTrendline(
|
||||
Reference<chart2::XRegressionCurve> const & xCurve, const OUString& aExpectedName,
|
||||
sal_Int32 aExpectedDegree,
|
||||
double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward,
|
||||
bool aExpectedForceIntercept, double aExpectedInterceptValue,
|
||||
bool aExpectedShowEquation, bool aExpectedR2)
|
||||
double aExpectedInterceptValue)
|
||||
{
|
||||
Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY );
|
||||
CPPUNIT_ASSERT(xProperties.is());
|
||||
@@ -374,8 +372,8 @@ void checkPolynomialTrendline(
|
||||
checkCommonTrendline(
|
||||
xCurve,
|
||||
aExpectedExtrapolateForward, aExpectedExtrapolateBackward,
|
||||
aExpectedForceIntercept, aExpectedInterceptValue,
|
||||
aExpectedShowEquation, aExpectedR2);
|
||||
/*aExpectedForceIntercept*/true, aExpectedInterceptValue,
|
||||
/*aExpectedShowEquation*/true, /*aExpectedR2*/true);
|
||||
}
|
||||
|
||||
void checkMovingAverageTrendline(
|
||||
@@ -408,11 +406,11 @@ void checkTrendlinesInChart(uno::Reference< chart2::XChartDocument > const & xCh
|
||||
|
||||
xCurve = xRegressionCurveSequence[0];
|
||||
CPPUNIT_ASSERT(xCurve.is());
|
||||
checkPolynomialTrendline(xCurve, "col2_poly", 3, 0.1, -0.1, true, -1.0, true, true);
|
||||
checkPolynomialTrendline(xCurve, "col2_poly", 3, 0.1, -0.1, -1.0);
|
||||
|
||||
xCurve = xRegressionCurveSequence[1];
|
||||
CPPUNIT_ASSERT(xCurve.is());
|
||||
checkLinearTrendline(xCurve, "col2_linear", -0.5, -0.5, false, 0.0, true, false);
|
||||
checkLinearTrendline(xCurve, "col2_linear", -0.5, -0.5, 0.0);
|
||||
|
||||
xCurve = xRegressionCurveSequence[2];
|
||||
CPPUNIT_ASSERT(xCurve.is());
|
||||
@@ -798,23 +796,21 @@ void Chart2ExportTest::testAxisNumberFormatXLS()
|
||||
}
|
||||
}
|
||||
|
||||
void change( const Reference<chart2::XChartDocument>& xChartDoc, bool bSetNumFmtLinked, sal_Int16 nNumFmtTypeFlag )
|
||||
void change( const Reference<chart2::XChartDocument>& xChartDoc, sal_Int16 nNumFmtTypeFlag )
|
||||
{
|
||||
Reference<chart2::XAxis> xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 );
|
||||
Reference<beans::XPropertySet> xPS( xAxisY, uno::UNO_QUERY_THROW );
|
||||
Any aAny( bSetNumFmtLinked );
|
||||
Any aAny( false );
|
||||
xPS->setPropertyValue( "LinkNumberFormatToSource", aAny );
|
||||
if ( !bSetNumFmtLinked )
|
||||
{
|
||||
Reference<util::XNumberFormatsSupplier> xNFS( xChartDoc, uno::UNO_QUERY_THROW );
|
||||
Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats();
|
||||
CPPUNIT_ASSERT( xNumberFormats.is() );
|
||||
lang::Locale aLocale{ "en", "US", "" };
|
||||
Sequence<sal_Int32> aNumFmts = xNumberFormats->queryKeys( nNumFmtTypeFlag, aLocale, false );
|
||||
CPPUNIT_ASSERT( aNumFmts.hasElements() );
|
||||
aAny <<= aNumFmts[0];
|
||||
xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny );
|
||||
}
|
||||
|
||||
Reference<util::XNumberFormatsSupplier> xNFS( xChartDoc, uno::UNO_QUERY_THROW );
|
||||
Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats();
|
||||
CPPUNIT_ASSERT( xNumberFormats.is() );
|
||||
lang::Locale aLocale{ "en", "US", "" };
|
||||
Sequence<sal_Int32> aNumFmts = xNumberFormats->queryKeys( nNumFmtTypeFlag, aLocale, false );
|
||||
CPPUNIT_ASSERT( aNumFmts.hasElements() );
|
||||
aAny <<= aNumFmts[0];
|
||||
xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny );
|
||||
}
|
||||
|
||||
} aTest;
|
||||
@@ -824,7 +820,7 @@ void Chart2ExportTest::testAxisNumberFormatXLS()
|
||||
Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet( 0, mxComponent );
|
||||
aTest.check( xChartDoc, true, util::NumberFormat::PERCENT );
|
||||
|
||||
aTest.change( xChartDoc, false, util::NumberFormat::NUMBER );
|
||||
aTest.change( xChartDoc, util::NumberFormat::NUMBER );
|
||||
// Write the document(xls) with changes made close it, load it and check if changes are intact
|
||||
reload( "MS Excel 97" );
|
||||
xChartDoc = getChartDocFromSheet( 0, mxComponent );
|
||||
|
||||
@@ -57,7 +57,7 @@ OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSeq
|
||||
bool bMatchPrefix = false );
|
||||
|
||||
/** Retrieves all data sequences in the given data source that match the given
|
||||
role.
|
||||
role prefix.
|
||||
|
||||
@param aSource
|
||||
The data source containing all data sequences to be searched through.
|
||||
@@ -68,8 +68,7 @@ OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSeq
|
||||
OOO_DLLPUBLIC_CHARTTOOLS std::vector<
|
||||
css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
|
||||
getAllDataSequencesByRole( const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & aDataSequences,
|
||||
const OUString& aRole,
|
||||
bool bMatchPrefix );
|
||||
const OUString& aRole );
|
||||
|
||||
OOO_DLLPUBLIC_CHARTTOOLS
|
||||
std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence> >
|
||||
|
||||
@@ -306,7 +306,7 @@ Reference< beans::XPropertySet >
|
||||
}
|
||||
|
||||
std::vector< Reference< chart2::data::XLabeledDataSequence > > aValuesSeries(
|
||||
DataSeriesHelper::getAllDataSequencesByRole( aSequences , "values", true ) );
|
||||
DataSeriesHelper::getAllDataSequencesByRole( aSequences , "values" ) );
|
||||
|
||||
if (aValuesSeries.empty())
|
||||
throw lang::IndexOutOfBoundsException();
|
||||
|
||||
@@ -183,7 +183,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
|
||||
{
|
||||
vector< Reference< data::XLabeledDataSequence > > aValueSeqVec(
|
||||
DataSeriesHelper::getAllDataSequencesByRole(
|
||||
xSeriesSource->getDataSequences(), "values", true ));
|
||||
xSeriesSource->getDataSequences(), "values" ));
|
||||
if( xValuesX.is())
|
||||
aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX ));
|
||||
if( xValuesY.is())
|
||||
|
||||
@@ -163,7 +163,7 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries(
|
||||
{
|
||||
vector< Reference< data::XLabeledDataSequence > > aValueSeqVec(
|
||||
DataSeriesHelper::getAllDataSequencesByRole(
|
||||
xSeriesSource->getDataSequences(), "values", true ));
|
||||
xSeriesSource->getDataSequences(), "values" ));
|
||||
if( xValuesX.is())
|
||||
aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX ));
|
||||
if( xValuesY.is())
|
||||
|
||||
@@ -197,7 +197,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
|
||||
if( xSource.is() )
|
||||
{
|
||||
std::vector< Reference< chart2::data::XLabeledDataSequence > > aXValues(
|
||||
DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), "values-x", true ) );
|
||||
DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), "values-x" ) );
|
||||
if( aXValues.empty() )
|
||||
{
|
||||
Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
|
||||
|
||||
@@ -226,12 +226,12 @@ Reference< chart2::data::XLabeledDataSequence >
|
||||
|
||||
std::vector< Reference< chart2::data::XLabeledDataSequence > >
|
||||
getAllDataSequencesByRole( const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aDataSequences,
|
||||
const OUString& aRole, bool bMatchPrefix /* = false */ )
|
||||
const OUString& aRole )
|
||||
{
|
||||
std::vector< Reference< chart2::data::XLabeledDataSequence > > aResultVec;
|
||||
std::copy_if( aDataSequences.begin(), aDataSequences.end(),
|
||||
std::back_inserter( aResultVec ),
|
||||
lcl_MatchesRole(aRole, bMatchPrefix) );
|
||||
lcl_MatchesRole(aRole, /*bMatchPrefix*/true) );
|
||||
return aResultVec;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ uno::Reference< lang::XComponent > SynchronousDispatch::dispatch(
|
||||
const uno::Reference< uno::XInterface > &xStartPoint,
|
||||
const OUString &sURL,
|
||||
const OUString &sTarget,
|
||||
const sal_Int32 nFlags,
|
||||
const uno::Sequence< beans::PropertyValue > &lArguments )
|
||||
{
|
||||
util::URL aURL;
|
||||
@@ -50,7 +49,7 @@ uno::Reference< lang::XComponent > SynchronousDispatch::dispatch(
|
||||
uno::Reference < frame::XDispatchProvider > xProvider( xStartPoint, uno::UNO_QUERY );
|
||||
|
||||
if ( xProvider.is() )
|
||||
xDispatcher = xProvider->queryDispatch( aURL, sTarget, nFlags );
|
||||
xDispatcher = xProvider->queryDispatch( aURL, sTarget, 0 );
|
||||
|
||||
uno::Reference < lang::XComponent > aComponent;
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ Reference< XConnection> getConnection(const Reference< XRowSet>& _rxRowSet)
|
||||
// if connectRowset (which is deprecated) is removed, this function and one of its parameters are
|
||||
// not needed anymore, the whole implementation can be moved into ensureRowSetConnection then)
|
||||
SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext,
|
||||
bool _bSetAsActiveConnection, bool _bAttachAutoDisposer )
|
||||
bool _bAttachAutoDisposer )
|
||||
{
|
||||
SharedConnection xConnection;
|
||||
|
||||
@@ -359,11 +359,8 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R
|
||||
|| ( xExistingConn = findConnection( _rxRowSet ) ).is()
|
||||
)
|
||||
{
|
||||
if ( _bSetAsActiveConnection )
|
||||
{
|
||||
xRowSetProps->setPropertyValue("ActiveConnection", makeAny( xExistingConn ) );
|
||||
// no auto disposer needed, since we did not create the connection
|
||||
}
|
||||
xRowSetProps->setPropertyValue("ActiveConnection", makeAny( xExistingConn ) );
|
||||
// no auto disposer needed, since we did not create the connection
|
||||
|
||||
xConnection.reset( xExistingConn, SharedConnection::NoTakeOwnership );
|
||||
break;
|
||||
@@ -424,7 +421,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R
|
||||
);
|
||||
|
||||
// now if we created a connection, forward it to the row set
|
||||
if ( xConnection.is() && _bSetAsActiveConnection )
|
||||
if ( xConnection.is() )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -451,13 +448,13 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R
|
||||
|
||||
Reference< XConnection> connectRowset(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext )
|
||||
{
|
||||
SharedConnection xConnection = lcl_connectRowSet( _rxRowSet, _rxContext, true/*bSetAsActiveConnection*/, true );
|
||||
SharedConnection xConnection = lcl_connectRowSet( _rxRowSet, _rxContext, true );
|
||||
return xConnection.getTyped();
|
||||
}
|
||||
|
||||
SharedConnection ensureRowSetConnection(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext>& _rxContext )
|
||||
{
|
||||
return lcl_connectRowSet( _rxRowSet, _rxContext, true, false/*bUseAutoConnectionDisposer*/ );
|
||||
return lcl_connectRowSet( _rxRowSet, _rxContext, false/*bUseAutoConnectionDisposer*/ );
|
||||
}
|
||||
|
||||
Reference< XNameAccess> getTableFields(const Reference< XConnection>& _rxConn,const OUString& _rName)
|
||||
|
||||
@@ -45,14 +45,14 @@ static void lcl_GetDataArea(const uno::Reference<text::XTextTable>& xTable, sal_
|
||||
}
|
||||
|
||||
static void lcl_GetColumnInfo(const uno::Reference<text::XTextTable>& xTable,
|
||||
sal_Int32 nDocColumn, sal_Int32 nStartRow, bool bHasHeaders,
|
||||
sal_Int32 nDocColumn, bool bHasHeaders,
|
||||
OUString& rName, sal_Int32& rDataType, bool& rCurrency)
|
||||
{
|
||||
uno::Reference<table::XCellRange> xCellRange(xTable, uno::UNO_QUERY);
|
||||
// get column name from first row, if range contains headers
|
||||
if (bHasHeaders)
|
||||
{
|
||||
uno::Reference<text::XText> xHeaderText(xCellRange->getCellByPosition(nDocColumn, nStartRow), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xHeaderText(xCellRange->getCellByPosition(nDocColumn, /*nStartRow*/0), uno::UNO_QUERY);
|
||||
if (xHeaderText.is())
|
||||
rName = xHeaderText->getString();
|
||||
}
|
||||
@@ -63,11 +63,11 @@ static void lcl_GetColumnInfo(const uno::Reference<text::XTextTable>& xTable,
|
||||
|
||||
|
||||
static void lcl_SetValue(connectivity::ORowSetValue& rValue, const uno::Reference<text::XTextTable>& xTable,
|
||||
sal_Int32 nStartCol, sal_Int32 nStartRow, bool bHasHeaders,
|
||||
sal_Int32 nStartCol, bool bHasHeaders,
|
||||
sal_Int32 nDBRow, sal_Int32 nDBColumn)
|
||||
{
|
||||
sal_Int32 nDocColumn = nStartCol + nDBColumn - 1; // database counts from 1
|
||||
sal_Int32 nDocRow = nStartRow + nDBRow - 1;
|
||||
sal_Int32 nDocRow = nDBRow - 1;
|
||||
if (bHasHeaders)
|
||||
++nDocRow;
|
||||
|
||||
@@ -111,7 +111,7 @@ void OWriterTable::fillColumns()
|
||||
sal_Int32 eType = sdbc::DataType::OTHER;
|
||||
bool bCurrency = false;
|
||||
|
||||
lcl_GetColumnInfo(m_xTable, m_nStartCol + i, 0, m_bHasHeaders,
|
||||
lcl_GetColumnInfo(m_xTable, m_nStartCol + i, m_bHasHeaders,
|
||||
aColumnName, eType, bCurrency);
|
||||
|
||||
sal_Int32 nPrecision = 0; //! ...
|
||||
@@ -254,7 +254,7 @@ bool OWriterTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols,
|
||||
{
|
||||
if ((_rRow->get())[i]->isBound())
|
||||
{
|
||||
lcl_SetValue((_rRow->get())[i]->get(), m_xTable, m_nStartCol, 0, m_bHasHeaders,
|
||||
lcl_SetValue((_rRow->get())[i]->get(), m_xTable, m_nStartCol, m_bHasHeaders,
|
||||
m_nFilePos, i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
|
||||
// This is a synchron loading of a component so we don't have to deal with our statusChanged listener mechanism.
|
||||
try
|
||||
{
|
||||
xDoc.set( ::comphelper::SynchronousDispatch::dispatch( xDesktop, aName, aTarget, 0, aArgs ), UNO_QUERY );
|
||||
xDoc.set( ::comphelper::SynchronousDispatch::dispatch( xDesktop, aName, aTarget, aArgs ), UNO_QUERY );
|
||||
}
|
||||
catch (const css::lang::IllegalArgumentException& iae)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace comphelper
|
||||
const css::uno::Reference< css::uno::XInterface > &xStartPoint,
|
||||
const OUString &sURL,
|
||||
const OUString &sTarget,
|
||||
const sal_Int32 nFlags,
|
||||
const css::uno::Sequence< css::beans::PropertyValue > &lArguments );
|
||||
};
|
||||
|
||||
|
||||
@@ -1063,7 +1063,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
|
||||
|
||||
try
|
||||
{
|
||||
xComp = ::comphelper::SynchronousDispatch::dispatch( xTargetFrame, aFileName, aTarget, 0, aArgs );
|
||||
xComp = ::comphelper::SynchronousDispatch::dispatch( xTargetFrame, aFileName, aTarget, aArgs );
|
||||
}
|
||||
catch(const RuntimeException&)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user