Author: orw
Date: Tue Jun 10 14:43:28 2014
New Revision: 1601654
URL: http://svn.apache.org/r1601654
Log:
125073: method <SwFrameProperties_Impl::AnyToItemSet(..)> - map given style
name to corresponding UI name before searching for it.
Patch by: Elie Roux - roux dot elie at gmail dot com
Modified:
openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx
Modified: openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx?rev=1601654&r1=1601653&r2=1601654&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx (original)
+++ openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx Tue Jun 10
14:43:28 2014
@@ -912,44 +912,51 @@ inline void lcl_FillCol ( SfxItemSet &rT
rToSet.Put(aCol);
}
}
-sal_Bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet&
rSet, SfxItemSet&, sal_Bool& rSizeFound)
+sal_Bool SwFrameProperties_Impl::AnyToItemSet(
+ SwDoc *pDoc,
+ SfxItemSet& rSet,
+ SfxItemSet&,
+ sal_Bool& rSizeFound )
{
- //Properties fuer alle Frames
- const ::uno::Any *pStyleName;
- SwDocStyleSheet* pStyle = NULL;
- sal_Bool bRet;
+ sal_Bool bRet = sal_False;
- if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
- {
- OUString sStyle;
- *pStyleName >>= sStyle;
- pStyle =
(SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle,
-
SFX_STYLE_FAMILY_FRAME);
- }
+ SwDocStyleSheet* pStyle = NULL;
+ const ::uno::Any *pStyleName;
+ if ( GetProperty( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
+ {
+ OUString sTmpStylename;
+ *pStyleName >>= sTmpStylename;
+ String sStylename;
+ SwStyleNameMapper::FillUIName( String(sTmpStylename), sStylename,
nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, sal_True );
+ pStyle =
+ (SwDocStyleSheet*) pDoc->GetDocShell()->GetStyleSheetPool()->Find(
sStylename, SFX_STYLE_FAMILY_FRAME );
+ }
const ::uno::Any* pColumns = NULL;
- GetProperty (RES_COL, MID_COLUMNS, pColumns);
- if ( pStyle )
+ GetProperty( RES_COL, MID_COLUMNS, pColumns );
+ if ( pStyle != NULL )
{
- rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(
*pStyle ) );
- const :: SfxItemSet *pItemSet = &xStyle->GetItemSet();
- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
- lcl_FillCol ( rSet, *pItemSet, pColumns );
+ rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle
) );
+ const ::SfxItemSet *pItemSet = &xStyle->GetItemSet();
+ bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
+ lcl_FillCol( rSet, *pItemSet, pColumns );
}
- else
- {
- const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool(
RES_POOLFRM_FRAME )->GetAttrSet();
- bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
- lcl_FillCol ( rSet, *pItemSet, pColumns );
- }
+ else
+ {
+ const ::SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool(
RES_POOLFRM_FRAME )->GetAttrSet();
+ bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
+ lcl_FillCol( rSet, *pItemSet, pColumns );
+ }
+
const ::uno::Any* pEdit;
- if(GetProperty(RES_EDIT_IN_READONLY, 0, pEdit))
- {
- SfxBoolItem aBool(RES_EDIT_IN_READONLY);
- ((SfxPoolItem&)aBool).PutValue(*pEdit, 0);
- rSet.Put(aBool);
- }
- return bRet;
+ if ( GetProperty( RES_EDIT_IN_READONLY, 0, pEdit ) )
+ {
+ SfxBoolItem aBool( RES_EDIT_IN_READONLY );
+ ( (SfxPoolItem&) aBool ).PutValue( *pEdit, 0 );
+ rSet.Put( aBool );
+ }
+
+ return bRet;
}
/****************************************************************************
Grafik-Descriptor