summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-12-03 17:48:40 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-12-03 17:58:48 +0100
commitd9ef61fb546af443736057557552e3a95c569c11 (patch)
tree40e42d1f7d3574150699cf9b3b254fbe58703e42 /sw
parentb49ea0c9d24aa48d62590cb3443c3ad4143d2e2f (diff)
API CHANGE: roll back the XStyle changes to add a new Hidden property on Style
Change-Id: If6d23925567fb184cd8fc4e00fc72fe4d216e756
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/inc/unoprnms.hxx3
-rw-r--r--sw/inc/unostyle.hxx2
-rw-r--r--sw/source/core/unocore/unomap.cxx7
-rw-r--r--sw/source/core/unocore/unoprnms.cxx1
-rw-r--r--sw/source/core/unocore/unostyle.cxx57
6 files changed, 32 insertions, 39 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 524adcdc4ddd..e5052cfffa5c 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 28c7ba4eeae5..b681c11ae3d6 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 95835b8ac22f..76bbd5009776 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 8849dfd379ef..9c6fe6e28c9c 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 d2d653fe0e11..88eb7eb013c4 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 f0ab26e715f3..c8e7fa347031 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())