summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/SwXTextDefaults.cxx
diff options
context:
space:
mode:
authorThomas Lange <tl@openoffice.org>2002-10-16 07:56:04 +0000
committerThomas Lange <tl@openoffice.org>2002-10-16 07:56:04 +0000
commit71b7aa2a93f199ad9fa9528a571d3e3f8687e2a5 (patch)
treee247f5a9539dadb1ccbf3bac3abc49e4040ccb70 /sw/source/core/unocore/SwXTextDefaults.cxx
parent304d3856c138fb54ff536f41be3eff26ab4d6315 (diff)
#103124# setPropertyValue for DropCapCharStyleName fixed
Diffstat (limited to 'sw/source/core/unocore/SwXTextDefaults.cxx')
-rw-r--r--sw/source/core/unocore/SwXTextDefaults.cxx59
1 files changed, 48 insertions, 11 deletions
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index 44dc29fafb4a..dbc4e6fd650a 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SwXTextDefaults.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: tl $ $Date: 2002-10-16 06:55:14 $
+ * last change: $Author: tl $ $Date: 2002-10-16 08:56:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,29 +62,42 @@
#include "core_pch.hxx"
#endif
+#ifndef _VOS_MUTEX_HXX_
+#include <vos/mutex.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+
#pragma hdrstop
#ifndef _SW_XTEXT_DEFAULTS_HXX
#include <SwXTextDefaults.hxx>
#endif
-
+#ifndef _SWSTYLENAMEMAPPER_HXX
+#include <SwStyleNameMapper.hxx>
+#endif
+#ifndef _DOCSTYLE_HXX
+#include <docstyle.hxx>
+#endif
+#ifndef _SWDOCSH_HXX
+#include <docsh.hxx>
+#endif
#ifndef _UNOMAP_HXX
#include <unomap.hxx>
#endif
#ifndef SW_UNOMID_HXX
#include <unomid.h>
#endif
-#ifndef _VOS_MUTEX_HXX_
-#include <vos/mutex.hxx>
-#endif
-#ifndef _SV_SVAPP_HXX
-#include <vcl/svapp.hxx>
+#ifndef _PARATR_HXX
+#include <paratr.hxx>
#endif
#ifndef _UNOPRNMS_HXX
#include <unoprnms.hxx>
#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
#ifndef _HINTIDS_HXX
#include <hintids.hxx>
#endif
@@ -142,6 +155,30 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName,
lcl_setPageDesc( pDoc, aValue, aSet );
pDoc->SetDefault(aSet.Get(RES_PAGEDESC));
}
+ else if (RES_PARATR_DROP == pMap->nWID && MID_DROPCAP_CHAR_STYLE_NAME == pMap->nMemberId)
+ {
+ OUString uStyle;
+ if(aValue >>= uStyle)
+ {
+ String sStyle;
+ SwStyleNameMapper::FillUIName(uStyle, sStyle, GET_POOLID_CHRFMT, sal_True );
+ SwDocStyleSheet* pStyle =
+ (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR);
+ SwFmtDrop* pDrop = 0;
+ if(pStyle)
+ {
+ SwDocStyleSheet aStyle( *(SwDocStyleSheet*)pStyle );
+ pDrop = (SwFmtDrop*)rItem.Clone(); // because rItem ist const...
+ pDrop->SetCharFmt(aStyle.GetCharFmt());
+ }
+ else
+ throw lang::IllegalArgumentException();
+ pDoc->SetDefault(*pDrop);
+ delete pDrop;
+ }
+ else
+ throw lang::IllegalArgumentException();
+ }
else
{
SfxPoolItem * pNewItem = rItem.Clone();