Author: orw
Date: Tue Jun 10 14:49:06 2014
New Revision: 1601656
URL: http://svn.apache.org/r1601656
Log:
125072: method <SwGraphicProperties_Impl::AnyToItemSet(..)> - map given style
name to corresponding UI name before searching for it.
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=1601656&r1=1601655&r2=1601656&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:49:06 2014
@@ -991,24 +991,25 @@ inline void lcl_FillMirror ( SfxItemSet
}
}
-sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
- SwDoc* pDoc,
- SfxItemSet& rFrmSet,
- SfxItemSet& rGrSet,
- sal_Bool& rSizeFound)
+sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
+ SwDoc* pDoc,
+ SfxItemSet& rFrmSet,
+ SfxItemSet& rGrSet,
+ sal_Bool& rSizeFound )
{
- //Properties fuer alle Frames
- sal_Bool bRet;
- const ::uno::Any *pStyleName;
- SwDocStyleSheet* pStyle = NULL;
+ 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* pHEvenMirror = 0;
const ::uno::Any* pHOddMirror = 0;
@@ -1017,24 +1018,22 @@ sal_Bool SwGraphicProperties_Impl::AnyT
GetProperty(RES_GRFATR_MIRRORGRF, MID_MIRROR_HORZ_ODD_PAGES, pHOddMirror);
GetProperty(RES_GRFATR_MIRRORGRF, MID_MIRROR_VERT, pVMirror);
- if ( pStyle )
+ if ( pStyle != NULL )
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle)
);
const :: SfxItemSet *pItemSet = &xStyle->GetItemSet();
- //Begin Bug 119922
sal_Bool bOasis = sal_False;
{
const SfxMedium* pMedium = pDoc->GetDocShell()->GetMedium();
- const SfxFilter * pFilter = pMedium
- ? pMedium->GetFilter()
- : NULL;
- if ( pMedium && pFilter )
+ const SfxFilter * pFilter = pMedium != NULL
+ ? pMedium->GetFilter()
+ : NULL;
+ if ( pFilter != NULL )
{
bOasis = pFilter->GetVersion() > SOFFICE_FILEFORMAT_60;
}
}
bRet = FillBaseProperties( rFrmSet, *pItemSet, rSizeFound, bOasis );
- //End Bug 119922
lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror,
pVMirror, bRet );
}
else
@@ -1044,38 +1043,38 @@ sal_Bool SwGraphicProperties_Impl::AnyT
lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror,
pVMirror, bRet );
}
-
- static const :: sal_uInt16 nIDs[] =
- {
- RES_GRFATR_CROPGRF,
- RES_GRFATR_ROTATION,
- RES_GRFATR_LUMINANCE,
- RES_GRFATR_CONTRAST,
- RES_GRFATR_CHANNELR,
- RES_GRFATR_CHANNELG,
- RES_GRFATR_CHANNELB,
- RES_GRFATR_GAMMA,
- RES_GRFATR_INVERT,
- RES_GRFATR_TRANSPARENCY,
- RES_GRFATR_DRAWMODE,
- 0
- };
+ static const ::sal_uInt16 nIDs[] =
+ {
+ RES_GRFATR_CROPGRF,
+ RES_GRFATR_ROTATION,
+ RES_GRFATR_LUMINANCE,
+ RES_GRFATR_CONTRAST,
+ RES_GRFATR_CHANNELR,
+ RES_GRFATR_CHANNELG,
+ RES_GRFATR_CHANNELB,
+ RES_GRFATR_GAMMA,
+ RES_GRFATR_INVERT,
+ RES_GRFATR_TRANSPARENCY,
+ RES_GRFATR_DRAWMODE,
+ 0
+ };
const ::uno::Any* pAny;
- for(sal_Int16 nIndex = 0; nIDs[nIndex]; nIndex++)
- {
- sal_uInt8 nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ?
CONVERT_TWIPS : 0;
- if(GetProperty(nIDs[nIndex], nMId, pAny ))
- {
- SfxPoolItem* pItem = ::GetDfltAttr( nIDs[nIndex]
)->Clone();
- bRet &= pItem->PutValue(*pAny, nMId );
- rGrSet.Put(*pItem);
- delete pItem;
- }
- }
+ for ( sal_Int16 nIndex = 0; nIDs[nIndex]; nIndex++ )
+ {
+ const sal_uInt8 nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ?
CONVERT_TWIPS : 0;
+ if ( GetProperty( nIDs[nIndex], nMId, pAny ) )
+ {
+ SfxPoolItem* pItem = ::GetDfltAttr( nIDs[nIndex] )->Clone();
+ bRet &= pItem->PutValue( *pAny, nMId );
+ rGrSet.Put( *pItem );
+ delete pItem;
+ }
+ }
- return bRet;
+ return bRet;
}
+
class SwOLEProperties_Impl : public SwFrameProperties_Impl
{
public:
@@ -1086,17 +1085,22 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet,
SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-sal_Bool SwOLEProperties_Impl::AnyToItemSet(
- SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool&
rSizeFound)
+
+sal_Bool SwOLEProperties_Impl::AnyToItemSet(
+ SwDoc* pDoc,
+ SfxItemSet& rFrmSet,
+ SfxItemSet& rSet,
+ sal_Bool& rSizeFound )
{
const ::uno::Any* pTemp;
- if(!GetProperty(FN_UNO_CLSID, 0, pTemp) &&
!GetProperty(FN_UNO_STREAM_NAME, 0, pTemp) )
+ if ( !GetProperty( FN_UNO_CLSID, 0, pTemp ) && !GetProperty(
FN_UNO_STREAM_NAME, 0, pTemp ) )
return sal_False;
- SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrmSet, rSet, rSizeFound);
- //
+ SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrmSet, rSet, rSizeFound );
+
return sal_True;
}
+
/******************************************************************
* SwXFrame
******************************************************************/