xref: /AOO41X/main/sd/source/ui/view/drviewsf.cxx (revision cc69f169487aaafebce60fe2a3104f0f129242f7)
15b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
35b190011SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
45b190011SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
55b190011SAndrew Rist  * distributed with this work for additional information
65b190011SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
75b190011SAndrew Rist  * to you under the Apache License, Version 2.0 (the
85b190011SAndrew Rist  * "License"); you may not use this file except in compliance
95b190011SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
115b190011SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
135b190011SAndrew Rist  * Unless required by applicable law or agreed to in writing,
145b190011SAndrew Rist  * software distributed under the License is distributed on an
155b190011SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165b190011SAndrew Rist  * KIND, either express or implied.  See the License for the
175b190011SAndrew Rist  * specific language governing permissions and limitations
185b190011SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
205b190011SAndrew Rist  *************************************************************/
215b190011SAndrew Rist 
225b190011SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "DrawViewShell.hxx"
28cdf0e10cSrcweir #include <com/sun/star/form/FormButtonType.hpp>
29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #ifndef _SVXIDS_HRC
32cdf0e10cSrcweir #include <svx/svxids.hrc>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #ifndef _GLOBL3D_HXX
35cdf0e10cSrcweir #include <svx/globl3d.hxx>
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir #include <svx/hlnkitem.hxx>
38cdf0e10cSrcweir #include <editeng/eeitem.hxx>
39cdf0e10cSrcweir #ifndef _FLDITEM_HXX
40cdf0e10cSrcweir #include <editeng/flditem.hxx>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
43cdf0e10cSrcweir #include <svl/whiter.hxx>
44cdf0e10cSrcweir #include <svl/eitem.hxx>
45cdf0e10cSrcweir #include <svl/itempool.hxx>
46cdf0e10cSrcweir #include <sfx2/tplpitem.hxx>
47cdf0e10cSrcweir #ifndef _BINDING_HXX //autogen
48cdf0e10cSrcweir #include <sfx2/bindings.hxx>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #include <sfx2/app.hxx>
51cdf0e10cSrcweir #include <sfx2/templdlg.hxx>
52cdf0e10cSrcweir #include <svx/xdef.hxx>
53cdf0e10cSrcweir #include <svx/svddef.hxx>
54cdf0e10cSrcweir #include <svx/fmglob.hxx>
55cdf0e10cSrcweir #include <svx/svdouno.hxx>
56cdf0e10cSrcweir #include <tools/urlobj.hxx>
57cdf0e10cSrcweir #include <svx/fmshell.hxx>
58cdf0e10cSrcweir #include <svl/cjkoptions.hxx>
59cdf0e10cSrcweir 
60cdf0e10cSrcweir #ifndef SD_FRAME_VIEW
61cdf0e10cSrcweir #include "FrameView.hxx"
62cdf0e10cSrcweir #endif
63cdf0e10cSrcweir #include "Outliner.hxx"
64cdf0e10cSrcweir #include "app.hrc"
65cdf0e10cSrcweir 
66cdf0e10cSrcweir #include "app.hxx"
67cdf0e10cSrcweir #include "stlsheet.hxx"
68cdf0e10cSrcweir #include "drawview.hxx"
69cdf0e10cSrcweir #include "drawdoc.hxx"
70cdf0e10cSrcweir #include "Window.hxx"
71cdf0e10cSrcweir #include "ViewShellBase.hxx"
72cdf0e10cSrcweir #include "FormShellManager.hxx"
73cdf0e10cSrcweir #include "cfgids.hxx"
74cdf0e10cSrcweir #include "anminfo.hxx"
75cdf0e10cSrcweir 
76766ce4d0SZheng Fan #include <editeng/lspcitem.hxx>
77766ce4d0SZheng Fan #include <editeng/ulspitem.hxx>
78766ce4d0SZheng Fan #include <editeng/lrspitem.hxx>
79766ce4d0SZheng Fan #include <editeng/escpitem.hxx>
80*cc69f169SZheng Fan #include <editeng/numitem.hxx>
81*cc69f169SZheng Fan #include <svx/nbdtmgfact.hxx>
82*cc69f169SZheng Fan #include <svx/nbdtmg.hxx>
83*cc69f169SZheng Fan 
84*cc69f169SZheng Fan using namespace svx::sidebar;
85cdf0e10cSrcweir using ::rtl::OUString;
86cdf0e10cSrcweir using namespace ::com::sun::star;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir namespace sd {
89cdf0e10cSrcweir 
90cdf0e10cSrcweir /*************************************************************************
91cdf0e10cSrcweir |*
92cdf0e10cSrcweir |* Status von Controller-SfxSlots setzen
93cdf0e10cSrcweir |*
94cdf0e10cSrcweir \************************************************************************/
95cdf0e10cSrcweir 
96cdf0e10cSrcweir void DrawViewShell::GetCtrlState(SfxItemSet &rSet)
97cdf0e10cSrcweir {
98cdf0e10cSrcweir 	if (rSet.GetItemState(SID_RELOAD) != SFX_ITEM_UNKNOWN)
99cdf0e10cSrcweir 	{
100cdf0e10cSrcweir 		// "Letzte Version" vom SFx en/disablen lassen
101cdf0e10cSrcweir         GetViewFrame()->GetSlotState (SID_RELOAD, NULL, &rSet);
102cdf0e10cSrcweir 	}
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_HYPERLINK_GETLINK))
105cdf0e10cSrcweir 	{
106cdf0e10cSrcweir 		SvxHyperlinkItem aHLinkItem;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 		OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 		if (pOLV)
111cdf0e10cSrcweir 		{
112cdf0e10cSrcweir 			bool bField = false;
113cdf0e10cSrcweir 			const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
114cdf0e10cSrcweir 			if (pFieldItem)
115cdf0e10cSrcweir 			{
116cdf0e10cSrcweir                 ESelection aSel = pOLV->GetSelection();
117cdf0e10cSrcweir                 if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 )
118cdf0e10cSrcweir                 {
119cdf0e10cSrcweir 				    const SvxFieldData* pField = pFieldItem->GetField();
120cdf0e10cSrcweir 				    if (pField->ISA(SvxURLField))
121cdf0e10cSrcweir 				    {
122cdf0e10cSrcweir 					    aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
123cdf0e10cSrcweir 					    aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
124cdf0e10cSrcweir 					    aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
125cdf0e10cSrcweir 						bField = true;
126cdf0e10cSrcweir 				    }
127cdf0e10cSrcweir                 }
128cdf0e10cSrcweir 			}
129cdf0e10cSrcweir 			if (!bField)
130cdf0e10cSrcweir 			{
131cdf0e10cSrcweir 				// use selected text as name for urls
132cdf0e10cSrcweir 				String sReturn = pOLV->GetSelected();
133cdf0e10cSrcweir 				sReturn.Erase(255);
134cdf0e10cSrcweir 				sReturn.EraseTrailingChars();
135cdf0e10cSrcweir 				aHLinkItem.SetName(sReturn);
136cdf0e10cSrcweir 			}
137cdf0e10cSrcweir 		}
138cdf0e10cSrcweir 		else
139cdf0e10cSrcweir 		{
140cdf0e10cSrcweir 			if (mpDrawView->GetMarkedObjectList().GetMarkCount() > 0)
141cdf0e10cSrcweir 			{
142cdf0e10cSrcweir                 bool bFound = false;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir                 SdrObject* pMarkedObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
145cdf0e10cSrcweir                 if( pMarkedObj && (FmFormInventor == pMarkedObj->GetObjInventor()) )
146cdf0e10cSrcweir                 {
147cdf0e10cSrcweir 				    SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pMarkedObj );
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 				    if(pUnoCtrl) try
150cdf0e10cSrcweir 				    {
151cdf0e10cSrcweir                         uno::Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_QUERY_THROW );
152cdf0e10cSrcweir 					    uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW );
153cdf0e10cSrcweir 					    uno::Reference< beans::XPropertySetInfo > xPropInfo( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW );
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 					    form::FormButtonType eButtonType = form::FormButtonType_URL;
156cdf0e10cSrcweir                         const OUString sButtonType( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ) );
157cdf0e10cSrcweir 					    if(xPropInfo->hasPropertyByName( sButtonType ) && (xPropSet->getPropertyValue( sButtonType ) >>= eButtonType ) )
158cdf0e10cSrcweir 				        {
159cdf0e10cSrcweir 					        OUString aString;
160cdf0e10cSrcweir 
161cdf0e10cSrcweir 					        // Label
162cdf0e10cSrcweir                             const OUString sLabel( RTL_CONSTASCII_USTRINGPARAM( "Label" ) );
163cdf0e10cSrcweir 					        if(xPropInfo->hasPropertyByName(sLabel))
164cdf0e10cSrcweir                             {
165cdf0e10cSrcweir 						        if( xPropSet->getPropertyValue(sLabel) >>= aString )
166cdf0e10cSrcweir     						        aHLinkItem.SetName(String( aString ));
167cdf0e10cSrcweir                             }
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 					        // URL
170cdf0e10cSrcweir                             const OUString sTargetURL(RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ));
171cdf0e10cSrcweir 					        if(xPropInfo->hasPropertyByName(sTargetURL))
172cdf0e10cSrcweir                             {
173cdf0e10cSrcweir 						        if( xPropSet->getPropertyValue(sTargetURL) >>= aString )
174cdf0e10cSrcweir     						        aHLinkItem.SetURL(String( aString ));
175cdf0e10cSrcweir                             }
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 					        // Target
178cdf0e10cSrcweir                             const OUString sTargetFrame( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" ) );
179cdf0e10cSrcweir 					        if(xPropInfo->hasPropertyByName(sTargetFrame) )
180cdf0e10cSrcweir                             {
181cdf0e10cSrcweir 					            if( xPropSet->getPropertyValue(sTargetFrame) >>= aString )
182cdf0e10cSrcweir 						            aHLinkItem.SetTargetFrame(String( aString ));
183cdf0e10cSrcweir                             }
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 					        aHLinkItem.SetInsertMode(HLINK_BUTTON);
186cdf0e10cSrcweir                             bFound = true;
187cdf0e10cSrcweir 				        }
188cdf0e10cSrcweir                     }
189cdf0e10cSrcweir                     catch( uno::Exception& )
190cdf0e10cSrcweir                     {
191cdf0e10cSrcweir                     }
192cdf0e10cSrcweir 				}
193cdf0e10cSrcweir 
194cdf0e10cSrcweir                 // try interaction link
195cdf0e10cSrcweir                 if( !bFound && pMarkedObj )
196cdf0e10cSrcweir                 {
197cdf0e10cSrcweir                     SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pMarkedObj);
198cdf0e10cSrcweir                     if( pInfo && (pInfo->meClickAction == presentation::ClickAction_DOCUMENT) )
199cdf0e10cSrcweir                         aHLinkItem.SetURL( pInfo->GetBookmark());
200cdf0e10cSrcweir                     aHLinkItem.SetInsertMode(HLINK_BUTTON);
201cdf0e10cSrcweir                 }
202cdf0e10cSrcweir 			}
203cdf0e10cSrcweir 		}
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 		rSet.Put(aHLinkItem);
206cdf0e10cSrcweir 	}
207cdf0e10cSrcweir 	rSet.Put( SfxBoolItem( SID_READONLY_MODE, mbReadOnly ) );
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 	// Ausgabequalitaet
210cdf0e10cSrcweir 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_COLOR ) ||
211cdf0e10cSrcweir 		SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_GRAYSCALE ) ||
212cdf0e10cSrcweir 		SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_BLACKWHITE ) ||
213cdf0e10cSrcweir         SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_CONTRAST ) )
214cdf0e10cSrcweir 	{
215cdf0e10cSrcweir 		const sal_uLong nMode = (sal_Int32)GetActiveWindow()->GetDrawMode();
216cdf0e10cSrcweir 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_COLOR, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_COLOR == nMode) ) );
217cdf0e10cSrcweir 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_GRAYSCALE, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_GRAYSCALE == nMode) ) );
218cdf0e10cSrcweir 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_BLACKWHITE, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_BLACKWHITE == nMode) ) );
219cdf0e10cSrcweir 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_CONTRAST, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_CONTRAST == nMode) ) );
220cdf0e10cSrcweir 	}
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 	if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) )
223cdf0e10cSrcweir 	{
224cdf0e10cSrcweir 		rSet.Put( SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, sal_True ) );
225cdf0e10cSrcweir 	}
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 	if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_ATTR_YEAR2000) )
228cdf0e10cSrcweir 	{
229cdf0e10cSrcweir         FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
230cdf0e10cSrcweir         if (pFormShell != NULL)
231cdf0e10cSrcweir         {
232cdf0e10cSrcweir             sal_uInt16 nState = 0;
233cdf0e10cSrcweir             if (pFormShell->GetY2KState(nState))
234cdf0e10cSrcweir                 rSet.Put( SfxUInt16Item( SID_ATTR_YEAR2000, nState ) );
235cdf0e10cSrcweir             else
236cdf0e10cSrcweir                 rSet.DisableItem( SID_ATTR_YEAR2000 );
237cdf0e10cSrcweir         }
238cdf0e10cSrcweir 	}
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	if ( !GetView()->GetTextEditOutliner() )
241cdf0e10cSrcweir 	{
242cdf0e10cSrcweir         SvtCJKOptions aCJKOptions;
243cdf0e10cSrcweir 		if( !aCJKOptions.IsChangeCaseMapEnabled() )
244cdf0e10cSrcweir         {
245cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_False );
246cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_False );
247cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_False );
248cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_False );
249cdf0e10cSrcweir         }
250cdf0e10cSrcweir         else
251cdf0e10cSrcweir         {
252cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_True );
253cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_True );
254cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_True );
255cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_True );
256cdf0e10cSrcweir         }
257cdf0e10cSrcweir 
258cdf0e10cSrcweir         rSet.DisableItem( SID_TRANSLITERATE_SENTENCE_CASE );
259cdf0e10cSrcweir         rSet.DisableItem( SID_TRANSLITERATE_TITLE_CASE );
260cdf0e10cSrcweir         rSet.DisableItem( SID_TRANSLITERATE_TOGGLE_CASE );
261cdf0e10cSrcweir         rSet.DisableItem( SID_TRANSLITERATE_UPPER );
262cdf0e10cSrcweir 		rSet.DisableItem( SID_TRANSLITERATE_LOWER );
263cdf0e10cSrcweir 		rSet.DisableItem( SID_TRANSLITERATE_HALFWIDTH );
264cdf0e10cSrcweir 		rSet.DisableItem( SID_TRANSLITERATE_FULLWIDTH );
265cdf0e10cSrcweir 		rSet.DisableItem( SID_TRANSLITERATE_HIRAGANA );
266cdf0e10cSrcweir 		rSet.DisableItem( SID_TRANSLITERATE_KATAGANA );
267cdf0e10cSrcweir 	}
268cdf0e10cSrcweir 	else
269cdf0e10cSrcweir 	{
270cdf0e10cSrcweir         SvtCJKOptions aCJKOptions;
271cdf0e10cSrcweir 		if( !aCJKOptions.IsChangeCaseMapEnabled() )
272cdf0e10cSrcweir 		{
273cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_False );
274cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_False );
275cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_False );
276cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_False );
277cdf0e10cSrcweir             rSet.DisableItem( SID_TRANSLITERATE_HALFWIDTH );
278cdf0e10cSrcweir 			rSet.DisableItem( SID_TRANSLITERATE_FULLWIDTH );
279cdf0e10cSrcweir 			rSet.DisableItem( SID_TRANSLITERATE_HIRAGANA );
280cdf0e10cSrcweir 			rSet.DisableItem( SID_TRANSLITERATE_KATAGANA );
281cdf0e10cSrcweir 		}
282cdf0e10cSrcweir         else
283cdf0e10cSrcweir         {
284cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_True );
285cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_True );
286cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_True );
287cdf0e10cSrcweir             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_True );
288cdf0e10cSrcweir         }
289cdf0e10cSrcweir 	}
290cdf0e10cSrcweir }
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 
293cdf0e10cSrcweir /*************************************************************************
294cdf0e10cSrcweir |*
295cdf0e10cSrcweir |* Status der Attribut-Items
296cdf0e10cSrcweir |*
297cdf0e10cSrcweir \************************************************************************/
298cdf0e10cSrcweir 
299cdf0e10cSrcweir void DrawViewShell::GetAttrState( SfxItemSet& rSet )
300cdf0e10cSrcweir {
301cdf0e10cSrcweir 	SfxWhichIter	aIter( rSet );
302cdf0e10cSrcweir 	sal_uInt16			nWhich = aIter.FirstWhich();
303cdf0e10cSrcweir 
304cdf0e10cSrcweir 	sal_Bool	bAttr = sal_False;
305cdf0e10cSrcweir 	SfxAllItemSet aAllSet( *rSet.GetPool() );
306cdf0e10cSrcweir 
307cdf0e10cSrcweir 	while ( nWhich )
308cdf0e10cSrcweir 	{
309cdf0e10cSrcweir 		sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
310cdf0e10cSrcweir 			? GetPool().GetSlotId(nWhich)
311cdf0e10cSrcweir 			: nWhich;
312cdf0e10cSrcweir 		switch ( nSlotId )
313cdf0e10cSrcweir 		{
314766ce4d0SZheng Fan 			case SID_ATTR_PARA_LRSPACE:
315766ce4d0SZheng Fan 			{
316766ce4d0SZheng Fan 				SfxItemSet aAttrs( GetDoc()->GetPool() );
317766ce4d0SZheng Fan 				mpDrawView->GetAttributes( aAttrs );
318766ce4d0SZheng Fan 				SvxLRSpaceItem aLRSpace = ( (const SvxLRSpaceItem&) aAttrs.Get( EE_PARA_LRSPACE ) );
319766ce4d0SZheng Fan 				aLRSpace.SetWhich(SID_ATTR_PARA_LRSPACE);
320766ce4d0SZheng Fan 				rSet.Put(aLRSpace);
321766ce4d0SZheng Fan 				bAttr = sal_True;
322766ce4d0SZheng Fan 				Invalidate(SID_ATTR_PARA_LRSPACE);
323766ce4d0SZheng Fan 			}
324766ce4d0SZheng Fan 			break;
325766ce4d0SZheng Fan 			case SID_ATTR_PARA_LINESPACE:
326766ce4d0SZheng Fan 			{
327766ce4d0SZheng Fan 				SfxItemSet aAttrs( GetDoc()->GetPool() );
328766ce4d0SZheng Fan 				mpDrawView->GetAttributes( aAttrs );
329766ce4d0SZheng Fan 				SvxLineSpacingItem aLineLR = ( (const SvxLineSpacingItem&) aAttrs.Get( EE_PARA_SBL ) );
330766ce4d0SZheng Fan 				rSet.Put(aLineLR);
331766ce4d0SZheng Fan 				bAttr = sal_True;
332766ce4d0SZheng Fan 				Invalidate(SID_ATTR_PARA_LINESPACE);
333766ce4d0SZheng Fan 			}
334766ce4d0SZheng Fan 			break;
335766ce4d0SZheng Fan 			case SID_ATTR_PARA_ULSPACE:
336766ce4d0SZheng Fan 			{
337766ce4d0SZheng Fan 				SfxItemSet aAttrs( GetDoc()->GetPool() );
338766ce4d0SZheng Fan 				mpDrawView->GetAttributes( aAttrs );
339766ce4d0SZheng Fan 				SvxULSpaceItem aULSP = ( (const SvxULSpaceItem&) aAttrs.Get( EE_PARA_ULSPACE ) );
340766ce4d0SZheng Fan 				aULSP.SetWhich(SID_ATTR_PARA_ULSPACE);
341766ce4d0SZheng Fan 				rSet.Put(aULSP);
342766ce4d0SZheng Fan 				bAttr = sal_True;
343766ce4d0SZheng Fan 				Invalidate(SID_ATTR_PARA_ULSPACE);
344766ce4d0SZheng Fan 			}
345766ce4d0SZheng Fan 			break;
346cdf0e10cSrcweir 			case SID_ATTR_FILL_STYLE:
347cdf0e10cSrcweir 			case SID_ATTR_FILL_COLOR:
348cdf0e10cSrcweir 			case SID_ATTR_FILL_GRADIENT:
349cdf0e10cSrcweir 			case SID_ATTR_FILL_HATCH:
350cdf0e10cSrcweir 			case SID_ATTR_FILL_BITMAP:
351cdf0e10cSrcweir 			case SID_ATTR_FILL_SHADOW:
352d5370dc8SArmin Le Grand             case SID_ATTR_FILL_TRANSPARENCE:
353d5370dc8SArmin Le Grand             case SID_ATTR_FILL_FLOATTRANSPARENCE:
354cdf0e10cSrcweir 			case SID_ATTR_LINE_STYLE:
355cdf0e10cSrcweir 			case SID_ATTR_LINE_DASH:
356cdf0e10cSrcweir 			case SID_ATTR_LINE_WIDTH:
357cdf0e10cSrcweir 			case SID_ATTR_LINE_COLOR:
358d5370dc8SArmin Le Grand             case SID_ATTR_LINE_TRANSPARENCE:
359d5370dc8SArmin Le Grand             case SID_ATTR_LINE_JOINT:
360d5370dc8SArmin Le Grand             case SID_ATTR_LINE_CAP:
361cdf0e10cSrcweir 			case SID_ATTR_TEXT_FITTOSIZE:
362766ce4d0SZheng Fan 			case SID_ATTR_CHAR_FONT:
363766ce4d0SZheng Fan 			case SID_ATTR_CHAR_FONTHEIGHT:
364766ce4d0SZheng Fan 			case SID_ATTR_CHAR_SHADOWED:
365766ce4d0SZheng Fan 			case SID_ATTR_CHAR_POSTURE:
366766ce4d0SZheng Fan 			case SID_ATTR_CHAR_UNDERLINE:
367766ce4d0SZheng Fan 			case SID_ATTR_CHAR_STRIKEOUT:
368766ce4d0SZheng Fan 			case SID_ATTR_CHAR_WEIGHT:
369766ce4d0SZheng Fan 			case SID_ATTR_CHAR_COLOR:
370766ce4d0SZheng Fan 			case SID_ATTR_CHAR_KERNING:
371766ce4d0SZheng Fan 			case SID_SET_SUB_SCRIPT:
372766ce4d0SZheng Fan 			case SID_SET_SUPER_SCRIPT:
373cdf0e10cSrcweir 			{
374cdf0e10cSrcweir 				bAttr = sal_True;
375cdf0e10cSrcweir 			}
376cdf0e10cSrcweir 			break;
377cdf0e10cSrcweir 
378cdf0e10cSrcweir 			case SID_HYPHENATION:
379cdf0e10cSrcweir 			{
380cdf0e10cSrcweir 				SfxItemSet aAttrs( GetDoc()->GetPool() );
381cdf0e10cSrcweir 				mpDrawView->GetAttributes( aAttrs );
382cdf0e10cSrcweir 				if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SFX_ITEM_AVAILABLE )
383cdf0e10cSrcweir 				{
384cdf0e10cSrcweir 					sal_Bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
385cdf0e10cSrcweir 					rSet.Put( SfxBoolItem( SID_HYPHENATION, bValue ) );
386cdf0e10cSrcweir 				}
387cdf0e10cSrcweir 			}
388cdf0e10cSrcweir 			break;
389cdf0e10cSrcweir 
390cdf0e10cSrcweir 			case SID_STYLE_FAMILY2:
391cdf0e10cSrcweir 			case SID_STYLE_FAMILY3:
392cdf0e10cSrcweir 			case SID_STYLE_FAMILY5:
393cdf0e10cSrcweir 			case SID_STYLE_APPLY: // StyleControl
394cdf0e10cSrcweir 			{
395cdf0e10cSrcweir 				SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet();
396cdf0e10cSrcweir 				if( pStyleSheet )
397cdf0e10cSrcweir 				{
398cdf0e10cSrcweir 					if( nSlotId != SID_STYLE_APPLY && !mpDrawView->AreObjectsMarked() )
399cdf0e10cSrcweir 					{
400cdf0e10cSrcweir 						SfxTemplateItem aTmpItem( nWhich, String() );
401cdf0e10cSrcweir 						aAllSet.Put( aTmpItem, aTmpItem.Which()  );
402cdf0e10cSrcweir 					}
403cdf0e10cSrcweir 					else
404cdf0e10cSrcweir 					{
405cdf0e10cSrcweir 						if (pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE)
406cdf0e10cSrcweir 							pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet();
407cdf0e10cSrcweir 
408cdf0e10cSrcweir 						if( pStyleSheet )
409cdf0e10cSrcweir 						{
410cdf0e10cSrcweir 							SfxStyleFamily eFamily = pStyleSheet->GetFamily();
411cdf0e10cSrcweir 
412cdf0e10cSrcweir 							if ((eFamily == SD_STYLE_FAMILY_GRAPHICS &&		nSlotId == SID_STYLE_FAMILY2)       ||
413cdf0e10cSrcweir 								(eFamily == SD_STYLE_FAMILY_CELL	 &&	nSlotId == SID_STYLE_FAMILY3)		||
414cdf0e10cSrcweir 								(eFamily == SD_STYLE_FAMILY_PSEUDO &&	nSlotId == SID_STYLE_FAMILY5))
415cdf0e10cSrcweir 							{
416cdf0e10cSrcweir 								SfxTemplateItem aTmpItem ( nWhich, pStyleSheet->GetName() );
417cdf0e10cSrcweir 								aAllSet.Put( aTmpItem, aTmpItem.Which()  );
418cdf0e10cSrcweir 							}
419cdf0e10cSrcweir 							else
420cdf0e10cSrcweir 							{
421cdf0e10cSrcweir 								SfxTemplateItem aTmpItem(nWhich, String());
422cdf0e10cSrcweir 								aAllSet.Put(aTmpItem,aTmpItem.Which()  );
423cdf0e10cSrcweir 							}
424cdf0e10cSrcweir 						}
425cdf0e10cSrcweir 					}
426cdf0e10cSrcweir 				}
427cdf0e10cSrcweir 				else
428cdf0e10cSrcweir 				{	SfxTemplateItem aItem( nWhich, String() );
429cdf0e10cSrcweir 					aAllSet.Put( aItem, aItem.Which() );
430cdf0e10cSrcweir 					// rSet.DisableItem( nWhich );
431cdf0e10cSrcweir 				}
432cdf0e10cSrcweir 			}
433cdf0e10cSrcweir 			break;
434cdf0e10cSrcweir 
435cdf0e10cSrcweir 			case SID_SET_DEFAULT:
436cdf0e10cSrcweir 			{
437cdf0e10cSrcweir                 if( !mpDrawView->GetMarkedObjectList().GetMarkCount() ||
438cdf0e10cSrcweir                     ( !mpDrawView->IsTextEdit() && !mpDrawView->GetStyleSheet() )
439cdf0e10cSrcweir                   )
440cdf0e10cSrcweir 					rSet.DisableItem( nWhich );
441cdf0e10cSrcweir 			}
442cdf0e10cSrcweir 			break;
443cdf0e10cSrcweir 
444cdf0e10cSrcweir 			case SID_STYLE_WATERCAN:
445cdf0e10cSrcweir 			{
446cdf0e10cSrcweir 				ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
447cdf0e10cSrcweir 				if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
448cdf0e10cSrcweir 					rSet.Put(SfxBoolItem(nWhich,sal_False));
449cdf0e10cSrcweir 				else
450cdf0e10cSrcweir 				{
451cdf0e10cSrcweir 					SfxBoolItem aItem(nWhich, SD_MOD()->GetWaterCan());
452cdf0e10cSrcweir 					aAllSet.Put( aItem, aItem.Which());
453cdf0e10cSrcweir 				}
454cdf0e10cSrcweir 			}
455cdf0e10cSrcweir 			break;
456cdf0e10cSrcweir 
457cdf0e10cSrcweir 			case SID_STYLE_NEW:
458cdf0e10cSrcweir 			{
459cdf0e10cSrcweir 				ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
460cdf0e10cSrcweir 				if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
461cdf0e10cSrcweir 					rSet.DisableItem(nWhich);
462cdf0e10cSrcweir 			}
463cdf0e10cSrcweir 			break;
464cdf0e10cSrcweir 
465cdf0e10cSrcweir 			case SID_STYLE_DRAGHIERARCHIE:
466cdf0e10cSrcweir 			{
467cdf0e10cSrcweir 				ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
468cdf0e10cSrcweir 				if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
469cdf0e10cSrcweir 					rSet.DisableItem(nWhich);
470cdf0e10cSrcweir 			}
471cdf0e10cSrcweir 			break;
472cdf0e10cSrcweir 
473cdf0e10cSrcweir 			case SID_STYLE_NEW_BY_EXAMPLE:
474cdf0e10cSrcweir 			{
475cdf0e10cSrcweir 				// PseudoStyleSheets koennen nicht 'by Example' erzeugt werden;
476cdf0e10cSrcweir 				// normale StyleSheets brauchen dafuer ein selektiertes Objekt
477cdf0e10cSrcweir 				ISfxTemplateCommon* pTemplCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
478cdf0e10cSrcweir 				if (pTemplCommon)
479cdf0e10cSrcweir 				{
480cdf0e10cSrcweir 					if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
481cdf0e10cSrcweir 					{
482cdf0e10cSrcweir 						rSet.DisableItem(nWhich);
483cdf0e10cSrcweir 					}
484cdf0e10cSrcweir 					else if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_GRAPHICS)
485cdf0e10cSrcweir 					{
486cdf0e10cSrcweir 						if (!mpDrawView->AreObjectsMarked())
487cdf0e10cSrcweir 						{
488cdf0e10cSrcweir 							rSet.DisableItem(nWhich);
489cdf0e10cSrcweir 						}
490cdf0e10cSrcweir 					}
491cdf0e10cSrcweir 				}
492cdf0e10cSrcweir 				// falls (noch) kein Gestalter da ist, muessen wir uns auf den
493cdf0e10cSrcweir 				// View-Zustand zurueckziehen; eine aktuell eingestellte Familie
494cdf0e10cSrcweir 				// kann nicht beruecksichtigt werden
495cdf0e10cSrcweir 				else
496cdf0e10cSrcweir 				{
497cdf0e10cSrcweir 					if (!mpDrawView->AreObjectsMarked())
498cdf0e10cSrcweir 					{
499cdf0e10cSrcweir 						rSet.DisableItem(nWhich);
500cdf0e10cSrcweir 					}
501cdf0e10cSrcweir 				}
502cdf0e10cSrcweir 
503cdf0e10cSrcweir 			}
504cdf0e10cSrcweir 			break;
505cdf0e10cSrcweir 
506cdf0e10cSrcweir 			case SID_STYLE_UPDATE_BY_EXAMPLE:
507cdf0e10cSrcweir 			{
508cdf0e10cSrcweir 				if (!mpDrawView->AreObjectsMarked())
509cdf0e10cSrcweir 				{
510cdf0e10cSrcweir 					rSet.DisableItem(nWhich);
511cdf0e10cSrcweir 				}
512cdf0e10cSrcweir 			}
513cdf0e10cSrcweir 			break;
5141ff378efSZheng Fan 			case FN_BUL_NUM_RULE_INDEX:
5151ff378efSZheng Fan 			case FN_NUM_NUM_RULE_INDEX:
5161ff378efSZheng Fan 			{
5171ff378efSZheng Fan 				SfxItemSet aEditAttr( GetDoc()->GetPool() );
5181ff378efSZheng Fan 				mpDrawView->GetAttributes( aEditAttr );
5191ff378efSZheng Fan 
5201ff378efSZheng Fan 				SfxItemSet aNewAttr( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
5211ff378efSZheng Fan 				aNewAttr.Put( aEditAttr, sal_False );
5221ff378efSZheng Fan 
5231ff378efSZheng Fan 
5241ff378efSZheng Fan 				sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF;
5251ff378efSZheng Fan 				SvxNumRule* pNumRule = NULL;
5261ff378efSZheng Fan 				const SfxPoolItem* pTmpItem=NULL;
5271ff378efSZheng Fan 				sal_uInt16 nNumItemId = SID_ATTR_NUMBERING_RULE;
5281ff378efSZheng Fan 
5291ff378efSZheng Fan 				//if(SFX_ITEM_SET == aNewAttr.GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pTmpItem))
5301ff378efSZheng Fan 				//	nActNumLvl = ((const SfxUInt16Item*)pTmpItem)->GetValue();
5311ff378efSZheng Fan 				rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,DEFAULT_NONE));
5321ff378efSZheng Fan 				rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,DEFAULT_NONE));
5331ff378efSZheng Fan 				nActNumLvl = mpDrawView->GetSelectionLevel();
5341ff378efSZheng Fan 				pTmpItem=GetNumBulletItem(aNewAttr, nNumItemId);
5351ff378efSZheng Fan 
5361ff378efSZheng Fan 				if (pTmpItem)
5371ff378efSZheng Fan 					pNumRule = new SvxNumRule(*((SvxNumBulletItem*)pTmpItem)->GetNumRule());
5381ff378efSZheng Fan 
5391ff378efSZheng Fan 				if ( pNumRule )
5401ff378efSZheng Fan 				{
5411ff378efSZheng Fan 					sal_uInt16 nMask = 1;
5421ff378efSZheng Fan 					sal_uInt16 nCount = 0;
5431ff378efSZheng Fan 					sal_uInt16 nCurLevel = (sal_uInt16)0xFFFF;
5441ff378efSZheng Fan 					for(sal_uInt16 i = 0; i < pNumRule->GetLevelCount(); i++)
5451ff378efSZheng Fan 					{
5461ff378efSZheng Fan 						if(nActNumLvl & nMask)
5471ff378efSZheng Fan 						{
5481ff378efSZheng Fan 							nCount++;
5491ff378efSZheng Fan 							nCurLevel = i;
5501ff378efSZheng Fan 						}
5511ff378efSZheng Fan 						nMask <<= 1;
5521ff378efSZheng Fan 					}
5531ff378efSZheng Fan 					if ( nCount == 1 )
5541ff378efSZheng Fan 					{
5551ff378efSZheng Fan 						sal_Bool bBullets = sal_False;
5561ff378efSZheng Fan 						const SvxNumberFormat* pNumFmt = pNumRule->Get(nCurLevel);
5571ff378efSZheng Fan 						if ( pNumFmt )
5581ff378efSZheng Fan 						{
5591ff378efSZheng Fan 							switch(pNumFmt->GetNumberingType())
5601ff378efSZheng Fan 							{
5611ff378efSZheng Fan 								case SVX_NUM_CHAR_SPECIAL:
5621ff378efSZheng Fan 								case SVX_NUM_BITMAP:
5631ff378efSZheng Fan 									bBullets = sal_True;
5641ff378efSZheng Fan 									break;
5651ff378efSZheng Fan 
5661ff378efSZheng Fan 								default:
5671ff378efSZheng Fan 									bBullets = sal_False;
5681ff378efSZheng Fan 							}
5691ff378efSZheng Fan 
5701ff378efSZheng Fan 							rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
5711ff378efSZheng Fan 							rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
5721ff378efSZheng Fan 							if ( bBullets )
5731ff378efSZheng Fan 							{
5741ff378efSZheng Fan 								NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::MIXBULLETS);
5751ff378efSZheng Fan 								if ( pBullets )
5761ff378efSZheng Fan 								{
5771ff378efSZheng Fan 									sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(*pNumRule,nActNumLvl);
5781ff378efSZheng Fan 									 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,nBulIndex));
5791ff378efSZheng Fan 								}
5801ff378efSZheng Fan 							}else
5811ff378efSZheng Fan 							{
5821ff378efSZheng Fan 								NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING);
5831ff378efSZheng Fan 								if ( pNumbering )
5841ff378efSZheng Fan 								{
5851ff378efSZheng Fan 									sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(*pNumRule,nActNumLvl);
5861ff378efSZheng Fan 									 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,nBulIndex));
5871ff378efSZheng Fan 								}
5881ff378efSZheng Fan 							}
5891ff378efSZheng Fan 						}
5901ff378efSZheng Fan 					}
5911ff378efSZheng Fan 				}
5921ff378efSZheng Fan 			}
5931ff378efSZheng Fan             		break;
5941ff378efSZheng Fan 			//End
5951ff378efSZheng Fan 			// Added by Li Hui for story 179.
5961ff378efSZheng Fan 			case FN_NUM_BULLET_ON:
5971ff378efSZheng Fan 			case FN_NUM_NUMBERING_ON:
5981ff378efSZheng Fan 			{
5991ff378efSZheng Fan 				sal_Bool bEnable = sal_False;
6001ff378efSZheng Fan 				const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
601*cc69f169SZheng Fan 				const sal_uInt32 nMarkCount = rMarkList.GetMarkCount();
602*cc69f169SZheng Fan 				for (sal_uInt32 nIndex = 0; nIndex < nMarkCount; nIndex++)
6031ff378efSZheng Fan 				{
6041ff378efSZheng Fan 					SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(rMarkList.GetMark(nIndex)->GetMarkedSdrObj());
6051ff378efSZheng Fan 					if (pTextObj && pTextObj->GetObjInventor() == SdrInventor)
6061ff378efSZheng Fan 					{
6071ff378efSZheng Fan 						if (pTextObj->GetObjIdentifier() != OBJ_OLE2)
6081ff378efSZheng Fan 						{
6091ff378efSZheng Fan 							bEnable = sal_True;
6101ff378efSZheng Fan 							break;
6111ff378efSZheng Fan 						}
6121ff378efSZheng Fan 					}
6131ff378efSZheng Fan 				}
6141ff378efSZheng Fan 				if (bEnable)
6151ff378efSZheng Fan 				{
6161ff378efSZheng Fan 					rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, sal_False));
6171ff378efSZheng Fan 					rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON, sal_False));
6181ff378efSZheng Fan 				}
6191ff378efSZheng Fan 				else
6201ff378efSZheng Fan 				{
6211ff378efSZheng Fan 					rSet.DisableItem(FN_NUM_BULLET_ON);
6221ff378efSZheng Fan 					rSet.DisableItem(FN_NUM_NUMBERING_ON);
6231ff378efSZheng Fan 				}
6241ff378efSZheng Fan 			}
6251ff378efSZheng Fan 			break;
626cdf0e10cSrcweir 		}
627cdf0e10cSrcweir 		nWhich = aIter.NextWhich();
628cdf0e10cSrcweir 	}
629cdf0e10cSrcweir 
630cdf0e10cSrcweir 	SfxItemSet* pSet = NULL;
631cdf0e10cSrcweir 
632cdf0e10cSrcweir 	if( bAttr )
633cdf0e10cSrcweir 	{
634cdf0e10cSrcweir 		pSet = new SfxItemSet( GetDoc()->GetPool() );
635cdf0e10cSrcweir 		mpDrawView->GetAttributes( *pSet );
636cdf0e10cSrcweir 		rSet.Put( *pSet, sal_False );
637cdf0e10cSrcweir 	}
638cdf0e10cSrcweir 
639cdf0e10cSrcweir 	rSet.Put( aAllSet, sal_False );
640cdf0e10cSrcweir 
641cdf0e10cSrcweir 	// Flaechen und/oder Linienattribute wurden geaendert
642cdf0e10cSrcweir 	if( bAttr && pSet )
643cdf0e10cSrcweir 	{
644cdf0e10cSrcweir 		// Wenn die View selektierte Objekte besitzt, muessen entspr. Items
645cdf0e10cSrcweir 		// von SFX_ITEM_DEFAULT (_ON) auf SFX_ITEM_DISABLED geaendert werden
646cdf0e10cSrcweir 		if( mpDrawView->AreObjectsMarked() )
647cdf0e10cSrcweir 		{
648cdf0e10cSrcweir 			SfxWhichIter aNewIter( *pSet, XATTR_LINE_FIRST, XATTR_FILL_LAST );
649cdf0e10cSrcweir 			nWhich = aNewIter.FirstWhich();
650cdf0e10cSrcweir 			while( nWhich )
651cdf0e10cSrcweir 			{
652cdf0e10cSrcweir 				if( SFX_ITEM_DEFAULT == pSet->GetItemState( nWhich ) )
653cdf0e10cSrcweir 				{
654cdf0e10cSrcweir 					rSet.ClearItem( nWhich );
655cdf0e10cSrcweir 					rSet.DisableItem( nWhich );
656cdf0e10cSrcweir 				}
657cdf0e10cSrcweir 				nWhich = aNewIter.NextWhich();
658cdf0e10cSrcweir 			}
659cdf0e10cSrcweir 		}
660766ce4d0SZheng Fan 
661766ce4d0SZheng Fan 		SfxItemState eState = pSet->GetItemState( EE_PARA_LRSPACE );
662766ce4d0SZheng Fan 		if ( eState == SFX_ITEM_DONTCARE )
663766ce4d0SZheng Fan 		{
664766ce4d0SZheng Fan 			rSet.InvalidateItem(EE_PARA_LRSPACE);
665766ce4d0SZheng Fan 			rSet.InvalidateItem(SID_ATTR_PARA_LRSPACE);
666766ce4d0SZheng Fan 		}
667766ce4d0SZheng Fan 		eState = pSet->GetItemState( EE_PARA_SBL );
668766ce4d0SZheng Fan 		if ( eState == SFX_ITEM_DONTCARE )
669766ce4d0SZheng Fan 		{
670766ce4d0SZheng Fan 			rSet.InvalidateItem(EE_PARA_SBL);
671766ce4d0SZheng Fan 			rSet.InvalidateItem(SID_ATTR_PARA_LINESPACE);
672766ce4d0SZheng Fan 		}
673766ce4d0SZheng Fan 		eState = pSet->GetItemState( EE_PARA_ULSPACE );
674766ce4d0SZheng Fan 		if ( eState == SFX_ITEM_DONTCARE )
675766ce4d0SZheng Fan 		{
676766ce4d0SZheng Fan 			rSet.InvalidateItem(EE_PARA_ULSPACE);
677766ce4d0SZheng Fan 			rSet.InvalidateItem(SID_ATTR_PARA_ULSPACE);
678cdf0e10cSrcweir 		}
679cdf0e10cSrcweir 
680766ce4d0SZheng Fan 		SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&)
681766ce4d0SZheng Fan 						pSet->Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
682766ce4d0SZheng Fan 		if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
683766ce4d0SZheng Fan 		{
684766ce4d0SZheng Fan 			rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, sal_True ) );
685766ce4d0SZheng Fan 		}
686766ce4d0SZheng Fan 		else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
687766ce4d0SZheng Fan 		{
688766ce4d0SZheng Fan 			rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, sal_True ) );
689766ce4d0SZheng Fan 		}
690766ce4d0SZheng Fan 
691766ce4d0SZheng Fan 		eState = pSet->GetItemState( EE_CHAR_KERNING, sal_True );
692766ce4d0SZheng Fan 		if ( eState == SFX_ITEM_DONTCARE )
693766ce4d0SZheng Fan 		{
694766ce4d0SZheng Fan 			rSet.InvalidateItem(EE_CHAR_KERNING);
695766ce4d0SZheng Fan 			rSet.InvalidateItem(SID_ATTR_CHAR_KERNING);
696766ce4d0SZheng Fan 		}
697766ce4d0SZheng Fan 		delete pSet;
698766ce4d0SZheng Fan 	}
699cdf0e10cSrcweir }
700cdf0e10cSrcweir 
701cdf0e10cSrcweir 
702cdf0e10cSrcweir /*************************************************************************
703cdf0e10cSrcweir |*
704cdf0e10cSrcweir |* Text der Selektion zurueckgeben
705cdf0e10cSrcweir |*
706cdf0e10cSrcweir \************************************************************************/
707cdf0e10cSrcweir 
708cdf0e10cSrcweir String DrawViewShell::GetSelectionText(sal_Bool bCompleteWords)
709cdf0e10cSrcweir {
710cdf0e10cSrcweir 	String aStrSelection;
711cdf0e10cSrcweir 	::Outliner* pOl = mpDrawView->GetTextEditOutliner();
712cdf0e10cSrcweir 	OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
713cdf0e10cSrcweir 
714cdf0e10cSrcweir 	if (pOl && pOlView)
715cdf0e10cSrcweir 	{
716cdf0e10cSrcweir 		if (bCompleteWords)
717cdf0e10cSrcweir 		{
718cdf0e10cSrcweir 			ESelection aSel = pOlView->GetSelection();
719cdf0e10cSrcweir 			String aStrCurrentDelimiters = pOl->GetWordDelimiters();
720cdf0e10cSrcweir 
721cdf0e10cSrcweir 			pOl->SetWordDelimiters( String( RTL_CONSTASCII_USTRINGPARAM( " .,;\"'" )));
722cdf0e10cSrcweir 			aStrSelection = pOl->GetWord( aSel.nEndPara, aSel.nEndPos );
723cdf0e10cSrcweir 			pOl->SetWordDelimiters( aStrCurrentDelimiters );
724cdf0e10cSrcweir 		}
725cdf0e10cSrcweir 		else
726cdf0e10cSrcweir 		{
727cdf0e10cSrcweir 			aStrSelection = pOlView->GetSelected();
728cdf0e10cSrcweir 		}
729cdf0e10cSrcweir 	}
730cdf0e10cSrcweir 
731cdf0e10cSrcweir 	return (aStrSelection);
732cdf0e10cSrcweir }
733cdf0e10cSrcweir 
734cdf0e10cSrcweir /*************************************************************************
735cdf0e10cSrcweir |*
736cdf0e10cSrcweir |* Ist etwas selektiert?
737cdf0e10cSrcweir |*
738cdf0e10cSrcweir \************************************************************************/
739cdf0e10cSrcweir 
740cdf0e10cSrcweir sal_Bool DrawViewShell::HasSelection(sal_Bool bText) const
741cdf0e10cSrcweir {
742cdf0e10cSrcweir 	sal_Bool bReturn = sal_False;
743cdf0e10cSrcweir 
744cdf0e10cSrcweir 	if (bText)
745cdf0e10cSrcweir 	{
746cdf0e10cSrcweir 		OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
747cdf0e10cSrcweir 
748cdf0e10cSrcweir 		if (pOlView && pOlView->GetSelected().Len() != 0)
749cdf0e10cSrcweir 		{
750cdf0e10cSrcweir 			bReturn = sal_True;
751cdf0e10cSrcweir 		}
752cdf0e10cSrcweir 	}
753cdf0e10cSrcweir 	else if (mpDrawView->GetMarkedObjectList().GetMarkCount() != 0)
754cdf0e10cSrcweir 	{
755cdf0e10cSrcweir 		bReturn = sal_True;
756cdf0e10cSrcweir 	}
757cdf0e10cSrcweir 
758cdf0e10cSrcweir 	return bReturn;
759cdf0e10cSrcweir }
760cdf0e10cSrcweir 
761cdf0e10cSrcweir } // end of namespace sd
762