1efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3efeef26fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist * or more contributor license agreements. See the NOTICE file
5efeef26fSAndrew Rist * distributed with this work for additional information
6efeef26fSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7efeef26fSAndrew Rist * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist * with the License. You may obtain a copy of the License at
10efeef26fSAndrew Rist *
11efeef26fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12efeef26fSAndrew Rist *
13efeef26fSAndrew Rist * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist * software distributed under the License is distributed on an
15efeef26fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist * KIND, either express or implied. See the License for the
17efeef26fSAndrew Rist * specific language governing permissions and limitations
18efeef26fSAndrew Rist * under the License.
19efeef26fSAndrew Rist *
20efeef26fSAndrew Rist *************************************************************/
21efeef26fSAndrew Rist
2264b14621SArmin Le Grand // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_sw.hxx"
24cdf0e10cSrcweir
25cdf0e10cSrcweir #include <hintids.hxx>
26cdf0e10cSrcweir #include <svl/whiter.hxx>
27cdf0e10cSrcweir #include <svtools/imapobj.hxx>
28cdf0e10cSrcweir #include <svl/srchitem.hxx>
29cdf0e10cSrcweir #include <svtools/imap.hxx>
30cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
31cdf0e10cSrcweir #include <basic/sbstar.hxx>
32cdf0e10cSrcweir #include <svl/rectitem.hxx>
33cdf0e10cSrcweir #include <svl/ptitem.hxx>
34cdf0e10cSrcweir #include <svl/stritem.hxx>
350c259c9fSOliver-Rainer Wittmann #include <svl/intitem.hxx>
360c259c9fSOliver-Rainer Wittmann #include <svl/eitem.hxx>
37cdf0e10cSrcweir #include <editeng/colritem.hxx>
38cdf0e10cSrcweir #include <editeng/bolnitem.hxx>
39cdf0e10cSrcweir #include <editeng/boxitem.hxx>
40cdf0e10cSrcweir #include <editeng/protitem.hxx>
41cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
42cdf0e10cSrcweir #include <sfx2/request.hxx>
43cdf0e10cSrcweir #include <sfx2/objface.hxx>
44f120fe41SAndre Fischer #include <sfx2/sidebar/EnumContext.hxx>
45cdf0e10cSrcweir #include <svx/hlnkitem.hxx>
46cdf0e10cSrcweir #include <svx/svdview.hxx>
47cdf0e10cSrcweir #include <vcl/msgbox.hxx>
48cdf0e10cSrcweir #include <doc.hxx>
49cdf0e10cSrcweir #include <fmturl.hxx>
50cdf0e10cSrcweir #include <fmtclds.hxx>
51cdf0e10cSrcweir #include <fmtcnct.hxx>
52cdf0e10cSrcweir #include <swmodule.hxx>
53cdf0e10cSrcweir #include <wrtsh.hxx>
54cdf0e10cSrcweir #include <wview.hxx>
55cdf0e10cSrcweir #include <frmatr.hxx>
56cdf0e10cSrcweir #include <uitool.hxx>
57cdf0e10cSrcweir #include <frmfmt.hxx>
58cdf0e10cSrcweir #include <frmsh.hxx>
59cdf0e10cSrcweir #include <frmmgr.hxx>
60cdf0e10cSrcweir #include <frmdlg.hxx>
61cdf0e10cSrcweir #include <swevent.hxx>
62cdf0e10cSrcweir #include <usrpref.hxx>
63cdf0e10cSrcweir #include <edtwin.hxx>
64cdf0e10cSrcweir #include <swdtflvr.hxx>
65cdf0e10cSrcweir #include <swwait.hxx>
66cdf0e10cSrcweir #include <docstat.hxx>
67cdf0e10cSrcweir #include <IDocumentStatistics.hxx>
68cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
69cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
70cdf0e10cSrcweir #include <helpid.h>
71cdf0e10cSrcweir #include <cmdid.h>
72cdf0e10cSrcweir #include <cfgitems.hxx>
73cdf0e10cSrcweir #include <globals.hrc>
74cdf0e10cSrcweir #include <popup.hrc>
75cdf0e10cSrcweir #include <shells.hrc>
76cdf0e10cSrcweir #include "swabstdlg.hxx"
77cdf0e10cSrcweir #include "misc.hrc"
78cdf0e10cSrcweir #include <svx/dialogs.hrc>
7964b14621SArmin Le Grand #include <docsh.hxx>
8064b14621SArmin Le Grand #include <svx/drawitem.hxx>
8126ea3662SArmin Le Grand #include <drawdoc.hxx>
82cdf0e10cSrcweir
83cdf0e10cSrcweir using namespace ::com::sun::star;
84cdf0e10cSrcweir using namespace ::com::sun::star::uno;
85cdf0e10cSrcweir
86cdf0e10cSrcweir // Prototypen ------------------------------------------------------------
87cdf0e10cSrcweir
88cdf0e10cSrcweir void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine);
lcl_GetFrmFmtByName(SwWrtShell & rSh,const String & rName)89cdf0e10cSrcweir const SwFrmFmt* lcl_GetFrmFmtByName(SwWrtShell& rSh, const String& rName)
90cdf0e10cSrcweir {
91cdf0e10cSrcweir sal_uInt16 nCount = rSh.GetFlyCount(FLYCNTTYPE_FRM);
92cdf0e10cSrcweir for( sal_uInt16 i = 0; i < nCount; i++)
93cdf0e10cSrcweir {
94cdf0e10cSrcweir const SwFrmFmt* pFmt = rSh.GetFlyNum(i, FLYCNTTYPE_FRM);
95cdf0e10cSrcweir if(pFmt->GetName() == rName)
96cdf0e10cSrcweir return pFmt;
97cdf0e10cSrcweir }
98cdf0e10cSrcweir return 0;
99cdf0e10cSrcweir }
100cdf0e10cSrcweir
101cdf0e10cSrcweir #define SwFrameShell
102cdf0e10cSrcweir #include <sfx2/msg.hxx>
103cdf0e10cSrcweir #include "swslots.hxx"
104cdf0e10cSrcweir
SFX_IMPL_INTERFACE(SwFrameShell,SwBaseShell,SW_RES (STR_SHELLNAME_FRAME))105cdf0e10cSrcweir SFX_IMPL_INTERFACE(SwFrameShell, SwBaseShell, SW_RES(STR_SHELLNAME_FRAME))
106cdf0e10cSrcweir {
107cdf0e10cSrcweir SFX_POPUPMENU_REGISTRATION(SW_RES(MN_FRM_POPUPMENU));
108cdf0e10cSrcweir SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_FRAME_TOOLBOX));
109cdf0e10cSrcweir }
110cdf0e10cSrcweir
111cdf0e10cSrcweir
112cdf0e10cSrcweir
Execute(SfxRequest & rReq)113cdf0e10cSrcweir void SwFrameShell::Execute(SfxRequest &rReq)
114cdf0e10cSrcweir {
115cdf0e10cSrcweir //Erstmal die, die keinen FrmMgr benoetigen.
116cdf0e10cSrcweir SwWrtShell &rSh = GetShell();
117cdf0e10cSrcweir sal_Bool bMore = sal_False;
118cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs();
119cdf0e10cSrcweir const SfxPoolItem* pItem;
120cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot();
121cdf0e10cSrcweir
122cdf0e10cSrcweir switch ( nSlot )
123cdf0e10cSrcweir {
124cdf0e10cSrcweir case FN_FRAME_TO_ANCHOR:
125cdf0e10cSrcweir if ( rSh.IsFrmSelected() )
126cdf0e10cSrcweir {
127cdf0e10cSrcweir rSh.GotoFlyAnchor();
128cdf0e10cSrcweir rSh.EnterStdMode();
129cdf0e10cSrcweir rSh.CallChgLnk();
130cdf0e10cSrcweir }
131cdf0e10cSrcweir break;
132cdf0e10cSrcweir case SID_FRAME_TO_TOP:
133cdf0e10cSrcweir rSh.SelectionToTop();
134cdf0e10cSrcweir break;
135cdf0e10cSrcweir
136cdf0e10cSrcweir case SID_FRAME_TO_BOTTOM:
137cdf0e10cSrcweir rSh.SelectionToBottom();
138cdf0e10cSrcweir break;
139cdf0e10cSrcweir
140cdf0e10cSrcweir case FN_FRAME_UP:
141cdf0e10cSrcweir rSh.SelectionToTop( sal_False );
142cdf0e10cSrcweir break;
143cdf0e10cSrcweir
144cdf0e10cSrcweir case FN_FRAME_DOWN:
145cdf0e10cSrcweir rSh.SelectionToBottom( sal_False );
146cdf0e10cSrcweir break;
147cdf0e10cSrcweir case FN_INSERT_FRAME:
148cdf0e10cSrcweir if (!pArgs)
149cdf0e10cSrcweir {
150cdf0e10cSrcweir // Rahmen existiert bereits, Rahmendialog zur Bearbeitung oeffnen
151cdf0e10cSrcweir SfxUInt16Item aDefPage(FN_FORMAT_FRAME_DLG, TP_COLUMN);
152cdf0e10cSrcweir rSh.GetView().GetViewFrame()->GetDispatcher()->Execute( FN_FORMAT_FRAME_DLG,
153cdf0e10cSrcweir SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
154cdf0e10cSrcweir &aDefPage, 0L );
155cdf0e10cSrcweir
156cdf0e10cSrcweir }
157cdf0e10cSrcweir else
158cdf0e10cSrcweir {
159cdf0e10cSrcweir // Rahmen existiert bereits, nur Spaltenanzahl wird geaendert
160cdf0e10cSrcweir sal_uInt16 nCols = 1;
161cdf0e10cSrcweir if(pArgs->GetItemState(SID_ATTR_COLUMNS, sal_False, &pItem) == SFX_ITEM_SET)
162cdf0e10cSrcweir nCols = ((SfxUInt16Item *)pItem)->GetValue();
163cdf0e10cSrcweir
164cdf0e10cSrcweir SfxItemSet aSet(GetPool(),RES_COL,RES_COL);
165cdf0e10cSrcweir rSh.GetFlyFrmAttr( aSet );
166cdf0e10cSrcweir SwFmtCol aCol((const SwFmtCol&)aSet.Get(RES_COL));
167cdf0e10cSrcweir // GutterWidth wird nicht immer uebergeben, daher erst besorgen (siehe view2: Execute auf diesen Slot)
168cdf0e10cSrcweir sal_uInt16 nGutterWidth = aCol.GetGutterWidth();
169cdf0e10cSrcweir if(!nCols )
170cdf0e10cSrcweir nCols++;
171cdf0e10cSrcweir aCol.Init(nCols, nGutterWidth, aCol.GetWishWidth());
172cdf0e10cSrcweir aSet.Put(aCol);
173cdf0e10cSrcweir // Vorlagen-AutoUpdate
174cdf0e10cSrcweir SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
175cdf0e10cSrcweir if(pFmt && pFmt->IsAutoUpdateFmt())
176cdf0e10cSrcweir {
177cdf0e10cSrcweir rSh.AutoUpdateFrame(pFmt, aSet);
178cdf0e10cSrcweir }
179cdf0e10cSrcweir else
180cdf0e10cSrcweir {
181cdf0e10cSrcweir rSh.StartAllAction();
182cdf0e10cSrcweir rSh.SetFlyFrmAttr( aSet );
183cdf0e10cSrcweir rSh.SetModified();
184cdf0e10cSrcweir rSh.EndAllAction();
185cdf0e10cSrcweir }
186cdf0e10cSrcweir
187cdf0e10cSrcweir }
188cdf0e10cSrcweir return;
189cdf0e10cSrcweir
190cdf0e10cSrcweir case SID_HYPERLINK_SETLINK:
191cdf0e10cSrcweir {
192cdf0e10cSrcweir if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_HYPERLINK_SETLINK, sal_False, &pItem))
193cdf0e10cSrcweir {
194cdf0e10cSrcweir const SvxHyperlinkItem& rHLinkItem = *(const SvxHyperlinkItem *)pItem;
195cdf0e10cSrcweir const String& rURL = rHLinkItem.GetURL();
196cdf0e10cSrcweir const String& rTarget = rHLinkItem.GetTargetFrame();
197cdf0e10cSrcweir
198cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL );
199cdf0e10cSrcweir rSh.GetFlyFrmAttr( aSet );
200cdf0e10cSrcweir SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) );
201cdf0e10cSrcweir
202cdf0e10cSrcweir String sOldName(rHLinkItem.GetName());
203cdf0e10cSrcweir String sFlyName(rSh.GetFlyName());
204cdf0e10cSrcweir if (sOldName.ToUpperAscii() != sFlyName.ToUpperAscii())
205cdf0e10cSrcweir {
206cdf0e10cSrcweir String sName(sOldName);
207cdf0e10cSrcweir sal_uInt16 i = 1;
208cdf0e10cSrcweir while (rSh.FindFlyByName(sName))
209cdf0e10cSrcweir {
210cdf0e10cSrcweir sName = sOldName;
211cdf0e10cSrcweir sName += '_';
212cdf0e10cSrcweir sName += String::CreateFromInt32(i++);
213cdf0e10cSrcweir }
214cdf0e10cSrcweir rSh.SetFlyName(sName);
215cdf0e10cSrcweir }
216cdf0e10cSrcweir aURL.SetURL( rURL, sal_False );
217cdf0e10cSrcweir aURL.SetTargetFrameName(rTarget);
218cdf0e10cSrcweir
219cdf0e10cSrcweir aSet.Put( aURL );
220cdf0e10cSrcweir rSh.SetFlyFrmAttr( aSet );
221cdf0e10cSrcweir }
222cdf0e10cSrcweir }
223cdf0e10cSrcweir break;
224cdf0e10cSrcweir
225cdf0e10cSrcweir case FN_FRAME_CHAIN:
226cdf0e10cSrcweir rSh.GetView().GetEditWin().SetChainMode( !rSh.GetView().GetEditWin().IsChainMode() );
227cdf0e10cSrcweir break;
228cdf0e10cSrcweir
229cdf0e10cSrcweir case FN_FRAME_UNCHAIN:
230cdf0e10cSrcweir rSh.Unchain( (SwFrmFmt&)*rSh.GetFlyFrmFmt() );
231cdf0e10cSrcweir GetView().GetViewFrame()->GetBindings().Invalidate(FN_FRAME_CHAIN);
232cdf0e10cSrcweir break;
233cdf0e10cSrcweir case FN_FORMAT_FOOTNOTE_DLG:
234cdf0e10cSrcweir {
235cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
236cdf0e10cSrcweir DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
237cdf0e10cSrcweir
238cdf0e10cSrcweir VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), GetView().GetWrtShell(), DLG_DOC_FOOTNOTE );
239cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!");
240cdf0e10cSrcweir pDlg->Execute();
241cdf0e10cSrcweir delete pDlg;
242cdf0e10cSrcweir break;
243cdf0e10cSrcweir }
244cdf0e10cSrcweir case FN_NUMBERING_OUTLINE_DLG:
245cdf0e10cSrcweir {
246cdf0e10cSrcweir SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
247cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
248cdf0e10cSrcweir DBG_ASSERT(pFact, "Dialogdiet fail!");
249cdf0e10cSrcweir SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
250cdf0e10cSrcweir GetView().GetWindow(), &aTmp, GetView().GetWrtShell());
251cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!");
252cdf0e10cSrcweir pDlg->Execute();
253cdf0e10cSrcweir delete pDlg;
254cdf0e10cSrcweir rReq.Done();
255cdf0e10cSrcweir break;
256cdf0e10cSrcweir }
257cdf0e10cSrcweir case SID_OPEN_XML_FILTERSETTINGS:
258cdf0e10cSrcweir {
259cdf0e10cSrcweir try
260cdf0e10cSrcweir {
261cdf0e10cSrcweir uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
262cdf0e10cSrcweir if( xDialog.is() )
263cdf0e10cSrcweir {
264cdf0e10cSrcweir xDialog->execute();
265cdf0e10cSrcweir }
266cdf0e10cSrcweir }
267cdf0e10cSrcweir catch( uno::Exception& )
268cdf0e10cSrcweir {
269cdf0e10cSrcweir }
270cdf0e10cSrcweir rReq.Ignore ();
271cdf0e10cSrcweir }
272cdf0e10cSrcweir break;
273cdf0e10cSrcweir case FN_WORDCOUNT_DIALOG:
274cdf0e10cSrcweir {
275cdf0e10cSrcweir SwDocStat aCurr;
276cdf0e10cSrcweir SwDocStat aDocStat( rSh.getIDocumentStatistics()->GetDocStat() );
277cdf0e10cSrcweir {
2788ef2f12bSOliver-Rainer Wittmann SwWait aWait( *GetView().GetDocShell(), true );
279cdf0e10cSrcweir rSh.StartAction();
280cdf0e10cSrcweir rSh.CountWords( aCurr );
281cdf0e10cSrcweir rSh.UpdateDocStat( aDocStat );
282cdf0e10cSrcweir rSh.EndAction();
283cdf0e10cSrcweir }
284cdf0e10cSrcweir
285cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
286cdf0e10cSrcweir DBG_ASSERT(pFact, "Dialogdiet fail!");
287cdf0e10cSrcweir AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() );
288cdf0e10cSrcweir pDialog->SetValues(aCurr, aDocStat );
289cdf0e10cSrcweir pDialog->Execute();
290cdf0e10cSrcweir delete pDialog;
291cdf0e10cSrcweir }
292cdf0e10cSrcweir break;
293cdf0e10cSrcweir default: bMore = sal_True;
294cdf0e10cSrcweir }
295cdf0e10cSrcweir
296cdf0e10cSrcweir if ( !bMore )
297cdf0e10cSrcweir {
298cdf0e10cSrcweir return;
299cdf0e10cSrcweir }
300cdf0e10cSrcweir
301cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE );
302cdf0e10cSrcweir sal_Bool bUpdateMgr = sal_True;
303cdf0e10cSrcweir sal_Bool bCopyToFmt = sal_False;
304cdf0e10cSrcweir switch ( nSlot )
305cdf0e10cSrcweir {
306cdf0e10cSrcweir case SID_OBJECT_ALIGN_MIDDLE:
307cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CENTER:
308cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::CENTER );
309cdf0e10cSrcweir break;
310cdf0e10cSrcweir case SID_OBJECT_ALIGN_DOWN :
311cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_BOTTOM:
312cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::BOTTOM );
313cdf0e10cSrcweir break;
314cdf0e10cSrcweir case SID_OBJECT_ALIGN_UP :
315cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_TOP:
316cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::TOP );
317cdf0e10cSrcweir break;
318cdf0e10cSrcweir
319cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CHAR_CENTER:
320cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::CHAR_CENTER );
321cdf0e10cSrcweir break;
322cdf0e10cSrcweir
323cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM:
324cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::CHAR_BOTTOM );
325cdf0e10cSrcweir break;
326cdf0e10cSrcweir
327cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CHAR_TOP:
328cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::CHAR_TOP );
329cdf0e10cSrcweir break;
330cdf0e10cSrcweir
331cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_ROW_CENTER:
332cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::LINE_CENTER );
333cdf0e10cSrcweir break;
334cdf0e10cSrcweir
335cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_ROW_BOTTOM:
336cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::LINE_BOTTOM );
337cdf0e10cSrcweir break;
338cdf0e10cSrcweir
339cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_ROW_TOP:
340cdf0e10cSrcweir aMgr.SetVertOrientation( text::VertOrientation::LINE_TOP );
341cdf0e10cSrcweir break;
342cdf0e10cSrcweir case SID_OBJECT_ALIGN_CENTER :
343cdf0e10cSrcweir case FN_FRAME_ALIGN_HORZ_CENTER:
344cdf0e10cSrcweir aMgr.SetHorzOrientation( text::HoriOrientation::CENTER );
345cdf0e10cSrcweir break;
346cdf0e10cSrcweir case SID_OBJECT_ALIGN_RIGHT:
347cdf0e10cSrcweir case FN_FRAME_ALIGN_HORZ_RIGHT:
348cdf0e10cSrcweir aMgr.SetHorzOrientation( text::HoriOrientation::RIGHT );
349cdf0e10cSrcweir break;
350cdf0e10cSrcweir case SID_OBJECT_ALIGN_LEFT:
351cdf0e10cSrcweir case FN_FRAME_ALIGN_HORZ_LEFT:
352cdf0e10cSrcweir aMgr.SetHorzOrientation( text::HoriOrientation::LEFT );
353cdf0e10cSrcweir break;
354cdf0e10cSrcweir
355cdf0e10cSrcweir case FN_SET_FRM_POSITION:
356cdf0e10cSrcweir {
357cdf0e10cSrcweir aMgr.SetAbsPos(((SfxPointItem &)pArgs->Get
358cdf0e10cSrcweir (FN_SET_FRM_POSITION)).GetValue());
359cdf0e10cSrcweir }
360cdf0e10cSrcweir break;
361cdf0e10cSrcweir case SID_ATTR_BRUSH:
362cdf0e10cSrcweir {
363cdf0e10cSrcweir if(pArgs)
364cdf0e10cSrcweir {
365cdf0e10cSrcweir aMgr.SetAttrSet( *pArgs );
366cdf0e10cSrcweir bCopyToFmt = sal_True;
367cdf0e10cSrcweir }
368cdf0e10cSrcweir }
369cdf0e10cSrcweir break;
370cdf0e10cSrcweir case SID_ATTR_ULSPACE:
371cdf0e10cSrcweir case SID_ATTR_LRSPACE:
372cdf0e10cSrcweir {
373cdf0e10cSrcweir if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem))
374cdf0e10cSrcweir {
375cdf0e10cSrcweir aMgr.SetAttrSet( *pArgs );
376cdf0e10cSrcweir if(SID_ATTR_ULSPACE == nSlot && SID_ATTR_ULSPACE == nSlot)
377cdf0e10cSrcweir bCopyToFmt = sal_True;
378cdf0e10cSrcweir }
379cdf0e10cSrcweir }
380cdf0e10cSrcweir break;
3810c259c9fSOliver-Rainer Wittmann
3820c259c9fSOliver-Rainer Wittmann case SID_ATTR_TRANSFORM:
3830c259c9fSOliver-Rainer Wittmann {
3840c259c9fSOliver-Rainer Wittmann bool bApplyNewSize = false;
3850c259c9fSOliver-Rainer Wittmann
3860c259c9fSOliver-Rainer Wittmann Size aNewSize = aMgr.GetSize();
3871ff378efSZheng Fan if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_WIDTH, sal_False, &pItem ) )
3880c259c9fSOliver-Rainer Wittmann {
3890c259c9fSOliver-Rainer Wittmann aNewSize.setWidth( static_cast< const SfxUInt32Item* >(pItem)->GetValue() );
3900c259c9fSOliver-Rainer Wittmann bApplyNewSize = true;
3910c259c9fSOliver-Rainer Wittmann }
3920c259c9fSOliver-Rainer Wittmann
3931ff378efSZheng Fan if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_HEIGHT, sal_False, &pItem ) )
3940c259c9fSOliver-Rainer Wittmann {
3950c259c9fSOliver-Rainer Wittmann aNewSize.setHeight( static_cast< const SfxUInt32Item* >(pItem)->GetValue() );
3960c259c9fSOliver-Rainer Wittmann bApplyNewSize = true;
3970c259c9fSOliver-Rainer Wittmann }
3980c259c9fSOliver-Rainer Wittmann
3990c259c9fSOliver-Rainer Wittmann if ( bApplyNewSize )
4000c259c9fSOliver-Rainer Wittmann {
4010c259c9fSOliver-Rainer Wittmann aMgr.SetSize( aNewSize );
4020c259c9fSOliver-Rainer Wittmann }
4030c259c9fSOliver-Rainer Wittmann else
4040c259c9fSOliver-Rainer Wittmann {
4050c259c9fSOliver-Rainer Wittmann bUpdateMgr = sal_False;
4060c259c9fSOliver-Rainer Wittmann }
4070c259c9fSOliver-Rainer Wittmann
4080c259c9fSOliver-Rainer Wittmann }
4090c259c9fSOliver-Rainer Wittmann break;
4100c259c9fSOliver-Rainer Wittmann
411721f296aSOliver-Rainer Wittmann case FN_FORMAT_FRAME_DLG:
412395b75f9SOliver-Rainer Wittmann case FN_DRAW_WRAP_DLG:
413cdf0e10cSrcweir {
414cdf0e10cSrcweir const int nSel = rSh.GetSelectionType();
415cdf0e10cSrcweir if (nSel & nsSelectionType::SEL_GRF)
416cdf0e10cSrcweir {
417cdf0e10cSrcweir rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_GRAFIC_DLG);
418cdf0e10cSrcweir bUpdateMgr = sal_False;
419cdf0e10cSrcweir }
420cdf0e10cSrcweir else
421cdf0e10cSrcweir {
42264b14621SArmin Le Grand SfxItemSet aSet(GetPool(), //UUUU sorted by indices
42364b14621SArmin Le Grand RES_FRMATR_BEGIN, RES_FRMATR_END-1, // [82
42464b14621SArmin Le Grand
42564b14621SArmin Le Grand //UUUU FillAttribute support
42664b14621SArmin Le Grand XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014
42764b14621SArmin Le Grand
42864b14621SArmin Le Grand SID_DOCFRAME, SID_DOCFRAME, // [5598
42964b14621SArmin Le Grand
43064b14621SArmin Le Grand SID_ATTR_BRUSH, SID_ATTR_BRUSH, // [10001
43164b14621SArmin Le Grand SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, // [10023
43264b14621SArmin Le Grand SID_ATTR_LRSPACE, SID_ATTR_ULSPACE, // [10048
43364b14621SArmin Le Grand SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, // [10051
43464b14621SArmin Le Grand
43564b14621SArmin Le Grand //UUUU items to hand over XPropertyList things like
43664b14621SArmin Le Grand // XColorList, XHatchList, XGradientList and XBitmapList
43764b14621SArmin Le Grand // to the Area TabPage
43864b14621SArmin Le Grand SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179
43964b14621SArmin Le Grand
44064b14621SArmin Le Grand SID_HTML_MODE, SID_HTML_MODE, // [10414
44164b14621SArmin Le Grand FN_GET_PRINT_AREA, FN_GET_PRINT_AREA, // [21032
44264b14621SArmin Le Grand FN_SURROUND, FN_HORI_ORIENT, // [21303
443b740b198SArmin Le Grand FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, // [21306
44464b14621SArmin Le Grand FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, // [21318
445b740b198SArmin Le Grand FN_OLE_IS_MATH, FN_MATH_BASELINE_ALIGNMENT, // [22314
44664b14621SArmin Le Grand FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT, // [22420
44764b14621SArmin Le Grand
44864b14621SArmin Le Grand 0);
44964b14621SArmin Le Grand
45064b14621SArmin Le Grand //UUUU create needed items for XPropertyList entries from the DrawModel so that
45164b14621SArmin Le Grand // the Area TabPage can access them
45226ea3662SArmin Le Grand const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel();
45364b14621SArmin Le Grand
45464b14621SArmin Le Grand aSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
45564b14621SArmin Le Grand aSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
45664b14621SArmin Le Grand aSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
45764b14621SArmin Le Grand aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
458cdf0e10cSrcweir
459721f296aSOliver-Rainer Wittmann const SwViewOption* pVOpt = rSh.GetViewOptions();
460721f296aSOliver-Rainer Wittmann if(nSel & nsSelectionType::SEL_OLE)
461cdf0e10cSrcweir aSet.Put( SfxBoolItem(FN_KEEP_ASPECT_RATIO, pVOpt->IsKeepRatio()) );
462721f296aSOliver-Rainer Wittmann aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
463721f296aSOliver-Rainer Wittmann aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
464cdf0e10cSrcweir if( nSel & nsSelectionType::SEL_OLE )
465cdf0e10cSrcweir {
466cdf0e10cSrcweir aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
467cdf0e10cSrcweir }
468cdf0e10cSrcweir
469cdf0e10cSrcweir const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE);
470cdf0e10cSrcweir SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
471cdf0e10cSrcweir aFrmSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
472cdf0e10cSrcweir aSet.Put(aFrmSize);
473cdf0e10cSrcweir
474cdf0e10cSrcweir const SwRect &rPr = rSh.GetAnyCurRect(RECT_PAGE_PRT);
475cdf0e10cSrcweir SwFmtFrmSize aPrtSize(ATT_VAR_SIZE, rPr.Width(), rPr.Height());
476cdf0e10cSrcweir aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
477cdf0e10cSrcweir aSet.Put(aPrtSize);
478cdf0e10cSrcweir
479cdf0e10cSrcweir aSet.Put(aMgr.GetAttrSet());
480cdf0e10cSrcweir aSet.SetParent( aMgr.GetAttrSet().GetParent() );
481cdf0e10cSrcweir
482cdf0e10cSrcweir // Bei %-Werten Groesse initialisieren
483cdf0e10cSrcweir SwFmtFrmSize& rSize = (SwFmtFrmSize&)aSet.Get(RES_FRM_SIZE);
484cdf0e10cSrcweir if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != 0xff)
485cdf0e10cSrcweir rSize.SetWidth(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width());
486cdf0e10cSrcweir if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != 0xff)
487cdf0e10cSrcweir rSize.SetHeight(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height());
488cdf0e10cSrcweir
489cdf0e10cSrcweir // disable vertical positioning for Math Objects anchored 'as char' if baseline alignment is activated
490cdf0e10cSrcweir aSet.Put( SfxBoolItem( FN_MATH_BASELINE_ALIGNMENT,
491cdf0e10cSrcweir rSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ) );
492cdf0e10cSrcweir const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
493cdf0e10cSrcweir aSet.Put( SfxBoolItem( FN_OLE_IS_MATH, xObj.is() && SotExchange::IsMath( xObj->getClassID() ) ) );
494cdf0e10cSrcweir
495cdf0e10cSrcweir sal_uInt16 nDefPage = 0;
496cdf0e10cSrcweir if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, sal_False, &pItem) == SFX_ITEM_SET)
497cdf0e10cSrcweir nDefPage = ((SfxUInt16Item *)pItem)->GetValue();
498cdf0e10cSrcweir
499cdf0e10cSrcweir aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame()));
500cdf0e10cSrcweir FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
501cdf0e10cSrcweir SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) ));
502cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
503cdf0e10cSrcweir DBG_ASSERT(pFact, "Dialogdiet fail!");
504cdf0e10cSrcweir SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
505cdf0e10cSrcweir GetView().GetViewFrame(),
506cdf0e10cSrcweir GetView().GetWindow(),
507cdf0e10cSrcweir aSet, sal_False,
508cdf0e10cSrcweir nSel & nsSelectionType::SEL_GRF ? DLG_FRM_GRF :
509cdf0e10cSrcweir nSel & nsSelectionType::SEL_OLE ? DLG_FRM_OLE :
510cdf0e10cSrcweir DLG_FRM_STD,
511cdf0e10cSrcweir sal_False,
512cdf0e10cSrcweir nDefPage);
513cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!");
514cdf0e10cSrcweir
515395b75f9SOliver-Rainer Wittmann if ( nSlot == FN_DRAW_WRAP_DLG )
516721f296aSOliver-Rainer Wittmann {
517721f296aSOliver-Rainer Wittmann pDlg->SetCurPageId(TP_FRM_WRAP);
518721f296aSOliver-Rainer Wittmann }
519721f296aSOliver-Rainer Wittmann
520cdf0e10cSrcweir if ( pDlg->Execute() )
521cdf0e10cSrcweir {
522cdf0e10cSrcweir const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
523cdf0e10cSrcweir if(pOutSet)
524cdf0e10cSrcweir {
525cdf0e10cSrcweir rReq.Done(*pOutSet);
526cdf0e10cSrcweir if(nSel & nsSelectionType::SEL_OLE &&
527cdf0e10cSrcweir SFX_ITEM_SET == pOutSet->GetItemState(FN_KEEP_ASPECT_RATIO, sal_True, &pItem))
528cdf0e10cSrcweir {
529cdf0e10cSrcweir SwViewOption aUsrPref( *pVOpt );
530cdf0e10cSrcweir aUsrPref.SetKeepRatio(((const SfxBoolItem*)pItem)->GetValue());
531cdf0e10cSrcweir SW_MOD()->ApplyUsrPref(aUsrPref, &GetView());
532cdf0e10cSrcweir }
533cdf0e10cSrcweir if (SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_ALT_NAME, sal_True, &pItem))
534cdf0e10cSrcweir {
535cdf0e10cSrcweir // --> OD 2009-07-13 #i73249#
536cdf0e10cSrcweir // rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue());
537cdf0e10cSrcweir rSh.SetObjTitle(((const SfxStringItem*)pItem)->GetValue());
538cdf0e10cSrcweir // <--
539cdf0e10cSrcweir }
540cdf0e10cSrcweir // Vorlagen-AutoUpdate
541cdf0e10cSrcweir SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
542cdf0e10cSrcweir if(pFmt && pFmt->IsAutoUpdateFmt())
543cdf0e10cSrcweir {
544cdf0e10cSrcweir rSh.AutoUpdateFrame(pFmt, *pOutSet);
545cdf0e10cSrcweir // alles, dass das Format nicht kann, muss hart
546cdf0e10cSrcweir // gesetzt werden
547cdf0e10cSrcweir if(SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_NAME, sal_False, &pItem))
548cdf0e10cSrcweir rSh.SetFlyName(((SfxStringItem*)pItem)->GetValue());
549cdf0e10cSrcweir SfxItemSet aShellSet(GetPool(), RES_FRM_SIZE, RES_FRM_SIZE,
550cdf0e10cSrcweir RES_SURROUND, RES_SURROUND,
551cdf0e10cSrcweir RES_ANCHOR, RES_ANCHOR,
552cdf0e10cSrcweir RES_VERT_ORIENT,RES_HORI_ORIENT,
553cdf0e10cSrcweir 0);
554cdf0e10cSrcweir aShellSet.Put(*pOutSet);
555cdf0e10cSrcweir aMgr.SetAttrSet(aShellSet);
556cdf0e10cSrcweir if(SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_NAME, sal_False, &pItem))
557cdf0e10cSrcweir rSh.SetFlyName(((SfxStringItem*)pItem)->GetValue());
558cdf0e10cSrcweir }
559cdf0e10cSrcweir else
560cdf0e10cSrcweir aMgr.SetAttrSet( *pOutSet );
561cdf0e10cSrcweir
562cdf0e10cSrcweir const SwFrmFmt* pCurrFlyFmt = rSh.GetFlyFrmFmt();
563cdf0e10cSrcweir if(SFX_ITEM_SET ==
564cdf0e10cSrcweir pOutSet->GetItemState(FN_PARAM_CHAIN_PREVIOUS,
565cdf0e10cSrcweir sal_False, &pItem))
566cdf0e10cSrcweir {
567cdf0e10cSrcweir rSh.HideChainMarker();
568cdf0e10cSrcweir
569cdf0e10cSrcweir String sPrevName =
570cdf0e10cSrcweir ((const SfxStringItem*)pItem)->GetValue();
571cdf0e10cSrcweir const SwFmtChain &rChain = pCurrFlyFmt->GetChain();
572cdf0e10cSrcweir //needs cast - no non-const method available
573cdf0e10cSrcweir SwFlyFrmFmt* pFlyFmt =
574cdf0e10cSrcweir (SwFlyFrmFmt*)rChain.GetPrev();
575cdf0e10cSrcweir if(pFlyFmt)
576cdf0e10cSrcweir {
577cdf0e10cSrcweir if (pFlyFmt->GetName() != sPrevName)
578cdf0e10cSrcweir {
579cdf0e10cSrcweir rSh.Unchain(*pFlyFmt);
580cdf0e10cSrcweir }
581cdf0e10cSrcweir else
582cdf0e10cSrcweir sPrevName.Erase();
583cdf0e10cSrcweir }
584cdf0e10cSrcweir
585cdf0e10cSrcweir if(sPrevName.Len())
586cdf0e10cSrcweir {
587cdf0e10cSrcweir //needs cast - no non-const method available
588cdf0e10cSrcweir SwFrmFmt* pPrevFmt = (SwFrmFmt*)
589cdf0e10cSrcweir lcl_GetFrmFmtByName(rSh, sPrevName);
590cdf0e10cSrcweir DBG_ASSERT(pPrevFmt, "No frame found!");
591cdf0e10cSrcweir if(pPrevFmt)
592cdf0e10cSrcweir {
593cdf0e10cSrcweir rSh.Chain(*pPrevFmt, *pCurrFlyFmt);
594cdf0e10cSrcweir }
595cdf0e10cSrcweir }
596cdf0e10cSrcweir rSh.SetChainMarker();
597cdf0e10cSrcweir }
598cdf0e10cSrcweir if(SFX_ITEM_SET ==
599cdf0e10cSrcweir pOutSet->GetItemState(FN_PARAM_CHAIN_NEXT, sal_False,
600cdf0e10cSrcweir &pItem))
601cdf0e10cSrcweir {
602cdf0e10cSrcweir rSh.HideChainMarker();
603cdf0e10cSrcweir String sNextName =
604cdf0e10cSrcweir ((const SfxStringItem*)pItem)->GetValue();
605cdf0e10cSrcweir const SwFmtChain &rChain = pCurrFlyFmt->GetChain();
606cdf0e10cSrcweir //needs cast - no non-const method available
607cdf0e10cSrcweir SwFlyFrmFmt* pFlyFmt =
608cdf0e10cSrcweir (SwFlyFrmFmt*)rChain.GetNext();
609cdf0e10cSrcweir if(pFlyFmt)
610cdf0e10cSrcweir {
611cdf0e10cSrcweir if (pFlyFmt->GetName() != sNextName)
612cdf0e10cSrcweir {
613cdf0e10cSrcweir rSh.Unchain(*((SwFlyFrmFmt*) pCurrFlyFmt));
614cdf0e10cSrcweir }
615cdf0e10cSrcweir else
616cdf0e10cSrcweir sNextName.Erase();
617cdf0e10cSrcweir }
618cdf0e10cSrcweir
619cdf0e10cSrcweir if(sNextName.Len())
620cdf0e10cSrcweir {
621cdf0e10cSrcweir //needs cast - no non-const method available
622cdf0e10cSrcweir SwFrmFmt* pNextFmt = (SwFrmFmt*)
623cdf0e10cSrcweir lcl_GetFrmFmtByName(rSh, sNextName);
624cdf0e10cSrcweir DBG_ASSERT(pNextFmt, "No frame found!");
625cdf0e10cSrcweir if(pNextFmt)
626cdf0e10cSrcweir {
627cdf0e10cSrcweir rSh.Chain(*(SwFrmFmt*)
628cdf0e10cSrcweir pCurrFlyFmt, *pNextFmt);
629cdf0e10cSrcweir }
630cdf0e10cSrcweir }
631cdf0e10cSrcweir rSh.SetChainMarker();
632cdf0e10cSrcweir }
633cdf0e10cSrcweir }
634cdf0e10cSrcweir }
635cdf0e10cSrcweir else
636cdf0e10cSrcweir bUpdateMgr = sal_False;
637cdf0e10cSrcweir delete pDlg;
638cdf0e10cSrcweir }
639cdf0e10cSrcweir }
640cdf0e10cSrcweir break;
641cdf0e10cSrcweir case FN_FRAME_MIRROR_ON_EVEN_PAGES:
642cdf0e10cSrcweir {
643cdf0e10cSrcweir SwFmtHoriOrient aHori(aMgr.GetHoriOrient());
644cdf0e10cSrcweir sal_Bool bMirror = !aHori.IsPosToggle();
645cdf0e10cSrcweir aHori.SetPosToggle(bMirror);
646cdf0e10cSrcweir SfxItemSet aSet(GetPool(), RES_HORI_ORIENT, RES_HORI_ORIENT);
647cdf0e10cSrcweir aSet.Put(aHori);
648cdf0e10cSrcweir aMgr.SetAttrSet(aSet);
649cdf0e10cSrcweir bCopyToFmt = sal_True;
650cdf0e10cSrcweir rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror));
651cdf0e10cSrcweir }
652cdf0e10cSrcweir break;
653cdf0e10cSrcweir // --> OD 2009-07-14 #i73249#
654cdf0e10cSrcweir case FN_TITLE_DESCRIPTION_SHAPE:
655cdf0e10cSrcweir {
656cdf0e10cSrcweir bUpdateMgr = sal_False;
657cdf0e10cSrcweir SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
658cdf0e10cSrcweir if ( pSdrView &&
659cdf0e10cSrcweir pSdrView->GetMarkedObjectCount() == 1 )
660cdf0e10cSrcweir {
661cdf0e10cSrcweir String aDescription(rSh.GetObjDescription());
662cdf0e10cSrcweir String aTitle(rSh.GetObjTitle());
663cdf0e10cSrcweir
664cdf0e10cSrcweir SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
665cdf0e10cSrcweir OSL_ENSURE(pFact, "Dialogdiet fail!");
666cdf0e10cSrcweir AbstractSvxObjectTitleDescDialog* pDlg =
667cdf0e10cSrcweir pFact->CreateSvxObjectTitleDescDialog( NULL,
668cdf0e10cSrcweir aTitle,
669cdf0e10cSrcweir aDescription );
670cdf0e10cSrcweir OSL_ENSURE(pDlg, "Dialogdiet fail!");
671cdf0e10cSrcweir
672cdf0e10cSrcweir if ( pDlg->Execute() == RET_OK )
673cdf0e10cSrcweir {
674cdf0e10cSrcweir pDlg->GetDescription(aDescription);
675cdf0e10cSrcweir pDlg->GetTitle(aTitle);
676cdf0e10cSrcweir
677cdf0e10cSrcweir rSh.SetObjDescription(aDescription);
678cdf0e10cSrcweir rSh.SetObjTitle(aTitle);
679cdf0e10cSrcweir }
680cdf0e10cSrcweir
681cdf0e10cSrcweir delete pDlg;
682cdf0e10cSrcweir }
683cdf0e10cSrcweir }
684cdf0e10cSrcweir break;
685cdf0e10cSrcweir // <--
6860c259c9fSOliver-Rainer Wittmann default:
687*870262e3SDon Lewis ASSERT( sal_False, "wrong dispatcher" );
6880c259c9fSOliver-Rainer Wittmann return;
6890c259c9fSOliver-Rainer Wittmann }
6900c259c9fSOliver-Rainer Wittmann if ( bUpdateMgr )
6910c259c9fSOliver-Rainer Wittmann {
6920c259c9fSOliver-Rainer Wittmann SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
6930c259c9fSOliver-Rainer Wittmann if ( bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt() )
6940c259c9fSOliver-Rainer Wittmann {
6950c259c9fSOliver-Rainer Wittmann rSh.AutoUpdateFrame(pFmt, aMgr.GetAttrSet());
6960c259c9fSOliver-Rainer Wittmann }
6970c259c9fSOliver-Rainer Wittmann else
6980c259c9fSOliver-Rainer Wittmann {
6990c259c9fSOliver-Rainer Wittmann aMgr.UpdateFlyFrm();
7000c259c9fSOliver-Rainer Wittmann }
7010c259c9fSOliver-Rainer Wittmann }
702cdf0e10cSrcweir
703cdf0e10cSrcweir }
704cdf0e10cSrcweir
705cdf0e10cSrcweir /*--------------------------------------------------------------------
706cdf0e10cSrcweir Beschreibung:
707cdf0e10cSrcweir --------------------------------------------------------------------*/
708cdf0e10cSrcweir
709cdf0e10cSrcweir
GetState(SfxItemSet & rSet)710cdf0e10cSrcweir void SwFrameShell::GetState(SfxItemSet& rSet)
711cdf0e10cSrcweir {
712cdf0e10cSrcweir SwWrtShell &rSh = GetShell();
713cdf0e10cSrcweir sal_Bool bHtmlMode = 0 != ::GetHtmlMode(rSh.GetView().GetDocShell());
714cdf0e10cSrcweir if (rSh.IsFrmSelected())
715cdf0e10cSrcweir {
716cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(),
717cdf0e10cSrcweir RES_LR_SPACE, RES_UL_SPACE,
718cdf0e10cSrcweir RES_PROTECT, RES_HORI_ORIENT,
719cdf0e10cSrcweir RES_OPAQUE, RES_OPAQUE,
720cdf0e10cSrcweir RES_PRINT, RES_OPAQUE,
721cdf0e10cSrcweir 0 );
722cdf0e10cSrcweir rSh.GetFlyFrmAttr( aSet );
723cdf0e10cSrcweir
724cdf0e10cSrcweir sal_Bool bProtect = rSh.IsSelObjProtected(FLYPROTECT_POS);
725cdf0e10cSrcweir sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
726cdf0e10cSrcweir
727cdf0e10cSrcweir bProtect |= bParentCntProt;
728cdf0e10cSrcweir
729cdf0e10cSrcweir const sal_uInt16 eFrmType = rSh.GetFrmType(0,sal_True);
730cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE );
731cdf0e10cSrcweir
732cdf0e10cSrcweir SfxWhichIter aIter( rSet );
733cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich();
734cdf0e10cSrcweir while ( nWhich )
735cdf0e10cSrcweir {
736cdf0e10cSrcweir switch ( nWhich )
737cdf0e10cSrcweir {
738cdf0e10cSrcweir case RES_FRM_SIZE:
739cdf0e10cSrcweir {
740cdf0e10cSrcweir SwFmtFrmSize aSz(aMgr.GetFrmSize());
741cdf0e10cSrcweir rSet.Put(aSz);
742cdf0e10cSrcweir }
743cdf0e10cSrcweir break;
744cdf0e10cSrcweir case RES_VERT_ORIENT:
745cdf0e10cSrcweir case RES_HORI_ORIENT:
746cdf0e10cSrcweir case SID_ATTR_ULSPACE:
747cdf0e10cSrcweir case SID_ATTR_LRSPACE:
748cdf0e10cSrcweir case RES_LR_SPACE:
749cdf0e10cSrcweir case RES_UL_SPACE:
750cdf0e10cSrcweir case RES_PROTECT:
751cdf0e10cSrcweir case RES_OPAQUE:
752cdf0e10cSrcweir case RES_PRINT:
753cdf0e10cSrcweir case RES_SURROUND:
754cdf0e10cSrcweir {
755cdf0e10cSrcweir rSet.Put(aSet.Get(GetPool().GetWhich(nWhich), sal_True ));
756cdf0e10cSrcweir }
757cdf0e10cSrcweir break;
758cdf0e10cSrcweir case SID_OBJECT_ALIGN_LEFT :
759cdf0e10cSrcweir case SID_OBJECT_ALIGN_CENTER :
760cdf0e10cSrcweir case SID_OBJECT_ALIGN_RIGHT :
761cdf0e10cSrcweir case FN_FRAME_ALIGN_HORZ_CENTER:
762cdf0e10cSrcweir case FN_FRAME_ALIGN_HORZ_RIGHT:
763cdf0e10cSrcweir case FN_FRAME_ALIGN_HORZ_LEFT:
764cdf0e10cSrcweir if ( (eFrmType & FRMTYPE_FLY_INCNT) ||
765cdf0e10cSrcweir bProtect ||
766cdf0e10cSrcweir ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER)&& bHtmlMode) )
767cdf0e10cSrcweir rSet.DisableItem( nWhich );
768cdf0e10cSrcweir break;
769cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_ROW_TOP:
770cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_ROW_CENTER:
771cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_ROW_BOTTOM:
772cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CHAR_TOP:
773cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CHAR_CENTER:
774cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM:
775cdf0e10cSrcweir if ( !(eFrmType & FRMTYPE_FLY_INCNT) || bProtect
776cdf0e10cSrcweir || (bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich) )
777cdf0e10cSrcweir rSet.DisableItem( nWhich );
778cdf0e10cSrcweir break;
779cdf0e10cSrcweir
780cdf0e10cSrcweir case SID_OBJECT_ALIGN_UP :
781cdf0e10cSrcweir case SID_OBJECT_ALIGN_MIDDLE :
782cdf0e10cSrcweir case SID_OBJECT_ALIGN_DOWN :
783cdf0e10cSrcweir
784cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_TOP:
785cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CENTER:
786cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_BOTTOM:
787cdf0e10cSrcweir if ( bProtect || (bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT) )
788cdf0e10cSrcweir rSet.DisableItem( nWhich );
789cdf0e10cSrcweir else
790cdf0e10cSrcweir {
791cdf0e10cSrcweir sal_uInt16 nId = 0;
792cdf0e10cSrcweir if (eFrmType & FRMTYPE_FLY_INCNT)
793cdf0e10cSrcweir {
794cdf0e10cSrcweir switch (nWhich)
795cdf0e10cSrcweir {
796cdf0e10cSrcweir case SID_OBJECT_ALIGN_UP :
797cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_TOP:
798cdf0e10cSrcweir nId = STR_TOP_BASE; break;
799cdf0e10cSrcweir case SID_OBJECT_ALIGN_MIDDLE :
800cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CENTER:
801cdf0e10cSrcweir nId = STR_CENTER_BASE; break;
802cdf0e10cSrcweir case SID_OBJECT_ALIGN_DOWN :
803cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_BOTTOM:
804cdf0e10cSrcweir if(!bHtmlMode)
805cdf0e10cSrcweir nId = STR_BOTTOM_BASE;
806cdf0e10cSrcweir else
807cdf0e10cSrcweir rSet.DisableItem( nWhich );
808cdf0e10cSrcweir break;
809cdf0e10cSrcweir }
810cdf0e10cSrcweir }
811cdf0e10cSrcweir else
812cdf0e10cSrcweir {
813cdf0e10cSrcweir if (nWhich != FN_FRAME_ALIGN_VERT_TOP &&
814cdf0e10cSrcweir nWhich != SID_OBJECT_ALIGN_UP )
815cdf0e10cSrcweir {
816cdf0e10cSrcweir if (aMgr.GetAnchor() == FLY_AT_FLY)
817cdf0e10cSrcweir {
818cdf0e10cSrcweir const SwFrmFmt* pFmt = rSh.IsFlyInFly();
819cdf0e10cSrcweir if (pFmt)
820cdf0e10cSrcweir {
821cdf0e10cSrcweir const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize();
822cdf0e10cSrcweir if (rFrmSz.GetHeightSizeType() != ATT_FIX_SIZE)
823cdf0e10cSrcweir {
824cdf0e10cSrcweir rSet.DisableItem( nWhich );
825cdf0e10cSrcweir break;
826cdf0e10cSrcweir }
827cdf0e10cSrcweir }
828cdf0e10cSrcweir }
829cdf0e10cSrcweir }
830cdf0e10cSrcweir switch (nWhich)
831cdf0e10cSrcweir {
832cdf0e10cSrcweir case SID_OBJECT_ALIGN_UP :
833cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_TOP:
834cdf0e10cSrcweir nId = STR_TOP; break;
835cdf0e10cSrcweir case SID_OBJECT_ALIGN_MIDDLE:
836cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_CENTER:
837cdf0e10cSrcweir nId = STR_CENTER_VERT; break;
838cdf0e10cSrcweir case SID_OBJECT_ALIGN_DOWN:
839cdf0e10cSrcweir case FN_FRAME_ALIGN_VERT_BOTTOM:
840cdf0e10cSrcweir nId = STR_BOTTOM; break;
841cdf0e10cSrcweir }
842cdf0e10cSrcweir }
843cdf0e10cSrcweir if ( nId )
844cdf0e10cSrcweir rSet.Put( SfxStringItem( nWhich, SW_RES(nId) ));
845cdf0e10cSrcweir }
846cdf0e10cSrcweir break;
847cdf0e10cSrcweir case SID_HYPERLINK_GETLINK:
848cdf0e10cSrcweir {
849cdf0e10cSrcweir String sURL;
850cdf0e10cSrcweir SvxHyperlinkItem aHLinkItem;
851cdf0e10cSrcweir const SfxPoolItem* pItem;
852cdf0e10cSrcweir
853cdf0e10cSrcweir SfxItemSet aURLSet(GetPool(), RES_URL, RES_URL);
854cdf0e10cSrcweir rSh.GetFlyFrmAttr( aURLSet );
855cdf0e10cSrcweir
856cdf0e10cSrcweir if(SFX_ITEM_SET == aURLSet.GetItemState(RES_URL, sal_True, &pItem))
857cdf0e10cSrcweir {
858cdf0e10cSrcweir const SwFmtURL* pFmtURL = (const SwFmtURL*)pItem;
859cdf0e10cSrcweir aHLinkItem.SetURL(pFmtURL->GetURL());
860cdf0e10cSrcweir aHLinkItem.SetTargetFrame(pFmtURL->GetTargetFrameName());
861cdf0e10cSrcweir aHLinkItem.SetName(rSh.GetFlyName());
862cdf0e10cSrcweir }
863cdf0e10cSrcweir
864cdf0e10cSrcweir aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
865cdf0e10cSrcweir (bHtmlMode ? HLINK_HTMLMODE : 0)));
866cdf0e10cSrcweir
867cdf0e10cSrcweir rSet.Put(aHLinkItem);
868cdf0e10cSrcweir }
869cdf0e10cSrcweir break;
870cdf0e10cSrcweir
871cdf0e10cSrcweir case FN_FRAME_CHAIN:
872cdf0e10cSrcweir {
873cdf0e10cSrcweir const int nSel = rSh.GetSelectionType();
874cdf0e10cSrcweir if (nSel & nsSelectionType::SEL_GRF || nSel & nsSelectionType::SEL_OLE)
875cdf0e10cSrcweir rSet.DisableItem( FN_FRAME_CHAIN );
876cdf0e10cSrcweir else
877cdf0e10cSrcweir {
878cdf0e10cSrcweir const SwFrmFmt *pFmt = rSh.GetFlyFrmFmt();
879cdf0e10cSrcweir if ( bParentCntProt || rSh.GetView().GetEditWin().GetApplyTemplate() ||
880cdf0e10cSrcweir !pFmt || pFmt->GetChain().GetNext() )
881cdf0e10cSrcweir {
882cdf0e10cSrcweir rSet.DisableItem( FN_FRAME_CHAIN );
883cdf0e10cSrcweir }
884cdf0e10cSrcweir else
885cdf0e10cSrcweir {
886cdf0e10cSrcweir sal_Bool bChainMode = rSh.GetView().GetEditWin().IsChainMode();
887cdf0e10cSrcweir rSet.Put( SfxBoolItem( FN_FRAME_CHAIN, bChainMode ) );
888cdf0e10cSrcweir }
889cdf0e10cSrcweir }
890cdf0e10cSrcweir }
891cdf0e10cSrcweir break;
892cdf0e10cSrcweir case FN_FRAME_UNCHAIN:
893cdf0e10cSrcweir {
894cdf0e10cSrcweir const int nSel = rSh.GetSelectionType();
895cdf0e10cSrcweir if (nSel & nsSelectionType::SEL_GRF || nSel & nsSelectionType::SEL_OLE)
896cdf0e10cSrcweir rSet.DisableItem( FN_FRAME_UNCHAIN );
897cdf0e10cSrcweir else
898cdf0e10cSrcweir {
899cdf0e10cSrcweir const SwFrmFmt *pFmt = rSh.GetFlyFrmFmt();
900cdf0e10cSrcweir if ( bParentCntProt || rSh.GetView().GetEditWin().GetApplyTemplate() ||
901cdf0e10cSrcweir !pFmt || !pFmt->GetChain().GetNext() )
902cdf0e10cSrcweir {
903cdf0e10cSrcweir rSet.DisableItem( FN_FRAME_UNCHAIN );
904cdf0e10cSrcweir }
905cdf0e10cSrcweir }
906cdf0e10cSrcweir }
907cdf0e10cSrcweir break;
908cdf0e10cSrcweir case SID_FRAME_TO_TOP:
909cdf0e10cSrcweir case SID_FRAME_TO_BOTTOM:
910cdf0e10cSrcweir case FN_FRAME_UP:
911cdf0e10cSrcweir case FN_FRAME_DOWN:
912cdf0e10cSrcweir if ( bParentCntProt )
913cdf0e10cSrcweir rSet.DisableItem( nWhich );
914cdf0e10cSrcweir break;
9150c259c9fSOliver-Rainer Wittmann
9160c259c9fSOliver-Rainer Wittmann case SID_ATTR_TRANSFORM:
9170c259c9fSOliver-Rainer Wittmann {
9180c259c9fSOliver-Rainer Wittmann rSet.DisableItem( nWhich );
9190c259c9fSOliver-Rainer Wittmann }
9200c259c9fSOliver-Rainer Wittmann break;
9210c259c9fSOliver-Rainer Wittmann
9220c259c9fSOliver-Rainer Wittmann case SID_ATTR_TRANSFORM_PROTECT_SIZE:
9230c259c9fSOliver-Rainer Wittmann {
9240c259c9fSOliver-Rainer Wittmann const sal_uInt8 eProtection = rSh.IsSelObjProtected( FLYPROTECT_SIZE );
9250c259c9fSOliver-Rainer Wittmann if ( ( eProtection & FLYPROTECT_CONTENT ) ||
9260c259c9fSOliver-Rainer Wittmann ( eProtection & FLYPROTECT_SIZE ) )
9270c259c9fSOliver-Rainer Wittmann {
9280c259c9fSOliver-Rainer Wittmann rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_True ) );
9290c259c9fSOliver-Rainer Wittmann }
9300c259c9fSOliver-Rainer Wittmann else
9310c259c9fSOliver-Rainer Wittmann {
9320c259c9fSOliver-Rainer Wittmann rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_False ) );
9330c259c9fSOliver-Rainer Wittmann }
9340c259c9fSOliver-Rainer Wittmann }
9350c259c9fSOliver-Rainer Wittmann break;
9360c259c9fSOliver-Rainer Wittmann
9370c259c9fSOliver-Rainer Wittmann case SID_ATTR_TRANSFORM_WIDTH:
9380c259c9fSOliver-Rainer Wittmann {
9390c259c9fSOliver-Rainer Wittmann rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_WIDTH, aMgr.GetSize().getWidth() ) );
9400c259c9fSOliver-Rainer Wittmann }
9410c259c9fSOliver-Rainer Wittmann break;
9420c259c9fSOliver-Rainer Wittmann
9430c259c9fSOliver-Rainer Wittmann case SID_ATTR_TRANSFORM_HEIGHT:
9440c259c9fSOliver-Rainer Wittmann {
9450c259c9fSOliver-Rainer Wittmann rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_HEIGHT, aMgr.GetSize().getHeight() ) );
9460c259c9fSOliver-Rainer Wittmann }
9470c259c9fSOliver-Rainer Wittmann break;
9480c259c9fSOliver-Rainer Wittmann
949cdf0e10cSrcweir case FN_FORMAT_FRAME_DLG:
950cdf0e10cSrcweir {
951cdf0e10cSrcweir const int nSel = rSh.GetSelectionType();
952cdf0e10cSrcweir if ( bParentCntProt || nSel & nsSelectionType::SEL_GRF)
9530c259c9fSOliver-Rainer Wittmann rSet.DisableItem( nWhich );
954cdf0e10cSrcweir }
955cdf0e10cSrcweir break;
9560c259c9fSOliver-Rainer Wittmann
957cdf0e10cSrcweir case FN_TITLE_DESCRIPTION_SHAPE:
958cdf0e10cSrcweir {
959cdf0e10cSrcweir SwWrtShell &rWrtSh = GetShell();
960cdf0e10cSrcweir SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList();
961cdf0e10cSrcweir if ( !pSdrView ||
962cdf0e10cSrcweir pSdrView->GetMarkedObjectCount() != 1 )
963cdf0e10cSrcweir {
964cdf0e10cSrcweir rSet.DisableItem( nWhich );
965cdf0e10cSrcweir }
966cdf0e10cSrcweir
967cdf0e10cSrcweir }
968cdf0e10cSrcweir break;
9690c259c9fSOliver-Rainer Wittmann
9700c259c9fSOliver-Rainer Wittmann default:
9710c259c9fSOliver-Rainer Wittmann /* do nothing */;
9720c259c9fSOliver-Rainer Wittmann break;
9730c259c9fSOliver-Rainer Wittmann }
9740c259c9fSOliver-Rainer Wittmann nWhich = aIter.NextWhich();
9750c259c9fSOliver-Rainer Wittmann }
9760c259c9fSOliver-Rainer Wittmann }
977cdf0e10cSrcweir }
978cdf0e10cSrcweir
979cdf0e10cSrcweir /*--------------------------------------------------------------------
980cdf0e10cSrcweir Beschreibung: Ctor fuer FrameShell
981cdf0e10cSrcweir --------------------------------------------------------------------*/
982cdf0e10cSrcweir
983cdf0e10cSrcweir
SwFrameShell(SwView & _rView)984cdf0e10cSrcweir SwFrameShell::SwFrameShell(SwView &_rView) :
985cdf0e10cSrcweir SwBaseShell( _rView )
986cdf0e10cSrcweir {
987cdf0e10cSrcweir SetName(String::CreateFromAscii("Frame"));
988cdf0e10cSrcweir SetHelpId(SW_FRAMESHELL);
989cdf0e10cSrcweir
990cdf0e10cSrcweir /* #96392# Use this to announce it is the frame shell who creates the
991cdf0e10cSrcweir selection. */
992cdf0e10cSrcweir SwTransferable::CreateSelection( _rView.GetWrtShell(), (ViewShell *) this );
993f120fe41SAndre Fischer
994f120fe41SAndre Fischer SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Frame));
995cdf0e10cSrcweir }
996cdf0e10cSrcweir
~SwFrameShell()997cdf0e10cSrcweir SwFrameShell::~SwFrameShell()
998cdf0e10cSrcweir {
999cdf0e10cSrcweir /* #96392# Only clear the selection if it was this frame shell who created
1000cdf0e10cSrcweir it. */
1001cdf0e10cSrcweir SwTransferable::ClearSelection( GetShell(), (ViewShell *) this );
1002cdf0e10cSrcweir }
1003cdf0e10cSrcweir
1004cdf0e10cSrcweir /*--------------------------------------------------------------------
1005cdf0e10cSrcweir Beschreibung:
1006cdf0e10cSrcweir --------------------------------------------------------------------*/
1007cdf0e10cSrcweir
1008cdf0e10cSrcweir
1009cdf0e10cSrcweir
ExecFrameStyle(SfxRequest & rReq)1010cdf0e10cSrcweir void SwFrameShell::ExecFrameStyle(SfxRequest& rReq)
1011cdf0e10cSrcweir {
1012cdf0e10cSrcweir SwWrtShell &rSh = GetShell();
1013cdf0e10cSrcweir sal_Bool bDefault = sal_False;
1014cdf0e10cSrcweir if (!rSh.IsFrmSelected())
1015cdf0e10cSrcweir return;
1016cdf0e10cSrcweir
1017cdf0e10cSrcweir // Erst Default-BoxItem aus Pool holen. Wenn ungleich normalem Boxitem,
1018cdf0e10cSrcweir // dann ist es bereits geaendert worden (neues ist kein Default).
1019cdf0e10cSrcweir const SvxBoxItem* pPoolBoxItem = (const SvxBoxItem*)::GetDfltAttr(RES_BOX);
1020cdf0e10cSrcweir
1021cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs();
1022cdf0e10cSrcweir SfxItemSet aFrameSet(rSh.GetAttrPool(), RES_BOX, RES_BOX);
1023cdf0e10cSrcweir
1024cdf0e10cSrcweir rSh.GetFlyFrmAttr( aFrameSet );
1025cdf0e10cSrcweir const SvxBoxItem& rBoxItem = (const SvxBoxItem&)aFrameSet.Get(RES_BOX);
1026cdf0e10cSrcweir
1027cdf0e10cSrcweir if (pPoolBoxItem == &rBoxItem)
1028cdf0e10cSrcweir bDefault = sal_True;
1029cdf0e10cSrcweir
1030cdf0e10cSrcweir SvxBoxItem aBoxItem(rBoxItem);
1031cdf0e10cSrcweir
1032cdf0e10cSrcweir SvxBorderLine aBorderLine;
1033cdf0e10cSrcweir const SfxPoolItem *pItem = 0;
1034cdf0e10cSrcweir
1035cdf0e10cSrcweir if(pArgs) //irgendein Controller kann auch mal nichts liefern #48169#
1036cdf0e10cSrcweir {
1037cdf0e10cSrcweir switch (rReq.GetSlot())
1038cdf0e10cSrcweir {
1039cdf0e10cSrcweir case SID_ATTR_BORDER:
1040cdf0e10cSrcweir {
1041cdf0e10cSrcweir if (pArgs->GetItemState(RES_BOX, sal_True, &pItem) == SFX_ITEM_SET)
1042cdf0e10cSrcweir {
1043cdf0e10cSrcweir SvxBoxItem aNewBox(*((SvxBoxItem *)pItem));
1044cdf0e10cSrcweir const SvxBorderLine* pBorderLine;
1045cdf0e10cSrcweir
1046cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetTop()) != NULL)
1047cdf0e10cSrcweir lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
1048cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetBottom()) != NULL)
1049cdf0e10cSrcweir lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
1050cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetLeft()) != NULL)
1051cdf0e10cSrcweir lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
1052cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetRight()) != NULL)
1053cdf0e10cSrcweir lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
1054cdf0e10cSrcweir
1055cdf0e10cSrcweir if(aBorderLine.GetOutWidth() == 0)
1056cdf0e10cSrcweir {
1057cdf0e10cSrcweir aBorderLine.SetInWidth(0);
1058cdf0e10cSrcweir aBorderLine.SetOutWidth(DEF_LINE_WIDTH_0);
1059cdf0e10cSrcweir aBorderLine.SetDistance(0);
1060cdf0e10cSrcweir }
1061cdf0e10cSrcweir //Distance nur setzen, wenn der Request vom Controller kommt
1062cdf0e10cSrcweir
1063cdf0e10cSrcweir if(!StarBASIC::IsRunning())
1064cdf0e10cSrcweir {
1065cdf0e10cSrcweir aNewBox.SetDistance( rBoxItem.GetDistance() );
1066cdf0e10cSrcweir }
1067cdf0e10cSrcweir
1068cdf0e10cSrcweir aBoxItem = aNewBox;
1069cdf0e10cSrcweir SvxBorderLine aDestBorderLine;
1070cdf0e10cSrcweir
1071cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetTop()) != NULL)
1072cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
1073cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetBottom()) != NULL)
1074cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
1075cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetLeft()) != NULL)
1076cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
1077cdf0e10cSrcweir if ((pBorderLine = aBoxItem.GetRight()) != NULL)
1078cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
1079cdf0e10cSrcweir }
1080cdf0e10cSrcweir }
1081cdf0e10cSrcweir break;
1082cdf0e10cSrcweir
1083cdf0e10cSrcweir case SID_FRAME_LINESTYLE:
1084cdf0e10cSrcweir {
1085cdf0e10cSrcweir if (pArgs->GetItemState(SID_FRAME_LINESTYLE, sal_False, &pItem) == SFX_ITEM_SET)
1086cdf0e10cSrcweir {
1087cdf0e10cSrcweir const SvxLineItem* pLineItem =
1088cdf0e10cSrcweir (const SvxLineItem*)pItem;
1089cdf0e10cSrcweir
1090cdf0e10cSrcweir if ( pLineItem->GetLine() )
1091cdf0e10cSrcweir {
1092cdf0e10cSrcweir aBorderLine = *(pLineItem->GetLine());
1093cdf0e10cSrcweir
1094cdf0e10cSrcweir if (!aBoxItem.GetTop() && !aBoxItem.GetBottom() &&
1095cdf0e10cSrcweir !aBoxItem.GetLeft() && !aBoxItem.GetRight())
1096cdf0e10cSrcweir {
1097cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
1098cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
1099cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
1100cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
1101cdf0e10cSrcweir }
1102cdf0e10cSrcweir else
1103cdf0e10cSrcweir {
1104cdf0e10cSrcweir if( aBoxItem.GetTop() )
1105cdf0e10cSrcweir {
1106cdf0e10cSrcweir aBorderLine.SetColor( aBoxItem.GetTop()->GetColor() );
1107cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
1108cdf0e10cSrcweir }
1109cdf0e10cSrcweir if( aBoxItem.GetBottom() )
1110cdf0e10cSrcweir {
1111cdf0e10cSrcweir aBorderLine.SetColor( aBoxItem.GetBottom()->GetColor());
1112cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
1113cdf0e10cSrcweir }
1114cdf0e10cSrcweir if( aBoxItem.GetLeft() )
1115cdf0e10cSrcweir {
1116cdf0e10cSrcweir aBorderLine.SetColor( aBoxItem.GetLeft()->GetColor());
1117cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
1118cdf0e10cSrcweir }
1119cdf0e10cSrcweir if( aBoxItem.GetRight() )
1120cdf0e10cSrcweir {
1121cdf0e10cSrcweir aBorderLine.SetColor(aBoxItem.GetRight()->GetColor());
1122cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
1123cdf0e10cSrcweir }
1124cdf0e10cSrcweir }
1125cdf0e10cSrcweir }
1126cdf0e10cSrcweir else
1127cdf0e10cSrcweir {
1128cdf0e10cSrcweir aBoxItem.SetLine(0, BOX_LINE_TOP);
1129cdf0e10cSrcweir aBoxItem.SetLine(0, BOX_LINE_BOTTOM);
1130cdf0e10cSrcweir aBoxItem.SetLine(0, BOX_LINE_LEFT);
1131cdf0e10cSrcweir aBoxItem.SetLine(0, BOX_LINE_RIGHT);
1132cdf0e10cSrcweir }
1133cdf0e10cSrcweir }
1134cdf0e10cSrcweir }
1135cdf0e10cSrcweir break;
1136cdf0e10cSrcweir
1137cdf0e10cSrcweir case SID_FRAME_LINECOLOR:
1138cdf0e10cSrcweir {
1139cdf0e10cSrcweir if (pArgs->GetItemState(SID_FRAME_LINECOLOR, sal_False, &pItem) == SFX_ITEM_SET)
1140cdf0e10cSrcweir {
1141cdf0e10cSrcweir const Color& rNewColor = ((const SvxColorItem*)pItem)->GetValue();
1142cdf0e10cSrcweir
1143cdf0e10cSrcweir if (!aBoxItem.GetTop() && !aBoxItem.GetBottom() &&
1144cdf0e10cSrcweir !aBoxItem.GetLeft() && !aBoxItem.GetRight())
1145cdf0e10cSrcweir {
1146cdf0e10cSrcweir aBorderLine.SetColor( rNewColor );
1147cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
1148cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
1149cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
1150cdf0e10cSrcweir aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
1151cdf0e10cSrcweir }
1152cdf0e10cSrcweir else
1153cdf0e10cSrcweir {
1154cdf0e10cSrcweir if ( aBoxItem.GetTop() )
1155cdf0e10cSrcweir ((SvxBorderLine*)aBoxItem.GetTop())->SetColor( rNewColor );
1156cdf0e10cSrcweir if ( aBoxItem.GetBottom() )
1157cdf0e10cSrcweir ((SvxBorderLine*)aBoxItem.GetBottom())->SetColor( rNewColor );
1158cdf0e10cSrcweir if ( aBoxItem.GetLeft() )
1159cdf0e10cSrcweir ((SvxBorderLine*)aBoxItem.GetLeft())->SetColor( rNewColor );
1160cdf0e10cSrcweir if ( aBoxItem.GetRight() )
1161cdf0e10cSrcweir ((SvxBorderLine*)aBoxItem.GetRight())->SetColor( rNewColor );
1162cdf0e10cSrcweir }
1163cdf0e10cSrcweir }
1164cdf0e10cSrcweir }
1165cdf0e10cSrcweir break;
1166cdf0e10cSrcweir }
1167cdf0e10cSrcweir }
1168cdf0e10cSrcweir if (bDefault && (aBoxItem.GetTop() || aBoxItem.GetBottom() ||
1169cdf0e10cSrcweir aBoxItem.GetLeft() || aBoxItem.GetRight()))
1170cdf0e10cSrcweir {
1171cdf0e10cSrcweir aBoxItem.SetDistance(MIN_BORDER_DIST);
1172cdf0e10cSrcweir }
1173cdf0e10cSrcweir aFrameSet.Put( aBoxItem );
1174cdf0e10cSrcweir // Vorlagen-AutoUpdate
1175cdf0e10cSrcweir SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
1176cdf0e10cSrcweir if(pFmt && pFmt->IsAutoUpdateFmt())
1177cdf0e10cSrcweir {
1178cdf0e10cSrcweir rSh.AutoUpdateFrame(pFmt, aFrameSet);
1179cdf0e10cSrcweir }
1180cdf0e10cSrcweir else
1181cdf0e10cSrcweir rSh.SetFlyFrmAttr( aFrameSet );
1182cdf0e10cSrcweir
1183cdf0e10cSrcweir }
1184cdf0e10cSrcweir
1185cdf0e10cSrcweir
1186cdf0e10cSrcweir
lcl_FrmGetMaxLineWidth(const SvxBorderLine * pBorderLine,SvxBorderLine & rBorderLine)1187cdf0e10cSrcweir void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine)
1188cdf0e10cSrcweir {
1189cdf0e10cSrcweir if(pBorderLine->GetInWidth() > rBorderLine.GetInWidth())
1190cdf0e10cSrcweir rBorderLine.SetInWidth(pBorderLine->GetInWidth());
1191cdf0e10cSrcweir
1192cdf0e10cSrcweir if(pBorderLine->GetOutWidth() > rBorderLine.GetOutWidth())
1193cdf0e10cSrcweir rBorderLine.SetOutWidth(pBorderLine->GetOutWidth());
1194cdf0e10cSrcweir
1195cdf0e10cSrcweir if(pBorderLine->GetDistance() > rBorderLine.GetDistance())
1196cdf0e10cSrcweir rBorderLine.SetDistance(pBorderLine->GetDistance());
1197cdf0e10cSrcweir
1198cdf0e10cSrcweir rBorderLine.SetColor(pBorderLine->GetColor());
1199cdf0e10cSrcweir }
1200cdf0e10cSrcweir
1201cdf0e10cSrcweir
1202cdf0e10cSrcweir
GetLineStyleState(SfxItemSet & rSet)1203cdf0e10cSrcweir void SwFrameShell::GetLineStyleState(SfxItemSet &rSet)
1204cdf0e10cSrcweir {
1205cdf0e10cSrcweir SwWrtShell &rSh = GetShell();
1206cdf0e10cSrcweir sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
1207cdf0e10cSrcweir
1208cdf0e10cSrcweir if (bParentCntProt)
1209cdf0e10cSrcweir {
1210cdf0e10cSrcweir if (rSh.IsFrmSelected())
1211cdf0e10cSrcweir rSet.DisableItem( SID_FRAME_LINECOLOR );
1212cdf0e10cSrcweir
1213cdf0e10cSrcweir rSet.DisableItem( SID_ATTR_BORDER );
1214cdf0e10cSrcweir rSet.DisableItem( SID_FRAME_LINESTYLE );
1215cdf0e10cSrcweir }
1216cdf0e10cSrcweir else
1217cdf0e10cSrcweir {
1218cdf0e10cSrcweir if (rSh.IsFrmSelected())
1219cdf0e10cSrcweir {
1220cdf0e10cSrcweir SfxItemSet aFrameSet( rSh.GetAttrPool(), RES_BOX, RES_BOX );
1221cdf0e10cSrcweir
1222cdf0e10cSrcweir rSh.GetFlyFrmAttr(aFrameSet);
1223cdf0e10cSrcweir
1224cdf0e10cSrcweir const SvxBorderLine* pLine = ((const SvxBoxItem&)aFrameSet.Get(RES_BOX)).GetTop();
1225cdf0e10cSrcweir rSet.Put(SvxColorItem(pLine ? pLine->GetColor() : Color(), SID_FRAME_LINECOLOR));
1226cdf0e10cSrcweir }
1227cdf0e10cSrcweir }
1228cdf0e10cSrcweir }
1229cdf0e10cSrcweir
StateInsert(SfxItemSet & rSet)1230cdf0e10cSrcweir void SwFrameShell::StateInsert(SfxItemSet &rSet)
1231cdf0e10cSrcweir {
123269a74367SOliver-Rainer Wittmann const int nSel = GetShell().GetSelectionType();
123369a74367SOliver-Rainer Wittmann if ( (nSel & nsSelectionType::SEL_GRF)
123469a74367SOliver-Rainer Wittmann || (nSel & nsSelectionType::SEL_OLE) )
123569a74367SOliver-Rainer Wittmann {
123669a74367SOliver-Rainer Wittmann rSet.DisableItem(FN_INSERT_FRAME);
123769a74367SOliver-Rainer Wittmann }
123869a74367SOliver-Rainer Wittmann else if ( GetShell().CrsrInsideInputFld() )
123969a74367SOliver-Rainer Wittmann {
124069a74367SOliver-Rainer Wittmann rSet.DisableItem(FN_INSERT_FRAME);
124169a74367SOliver-Rainer Wittmann }
1242cdf0e10cSrcweir }
124364b14621SArmin Le Grand
124464b14621SArmin Le Grand //UUUU
GetDrawAttrStateTextFrame(SfxItemSet & rSet)124564b14621SArmin Le Grand void SwFrameShell::GetDrawAttrStateTextFrame(SfxItemSet &rSet)
124664b14621SArmin Le Grand {
124764b14621SArmin Le Grand SwWrtShell &rSh = GetShell();
124864b14621SArmin Le Grand
124964b14621SArmin Le Grand if(rSh.IsFrmSelected())
125064b14621SArmin Le Grand {
125164b14621SArmin Le Grand rSh.GetFlyFrmAttr(rSet);
125264b14621SArmin Le Grand }
125364b14621SArmin Le Grand else
125464b14621SArmin Le Grand {
125564b14621SArmin Le Grand SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
125664b14621SArmin Le Grand
125764b14621SArmin Le Grand if(pSdrView)
125864b14621SArmin Le Grand {
125964b14621SArmin Le Grand rSet.Put(pSdrView->GetDefaultAttr());
126064b14621SArmin Le Grand }
126164b14621SArmin Le Grand }
126264b14621SArmin Le Grand }
126364b14621SArmin Le Grand
126464b14621SArmin Le Grand //UUUU
ExecDrawAttrArgsTextFrame(SfxRequest & rReq)126564b14621SArmin Le Grand void SwFrameShell::ExecDrawAttrArgsTextFrame(SfxRequest& rReq)
126664b14621SArmin Le Grand {
126764b14621SArmin Le Grand const SfxItemSet* pArgs = rReq.GetArgs();
126864b14621SArmin Le Grand SwWrtShell& rSh = GetShell();
126964b14621SArmin Le Grand
127064b14621SArmin Le Grand if(pArgs)
127164b14621SArmin Le Grand {
127264b14621SArmin Le Grand if(rSh.IsFrmSelected())
127364b14621SArmin Le Grand {
127464b14621SArmin Le Grand rSh.SetFlyFrmAttr(const_cast< SfxItemSet& >(*pArgs));
127564b14621SArmin Le Grand }
127664b14621SArmin Le Grand else
127764b14621SArmin Le Grand {
127864b14621SArmin Le Grand SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
127964b14621SArmin Le Grand
128064b14621SArmin Le Grand if(pSdrView)
128164b14621SArmin Le Grand {
128264b14621SArmin Le Grand pSdrView->SetDefaultAttr(*pArgs, sal_False);
128364b14621SArmin Le Grand }
128464b14621SArmin Le Grand }
128564b14621SArmin Le Grand }
128664b14621SArmin Le Grand else
128764b14621SArmin Le Grand {
128864b14621SArmin Le Grand SfxDispatcher* pDis = rSh.GetView().GetViewFrame()->GetDispatcher();
128964b14621SArmin Le Grand
129064b14621SArmin Le Grand switch(rReq.GetSlot())
129164b14621SArmin Le Grand {
129264b14621SArmin Le Grand case SID_ATTR_FILL_STYLE:
129364b14621SArmin Le Grand case SID_ATTR_FILL_COLOR:
129464b14621SArmin Le Grand case SID_ATTR_FILL_GRADIENT:
129564b14621SArmin Le Grand case SID_ATTR_FILL_HATCH:
129664b14621SArmin Le Grand case SID_ATTR_FILL_BITMAP:
129764b14621SArmin Le Grand case SID_ATTR_FILL_TRANSPARENCE:
129864b14621SArmin Le Grand case SID_ATTR_FILL_FLOATTRANSPARENCE:
129964b14621SArmin Le Grand {
130064b14621SArmin Le Grand pDis->Execute(SID_ATTRIBUTES_AREA, sal_False);
130164b14621SArmin Le Grand break;
130264b14621SArmin Le Grand }
130364b14621SArmin Le Grand }
130464b14621SArmin Le Grand }
130564b14621SArmin Le Grand }
130664b14621SArmin Le Grand
130764b14621SArmin Le Grand //UUUU
ExecDrawDlgTextFrame(SfxRequest & rReq)130864b14621SArmin Le Grand void SwFrameShell::ExecDrawDlgTextFrame(SfxRequest& rReq)
130964b14621SArmin Le Grand {
131064b14621SArmin Le Grand switch(rReq.GetSlot())
131164b14621SArmin Le Grand {
131264b14621SArmin Le Grand case SID_ATTRIBUTES_AREA:
131364b14621SArmin Le Grand {
131464b14621SArmin Le Grand SwWrtShell& rSh = GetShell();
131564b14621SArmin Le Grand
131664b14621SArmin Le Grand if(rSh.IsFrmSelected())
131764b14621SArmin Le Grand {
131864b14621SArmin Le Grand SdrView* pView = rSh.GetDrawView();
131964b14621SArmin Le Grand SdrModel* pDoc = pView->GetModel();
132064b14621SArmin Le Grand SfxItemSet aNewAttr(pDoc->GetItemPool());
132164b14621SArmin Le Grand
132223e8672cSArmin Le Grand // get attributes from FlyFrame
132323e8672cSArmin Le Grand rSh.GetFlyFrmAttr(aNewAttr);
132423e8672cSArmin Le Grand
132564b14621SArmin Le Grand SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
132664b14621SArmin Le Grand DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
132764b14621SArmin Le Grand AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog(
132864b14621SArmin Le Grand NULL,
132964b14621SArmin Le Grand &aNewAttr,
133064b14621SArmin Le Grand pDoc,
133123e8672cSArmin Le Grand false);
133264b14621SArmin Le Grand DBG_ASSERT(pDlg, "Dialogdiet fail!");
133364b14621SArmin Le Grand
133464b14621SArmin Le Grand if(RET_OK == pDlg->Execute())
133564b14621SArmin Le Grand {
133623e8672cSArmin Le Grand // set attributes at FlyFrame
133764b14621SArmin Le Grand rSh.SetFlyFrmAttr(const_cast< SfxItemSet& >(*pDlg->GetOutputItemSet()));
133864b14621SArmin Le Grand
133964b14621SArmin Le Grand static sal_uInt16 __READONLY_DATA aInval[] =
134064b14621SArmin Le Grand {
134164b14621SArmin Le Grand SID_ATTR_FILL_STYLE,
134264b14621SArmin Le Grand SID_ATTR_FILL_COLOR,
134364b14621SArmin Le Grand SID_ATTR_FILL_TRANSPARENCE,
134464b14621SArmin Le Grand SID_ATTR_FILL_FLOATTRANSPARENCE,
134564b14621SArmin Le Grand 0
134664b14621SArmin Le Grand };
134764b14621SArmin Le Grand
134864b14621SArmin Le Grand SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
134964b14621SArmin Le Grand
135064b14621SArmin Le Grand rBnd.Invalidate(aInval);
135164b14621SArmin Le Grand rBnd.Update(SID_ATTR_FILL_STYLE);
135264b14621SArmin Le Grand rBnd.Update(SID_ATTR_FILL_COLOR);
135364b14621SArmin Le Grand rBnd.Update(SID_ATTR_FILL_TRANSPARENCE);
135464b14621SArmin Le Grand rBnd.Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
135564b14621SArmin Le Grand }
135664b14621SArmin Le Grand
135764b14621SArmin Le Grand delete pDlg;
135864b14621SArmin Le Grand }
135964b14621SArmin Le Grand
136064b14621SArmin Le Grand break;
136164b14621SArmin Le Grand }
136264b14621SArmin Le Grand }
136364b14621SArmin Le Grand }
136464b14621SArmin Le Grand
136564b14621SArmin Le Grand //UUUU
DisableStateTextFrame(SfxItemSet & rSet)136664b14621SArmin Le Grand void SwFrameShell::DisableStateTextFrame(SfxItemSet &rSet)
136764b14621SArmin Le Grand {
136864b14621SArmin Le Grand SfxWhichIter aIter(rSet);
136964b14621SArmin Le Grand sal_uInt16 nWhich(aIter.FirstWhich());
137064b14621SArmin Le Grand
137164b14621SArmin Le Grand while(nWhich)
137264b14621SArmin Le Grand {
137364b14621SArmin Le Grand switch(nWhich)
137464b14621SArmin Le Grand {
137564b14621SArmin Le Grand case SID_ATTRIBUTES_AREA:
137664b14621SArmin Le Grand {
137764b14621SArmin Le Grand SwWrtShell& rSh = GetShell();
137864b14621SArmin Le Grand
137964b14621SArmin Le Grand if(!rSh.IsFrmSelected())
138064b14621SArmin Le Grand {
138164b14621SArmin Le Grand rSet.DisableItem(nWhich);
138264b14621SArmin Le Grand }
138364b14621SArmin Le Grand
138464b14621SArmin Le Grand break;
138564b14621SArmin Le Grand }
138664b14621SArmin Le Grand default:
138764b14621SArmin Le Grand {
138864b14621SArmin Le Grand rSet.DisableItem(nWhich);
138964b14621SArmin Le Grand break;
139064b14621SArmin Le Grand }
139164b14621SArmin Le Grand }
139264b14621SArmin Le Grand
139364b14621SArmin Le Grand nWhich = aIter.NextWhich();
139464b14621SArmin Le Grand }
139564b14621SArmin Le Grand }
139664b14621SArmin Le Grand
139764b14621SArmin Le Grand // eof
1398