[Libreoffice-commits] .: dictionaries helpcontent2 offapi/com offapi/type_reference reportdesign/source sc/inc sc/source sd/inc sd/source svx/source sw/inc sw/source xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 3 09:02:01 PST 2012


 dictionaries                                      |    2 
 helpcontent2                                      |    2 
 offapi/com/sun/star/style/Style.idl               |    4 +
 offapi/com/sun/star/style/XStyle.idl              |    9 ---
 offapi/type_reference/types.rdb                   |binary
 reportdesign/source/core/api/ReportDefinition.cxx |    2 
 sc/inc/scitems.hxx                                |    4 +
 sc/inc/styleuno.hxx                               |    2 
 sc/inc/unonames.hxx                               |    1 
 sc/source/core/data/docpool.cxx                   |    1 
 sc/source/ui/unoobj/styleuno.cxx                  |   35 ++++++-------
 sd/inc/stlsheet.hxx                               |    2 
 sd/source/core/stlsheet.cxx                       |   29 +++++------
 svx/source/table/tabledesign.cxx                  |    2 
 sw/inc/cmdid.h                                    |    1 
 sw/inc/unoprnms.hxx                               |    3 -
 sw/inc/unostyle.hxx                               |    2 
 sw/source/core/unocore/unomap.cxx                 |    7 ++
 sw/source/core/unocore/unoprnms.cxx               |    1 
 sw/source/core/unocore/unostyle.cxx               |   57 ++++++++--------------
 xmloff/source/style/XMLPageExport.cxx             |    9 ++-
 xmloff/source/style/prstylei.cxx                  |    9 ++-
 xmloff/source/style/styleexp.cxx                  |    9 ++-
 xmloff/source/style/xmlnume.cxx                   |    9 +++
 xmloff/source/style/xmlnumi.cxx                   |    4 +
 xmloff/source/text/XMLTextMasterPageContext.cxx   |    5 +
 xmloff/source/text/txtstyli.cxx                   |    2 
 27 files changed, 112 insertions(+), 101 deletions(-)

New commits:
commit d9ef61fb546af443736057557552e3a95c569c11
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Mon Dec 3 17:48:40 2012 +0100

    API CHANGE: roll back the XStyle changes to add a new Hidden property on Style
    
    Change-Id: If6d23925567fb184cd8fc4e00fc72fe4d216e756

diff --git a/dictionaries b/dictionaries
index 1595bf1..8486186 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit 1595bf11e295d96123fcb327ba9919307aa5b127
+Subproject commit 84861864e2555282a23235225dd15dc1c6d30249
diff --git a/helpcontent2 b/helpcontent2
index 9a48845..cd65acb 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 9a488450c8fec4ec520541d50683b07b9bd86b22
+Subproject commit cd65acbcb541da83c39c3f1eeb6672a7bcc123d6
diff --git a/offapi/com/sun/star/style/Style.idl b/offapi/com/sun/star/style/Style.idl
index 31e7dd7..52089e1 100644
--- a/offapi/com/sun/star/style/Style.idl
+++ b/offapi/com/sun/star/style/Style.idl
@@ -135,6 +135,10 @@ published service Style
      */
     [optional, property] sequence< com::sun::star::beans::NamedValue > ParaStyleConditions;
 
+    /** Flag indicating whether to hide the style in the UI.
+        @since LibreOffice 4.0
+     */
+    [optional, property] boolean Hidden;
 };
 
 
diff --git a/offapi/com/sun/star/style/XStyle.idl b/offapi/com/sun/star/style/XStyle.idl
index 4367c5c..8ceb036 100644
--- a/offapi/com/sun/star/style/XStyle.idl
+++ b/offapi/com/sun/star/style/XStyle.idl
@@ -54,15 +54,6 @@ published interface XStyle: com::sun::star::container::XNamed
      */
     void setParentStyle( [in] string aParentStyle )
             raises( com::sun::star::container::NoSuchElementException );
