summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2019-12-07 08:31:34 +0100
committerJulien Nabet <serval2412@yahoo.fr>2019-12-07 09:53:13 +0100
commit656c20a3d7de994f2e87335b9d405151e005eb7a (patch)
tree036209876673d541dc6d0b7aa173dbcefd25be1e /chart2
parent83375454ca1151fabf797f0c47cc8d10156ebc98 (diff)
PageStyle and WritingMode may be absent (chart2)
Create a brand new odb file (embedded hsqldb) Create a report with design, just insert a chart It'll error-log first because of missing "PageStyle" property once this one fixed, it'll error-log with missing "WritingMode" property Remark: the chart will be created But let's avoid these error-logs Change-Id: I04bb4d87e8e97fb3ff7c4e5dc7f81897afca64ec Reviewed-on: https://gerrit.libreoffice.org/84675 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/main/ChartView.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 83385f4f5d22..04595a6138db 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1374,15 +1374,23 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
else
{
//Calc is parent document
- xParentProps->getPropertyValue( "PageStyle" ) >>= aPageStyle;
+ Reference< com::sun::star::beans::XPropertySetInfo > xInfo = xParentProps->getPropertySetInfo();
+ if (xInfo->hasPropertyByName("PageStyle"))
+ {
+ xParentProps->getPropertyValue( "PageStyle" ) >>= aPageStyle;
+ }
if(aPageStyle.isEmpty())
aPageStyle = "Default";
}
if( nWritingMode == -1 || nWritingMode == text::WritingMode2::PAGE )
{
uno::Reference< beans::XPropertySet > xPageStyle( xPageStyles->getByName( aPageStyle ), uno::UNO_QUERY );
- if( xPageStyle.is() )
- xPageStyle->getPropertyValue( "WritingMode" ) >>= nWritingMode;
+ Reference< com::sun::star::beans::XPropertySetInfo > xInfo = xPageStyle->getPropertySetInfo();
+ if (xInfo->hasPropertyByName("WritingMode"))
+ {
+ if( xPageStyle.is() )
+ xPageStyle->getPropertyValue( "WritingMode" ) >>= nWritingMode;
+ }
}
}
}