chart2/source/view/main/ChartView.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 656c20a3d7de994f2e87335b9d405151e005eb7a
Author:     Julien Nabet <[email protected]>
AuthorDate: Sat Dec 7 08:31:34 2019 +0100
Commit:     Julien Nabet <[email protected]>
CommitDate: Sat Dec 7 09:53:13 2019 +0100

    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 <[email protected]>

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;
+                                }
                             }
                         }
                     }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to