-
-
-    /** tells whether the style is hidden in the UI.
-     */
-    boolean isHidden();
-
-    /** sets whether a style should be hidden in the UI.
-     */
-    void setHidden( [in] boolean hidden );
 };
 
 
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index a6ff8e4..d70c98f 100644
Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index ea90e23..1ae1719 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -269,8 +269,6 @@ public:
     ::sal_Bool SAL_CALL isInUse(  ) throw (uno::RuntimeException);
     ::rtl::OUString SAL_CALL getParentStyle(  ) throw (uno::RuntimeException);
     void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) throw (container::NoSuchElementException, uno::RuntimeException);
-    ::sal_Bool SAL_CALL isHidden( ) throw (uno::RuntimeException) { return false; }
-    void SAL_CALL setHidden( ::sal_Bool ) throw (uno::RuntimeException) { };
 
     // XNamed
     ::rtl::OUString SAL_CALL getName(  ) throw (uno::RuntimeException);
diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx
index e644854..ea03478 100644
--- a/sc/inc/scitems.hxx
+++ b/sc/inc/scitems.hxx
@@ -164,7 +164,9 @@
 
 #define ATTR_PAGE_SCALETO       190     // #i8868# scale printout to width/height
 
-#define ATTR_ENDINDEX           ATTR_PAGE_SCALETO        // end of pool-range
+#define ATTR_HIDDEN             191
+
+#define ATTR_ENDINDEX           ATTR_HIDDEN        // end of pool-range
 
 //--------------------------------
 // Dummy Slot-IDs for dialogs
diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx
index 00b90f1..1664052 100644
--- a/sc/inc/styleuno.hxx
+++ b/sc/inc/styleuno.hxx
@@ -256,8 +256,6 @@ public:
     virtual void SAL_CALL   setParentStyle( const ::rtl::OUString& aParentStyle )
                                 throw(::com::sun::star::container::NoSuchElementException,
                                     ::com::sun::star::uno::RuntimeException);
-    virtual sal_Bool SAL_CALL isHidden() throw(::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL setHidden( sal_Bool bHidden ) throw(::com::sun::star::uno::RuntimeException);
 
                             // XNamed
     virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 167c10c..5d95c21 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -125,6 +125,7 @@
 #define SC_UNONAME_ROTREF           "RotateReference"
 #define SC_UNONAME_ASIANVERT        "AsianVerticalMode"
 #define SC_UNONAME_WRITING          "WritingMode"
+#define SC_UNONAME_HIDDEN           "Hidden"
 
 #define SC_UNONAME_BOTTBORDER       "BottomBorder"
 #define SC_UNONAME_LEFTBORDER       "LeftBorder"
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 3fe7aec..c1cacfb 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -333,6 +333,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts )
     ppPoolDefaults[ ATTR_PAGE_FORMULAS   - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, false );
     ppPoolDefaults[ ATTR_PAGE_NULLVALS   - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, sal_True );
     ppPoolDefaults[ ATTR_PAGE_SCALETO    - ATTR_STARTINDEX ] = new ScPageScaleToItem( 1, 1 );
+    ppPoolDefaults[ ATTR_HIDDEN          - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HIDDEN, sal_False );
 
     SetDefaults( ppPoolDefaults );
 
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 42bc2de..77bc8ce 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -167,6 +167,7 @@ static const SfxItemPropertySet* lcl_GetCellStyleSet()
         {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY,   &::getCppuType((const sal_Int32*)0),    0, 0 },
         {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0),   0, 0 },
         {MAP_CHAR_LEN(SC_UNONAME_WRITING),  ATTR_WRITINGDIR,    &getCppuType((sal_Int16*)0),            0, 0 },
+        {MAP_CHAR_LEN(SC_UNONAME_HIDDEN),   ATTR_HIDDEN,        &getCppuType((sal_Bool*)0),             0, 0 },
         {0,0,0,0,0,0}
     };
     static SfxItemPropertySet aCellStyleSet_Impl( aCellStyleMap_Impl );
