qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java |   44 ++++++++++------
 sc/source/core/data/docpool.cxx                         |    2 
 2 files changed, 30 insertions(+), 16 deletions(-)

New commits:
commit 08b5048198d59441cb8033ed14cd17e68c943004
Author:     heiko tietze <tietze.he...@gmail.com>
AuthorDate: Tue Aug 28 11:09:03 2018 +0200
Commit:     Heiko Tietze <tietze.he...@gmail.com>
CommitDate: Mon Sep 3 09:05:31 2018 +0200

    tdf#99296 - Disable headers/footers by default
    
    Change-Id: I9232c879cebdcb92236322e4d4a12048d9fec00f
    Reviewed-on: https://gerrit.libreoffice.org/59696
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <tietze.he...@gmail.com>

diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java 
b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
index 74670742c8ae..d7ff676f5a0e 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java
@@ -106,6 +106,35 @@ public class ScAccessiblePageHeader extends TestCase {
             e.printStackTrace(log);
         }
 
+        XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface(
+            XStyleFamiliesSupplier.class,
+            xSpreadsheetDoc );
+        XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+        XStyle StdStyle = null;
+
+        XNameAccess PageStyles = (XNameAccess) AnyConverter.toObject(
+                        new Type(XNameAccess.class),
+                                    StyleFamNames.getByName("PageStyles"));
+        StdStyle = (XStyle) AnyConverter.toObject(
+            new Type(XStyle.class), PageStyles.getByName("Default"));
+
+        //get the property-set
+        final XPropertySet PropSet = 
UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+        // tdf#99296 - Disable headers/footers by default
+        try {
+            PropSet.setPropertyValue("HeaderIsOn", Boolean.TRUE);
+            PropSet.setPropertyValue("FooterIsOn", Boolean.TRUE);
+        } catch (com.sun.star.beans.UnknownPropertyException upe) {
+            log.println("Don't know the Property 'HeaderIsOn' or 
'FooterIsOn'");
+        } catch (com.sun.star.lang.WrappedTargetException wte) {
+            log.println("WrappedTargetException while setting Property 
'HeaderIsOn' or 'FooterIsOn'");
+        } catch (com.sun.star.lang.IllegalArgumentException iae) {
+            log.println("IllegalArgumentException while setting Property 
'HeaderIsOn' or 'FooterIsOn'");
+        } catch (com.sun.star.beans.PropertyVetoException pve) {
+            log.println("PropertyVetoException while setting Property 
'HeaderIsOn' or 'FooterIsOn'");
+        }
+
         XModel aModel = UnoRuntime.queryInterface(XModel.class, 
xSpreadsheetDoc);
 
         XController xController = aModel.getCurrentController();
@@ -151,21 +180,6 @@ public class ScAccessiblePageHeader extends TestCase {
 
         TestEnvironment tEnv = new TestEnvironment(oObj);
 
-        XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface(
-            XStyleFamiliesSupplier.class,
-            xSpreadsheetDoc );
-        XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
-        XStyle StdStyle = null;
-
-        XNameAccess PageStyles = (XNameAccess) AnyConverter.toObject(
-                        new Type(XNameAccess.class),
-                                    StyleFamNames.getByName("PageStyles"));
-        StdStyle = (XStyle) AnyConverter.toObject(
-            new Type(XStyle.class), PageStyles.getByName("Default"));
-
-        //get the property-set
-        final XPropertySet PropSet = 
UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
-
         XHeaderFooterContent RPHC = null;
         // creation of testobject here
         // first we write what we are intend to do to log file
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index f117d783c35a..f199e49a26e2 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -293,7 +293,7 @@ ScDocumentPool::ScDocumentPool()
     mvPoolDefaults[ ATTR_PAGE_SIZE       - ATTR_STARTINDEX ] = new 
SvxSizeItem( ATTR_PAGE_SIZE );
     mvPoolDefaults[ ATTR_PAGE_HORCENTER  - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_PAGE_HORCENTER );
     mvPoolDefaults[ ATTR_PAGE_VERCENTER  - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_PAGE_VERCENTER );
-    mvPoolDefaults[ ATTR_PAGE_ON         - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_PAGE_ON, true );
+    mvPoolDefaults[ ATTR_PAGE_ON         - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_PAGE_ON, false );
     mvPoolDefaults[ ATTR_PAGE_DYNAMIC    - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_PAGE_DYNAMIC, true );
     mvPoolDefaults[ ATTR_PAGE_SHARED     - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_PAGE_SHARED, true );
     mvPoolDefaults[ ATTR_PAGE_NOTES      - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_PAGE_NOTES, false );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to