[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - 2 commits - chart2/source sc/source sd/source
Vasily Melenchuk
Vasily.Melenchuk at cib.de
Tue Jan 23 22:29:17 UTC 2018
chart2/source/controller/main/ChartController.cxx | 19 ++++-------
chart2/source/controller/main/ControllerCommandDispatch.cxx | 4 +-
sc/source/ui/unoobj/docuno.cxx | 4 --
sd/source/ui/view/DocumentRenderer.cxx | 20 ++++++------
4 files changed, 21 insertions(+), 26 deletions(-)
New commits:
commit 23cde162a20198a480262e26b5b32c7d40154b59
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date: Tue Jan 16 11:34:51 2018 +0300
tdf#113572: removed redundant calc service
calc service introduced previously in commit
0074951704022d173a5fdb9df933f47be1dcbb91 is not required, interface
is enough for feature implementation.
Reviewed-on: https://gerrit.libreoffice.org/47960
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Conflicts:
sc/source/ui/unoobj/docuno.cxx
Change-Id: I9cf30f2201619465da9061c7ef1e574209062cf9
Reviewed-on: https://gerrit.libreoffice.org/48432
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index c19edd0bd471..8ba455cbab6e 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1406,8 +1406,9 @@ void ChartController::executeDispatch_SourceData()
if ( rModel.hasInternalDataProvider() )
{
// Check if we will able to create data provider later
- Reference< lang::XServiceInfo > xParentServiceInfo( rModel.getParent(), uno::UNO_QUERY );
- if ( !xParentServiceInfo.is() || !xParentServiceInfo->supportsService("com.sun.star.chart2.XDataProviderAccess") )
+ css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(
+ rModel.getParent(), uno::UNO_QUERY);
+ if (!xCreatorDoc.is())
return;
SolarMutexGuard aSolarGuard;
@@ -1422,18 +1423,12 @@ void ChartController::executeDispatch_SourceData()
rModel.removeDataProviders();
// Ask parent document to create new data provider
- css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(
- rModel.getParent(), uno::UNO_QUERY );
- SAL_WARN_IF( !xCreatorDoc.is(), "chart2.main", "Invalid XDataProviderAccess" );
- if ( xCreatorDoc.is() )
+ uno::Reference< data::XDataProvider > xDataProvider = xCreatorDoc->createDataProvider();
+ SAL_WARN_IF( !xDataProvider.is(), "chart2.main", "Data provider was not created" );
+ if (xDataProvider.is())
{
- uno::Reference< data::XDataProvider > xDataProvider = xCreatorDoc->createDataProvider();
- SAL_WARN_IF( !xDataProvider.is(), "chart2.main", "Data provider was not created" );
- if ( xDataProvider.is() )
- {
- rModel.attachDataProvider(xDataProvider);
- }
+ rModel.attachDataProvider(xDataProvider);
}
}
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index cb0fb6f4a8ba..0dec06dbedcf 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
+#include <com/sun/star/chart2/XDataProviderAccess.hpp>
// only needed until #i68864# is fixed
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -554,7 +555,8 @@ void ControllerCommandDispatch::updateCommandAvailability()
OSL_ENSURE(xParentServiceInfo.is(), "Invalid XServiceInfo");
if ( xParentServiceInfo.is() )
{
- bCanCreateDataProvider = xParentServiceInfo->supportsService("com.sun.star.chart2.XDataProviderAccess");
+ css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(rModel.getParent(), uno::UNO_QUERY);
+ bCanCreateDataProvider = xCreatorDoc.is();
}
}
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index d31a0e01b330..21955c2c1344 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -218,7 +218,6 @@ using sc::TwipsToHMM;
#define SCMODELOBJ_SERVICE "com.sun.star.sheet.SpreadsheetDocument"
#define SCDOCSETTINGS_SERVICE "com.sun.star.sheet.SpreadsheetDocumentSettings"
#define SCDOC_SERVICE "com.sun.star.document.OfficeDocument"
-#define SCDATAPROVIDERACCESS_SERVICE "com.sun.star.chart2.XDataProviderAccess"
SC_SIMPLE_SERVICE_INFO( ScAnnotationsObj, "ScAnnotationsObj", "com.sun.star.sheet.CellAnnotations" )
SC_SIMPLE_SERVICE_INFO( ScDrawPagesObj, "ScDrawPagesObj", "com.sun.star.drawing.DrawPages" )
@@ -2613,11 +2612,10 @@ sal_Bool SAL_CALL ScModelObj::supportsService( const OUString& rServiceName )
uno::Sequence<OUString> SAL_CALL ScModelObj::getSupportedServiceNames()
throw(uno::RuntimeException, std::exception)
{
- uno::Sequence<OUString> aRet(4);
+ uno::Sequence<OUString> aRet(3);
aRet[0] = SCMODELOBJ_SERVICE;
aRet[1] = SCDOCSETTINGS_SERVICE;
aRet[2] = SCDOC_SERVICE;
- aRet[3] = SCDATAPROVIDERACCESS_SERVICE;
return aRet;
}
commit 0109da8d18d86037f6348c0ae29d1e243ee547e7
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date: Tue Dec 12 11:32:06 2017 +0300
tdf#91362: Use document paper size for printing slides.
By default for priniting slides we use not default A4, but size provided
in slide properties.
Additinally renamed IsPageSize() -> IsPaperSize(): it is less ambiguous.
Reviewed-on: https://gerrit.libreoffice.org/46407
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Conflicts:
sd/source/ui/view/DocumentRenderer.cxx
Change-Id: Iaf38dedb32b14cd6fbdd2ad355ecf3208e32663e
Reviewed-on: https://gerrit.libreoffice.org/48452
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 3eee8172e629..dc7b104d602e 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -143,7 +143,7 @@ namespace {
return nQuality;
}
- bool IsPageSize() const
+ bool IsPaperSize() const
{
return GetBoolValue("PageOptions", sal_Int32(1));
}
@@ -163,10 +163,10 @@ namespace {
return GetBoolValue("PrintProspect", false);
}
- bool IsPrinterPreferred(DocumentType eDocType) const
+ bool IsPrinterPreferred() const
{
- bool bIsDraw = eDocType == DOCUMENT_TYPE_DRAW;
- return IsTilePage() || IsPageSize() || IsBooklet() || (!bIsDraw && !IsNotes());
+ return IsTilePage() || IsPaperSize() || IsBooklet() ||
+ IsNotes() || IsHandout() || IsOutline();
}
bool IsPrintExcluded() const
@@ -1385,7 +1385,7 @@ private:
// Draw and Notes should usually abide by their specified paper size
Size aPaperSize;
- if (!mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()))
+ if (!mpOptions->IsPrinterPreferred())
{
aPaperSize.setWidth(rInfo.maPageSize.Width());
aPaperSize.setHeight(rInfo.maPageSize.Height());
@@ -1398,7 +1398,7 @@ private:
maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
- if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()))
+ if (mpOptions->IsPrinterPreferred())
{
if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
(aPaperSize.Width() < aPaperSize.Height()))
@@ -1461,7 +1461,7 @@ private:
aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( ::tools::Time( ::tools::Time::SYSTEM ), false );
// Draw and Notes should usually use specified paper size when printing
- if (!mpOptions->IsPrinterPreferred(mrBase.GetDocShell()->GetDocumentType()))
+ if (!mpOptions->IsPrinterPreferred())
{
aInfo.maPrintSize = mrBase.GetDocument()->GetSdPage(0, PK_STANDARD)->GetSize();
maPrintSize = awt::Size(aInfo.maPrintSize.Width(),
@@ -1775,7 +1775,7 @@ private:
OSL_ASSERT(pDocument != nullptr);
SdPage& rHandoutPage (*pDocument->GetSdPage(0, PK_HANDOUT));
- const bool bScalePage (mpOptions->IsPageSize());
+ const bool bScalePage (mpOptions->IsPaperSize());
sal_uInt16 nPaperBin;
if ( ! mpOptions->IsPaperBin())
@@ -1936,7 +1936,7 @@ private:
// is it possible that the page size changed?
const Size aPageSize = pPage->GetSize();
- if (mpOptions->IsPageSize())
+ if (mpOptions->IsPrinterPreferred())
{
const double fHorz ((double) rInfo.maPrintSize.Width() / aPageSize.Width());
const double fVert ((double) rInfo.maPrintSize.Height() / aPageSize.Height());
@@ -2169,7 +2169,7 @@ private:
// (without the unprintable borders).
// 3. Split the page into parts of the size of the
// printable area.
- const bool bScalePage (mpOptions->IsPageSize());
+ const bool bScalePage (mpOptions->IsPaperSize());
const bool bCutPage (mpOptions->IsCutPage());
MapMode aMap (rInfo.maMap);
if (bScalePage || bCutPage)
More information about the Libreoffice-commits
mailing list