@@ -287,6 +288,7 @@ static const SfxItemPropertySet * lcl_GetPageStyleSet()
         {MAP_CHAR_LEN(SC_UNONAME_USERDEF),      ATTR_USERDEF,       &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
         {MAP_CHAR_LEN(SC_UNO_PAGE_WIDTH),       ATTR_PAGE_SIZE,     &::getCppuType((const sal_Int32*)0),            0, MID_SIZE_WIDTH | CONVERT_TWIPS },
         {MAP_CHAR_LEN(SC_UNONAME_WRITING),      ATTR_WRITINGDIR,    &getCppuType((sal_Int16*)0),            0, 0 },
+        {MAP_CHAR_LEN(SC_UNONAME_HIDDEN),       ATTR_HIDDEN,        &getCppuType((sal_Bool*)0),             0, 0 },
         {0,0,0,0,0,0}
     };
     static SfxItemPropertySet aPageStyleSet_Impl( aPageStyleMap_Impl );
@@ -1246,23 +1248,6 @@ void SAL_CALL ScStyleObj::setParentStyle( const rtl::OUString& rParentStyle )
     }
 }
 
-sal_Bool SAL_CALL ScStyleObj::isHidden( ) throw (uno::RuntimeException)
-{
-    SolarMutexGuard aGuard;
-    SfxStyleSheetBase* pStyle = GetStyle_Impl();
-    if (pStyle)
-        return pStyle->IsHidden();
-    return false;
-}
-
-void SAL_CALL ScStyleObj::setHidden( sal_Bool bHidden ) throw (uno::RuntimeException)
-{
-    SolarMutexGuard aGuard;
-    SfxStyleSheetBase* pStyle = GetStyle_Impl();
-    if (pStyle)
-        pStyle->SetHidden( bHidden );
-}
-
 // container::XNamed
 
 rtl::OUString SAL_CALL ScStyleObj::getName() throw(uno::RuntimeException)
@@ -1897,6 +1882,13 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons
                                     }
                                 }
                                 break;
+                            case ATTR_HIDDEN:
+                                {
+                                    sal_Bool bHidden = sal_False;
+                                    if ( *pValue >>= bHidden )
+                                        pStyle->SetHidden( bHidden );
+                                }
+                                break;
                             default:
                                 //  Default-Items mit falscher Slot-ID
                                 //  funktionieren im SfxItemPropertySet3 nicht
@@ -2081,6 +2073,15 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const rtl::OUString& aPropertyNa
                                 aAny = uno::makeAny(static_cast<sal_Int16>(aItem.GetHeight()));
                         }
                         break;
+                    case ATTR_HIDDEN:
+                        {
+                            sal_Bool bHidden = sal_False;
+                            SfxStyleSheetBase* pStyle = GetStyle_Impl();
+                            if ( pStyle )
+                                bHidden = pStyle->IsHidden();
+                            aAny = uno::makeAny( bHidden );
+                        }
+                        break;
                     default:
                         //  Default-Items mit falscher Slot-ID
                         //  funktionieren im SfxItemPropertySet3 nicht
diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx
index 11942bb..191bcf9 100644
--- a/sd/inc/stlsheet.hxx
+++ b/sd/inc/stlsheet.hxx
@@ -92,8 +92,6 @@ public:
     virtual sal_Bool SAL_CALL isInUse(  ) throw(::com::sun::star::uno::RuntimeException);
     virtual ::rtl::OUString SAL_CALL getParentStyle(  ) throw(::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
-    virtual sal_Bool SAL_CALL isHidden( ) throw(::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL setHidden( sal_Bool bHidden ) throw(::com::sun::star::uno::RuntimeException);
 
     // XPropertySet
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 5705164..ecd84d7 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -66,6 +66,7 @@ using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::drawing;
 
+#define WID_STYLE_HIDDEN    7997
 #define WID_STYLE_DISPNAME  7998
 #define WID_STYLE_FAMILY    7999
 
@@ -76,6 +77,7 @@ static SvxItemPropertySet& GetStylePropertySet()
         { RTL_CONSTASCII_STRINGPARAM("Family"),                 WID_STYLE_FAMILY,       &::getCppuType((const OUString*)0), PropertyAttribute::READONLY,    0},
         { RTL_CONSTASCII_STRINGPARAM("UserDefinedAttributes"),  SDRATTR_XMLATTRIBUTES,  &XNameContainer::static_type(), 0,     0},
         { RTL_CONSTASCII_STRINGPARAM("DisplayName"),            WID_STYLE_DISPNAME,     &::getCppuType((const OUString*)0), PropertyAttribute::READONLY,    0},
+        { RTL_CONSTASCII_STRINGPARAM("Hidden"),                 WID_STYLE_HIDDEN,       &::getCppuType((bool*)0),       0,     0},
 
         SVX_UNOEDIT_NUMBERING_PROPERTIE,
         SHADOW_PROPERTIES
@@ -1024,22 +1026,6 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& rParentName  ) throw
     }
 }
 
-sal_Bool SAL_CALL SdStyleSheet::isHidden() throw(RuntimeException)
-{
-    SolarMutexGuard aGuard;
-    throwIfDisposed();
-
-    return IsHidden();
-}
-
-void SAL_CALL SdStyleSheet::setHidden( sal_Bool rbHidden ) throw(RuntimeException)
-{
-    SolarMutexGuard aGuard;
-    throwIfDisposed();
-
-    return SetHidden( rbHidden );
-}
-
 // --------------------------------------------------------------------
 // XPropertySet
 // --------------------------------------------------------------------
@@ -1067,6 +1053,13 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con
     }
     else
     {
+        if( pEntry->nWID == WID_STYLE_HIDDEN )
+        {
+            sal_Bool bValue = sal_False;
+            if ( aValue >>= bValue )
+                SetHidden( bValue );
+            return;
+        }
         if( pEntry->nWID == SDRATTR_TEXTDIRECTION )
             return; // not yet implemented for styles
 
@@ -1188,6 +1181,10 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName ) thro
                     aAny <<= BitmapMode_NO_REPEAT;
             }
         }
+        else if( pEntry->nWID == WID_STYLE_HIDDEN )
+        {
+            aAny <<= IsHidden( );
+        }
         else
         {
             SfxItemSet aSet( GetPool().GetPool(),   pEntry->nWID, pEntry->nWID);
diff --git a/svx/source/table/tabledesign.cxx b/svx/source/table/tabledesign.cxx
index 171b5e5..f719d36 100644
--- a/svx/source/table/tabledesign.cxx
+++ b/svx/source/table/tabledesign.cxx
@@ -84,8 +84,6 @@ public:
     virtual ::sal_Bool SAL_CALL isInUse() throw (RuntimeException);
     virtual OUString SAL_CALL getParentStyle() throw (RuntimeException);
     virtual void SAL_CALL setParentStyle( const OUString& aParentStyle ) throw (NoSuchElementException, RuntimeException);
-    virtual ::sal_Bool SAL_CALL isHidden() throw (RuntimeException) { return false; };
-    virtual void SAL_CALL setHidden( ::sal_Bool ) throw (RuntimeException) { };
 
     // XNamed
     virtual OUString SAL_CALL getName() throw (RuntimeException);
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 524adcd..e5052cf 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -659,6 +659,7 @@ included in c-context files, so c++ style stuff will cause problems.
 #define FN_UNO_TABLE_BORDER2                (FN_EXTRA2 + 120)
 
 #define FN_UNO_REPLACEMENT_GRAPHIC_U_R_L    (FN_EXTRA2 + 121)
+#define FN_UNO_HIDDEN                       (FN_EXTRA2 + 122)
 
 /*------------------------------------------------ --------------------
     Area: Help
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 28c7ba4..b681c11 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -815,8 +815,9 @@ enum SwPropNameIds
 /* 0754 */  UNO_NAME_TABLE_BORDER2,
 
 /* 0755 */  UNO_NAME_REPLACEMENT_GRAPHIC_URL,
+/* 0756 */  UNO_NAME_HIDDEN,
 
-/* 0756 */  SW_PROPNAME_END
+/* 0757 */  SW_PROPNAME_END
 
 // new items in this array must match SwPropNameTab aPropNameTab
 };
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 95835b8..76bbd50 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -213,8 +213,6 @@ public:
     virtual sal_Bool SAL_CALL isInUse(void) throw( ::com::sun::star::uno::RuntimeException );
     virtual rtl::OUString SAL_CALL getParentStyle(void) throw( ::com::sun::star::uno::RuntimeException );
     virtual void SAL_CALL setParentStyle(const rtl::OUString& aParentStyle) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException );
-    virtual sal_Bool SAL_CALL isHidden() throw( ::com::sun::star::uno::RuntimeException );
-    virtual void SAL_CALL setHidden(sal_Bool bHidden) throw( ::com::sun::star::uno::RuntimeException );
 
     //XPropertySet
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 8849dfd..9c6fe6e 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -461,7 +461,8 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
                     { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },\
                     { SW_PROP_NMID(UNO_NAME_PARA_IS_CONNECT_BORDER), RES_PARATR_CONNECT_BORDER, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0},\
                     { SW_PROP_NMID(UNO_NAME_SNAP_TO_GRID), RES_PARATR_SNAPTOGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \
-                    { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0},
+                    { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, \
+                    { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN,     CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
 
 
 #define COMMON_FLDTYP_PROPERTIES \
@@ -558,6 +559,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { SW_PROP_NMID(UNO_NAME_CHAR_WORD_MODE), RES_CHRATR_WORDLINEMODE,CPPU_E2T(CPPUTYPE_BOOLEAN)  ,    PROPERTY_NONE,     0},
                     { SW_PROP_NMID(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, CPPU_E2T(CPPUTYPE_REFNAMECNT), PropertyAttribute::MAYBEVOID, 0 },
                     { SW_PROP_NMID(UNO_NAME_IS_PHYSICAL), FN_UNO_IS_PHYSICAL,     CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
+                    { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN,     CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
                     { SW_PROP_NMID(UNO_NAME_DISPLAY_NAME), FN_UNO_DISPLAY_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0},
                     { SW_PROP_NMID(UNO_NAME_CHAR_COMBINE_IS_ON), RES_CHRATR_TWO_LINES,          CPPU_E2T(CPPUTYPE_BOOLEAN),     PROPERTY_NONE, MID_TWOLINES},
                     { SW_PROP_NMID(UNO_NAME_CHAR_COMBINE_PREFIX), RES_CHRATR_TWO_LINES,             CPPU_E2T(CPPUTYPE_OUSTRING),    PROPERTY_NONE, MID_START_BRACKET},
@@ -729,6 +731,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     // #i28701#
                     { SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE},
                     { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
+                    { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN,     CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
                     {0,0,0,0,0,0}
                 };
                 aMapEntriesArr[nPropertyId] = aFrameStyleMap;
@@ -855,6 +858,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { SW_PROP_NMID(UNO_NAME_GRID_BASE_WIDTH), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_GRID_BASEWIDTH|CONVERT_TWIPS},
                     { SW_PROP_NMID(UNO_NAME_GRID_SNAP_TO_CHARS), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_SNAPTOCHARS},
                     { SW_PROP_NMID(UNO_NAME_GRID_STANDARD_PAGE_MODE), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_STANDARD_MODE},
+                    { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN,     CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
                     {0,0,0,0,0,0}
                 };
                 aMapEntriesArr[nPropertyId] = aPageStyleMap;
@@ -867,6 +871,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { SW_PROP_NMID(UNO_NAME_NUMBERING_RULES), FN_UNO_NUM_RULES, CPPU_E2T(CPPUTYPE_REFIDXREPL), PROPERTY_NONE, CONVERT_TWIPS},
                     { SW_PROP_NMID(UNO_NAME_IS_PHYSICAL), FN_UNO_IS_PHYSICAL,     CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
                     { SW_PROP_NMID(UNO_NAME_DISPLAY_NAME), FN_UNO_DISPLAY_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0},
+                    { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN,     CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
                     {0,0,0,0,0,0}
                 };
                 aMapEntriesArr[nPropertyId] = aNumStyleMap;
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index d2d653f..88eb7eb 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -785,6 +785,7 @@ const SwPropNameTab aPropNameTab = {
 /* 0753 UNO_NAME_INITIALS */            {MAP_CHAR_LEN("Initials")},
 /* 0754 UNO_NAME_INITIALS */            {MAP_CHAR_LEN("TableBorder2")},
 /* 0755 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")},
+/* 0756 UNO_NAME_HIDDEN */              {MAP_CHAR_LEN("Hidden")},
 
 // new items in this array must match enum SwPropNameIds
 };
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index f0ab26e..c8e7fa3 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1505,41 +1505,6 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle)
         throw uno::RuntimeException();
 }
 
-sal_Bool SAL_CALL SwXStyle::isHidden( ) throw( uno::RuntimeException )
-{
-    sal_Bool bHidden = sal_False;
-    SolarMutexGuard aGuard;
-    if( pBasePool )
-    {
-        pBasePool->SetSearchMask( eFamily );
-        SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        if(pBase)
-        {
-            rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) );
-            bHidden = xBase->IsHidden();
-        }
-    }
-    return bHidden;
-}
-
-void SAL_CALL SwXStyle::setHidden( sal_Bool bHidden )
-            throw( uno::RuntimeException )
-{
-    SolarMutexGuard aGuard;
-    if( pBasePool )
-    {
-        pBasePool->SetSearchMask( eFamily );
-        SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        if(pBase)
-        {
-            rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) );
-            //make it a 'real' style - necessary for pooled styles
-            xBase->GetItemSet();
-            xBase->SetHidden( bHidden );
-        }
-    }
-}
-
 static uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily eFamily, sal_Bool bIsConditional )
 {
     uno::Reference< beans::XPropertySetInfo >  xRet;
@@ -1715,6 +1680,18 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
 {
     switch(rEntry.nWID)
     {
+        case FN_UNO_HIDDEN:
+        {
+            sal_Bool bHidden = sal_False;
+            if ( rValue >>= bHidden )
+            {
+                //make it a 'real' style - necessary for pooled styles
+                rBase.mxNewBase->GetItemSet();
+                rBase.mxNewBase->SetHidden( bHidden );
+            }
+        }
+        break;
+
         case RES_PAPER_BIN:
         {
             SfxPrinter *pPrinter = pDoc->getPrinter( true );
@@ -2210,6 +2187,16 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
         }
         aRet.setValue(&bPhys, ::getBooleanCppuType());
     }
+    else if (FN_UNO_HIDDEN == rEntry.nWID)
+    {
+        sal_Bool bHidden = sal_False;
+        if(pBase)
+        {
+            rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) );
+            bHidden = xBase->IsHidden();
+        }
+        aRet.setValue(&bHidden, ::getBooleanCppuType());
+    }
     else if(pBase)
     {
         if(!rBase.mxNewBase.is())
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index 2710bee..89fa46a 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -117,8 +117,13 @@ sal_Bool XMLPageExport::exportStyle(
         GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NAME,
                           GetExport().EncodeStyleName( sName, &bEncoded ) );
 
-        if ( rStyle->isHidden( ) && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST )
-            GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" );
+        if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
+        {
+            uno::Any aValue = xPropSet->getPropertyValue( "Hidden" );
+            sal_Bool bHidden = sal_False;
+            if ( ( aValue >>= bHidden ) && bHidden && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST )
+                GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" );
+        }
 
         if( bEncoded )
             GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DISPLAY_NAME,
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index 9dac482..e68261e 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -267,6 +267,7 @@ void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite )
         if( rName != GetName() )
             GetImport().AddStyleDisplayName( GetFamily(), GetName(), rName );
 
+
         if( bOverwrite || bNew )
         {
             Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
@@ -341,8 +342,6 @@ void XMLPropStyleContext::Finish( sal_Bool bOverwrite )
         if( !xFamilies.is() )
             return;
 
-        mxStyle->setHidden( IsHidden( ) );
-
         // connect parent
         OUString sParent( GetParentName() );
         if( !sParent.isEmpty() )
@@ -402,6 +401,12 @@ void XMLPropStyleContext::Finish( sal_Bool bOverwrite )
                 xPropSet->setPropertyValue( msFollowStyle, aAny );
             }
         }
+
+        if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
+        {
+            xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) );
+        }
+
     }
 }
 
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 0a9669e..1cb096c 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -121,8 +121,13 @@ sal_Bool XMLStyleExport::exportStyle(
     if( !rXMLFamily.isEmpty() )
         GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, rXMLFamily);
 
-    if ( rStyle->isHidden( ) && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST )
-        GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" );
+    if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
+    {
+        aAny = xPropSet->getPropertyValue( "Hidden" );
+        sal_Bool bHidden = sal_False;
+        if ( ( aAny >>= bHidden ) && bHidden && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST )
+            GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" );
+    }
 
     // style:parent-style-name="..."
     OUString sParentString(rStyle->getParentStyle());
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index cd697ec..6c94cbd 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -751,7 +751,14 @@ sal_Bool SvxXMLNumRuleExport::exportStyle( const Reference< XStyle >& rStyle )
 
     OUString sName = rStyle->getName();
 
-    exportNumberingRule( sName, rStyle->isHidden(), xNumRule );
+    sal_Bool bHidden = sal_False;
+    if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
+    {
+        aAny = xPropSet->getPropertyValue( "Hidden" );
+        aAny >>= bHidden;
+    }
+
+    exportNumberingRule( sName, bHidden, xNumRule );
 
     return sal_True;
 }
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 9d0dec5..8e89cba 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -1257,6 +1257,10 @@ void SvxXMLListStyleContext::CreateAndInsertLate( sal_Bool bOverwrite )
             Any aAny = xPropSet->getPropertyValue( sIsPhysical );
             bNew = !*(sal_Bool *)aAny.getValue();
         }
+
+        if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
+            xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) );
+
         if( rName != GetName() )
             GetImport().AddStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST,
                                              GetName(), rName );
diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx
index e707895..0b1c2ff 100644
--- a/xmloff/source/text/XMLTextMasterPageContext.cxx
+++ b/xmloff/source/text/XMLTextMasterPageContext.cxx
@@ -292,6 +292,11 @@ void XMLTextMasterPageContext::Finish( sal_Bool bOverwrite )
                 xPropSet->setPropertyValue( sFollowStyle, aAny );
             }
         }
+
+        if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
+        {
+            xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) );
+        }
     }
 }
 
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index 81ce15c..3497125 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -280,8 +280,6 @@ void XMLTextStyleContext::Finish( sal_Bool bOverwrite )
          !( bOverwrite || IsNew() ) )
         return;
 
-    xStyle->setHidden( IsHidden( ) );
-
     Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
     Reference< XPropertySetInfo > xPropSetInfo =
                 xPropSet->getPropertySetInfo();


More information about the Libreoffice-commits mailing list